[Done] PB v6.00B8 ListIconGadget Column Size (Beta 9)

Post bugreports for the Mac OSX version here
User avatar
mk-soft
Addict
Addict
Posts: 3806
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

[Done] PB v6.00B8 ListIconGadget Column Size (Beta 9)

Post by mk-soft »

ListIconGadget with several columns.

Moving the column width with the mouse works.
But double-clicking on the column width (autosize) does not work and creates a very wide column.

Update Beta 9

Code: Select all

;-TOP

Image = CreateImage(0, 32, 32, 32, #Red)
Image2 = CreateImage(1, 32, 32, 32, #Blue)

Procedure UpdateWindow()
  Protected dx, dy
  dx = WindowWidth(0)
  dy = WindowHeight(0)
  ResizeGadget(0, 10, 10, dx - 20, dy - 20)
EndProcedure

Procedure Main()
  Protected dx, dy, RowHeight.CGFloat
  
  If OpenWindow(0, 210, 210, 520, 520, "Window", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
    
    dx = WindowWidth(0)
    dy = WindowHeight(0)
    
    ListIconGadget(0, 10, 10, dx - 20, dy - 20, "Column 0", 200)
    AddGadgetColumn(0, 1, "Comlum 1", 200)
    AddGadgetColumn(0, 2, "Comlum 2", 400)
    ; AddGadgetColumn(0, 3, "", 0) ; Dummy column
    
    ; Set big row height for test
    RowHeight = 44
    CocoaMessage(0, GadgetID(0), "setRowHeight:@", @RowHeight)
    CocoaMessage(0, GadgetID(0), "setUsesAlternatingRowBackgroundColors:", #YES)
    
    For i = 0 To 25
      If i & 1
        AddGadgetItem(0, -1, "Data " + i + #LF$ + "ListBox Item Data 1" + #LF$ + "ListBox Item Data 2", ImageID(1))
      Else
        AddGadgetItem(0, -1, "Data " + i + #LF$ + "ListBox Item Data 1" + #LF$ + "ListBox Item Data 2", ImageID(0))
      EndIf  
    Next
    
    ; Not work beta 9
    ; SetGadgetItemAttribute(0, 0, #PB_ListIcon_ColumnWidth, 400, 2)
    
    BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
    
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Break
          
      EndSelect
    ForEver
    
  EndIf
  
EndProcedure : Main()
Last edited by mk-soft on Sun Jun 05, 2022 1:10 pm, edited 4 times in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 14732
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB v6.00B8 ListIconGadget Column Size

Post by Fred »

Fixed.
User avatar
mk-soft
Addict
Addict
Posts: 3806
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [Done] PB v6.00B8 ListIconGadget Column Size

Post by mk-soft »

Works now ;)

But it is annoying that the last column width is now set automatically. So the scroll bar to show the last column is missing.
And you have to double-click to make the last column fully visible.

Update example Beta 9 (TOP)

P.S.
Set last column width not work

Code: Select all

SetGadgetItemAttribute(0, 0, #PB_ListIcon_ColumnWidth, 400, 2)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply