Recent

Author Topic: Stop PageSplitterSide from shrinking?  (Read 2969 times)

A

  • Guest
Stop PageSplitterSide from shrinking?
« on: January 05, 2018, 12:17:38 am »
Hello,

In my form I have one main PairSplitter (pstHorizontal).
In the top PairSplitterSide I have another PairSplitter (pstVertical).
I'd like to make it so that in the main PairSplitter, the bottom PairSplitterSide does not shrink vertically when the form is resized, but I'd like the top main PairSplitterSide to resize normally.

I know this is quite difficult to understand, but if you have Geany installed, that'll give you a good idea of what I'm trying to achieve - the log window remains the same size (vertically) when the form is resized, while the top PairSplitterSide containing the code editor is resized vertically.

I hope my intentions are clear, thanks for your help, as always! :D

jamie

  • Hero Member
  • *****
  • Posts: 7405
Re: Stop PageSplitterSide from shrinking?
« Reply #1 on: January 05, 2018, 12:51:25 am »
Use  a TPanel on the lower display to hold the contents of what ever it is you display there.

using the anchor editor of the horizontal splitter, attach the button to the top side of that
Tpanel below and make sure you don't have the Tpanel to auto size..

 I think I have a good Idea of that you are trying to do, you want to be able to size the
bottom pan but keep the size intact if the form changes size..

 Experiment with the Anchor Editor..
The only true wisdom is knowing you know nothing

A

  • Guest
Re: Stop PageSplitterSide from shrinking?
« Reply #2 on: January 05, 2018, 01:39:02 am »
Thanks for your reply jamie,

I have been fiddling with the anchor properties for a while now, but unfortunately the closest I've got is: having all controls alClient, except for the main parenting PairSplitter which is alNone  LEFT RIGHT BOTTOM.

This is exactly what I wan't except for the fact that the whole splitter goes off of the screen on the top of the form when adjusting the size of the form (minimizing it) because, obviously, it's not anchored to the top of the form.

I just need the top PairSplitterSlide (the one whose side can adjust) to be anchored to the top).

You understand my problem perfectly, by the way.

Cheers for any help!

jamie

  • Hero Member
  • *****
  • Posts: 7405
Re: Stop PageSplitterSide from shrinking?
« Reply #3 on: January 05, 2018, 02:18:02 am »
When you say "minimize" do you mean when to the task bar or a minimum size the form
can be ?
   
  At some point the splitter will not have any room to show, it has to go somewhere so
that leaves me to thinking that you then want the bottom pan to start shrinking in such a case?
 
  It kind of reminds of the Dock type IDE's where you have the main editor in the center, menu
to the left and a status/ log window at the bottom. Is this correct?
The only true wisdom is knowing you know nothing

A

  • Guest
Re: Stop PageSplitterSide from shrinking?
« Reply #4 on: January 05, 2018, 02:36:48 am »
Hi jamie,

Sorry for the confusion - I do mean just shrinking it, not minimizing it completely.

And yes, it's very similar to the dock-type IDE's (except no docking, just resizing of the "windows" on the form). An example of what I'm trying to achieve: https://www.tecmint.com/wp-content/uploads/2016/06/Geany-IDE-for-Linux.png

In this example, when adjusting the IDE's size by pulling the borders in to shrink it, the main editing component, as well as the left LB are shrunk, however the logging component stays the same size.

I will, in the future, prepare some code to limit the forms minimum size based off of the log's horizontal size.

By the way, I have tried for at least an hour fiddling with the anchoring settings, no luck unfortunately. :/

Thanks for your help and patience.

jamie

  • Hero Member
  • *****
  • Posts: 7405
Re: Stop PageSplitterSide from shrinking?
« Reply #5 on: January 05, 2018, 03:08:00 am »
I find that if you use anchor settings you do not want to use any of the Align properties, just
set them as alNone for the border controls you are trying to anchor to.
 
 What you man need to do is in the OnSize event make the adjustments to the
Splitter so the log window will always be at the size you want and allow the log control
window to anchor to it..

 For example, assume you want 200 Pixels height, in the OnSize of the form, ajust the splitter
position.
 also you can set your constraints to not allow over or under sizing1


The only true wisdom is knowing you know nothing

Zoran

  • Hero Member
  • *****
  • Posts: 1977
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Stop PageSplitterSide from shrinking?
« Reply #6 on: January 05, 2018, 08:32:34 am »
Please test the attached project -- does it do what you want?
It is done with splitter control, not with PairSplitter.

PairSplitter gives you less control on this. Use Splitter and anchors, not PairSplitter if you want to control which side of the splitter resizes when the form resizes.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

A

  • Guest
Re: Stop PageSplitterSide from shrinking?
« Reply #7 on: January 05, 2018, 02:49:38 pm »
Hi Zoran,

That worked perfectly, thanks. I wasn't aware that there was a splitter control by itself; I thought there was only a PairSplitter.

Thanks Zoran, and thanks jamie!

 

TinyPortal © 2005-2018