createsplitter.bmx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Strict
  2. Import MaxGUI.Drivers
  3. Import MaxGUI.ProxyGadgets
  4. Global wndMain:TGadget = CreateWindow("Splitter Example",100,100,400,300,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_CENTER|WINDOW_CLIENTCOORDS|WINDOW_STATUS)
  5. 'Create a splitter gadget
  6. Global spltMain:TSplitter = CreateSplitter( 0, 0, ClientWidth(wndMain), ClientHeight(wndMain), wndMain )
  7. SetGadgetLayout spltMain,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED
  8. Local tmpSplitPanel:TGadget
  9. 'Add a gadget to our left pane
  10. tmpSplitPanel = SplitterPanel(spltMain,SPLITPANEL_MAIN)
  11. Global txtEditor:TGadget = CreateTextArea(0,0,ClientWidth(tmpSplitPanel),ClientHeight(tmpSplitPanel),tmpSplitPanel,TEXTAREA_WORDWRAP)
  12. SetGadgetLayout(txtEditor,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED)
  13. AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
  14. AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
  15. AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
  16. 'Add a gadget to our right pane
  17. tmpSplitPanel = SplitterPanel(spltMain,SPLITPANEL_SIDEPANE)
  18. Global treeView:TGadget = CreateTreeView(0,0,ClientWidth(tmpSplitPanel),ClientHeight(tmpSplitPanel),tmpSplitPanel)
  19. SetGadgetLayout(treeView,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED)
  20. AddTreeViewNode("Child", AddTreeViewNode("Parent Node", TreeViewRoot(treeView)))
  21. AddTreeViewNode("Other", TreeViewRoot(treeView))
  22. Repeat
  23. WaitEvent()
  24. SetStatusText wndMain, CurrentEvent.ToString()
  25. Select EventID()
  26. Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE;End
  27. EndSelect
  28. Forever