Главная страница
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.03 c
6-1077015533
Neznayka
2004-02-17 13:58
2004.04.18
Сканирование сети


3-1079685693
Max1
2004-03-19 11:41
2004.04.18
Обновление базы через Интернет


1-1080633907
Saturn_
2004-03-30 12:05
2004.04.18
ScrollBar


1-1080804059
Dmitrij_K
2004-04-01 11:20
2004.04.18
Как можно распаковать все html файлы из *.chm файла


3-1080101505
Oldster
2004-03-24 07:11
2004.04.18
События в базе данных