Please could i have some advise

Just starting out? Need help? Post your questions and find answers here.
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Please could i have some advise

Post by nrasool »

Hi there

Please could someone give me a guiding light. Its a followup from this thread

I have now got something which i like, many thanks to Paul which helped me out. I know have a series of dialog box see the following picture:
Image

If i highlight a node in the treeview, how can i relate that to the text dialog on the right hand side, so it shows information?

Please could anyone give me some advise or links?

Kind Regards
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Quick example

Code: Select all

OpenWindow(0, 0, 0, 500, 500, #PB_Window_ScreenCentered|#PB_Window_SystemMenu, "Tree Demo")

CreateGadgetList(WindowID())

TreeGadget(0, 0, 0, 250, 500)
TextGadget(1, 250, 0, 250, 500, "")

AddGadgetItem(0, -1, "England")
OpenTreeGadgetNode(0)
  AddGadgetItem(0, -1, "London")
  AddGadgetItem(0, -1, "Manchester")
  AddGadgetItem(0, -1, "Birmingham")
CloseTreeGadgetNode(0)


AddGadgetItem(0, -1, "France")
OpenTreeGadgetNode(0)
  AddGadgetItem(0, -1, "Paris")
  AddGadgetItem(0, -1, "Nice")
  AddGadgetItem(0, -1, "Lyon")
CloseTreeGadgetNode(0)

Repeat
  event = WaitWindowEvent()
  If event = #PB_Event_Gadget
    If EventGadgetID() = 0
      item = GetGadgetState(0)
      itemtext.s = GetGadgetItemText(0, item, 0)
      text.s = ""
      
      For i = 1 To 100
        text + itemtext + " "
      Next i
      
      SetGadgetText(1, text)
    EndIf
  EndIf
  
  
Until event = #PB_Event_CloseWindow
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

What about those functions ?

Code: Select all

- GetGadgetState(#MyTreeGadget): Return the current selected item. 
- GetGadgetText(#MyTreeGadget): Return the text of the currently selected item. 
If you know what tree item is selected, you can update your text dialog.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nrasool
User
User
Posts: 28
Joined: Tue Apr 26, 2005 9:55 am

Post by nrasool »

Hi there

I really appreciate the help, thankyou. Now got a good starting block.

@gnozal
i did check the helpfile, and saw that function, however just got stuck on EvenGadgetID, which GedB explained.

Many thanks for the help :)
Post Reply