Frage 1: (Wie) Kann ich die IDE dazu bringen, statt der als Standard für die "Dokumente" verwendeten Proportionalschrift eine dicktengleiche zu nutzen?
Frage 2: (Wie) Kann ich die in der IDE verwendete Tabulator-Größe ändern?
Beides führt dazu, dass der Code in meinem UI ganz anders formatiert wird als hier innerhalb eines <code-tags> und es heftige Überarbeitung des "White-Space" braucht, um ihn hier einigermaßen lesbar einzustellen.
Wie die LO-Fenster auf meinem Bildschirm aussehen, zeigen die angefügten Bilder einer kleinen Tabelle und der Ansicht des enthaltenen Codes in der IDE.
Die Beispiel-Datei ist nun doch der (stark reduzierte/verkleinerte) Nachbau des eigentlichen Projekts. Hatte ich auf mich genommen, nachdem ich (wieder einmal) einige Tage stecken geblieben war, hier nach einer Lösung fragen wollte und dann doch in dem sehr verkleinerten (vereinfachten) Umfeld selbst darauf gekommen bin.
Das Layout der Tabelle(n) und einiger spezieller Zeichen in strings (auch im Code) hängt wahrscheinlich stark von der Verfügbarkeit der in den Tabellen verwendeten Schrift ab. Vermutlich zeigt sich das Layout heftig zerschossen, wenn …
Noto Sans Condensed und Noto Sans Symbols 2 fehlen.
Und hier der Code:
Code: Alles auswählen
REM ***** BASIC *****
option explicit
const sMonthTmplt="99·99"
dim isInitd as boolean,oDoc as object,oCtrlr as object,oDataSht as object,oCrsr as object
dim lRow as integer,oRecs as object,nRecs as integer,hasNewRec as boolean,hasGaps as boolean,bNewRec as boolean
dim iCol as integer,iRow as integer
dim vTest' ⚒🌩💢
sub test
' dim <local variables>
' processing:
stop
end sub 'test
sub onActivate
if not isInitd then doInit
vTest=oDoc.getCurrentSelection
oDataSht.getCellByPosition(1,lRow).setValue(day(now)+timevalue(now))
doSlct(array(2,lRow)) : stop' stop for maual input
end sub 'onActivate
sub doInit
if isInitd then exit sub
oDoc=thisComponent
oCtrlr=oDoc.getCurrentController
oDataSht=oDoc.Sheets.getByIndex(1)
oCrsr=oDataSht.createCursorByRange(oDataSht.getCellRangeByPosition(0,0,0,0))
oCrsr.collapseToCurrentRegion
lRow=oCrsr.RangeAddress.EndRow
hasNewRec=(oDataSht.getCellByPosition(0,lRow).string=" 🖎")' hasNewRec: .string=" 🖎"" - otherwise "✔"
nRecs=oDataSht.getCellByPosition(0,1).value' # of complete records (data rows)
hasGaps=lRow-nRecs-1+hasNewRec
isInitd=True
if hasGaps then doFillGaps' incl. stop for maual input
if not(hasNewRec) then doMakeNewRec
end sub 'doInit
sub doSlct(aRng,optional vActiv)
dim oRng as object
if not isInitd then doInit
if ubound(aRng)=1 then oCtrlr.select(oDataSht.getCellByPosition(aRng(0),aRng(1)))
oRng = oDoc.createInstance("com.sun.star.sheet.SheetCellRanges")
if isMissing(vActiv) then oCtrlr.Select(oRng)
end sub 'doSlct
sub doFillGaps
if not isInitd then doInit
with oDataSht
for iRow=2 to lRow
if .getCellByPosition(0,iRow).string=" 🖎" then exit for
next 'iRow
for iCol=2 to 5
if 0=.getCellByPosition(iCol,iRow).type then exit for
next 'iCol
doSlct(array(iCol,iRow)) : stop' stop for maual input
end with 'oDataSht
end sub 'doFillGaps
sub doMakeNewRec
if not isInitd then doInit
if Format(Date,"yy·mm")<>oDataSht.Name then NewMonth
with oDataSht
iRow=lRow+1
.getCellByPosition(0,iRow).setFormula("=COUNTBLANK(C" & iRow+1 & ":F" & iRow+1 & ")=0")
.getCellByPosition(5,iRow).setFormula("=IF(ISBLANK(E" & iRow+1 & ");CHAR(24);" & 1-.value & ")")
.getCellByPosition(7,iRow).setFormula("=IF(E"& iRow+1 &";IF(F"& iRow+1 &";-99;E"& iRow+1 &");-99)")
.getCellByPosition(8,iRow).setFormula("=IF(E"& iRow+1 &";IF(F"& iRow+1 &";E"& iRow+1 &";-99);-99)")
end with
hasNewRec=true
end sub 'doMakeNewRec
function onDblClk(oCell as object) as boolean
dim oRng as object
if not isInitd then doInit
onDblClk=true' intercept system event
if Format(Date,"yy·mm")<>oDataSht.Name then NewMonth
oRng=oCell.RangeAddress
iCol=oRng.EndColumn : iRow=oRng.EndRow
select case iCol
case 0 : oDataSht.getCellByPosition(1,iRow).setValue(day(now)+timevalue(now)) : iCol=2
case 5
with oDataSht.getCellByPosition(5,iRow)
.setFormula("=IF(ISBLANK(E" & iRow+1 & ");CHAR(24);" & 1-.value & ")") ' =IF(ISBLANK(E3);CHAR(24);1) or =IF(ISBLANK(E3);CHAR(24);0)
end with 'oDataSht.getCellByPosition(5,iRow)
end select' case iCol
doSlct(array(iCol,iRow)) : stop' stop for maual input
end function 'onDblClk
sub NewMonth
if not isInitd then doInit
oDoc.Sheets.copyByName(sMonthTmplt, Format(Date,"yy·mm"), 1)
oDataSht=oDoc.Sheets.getByIndex(1)
'oCtrlr.setActiveSheet(oDataSht)
with oDataSht
.getCellByPosition(0,0).setString(Format(Date,"yyyy"))
.getCellByPosition(1,0).setString(Format(Date,"mmm"))
end with
end sub 'NewMonth
ok, dann eben hier: https://www.dropbox.com/scl/fi/wi7wtx1e ... 173en&dl=0