Re: XControls move splitter programatically
- Posted by Greg Haberek <ghaberek at gmail.com> Jan 30, 2005
- 431 views
> While you're at it, can you improve the library to have a window with > three controls split by two splitters, with each splitter not able to > cross over the other? Sure, I'll call it XSplitter. It may take some time to develop. I think I may change the approach to creating panes and splitters, it does seem a bit convoluted. Until then, here's a little routine I whipped up to make attaching a pane to a splitter a bit easier. Remember to call manage_now() after you've attached all panes. This will be in the next xControls to make it easier to attach panes to an XSplitter (cross-splitter) by adding values (Top+Left, etc.).
global constant Left = 1, Top = 2, Right = 4, Bottom = 8 global procedure attachPane( integer pGeom, integer pPane, integer pSplit, integer pPosition ) sequence pos1, pos2, pos3, pos4 pos1 = {0,0} -- left edge pos2 = {0,0} -- top edge pos3 = {1.0,0} -- right edge pos4 = {1.0,0} -- bottom edge if and_bits( pPosition, Left ) then pos3 = {pSplit,0} elsif and_bits( pPosition, Top ) then pos4 = {pSplit,0} elsif and_bits( pPosition, Right ) then pos1 = {pSplit,0} elsif and_bits( pPosition, Bottom ) then pos2 = {pSplit,0} end if manage( pGeom, pPane, pos1, pos2, pos3, pos4 ) end procedure