Ich weiß zwar nicht ob es noch aktuell ist, aber zumindest eine Antwort für @H.Brill
Code: Alles auswählen
Enumeration
#ListIcon
#ListIconvorschau
EndEnumeration
Procedure PrintListIcon(GadgetID.l, vorschau.l)
Protected x.l,y.l,yh.l,sp1.s,sp2.s,sp3.s,i.l,druini.l
If vorschau
ListIconGadget(#ListIconvorschau, 20, 20, 540, 760, "", 0)
ChangeListIconGadgetDisplay(#ListIconvorschau, #PB_ListIcon_LargeIcon)
druini = StartPrintingPreviewEx(#ListIconvorschau, #True, 0)
PrintingFontEx("Arial", 60, #True)
Else
druini= StartPrintingEx("Test Printing")
EndIf
x=120 ;1,2cm vom linken Seitenrand
yh=0 ;Dummyvorbelegung
y = 100 ;1 cm von oben anfangen zu drucken
lc = CountGadgetItems(GadgetID)
If druini
;PrintingFontEx("Arial", 60, #True)
yh=GetPrintingFontMetricEx(#PL_Font_Height) ;ermitteln der Texthöhe für den Zeilenvorschub
PrintingTextEx("Adressenliste", x, y, RGB(0, 0, 0))
y = y + yh ;Zeilenvorschub
For i = 1 To lc
sp1.s = GetGadgetItemText(GadgetID, i, 0)
sp2.s = GetGadgetItemText(GadgetID, i, 1)
sp3.s = GetGadgetItemText(GadgetID, i, 2)
;PrintingTextBoxEx("Adressenliste", 120, 120, 800, 200, RGB(0, 0, 0), #DT_VCENTER)
;PrintingTextBoxEx(sp1.s, 100, y, 400, y2, RGB(0, 0, 0))
;PrintingTextBoxEx(sp2.s, 500, y, 200, y2, RGB(0, 0, 0))
;PrintingTextBoxEx(sp3.s, 900, y, 300, y2, RGB(0, 0, 0))
PrintingTextEx(sp1.s, x, y, RGB(0, 0, 0))
PrintingTextEx(sp2.s, x+300, y, RGB(0, 0, 0))
PrintingTextEx(sp3.s, x+500, y, RGB(0, 0, 0))
;als Alternative könnte man den String auch zusammensetzen
;PrintingTextEx(LSet(sp1,12)+LSet(sp2,7)+sp3, x, y, RGB(0, 0, 0))
y = y + yh ;Zeilenvorschub
Next i
EndIf
If vorschau
StopPrintingPreviewEx()
Else
StopPrintingEx()
EndIf
EndProcedure
If OpenWindow(0,0,0,600,800, "Listicon sort test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
If CreateGadgetList(WindowID(0))
ListIconGadget(#ListIcon, 10, 10, 380, 280, "Column0", 100,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
; Fullrowselect must be set, because otherwiese only the first
; column will be clickable
AddGadgetColumn(#ListIcon, 1, "Column1", 100)
AddGadgetColumn(#ListIcon, 1, "Column2", 100)
For i=0 To 10
AddGadgetItem(#ListIcon, -1, "Eintrag"+Str(i)+Chr(10)+Str(i)+"000"+Chr(10)+"DEF"+Str(i))
Next
HideGadget(#ListIcon,1)
PrintListIcon(#ListIcon,#True)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
End