Page 1 of 1
[Implemented] GetGadgetColumWidth, SetGadgetColumnWidth
Posted: Sat Apr 10, 2004 7:55 am
by USCode
*This request could be addressed by a simple set of general Get/Set functions instead *
Hi Fred,
If the user resizes columns in a ListIconGadget, I would like to be able to get those new column widths later so as I can save them and restore the column widths the next time the user starts up my application.
Please add:
- SetGadgetColumnWidth - Set the column width of a ListIconGadget column dynamically at runtime.
e.g. SetGadgetColumnWidth(#MyGadget, position, width)
- GetGadgetColumnWidth - Get what the current column width is of a ListIconGadget column so as I can save it for later use.
e.g. Width = GetGadgetColumnWidth(#MyGadget,position)
Thanks Fred!
Posted: Sat Apr 10, 2004 12:10 pm
by MLK
that would be nice!
just because there is a general problem with the columnsizes
Code: Select all
#width=330
a=#width/3
b=#width/3
c=#width/3
If OpenWindow(0, 280, 190, 350, 340, #PB_Window_SystemMenu | #PB_Window_TitleBar |#PB_Window_MinimizeGadget, "")
neu:
If CreateGadgetList(WindowID())
ListIconGadget(0, 10, 30, #width, 290,"1",a)
AddGadgetColumn(0,1,"2",b)
AddGadgetColumn(0,2,"3",c)
EndIf
EndIf
Repeat
If x=0
MessageRequester("","each column is #width / 3"+Chr(13)+"but it doesn't fit"+Chr(13)+"look at the scrollbar below")
x+1
Delay(100)
ElseIf x=1
a-4
x+1
Delay(100)
Goto neu:
ElseIf x=2
MessageRequester("","width 4 pixel less it fits"+Chr(13)+"(4 columnborders)")
x+1
Delay(100)
ElseIf x=3
For i=0 To 50
AddGadgetItem(0,i,"one"+Chr(10)+"two"+Chr(10)+"three")
Next
x+1
Delay(100)
ElseIf x=4
MessageRequester("","but even with this short strings"+Chr(13)+" the srollbar is back!"+Chr(13)+"because of the scrollbar at the right side"+Chr(13)+"but when i reserve the place for the right scrollbar from beginning")
x+1
c-25
Delay(100)
Goto neu:
ElseIf x=5
MessageRequester("","i get 4 columns...")
x+1
Delay(100)
Else
MessageRequester("","end")
End
EndIf
Until WaitWindowEvent()=#PB_Event_CloseWindow
i think this is the same in other languages, but its not nice. so a option to resize the columnwidth is nery needed.
Posted: Sat Apr 10, 2004 12:23 pm
by Kale
Re: Feature Request: GetGadgetColumWidth, SetGadgetColumnWid
Posted: Tue Dec 27, 2005 6:26 am
by PB
> Please add:
> SetGadgetColumnWidth - Set the column width of a ListIconGadget
> GetGadgetColumnWidth - Get what the current column width
Yes, would be nice to have this natively. Currently it's done via API calls:
Code: Select all
SendMessage_(GadgetID(#listicongadget),#LVM_SETCOLUMNWIDTH,column,width)
SendMessage_(GadgetID(#listicongadget),#LVM_GETCOLUMNWIDTH,column,0)
4.0, setting column widths?
Posted: Mon Feb 20, 2006 6:43 am
by USCode
Does anyone know if this issue has been addressed by any of the enhancements in 4.0? I don't believe it has based on what I can get from the readme?
Posted: Fri Feb 24, 2006 2:48 am
by USCode
Looks like the API is still the only way to go with this?
Oh well, maybe some day.
In the meantime, I guess we can always use one of the excellent grids that we now have available.
Posted: Fri Feb 24, 2006 5:29 am
by freak
I just squeezed these into the next v4 beta:
Code: Select all
GetGadgetItemAttribute(#Gadget, 0, #PB_ListIcon_ColumnWidth, 2) ; return width of column 2
SetGadgetItemAttribute(#Gadget, 0, #PB_ListIcon_ColumnWidth, 100, 2) ; set width of column 2 to 100
GetGadgetItemText(#Gadget, -1, 2) ; return header text for column 2
SetGadgetItemText(#Gadget, -1, "New Text", 2) ; change header text for column 2
Posted: Fri Feb 24, 2006 5:41 am
by PB
> I just squeezed these into the next v4 beta
GIMME AN F! GIMME AN R! GIMME AN E! etc...

Posted: Fri Feb 24, 2006 6:22 am
by USCode
freak wrote:I just squeezed these into the next v4 beta:
"Houston, the Eagle has landed..."
Excellent, thanks Timo!!! This v4 release is blowing my socks off!
Posted: Fri Feb 24, 2006 7:30 am
by Fangbeast
You realise that we are going to owe Freak a lifetime's supply of pizza for all the work he has done?? And I don't even know if Fred is still alive after these marathon adding sessions. Pretty sure it's a bot in IRC these days due to Fred's body giving up the ghost.
Phew, what a language. I can sit here, bugs or not and crank out handly little things to use after a few minutes and I am as dumb as a rock. Can't do that with other languages.
You guys blokes are dead set legends!
Posted: Fri Feb 24, 2006 1:03 pm
by Fred
PB wrote:GIMME AN F! GIMME AN R! GIMME AN E! etc...

