Recent

Author Topic: Border Style  (Read 9692 times)

endik

  • New Member
  • *
  • Posts: 29
Border Style
« on: May 29, 2007, 03:30:51 pm »
next issue but concerning a Form in general
3/ I would like to run my application on different comp's but have found that it is not displayed properly. Whatever Border Style value I choose I can click on the edge of the form and change its size. Unfortunately when I change its size its contents is not scaled but just cut off, so some components are not visible.

What I expect  to get is not sizeable or sizeable form but in the latter case a form should be scaled when I change its size.

Now it seems that the components on the form have absolute dimensions which do not depends on screen size and form size.

Maybe that problem has been already posted. If so, please let me know a link.

thanks

antonio

  • Hero Member
  • *****
  • Posts: 605
RE: Border Style
« Reply #1 on: May 29, 2007, 08:23:31 pm »
Depending on which controls do you have on the form, you could set them to automatically maintain their position on the form or you should handle the position by yourself. If they have property Align, you could set it to Top, Bottom, etc, if they don't have, you must handle the position and size by yourself. You can also use Panels containing the controls to automatically change position of them, since TPanel has an Align property.

See also if ChildSizing form property fits your needs.

endik

  • New Member
  • *
  • Posts: 29
Border Style
« Reply #2 on: May 30, 2007, 10:58:55 am »
give up,
maybe you can prepare small form with few components like: Tedit, TButton, TMemo, TPanel etc and make the soruce files accessible, that would help for sure,

I tried to change options for Align, ChildSizing, also Anchors and Border Spacing but nothing worked as I want

once again, to clear up what I want to get:
when I open my form at different screen resolution or resize whole form, all components on the form should be scaled, if I shrink the form twice all components should be shrinked respectively, the same for fonts of course (Caption of TPanel or Text of TEdit for exampel). But all components on the form should have positions specified in advance and not changeable.

thanks in advance

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Border Style
« Reply #3 on: May 30, 2007, 12:13:29 pm »
For scaling use an OnResize event.

endik

  • New Member
  • *
  • Posts: 29
Border Style
« Reply #4 on: May 31, 2007, 08:48:43 am »
first: what to put inside OnResize procedure?
second: this will not work when the application is launched at different screen resolution than mine, since Form was not resized yet

antonio

  • Hero Member
  • *****
  • Posts: 605
Border Style
« Reply #5 on: May 31, 2007, 08:46:24 pm »
I guess OnResize executes when application is launched.

endik

  • New Member
  • *
  • Posts: 29
Border Style
« Reply #6 on: May 31, 2007, 08:54:45 pm »
OnResize does not matter now, since I found .Constarins options which let me make a form not sizeable, still do not know how to easy make my application screen resolution not dependant,

I found Screen.Width and Height to get screen resolution and can adjust all components on each form to present screen resolution but this is really tough work - to many components and for ach I need to change Top, Left, Width, Height and Size

antonio

  • Hero Member
  • *****
  • Posts: 605
Border Style
« Reply #7 on: May 31, 2007, 09:35:08 pm »
Setting form size as an approximately fixed part of the screen size will give you a true screen resolution independent application, since Constraints will give a fixed size application for any resolution.

endik

  • New Member
  • *
  • Posts: 29
Border Style
« Reply #8 on: May 31, 2007, 09:53:56 pm »
that's true,
do you know simple option how to adjust more than 50 components on a form to different screen resolution

antonio

  • Hero Member
  • *****
  • Posts: 605
Border Style
« Reply #9 on: May 31, 2007, 09:57:49 pm »
Perhaps by setting all sizes on an event handler like OnResize or OnShow.  Perhaps you can arrange your controls to maintain aspect ratio.

You could set Border Style to some not sizeable value like bsSingle or bsDialog. Fonts should be changed also.

You can test it on your own computer for different resolutions.

 

TinyPortal © 2005-2018