Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.04.18;
Скачать: CL | DM;

Вниз

How to scale form/controls/fonts when switch to higher resolution   Найти похожие ветки 

 
Boguslaw   (2003-08-26 23:50) [0]

How to scale form/controls/fonts when switch to higher screen resolution ? Of course I mean : how to do this in KOL ? Maybe some function is required ? I have form which has to work properly in 640x480 and above but under 1024x768 is horrible small with small fonts and even maximized - controls are small and fonts too.
What about sizers in KOL ? How to implement them ?


 
SPeller ©   (2003-08-27 02:22) [1]

Можно вручную написать такой объект для масштабирования размеров контролов. Я как-то делал подобное, но не объектом, а функцией, которая размеры контролов масштабировала для соответствующего разрешения. Делается просто, например так:

mx := <текущее разрешение> / <эталонное разрешение, относительно которого задаются размеры>; // это по Х.
my := ... // аналогично по Y.
r.Left := Round( r.Left * mx );
r.Top := Round( r.Top * my );
r.Right := Round( r.Right * mx );
r.Bottom := Round( r.Bottom * my );

И получаем размеры в масштабе. Нужно только поймать изменение разрешения.


 
Boguslaw   (2003-08-28 01:04) [2]

Better if form could have such property to do it for all controls automatically (should somehow compare resolution when program is compiled and adjust if is changed at run-time).Also font size should be fixed or scaled to proper resolution (in my windows I could set font size to small/normal/big in desktop settings, but only menu text is scaled properly,button captions are still very small).
Vladimir , could it be possible ?


 
Кладов   (2003-08-28 15:30) [3]

Autosize=true for all control;
+ Align for all controls (+Margins) to provide correct placing/spacing controls;
+ Once calculate Font.FontHeight needed and then assign it to Form (better to a panle placed on a form), and for each TC_ages[ ] of TabControls - the same (again, better to assign to a panel placed on a page).

If Font is never changed adjusted in the project, default font which can be scaled automatically used. But it is ugly.



Страницы: 1 вся ветка

Текущий архив: 2004.04.18;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
8-1071501250
kopcap
2003-12-15 18:14
2004.04.18
Перерисовка кадров


1-1080808212
TransparentGhost
2004-04-01 12:30
2004.04.18
Не обрабатываются VK_Up, Vk_Down и т.п.


1-1080803727
ORMADA
2004-04-01 11:15
2004.04.18
Variant


6-1076666201
Aleksandr
2004-02-13 12:56
2004.04.18
Почему МИДАС-сокеты не могут соединиться?


6-1077015533
Neznayka
2004-02-17 13:58
2004.04.18
Сканирование сети