CountGadgetColumns() Oh please!!!

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

CountGadgetColumns() Oh please!!!

Post by Rook Zimbabwe »

I think we need this feature. I do not see anythign in the docs about it and a search of the threads has revealed NADA!!!

I am having to carry a FLAG with the number of columns currently in my single #ListIcon_THING :?

Is it possible?
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Code: Select all

Procedure.l CountGadgetColumns(MyListIconGadget.l)
  ListIconGadgetHandle.l = SendMessage_(GadgetID(#MyListIconGadget), #LVM_GETHEADER, 0, 0)     ; Get collumn header
  numcols.l  = SendMessage_( ListIconGadgetHandle, #HDM_GETITEMCOUNT, 0, 0)                             ; Get number of collumns in header
	ProcedurReturn NumCols
EndProcedure
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Post by citystate »

Fangbeast wrote:

Code: Select all

Procedure.l CountGadgetColumns(MyListIconGadget.l)
  ListIconGadgetHandle.l = SendMessage_(GadgetID(#MyListIconGadget), #LVM_GETHEADER, 0, 0)     ; Get collumn header
  numcols.l  = SendMessage_( ListIconGadgetHandle, #HDM_GETITEMCOUNT, 0, 0)                             ; Get number of collumns in header
	ProcedurReturn NumCols
EndProcedure
that's fine if you're happy relying on the API, but what about crossplatform?
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

citystate wrote:
Fangbeast wrote:

Code: Select all

Procedure.l CountGadgetColumns(MyListIconGadget.l)
  ListIconGadgetHandle.l = SendMessage_(GadgetID(#MyListIconGadget), #LVM_GETHEADER, 0, 0)     ; Get collumn header
  numcols.l  = SendMessage_( ListIconGadgetHandle, #HDM_GETITEMCOUNT, 0, 0)                             ; Get number of collumns in header
	ProcedurReturn NumCols
EndProcedure
that's fine if you're happy relying on the API, but what about crossplatform?
No idea, but then, Rook didn't ask for a crossplatform solution. Instead of a separate flag, you could store the count in the item by using SetGadgetItemData(), it's in the manual.

Until the team see fit to add a native command.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Thats what i am asking for... a native command AND a fix of RemovegadgetColumn() as well! 8) 8) 8)
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Maybe we can expand the CountGadgetItems() command to a #Flag option where, when flag is set to #PB_Count_Columns is set, it returns the number of columns instead of items.
Tranquil
Post Reply