Главная страница
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.049 c
3-1079606654
Чайник.
2004-03-18 13:44
2004.04.18
DBComboBox?


1-1080888551
Relaxxx
2004-04-02 10:49
2004.04.18
Экспорт в Эксель(как заполнять сразу большие блоки)


7-1076695634
Maksss
2004-02-13 21:07
2004.04.18
Консоль в полно экранный режим


4-1076572782
Дёма
2004-02-12 10:59
2004.04.18
Версия Windows


7-1076590661
Davey
2004-02-12 15:57
2004.04.18
Где найти WMI SDK