Главная страница
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.024 c
3-1080134168
Witcher
2004-03-24 16:16
2004.04.18
Есть БД Paradox, которая обрабатываеться программой.


3-1079537704
snake1977
2004-03-17 18:35
2004.04.18
Зависают запросы


6-1075998789
DelphiN!
2004-02-05 19:33
2004.04.18
Команды SMTP серверов


1-1080743581
Фдуч
2004-03-31 18:33
2004.04.18
Меню в MDI приложении


7-1077179495
CC
2004-02-19 11:31
2004.04.18
Как поместить иконку в Tray ?