Found an issue in SpiderBasic ? Please report it here !
User avatar
Paul
 
Posts: 24
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada

ListIconGadget Resizing Problem

by Paul Sat Apr 21, 2018 11:08 pm

If I run the following code in PureBasic, when the Window is resized everything works as expected. The Window and LisIconGadget resize and the Columns stay static.

If the following code is run in SpiderBasic, when you resize the Window the ListIconGadget starts to resize and the Column titles start to resize as well instead of staying static but the data in the columns stays static... so the columns no longer line up.

Code: Select all
#Window_Main=1
#Gadget_Main_List=1
t.s=Chr(10)

Procedure SizeWindowHandler()
  wwin=WindowWidth(#Window_Main)
  hwin=WindowHeight(#Window_Main)
  ResizeGadget(#Gadget_Main_List,#PB_Ignore,#PB_Ignore,wwin,hwin)
EndProcedure
BindEvent(#PB_Event_SizeWindow,@SizeWindowHandler())

OpenWindow(#Window_Main,10,10,720,400,"Respite List",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
  ListIconGadget(#Gadget_Main_List,0,0,720,400,"Name",100,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
    SetGadgetColor(#Gadget_Main_List,#PB_Gadget_BackColor,$F4FFF5)
    AddGadgetColumn(#Gadget_Main_List,1,"Address",100)
    AddGadgetColumn(#Gadget_Main_List,2,"Home",100)
    AddGadgetColumn(#Gadget_Main_List,3,"Cell",100)
    AddGadgetColumn(#Gadget_Main_List,4,"Info",200)
    AddGadgetColumn(#Gadget_Main_List,5,"Preference",200)   
   
    For tmp=1 To 10
      AddGadgetItem(#Gadget_Main_List,-1,"Name"+Str(tmp)+t+"Address"+t+"Home"+t+"Cell"+t+"Info"+t+"Pref")
    Next
   
CompilerIf #PB_Compiler_OS=#PB_OS_Windows 
  Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
CompilerEndIf
User avatar
Peter
 
Posts: 486
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: ListIconGadget Resizing Problem

by Peter Sun Apr 22, 2018 8:18 am

Already reported: http://forums.spiderbasic.com/viewtopic.php?p=3422#p3422 (16 Month ago...)

Solution for you until it is fixed: Change the Column-Widths from 100 to 50 and from 200 to 100.

Greetings ... Peter
User avatar
Paul
 
Posts: 24
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada

Re: ListIconGadget Resizing Problem

by Paul Sun Apr 22, 2018 3:53 pm

Thanks Peter. Turns out the Forum search doesn't work well either :)
I searched for ListIconGadget before posting and your post doesn't show up. Trying again I notice mine doesn't show up either even though ListIconGadget is in both the Title and the message body.

Anyway, the workaround is no good for me because I actually have quite a number of columns in my real project which will always be larger than the Gadget. The code I posted is only a demo showing the problem.
The demo code also shows the problem with the columns trying to auto size with the sizing of the gadget which should not happen. Column widths should remain static unless I specifically resize them. (just like PureBasic behavior)

It's a little discouraging to see problems with this gadget were posted over a year ago and still not addressed.
User avatar
Peter
 
Posts: 486
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: ListIconGadget Resizing Problem

by Peter Sun Apr 22, 2018 5:40 pm

Paul wrote:Turns out the Forum search doesn't work well either :)

yes, unfortunately the forum search is unnecessarily case-sensitive. "ListIconGadget" will find 83 matches, "ListiconGadget" will find 2 matches...

Paul wrote:Anyway, the workaround is no good for me because I actually have quite a number of columns in my real project which will always be larger than the Gadget.

rule of thumb: the sum of all column widths must not exceed the total width of the listicongadget. I know it's not optimal, but it's better than nothing. :|

Greetings ... Peter
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 1 guest