: : I have a problem with splitterbars
: : The form is this way:
: :
: : panel0 split0 panel1 split1 panel2
: :
: : At times panel1 is invissible
: : at times both
: : panel1 and panel2 are invissible
: :
: : I can set the width of the adjacent splitterbar to zero
: : and later in some case the spltters will go to another place when I set the panels vusible again. (when i have moved split1 befor)
: : and i am test, the split0 jumps next to split1
: :
: : panel0 panel1 splitter splitter pane2
: :
: : and I can use the one splitterbar to resize the other splitterbar
: :
: :
: : Befor I didnot set the splitterwidt to zero, but then they also acted funny.
: :
: :
: : Did you ever have similar problems and what way did you solve them.? Thank you for your help!
: :
: :
: :
: Try to use the splitters with the AutoSnap set to false and the MinSize something positive. If this does not help then change the form into something like this:
:
: LeftPanel0 | splitter0 | ClientPanel0 |
: | | LeftPanel1 splitter1 ClientPanel1 |
:
: This will certainly work, although if both splitter0 and 1 are snapped to 0 the user might be hard-pressed to precisely move the cursor to select one. I would suggest you set the border of ClientPanel0 to something like 4.
:
a working solution
I solved the problem this way now
I call resetAlign; whenever I reset the visibility of an object
I do not know if obj.Align:=alNone; is necessary
Form will be, left to right:
panelBooks
splitter0
panelNotes
splitter1
panelmemo
procedure TForm1.resetAlign;
var gbLeft:integer;
begin
splitter1.Align:=alNone;
panelNotes.align:=alNone;
splitter0.Align:=alNone;
panelBooks.align:=alNone;
panelmemo.align:=alNone;
if panelBooks.visible=true then
begin
panelBooks.align:=alLeft;
gbLeft:= panelBooks.Width;
splitter0.Left:=gbLeft;
splitter0.Align:=alLeft;
gbLeft:= gbLeft+splitter0.Width ;
panelNotes.Left:=gbLeft;
panelNotes.align:=alLeft;
gbLeft:= gbLeft+panelNotes.width;
splitter1.Left:=gbLeft;
splitter1.Align:=alLeft;
gbLeft:= gbLeft+splitter1.width;
panelmemo.left:=gbleft;
panelmemo.align:=alClient;
exit;//!
end;//if panelBooks.visible=true then
if panelNotes.visible=true then
begin
panelNotes.align:=alLeft;
gbLeft:= gbLeft+panelNotes.width;
splitter1.Left:=gbLeft;
splitter1.Align:=alLeft;
gbLeft:= gbLeft+splitter1.width;
panelmemo.left:=gbleft;
panelmemo.align:=alClient;
exit;//!
end; //panelNotes.visible=true
//only memovisble
panelmemo.align:=alClient;
end;//resetAllign