Seite 1 von 1

listicongadget

Verfasst: 31.05.2012 14:27
von LuZiF3R
hi, arbeite derzeit mit dem Listicongadget und brauche für mein Projekt eine mehrzeilige Zelle.
mit dem Beispiel aus der Winlibary (siehe Code) sieht das bei mir folgenermaßen aus. Hoffe mir kann jemand helfen.

Bild

Code: Alles auswählen

;Autor: RASHAD

EnableExplicit

Define EventID
Define x
Define Texth
Define imageList

If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
  ListIconGadget(1,10,10,WindowWidth(0),WindowHeight(0),"Spalte",250,#PB_ListIcon_FullRowSelect|#PB_ListIcon_GridLines)
  AddGadgetColumn(1,1,"Spalte 2",200)
  
  Texth = SendMessage_(GadgetID(1), #LVM_GETITEMSPACING, 1, 0) >> 16 - 4
  imageList = ImageList_Create_(1, 5*Texth, #ILC_COLOR32 | #ILC_MASK, 0, 0) ;for 5 lines
  SendMessage_(GadgetID(1), #LVM_SETIMAGELIST, #LVSIL_SMALL, imageList)
 
  For x=1 To 4
    AddGadgetItem(1,-1, "This is a wordwrap text demonstration in a ListIcon Gadget  " + Chr(13) + "This is a separate line" + Chr(10) + "Line 1" + Chr(13) + "Line 2" + Chr(13) + "Line 3" + Chr(13) + "Line 4")
  Next
  
  Repeat
    EventID=WaitWindowEvent()
    If EventID = #PB_Event_CloseWindow
      End
    EndIf
  ForEver
EndIf
OS: Windows XP 32 Bit
PB: 4.6

Re: listicongadget

Verfasst: 31.05.2012 15:05
von ts-soft
XP-Style aktivieren!

PS: Man sollte den Style immer aktivieren, ansonsten werden evtl. Benutzer Deines Programmes böse :mrgreen:

Gruß
Thomas

Re: listicongadget

Verfasst: 31.05.2012 16:43
von LuZiF3R
wenn du "XP-Skin Unterstützung" in den Compileroptionen meinst, die ist an, hilft aber trotzdem nix

Re: listicongadget

Verfasst: 31.05.2012 16:58
von ts-soft
Windows XP unterstützt das anscheinend noch nicht. Unter Win 7 läuft es problemlos.

Re: listicongadget

Verfasst: 01.06.2012 09:25
von Shardik
In Windows XP funktioniert es anscheinend nur mit einem Callback.
Sparkie und srod haben im englischen Forum Beispiele dafür gezeigt
(im zweiten Beispiel sogar mit alternierenden Farben pro Zeile):
http://www.purebasic.fr/english/viewtop ... 6&start=37
http://www.purebasic.fr/english/viewtop ... 3&start=10