Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

splitterbar problems

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!


Comments

  • zibadianzibadian Posts: 6,349Member
    : 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:
    [code]
    LeftPanel0 | splitter0 | ClientPanel0 |
    | | LeftPanel1 splitter1 ClientPanel1 |
    [/code]
    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.
  • Crazy JimCrazy Jim Posts: 18Member
    : : 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:
    : [code]
    : LeftPanel0 | splitter0 | ClientPanel0 |
    : | | LeftPanel1 splitter1 ClientPanel1 |
    : [/code]
    : 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.
    :



    [b]a working solution[/b]
    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

    [code]

    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

    [/code]


Sign In or Register to comment.