Splitter annoyances

BlitzMax Forums/MaxGUI Module/Splitter annoyances

JoshK(Posted 2010) [#1]
First, I think the default "click to toggle!" tooltip should be removed.

Second, there is a one-pixel space inside the draggable splitter area where the mouse icon displays as the default pointer instead of a set of arrows.

Third, this example demonstrates the splitter is only limited on the right side of the screen:
Strict

Import MaxGUI.Drivers
Import MaxGUI.ProxyGadgets

Global wndMain:TGadget = CreateWindow("Splitter Example",100,100,400,300,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_CENTER|WINDOW_CLIENTCOORDS|WINDOW_STATUS)
	
	'Create a splitter gadget
	Global spltMain:TSplitter = CreateSplitter( 0, 0, ClientWidth(wndMain), ClientHeight(wndMain), wndMain )
	SetSplitterBehavior spltmain,SPLIT_VERTICAL
	SetGadgetToolTip(spltMain,"")
	
	SetGadgetLayout spltMain,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED
	
	Local tmpSplitPanel:TGadget
		
		'Add a gadget to our left pane
		tmpSplitPanel = SplitterPanel(spltMain,SPLITPANEL_MAIN)
		Global txtEditor:TGadget = CreateTextArea(0,0,ClientWidth(tmpSplitPanel),ClientHeight(tmpSplitPanel),tmpSplitPanel,TEXTAREA_WORDWRAP)
		SetGadgetLayout(txtEditor,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED)
		
			AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
			AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
			AddTextAreaText(txtEditor, "The quick brown fox jumped over the lazy dogs.~n~n")
		
		'Add a gadget to our right pane
		tmpSplitPanel = SplitterPanel(spltMain,SPLITPANEL_SIDEPANE)
		Global treeView:TGadget = CreateTreeView(0,0,ClientWidth(tmpSplitPanel),ClientHeight(tmpSplitPanel),tmpSplitPanel)
		SetGadgetLayout(treeView,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED)
		
			AddTreeViewNode("Child", AddTreeViewNode("Parent Node", TreeViewRoot(treeView)))
			AddTreeViewNode("Other", TreeViewRoot(treeView))
	
Repeat
	WaitEvent()
	SetStatusText wndMain, CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE;End
	EndSelect
Forever



SebHoll(Posted 2010) [#2]
Use SetSplitterOrientation() to programatically flip the side of the splitter pane, or alternatively specify the SPLIT_CANFLIP behaviour flag using SetSplitterBehavior() to allow the user to do it themselves.

P.S. Where does the code you posted differ from the 'CreateSplitter' example?


JoshK(Posted 2010) [#3]
SetSplitterBehavior()

The splitter should stop at the left and right sides of the screen.


SebHoll(Posted 2010) [#4]
The SPLIT_VERTICAL constant is for use with SetSplitterOrientation() only. See the docs for SetSplitterBehavior() for the constants supported with that command...

e.g.

SetSplitterBehavior spltmain,SPLIT_CANFLIP|SPLIT_CLICKTOTOGGLE



jsp(Posted 2010) [#5]
Hmm,
although Josh took the wrong constant I could simulate the problem when using the resize flag.
e.g. SetSplitterBehavior spltmain,SPLIT_RESIZABLE|SPLIT_CANORIENTATE
It is then possible to drag the split far out of the left/top of the window. And it jumps back to the correct position when you resize the window.


SebHoll(Posted 2010) [#6]
I could simulate the problem when using the resize flag.

SPLIT_LIMITPANESIZE was implemented to prevent this problem.


jsp(Posted 2010) [#7]
OK, but that is used for a different behavoir. Of course the problem does not show up with limitpanesize or with canflip, because the splitter does act different then.

SPLIT_LIMITPANESIZE The splitter side-pane is not allowed to take up more than half the splitted dimensions.

That means you can't have the full size or suffer ;)