Page 1 of 1
TreeGadget Flags
Posted: Fri May 16, 2003 4:48 pm
by Paul
Still waiting for a native PB flag that forces all branches of a TreeGadget to be open/displayed.

Posted: Fri May 16, 2003 5:04 pm
by Inner
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
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
Posted: Fri May 16, 2003 10:17 pm
by ebs
Inner,
Works!
Eric
Posted: Fri May 16, 2003 11:39 pm
by freak
Posted: Sat May 17, 2003 7:20 pm
by Paul
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 ;(
Posted: Sat May 17, 2003 7:24 pm
by freak
Hmm, TreeGadget is a "Windows only" Gadget. It's not supported on
any other Platform at all.
Noted on the bottom of the TreeGadget help page.
Sorry, you'll have to find a workaround around this whole Control to be
crossplatform compatible at the moment.
Timo
Posted: Sat May 17, 2003 11:18 pm
by Paul
The whole point is that I do not want workarounds... I would like native support with PureBasic.
Regardless, this was posted for Fred. If everyone else wants to use workarounds that is fine, but this is my own little personal wish.
Posted: Sun May 18, 2003 1:22 am
by Inner
Fare enough, just trying to help
(_wispers_)
I think so too!! shhh
Posted: Sun May 18, 2003 6:30 pm
by MeMyselfAndI
freak wrote:Hmm, TreeGadget is a "Windows only" Gadget. It's not supported on any other Platform at all.
...
Timo
But this is a PureBasic related shortcoming not OS related.
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.
Posted: Sun May 18, 2003 7:06 pm
by Inner
I don't think so, I think PB is just expanding and growing just like any language should.
Posted: Sun May 18, 2003 11:58 pm
by Fred
No it's not moving into a game langage, but into a multipurpose langage which is fairly different.