Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
splitterbar problems Posted by Crazy Jim on 1 Nov 2004 at 9:09 AM
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!


Report
Re: splitterbar problems Posted by zibadian on 1 Nov 2004 at 9:54 AM
: 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.
Report
Re: splitterbar problems Posted by Crazy Jim on 3 Nov 2004 at 8:37 AM
: : 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







 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.