
TreeGadget Flags
TreeGadget Flags
Still waiting for a native PB flag that forces all branches of a TreeGadget to be open/displayed. 

Ruff translation of my C code that does what you need.
As I only have the demo, so you can tell me how close I wasn't
As I only have the demo, so you can tell me how close I wasn't

Code: Select all
;-----------------------------------------------------------------------------
; Expand TreeView
;-----------------------------------------------------------------------------
Procedure TreeViewExpandAll(gadget.l)
hwndTV.l = GadgetID(gadget)
hRoot.l = SendMessage_(hwndTV, #TVM_GETNEXTITEM, #TVGN_ROOT, 0)
hItem.l = hRoot
Repeat
SendMessage_(hwndTV, #TVM_EXPAND, #TVE_EXPAND, hItem)
hItem = SendMessage_(hwndTV, #TVM_GETNEXTITEM, #TVGN_NEXTVISIBLE , hItem)
Until hItem = #NULL
SendMessage_(hwndTV, #TVM_ENSUREVISIBLE, 0, hRoot)
EndProcedure
;-----------------------------------------------------------------------------
; Collapse TreeView
;-----------------------------------------------------------------------------
Procedure TreeViewCollapseAll(gadget.l)
hwndTV.l = GadgetID(gadget)
hRoot.l = SendMessage_(hwndTV, #TVM_GETNEXTITEM, #TVGN_ROOT, 0)
hItem.l = hRoot
Repeat
SendMessage_(hwndTV, #TVM_EXPAND, #TVE_COLLAPSE, hItem)
hItem = SendMessage_(hwndTV, #TVM_GETNEXTITEM, #TVGN_NEXTVISIBLE , hItem)
Until hItem = #NULL
SendMessage_(hwndTV, #TVM_ENSUREVISIBLE, 0, hRoot)
EndProcedure
I guess I should have used Bold on my message...
I asked for a "native PB flag", not a workaround.
How can your app be cross platform if you fill it full of Windows API calls? Right now one must loop through using SetGadgetState as a workaround to keep everything cross platform but that way is very slow ;(
I asked for a "native PB flag", not a workaround.
How can your app be cross platform if you fill it full of Windows API calls? Right now one must loop through using SetGadgetState as a workaround to keep everything cross platform but that way is very slow ;(
-
- User
- Posts: 10
- Joined: Fri Apr 25, 2003 8:23 pm
But this is a PureBasic related shortcoming not OS related.freak wrote:Hmm, TreeGadget is a "Windows only" Gadget. It's not supported on any other Platform at all.
...
Timo
On my LINUX box I can have Treeviews all over the place 8O
QUESTION:
Is PureBasic moving from a all purpose language to a Gamer language

If yes, than the Linux version needs years from now to have the same GUI toolkit as the Windows version.
.
. Greetings
.
. from all three of us...
.
. Greetings
.
. from all three of us...
.