Rich, When you make a PageControl invisible as you planned, what had you planned to be in that same now open space? I wouldn't worry about making the visible/invisible, but would just use the Splitter itself to cover up the pane you don't wish the user to see. Just reset the appropriate Splitter bar's position to it's max which in effect would cover up the PageControl in its right-most pane. The PageControl in the left-most Pane of the same Splitter would then automatically become wider so that no empty space exists, or you could make it so that all other splitters change their positions so that the other PageControls share the extra width between them.
It's difficult knowing exactly what you are trying to accomplish without actually seeing it. I have the problem all the time! <g> from Robert Meek dba "Tangentals Design" e-mail: [EMAIL PROTECTED] Freelance Windows Programming for XP and Vista Also proud to be a Moderator of the "Delphi-List" at elists.org "Reality cannot be explained...only enjoyed or endured as your current perspective allows!" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Cooper Sent: Sunday, May 11, 2008 11:41 AM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls Hi Robert, Yes, we're both talking about the TSplitter component on the "Additional" component palette. All my three splitters modify the size of the PageControl on the immediate right of that splitter. All the splitters are set to alRight, and the fourth PageControl, which has no splitter, is set to alClient. That means I can resize the form, and the fourth PageControl takes up the slack. I have nearly given up making the three rightmost PageControls switch between visible and not visible - I haven't been able to figure out what happens to the PageControl and its associated Splitter when I make it invisible, so I haven't figured out how to reposition the three Splitters and three PageControls when changing visibility settings. I guess I could root through the watch window and set up cases to figure out how the various positions change when one or more is made invisible, but I haven't gotten there yet. But I have figured out how to keep the PageControls from disappearing when I adjust their width to too small a value. Here is an event I use to keep the Details PageControl from getting narrower than 30 pixels: procedure TfmConversation.spDetailsCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean); begin {Be sure the Details component can be seen} if NewSize<=30 then Accept := False else Accept := True; end; Sincerely, Rich Cooper EnglishLogicKernel.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Meek Sent: Sunday, May 11, 2008 8:21 AM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls Rich, Perhaps we're not in synch on what a "Splitter" is. When I refer to a "Splitter" I mean a visual control that looks like a Panel having a moveable bar splitting the panel into two Panes. The bar can be set to split the Panes vertically or horizontally. To set things up as you describe, I would first add a splitter to my Form set to alClient and its bar set to Vertical. Then I would add a second Splitter to the first Splitter's Left Pane set to alClient, and a third Splitter to the first Splitter's Right Pane set to alClient. You now have 4 separate resizable Panes that you can use the way you likee. From your description below, I would put the [pcConversations-PageControl] on the Second Splitter's Left Pane set to alClient, the [pcDetails-PageControl] in the Second Splitter's Right Pane set to alClient, the [pcObjects-Pagecontrol] in the Third Splitter's Left Pane set to alClient, and the [pcActions-PageControl] in the Third Splitter's Right Pane set to alClient. Next you would have to decide how you want the form and Splitters to react when one or more of the PageControls is made invisible. For example, if you make the [pcActions-PageControl] to disappear, you could do it two ways since it's in the right Pane of Splitter 3. You could reposition it's bar to it's max to cover the PageControl up, which would make the [pcObjects-Pagecontrol] twice as wide as it was. Or you could also re-position the bar of Splitter 1 and/or 2 at the same time to even out the widths of the remaining three PageControls. Or you could instead set the bar for Splitter 3 to its max position but instead of resizing the other Splitter's just readjust the Form's width! Doing this allows you many options as to what is visible or not and how visibility effects pane and/or Form size. All you need to do is create events to do exactly what you want, then save the Splitter.position for each Splitter and the Form's width to an inifile and read and set them again when the user calls one of the events. Anyway, all this depends on if we're even talking about the same type of control! <g> from Robert Meek dba "Tangentals Design" e-mail: [EMAIL PROTECTED] Freelance Windows Programming for XP and Vista Also proud to be a Moderator of the "Delphi-List" at elists.org "Reality cannot be explained...only enjoyed or endured as your current perspective allows!" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Cooper Sent: Saturday, May 10, 2008 11:55 AM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls Hi Robert, All the Splitters are set align=alRight, and each splitter is immediately to the left of its related PageControl. I'm using D7 with Vista, and the Splitters don't have a property named "UsePercent". That must be a new property later than D7. The best pictorial description is this one: [pcConversations]spDetails[pcDetails]spObjects[pcObjects]spActions[pcActions ] As it shows, there are four PCs and three Splitters. Sincerely, Rich Cooper EnglishLogicKernel.com [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Meek Sent: Saturday, May 10, 2008 12:06 AM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls Rich, If each Pagecontrol is set to alRight how, where, and when are their left sides being anchored? And you also didn't say how the splitters themselves are setup. For example, do you have one splitter set to alClient and parented by the form, and then a second Splitter set to alClient in one side's pane of the first Splitter? And also do you have the Splitters set to UsePercent = True or False? If you like I'd be happy to throw an example of how I'd do it for you and send it along, but I would need to know the answers to the above, and also if the three PageConrols are the only components ever seen on this form except for the two Splitter bars even when one or more is invisible. from Robert Meek dba "Tangentals Design" e-mail: [EMAIL PROTECTED] Freelance Windows Programming for XP and Vista Also proud to be a Moderator of the "Delphi-List" at elists.org "Reality cannot be explained...only enjoyed or endured as your current perspective allows!" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Cooper Sent: Friday, May 09, 2008 12:31 PM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls Not quite like that. Every TPageControl except the left most (pcConversations) has its align property set to alRight, and each of them has an associated splitter width=3, positioned just to left of the TPageControl. That's how the program starts running. Visually, the panels are as shown below: [pcConversations]spDetails[pcDetails]spObjects[pcObjects]spActions[pcActions ] Where the Hungarian prefix "sp" is for splitter, and "pc" is for PageControl. While the program is running, I want to let my user make any of the TPageControls visible or not visible in any combination. But when I turn off one page control's visible property, it gets positioned somewhere away from its original position. Then when I turn it visible again, its associated splitter has moved, and no longer fulfills the function of adjusting the TPageControl's width, since it is no longer just to the left of the TPageControl. Here is some code that turns ALL TPageControls off and on at the same time, in right to left order: procedure TurnOffAllPageControls; {in left to right order} begin fmConversation.pcConversations.Align := alNone; fmConversation.spDetails.Align := alNone; fmConversation.pcDetails.Align := alNone; fmConversation.spDetails.Visible := False; fmConversation.pcDetails.Visible := False; fmConversation.spObjects.Align := alNone; fmConversation.pcObjects.Align := alNone; fmConversation.spObjects.Visible := False; fmConversation.pcObjects.Visible := False; fmConversation.spActions.Align := alNone; fmConversation.pcActions.Align := alNone; fmConversation.spActions.Visible := False; fmConversation.pcActions.Visible := False; end; procedure TurnOnAllPageControls; {in right to left order} begin fmConversation.pcActions.Left := fmConversation.Width-16; fmConversation.pcActions.Align := alRight; fmConversation.pcActions.Visible := True; fmConversation.spActions.Align := alRight; fmConversation.spActions.Visible := True; fmConversation.pcObjects.Align := alRight; fmConversation.pcObjects.Visible := True; fmConversation.spObjects.Align := alRight; fmConversation.spObjects.Visible := True; fmConversation.pcDetails.Align := alRight; fmConversation.pcDetails.Visible := True; fmConversation.spDetails.Align := alRight; fmConversation.spDetails.Visible := True; fmConversation.pcConversations.Align := alClient; end; As long as I turn them all off in right to left order, then all on in right to left order, everything stays ok. But when I turn just one pc off, it gets moved because the other pcs to the left of it get adjusted due to the alRight setting of all the pc and sp components. What I need is a design concept that lets me adjust the position of each page control and its associated splitter. I'm still working on defining that concept. -Rich -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Meek Sent: Thursday, May 08, 2008 8:13 PM To: 'Delphi-Talk Discussion List' Subject: RE: Splitters and PageControls If I'm reading this correctly, you have a form which is divided into 3 panes. The left-most ConversationPane is always visible and is set to alLeft and of a width that is pre-set to always be the same. Then you have a splitter set to alRight with its top and left anchors set to always meet the right-edge of the left-most ConversationsPane. In the splitter's right-most panel you have set to alClient an ActionsPane, You then say that in the splitter's left-pane you repeat this setup for an ObjectsPane, yet this would infer that you have added a whole new splitter to the first splitter's left pane and set to alClient, and with the ObjectsPane set to alClient in the second Splitter's left-most Panel! I know this cannot be correct because it is not only redundant, but of no real use in anyway I can figure out no matter which of these "panes" are PageControls or some other component types! So perhaps THIS is what you are trying to describe: A Form on which you have added a Splitter set to alClient. In its left-most pane you have added a second Splitter set to alClient as well. In the Splitter's right-most pane you have added a pageControl set to alClient. In the second Splitter's left-most pane you have added a PageControl set to alClient, and in its right-most pane another PageControl set to alClient as well. The PageControls named from left to right appear as pcConversations, pcObjects, and pcActions. Depending upon events controlled from a popup menu on the pcConversations PageControl, you wish for one or both of the other two PageControls to be visible or not simultaneously, while the pcConversations PageControl is always visible and static down to a min Width Contraint. More than likely I would want the Form itself not to ever change it's width based upon any particular PageControl being visible or not, as that is confusing to the user's eyes. Instead, I would want the pcConversations PageControl to increase in width via increasing the secondary Splitter's left-most Pane being increased in width as required when ever one or both of the other two PageControls are made invisible. So the way I would handle this is to reset the second Splitter's Percentage to 100% or to its max position so as it make its left-most pane and the pcConversations PageControl as wide as possible whenever the pcObjects PageControl must disappear which can be accomplished simply by altering its Splitter's position or percentage as just stated. I would do exactly the same thing to the Position or Percentage of the original Splitter when ever the pcActions pane needs to disappear as well. This makes each one independent of the other so that they can be made to disappear and/or re-appear in whatever order and/or sequence the user wants, and to cause the pcConversations PageControl to react by getting wider or thinner as needed to fill in the addition empty space or allow for the additionally needed space depending upon how the other two PageControls are altered and without having to worry about the possibility that the Form itself may have had its own width changed between any of the events! Note: As I've used this same technique myself, depending upon the Splitter type and brand you are employing, and also on how you have it's borders and/or frames setup visually, you may need to play around with these settings as you click on these events so as to make things appear as "clean" as possible. What I have had to do in the past was actually make the Splitter bar width 0 when set to its max position and then to its default width again when resized to make both its panes visible again otherwise they often look clumsy all at one side! HTH's from Robert Meek dba "Tangentals Design" e-mail: [EMAIL PROTECTED] Freelance Windows Programming for XP and Vista Also proud to be a Moderator of the "Delphi-List" at elists.org "Reality cannot be explained...only enjoyed or endured as your current perspective allows!" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich Cooper Sent: Thursday, May 08, 2008 3:53 PM To: 'Delphi-Talk Discussion List' Subject: Splitters and PageControls Hi All, I have a form with three PageControls on it. The one on the left (pcConversations) is always visible. There is a menu which lets the user check or uncheck whether the other two PageControls are visible. Those two PageControls are called pcActions and pcObjects. pcActions is on the right side of the form, align=alRight, and there is a splitter (spActions) with align=alRight flush on the left side of pcActions. The same structure is used for pcObjects (just to the left of spActions and pcActions) and spObjects (just to the left of pcObjects). Now I want to write the handlers for the 'checked' property of the two menu items <View | Objects> and <View | Actions>. Here is the first attempt at writing these handlers: procedure TfmConversation.Objects1Click(Sender: TObject); begin Objects1.Checked := not Objects1.Checked; spObjects.Left := pcObjects.Left-7; spActions.Left := pcActions.Left-7; pcObjects.Visible := Objects1.Checked; end; procedure TfmConversation.Actions1Click(Sender: TObject); begin Actions1.Checked := not Actions1.Checked; spActions.Left := pcActions.Left-7; spObjects.Left := pcObjects.Left-7; pcActions.Visible := Actions1.Checked; end; The problem is that the splitters and the PageControls don't stay in the right places. If I make pcActions.visible=false and pcObjects.visible=false (by using the checks in the menu) everything is OK. But then when I bring them back to visible (again by using menu checks), they are in the wrong place. Does anyone know how to handle turning the PageControls and splitters visible and back to invisible without changing the left to right order of the components on the form? Thanks for any comments, Rich __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi-talk