Главная страница
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.042 c
1-1080478216
Guest32545654
2004-03-28 16:50
2004.04.18
Как получить массив символов dos-окна?


1-1080735344
Настенька
2004-03-31 16:15
2004.04.18
объединение ячеек в сринггриде


14-1080225799
Отшельник
2004-03-25 17:43
2004.04.18
Книга Delphi и технология COM


1-1080411855
leonidus
2004-03-27 21:24
2004.04.18
Как получить текущее время с точностью до миллисекунд?


6-1076419762
Prankster
2004-02-10 16:29
2004.04.18
Отправка почты