Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scaling-down a dialog when moved to another screen
#1
I designed a dialog on a 17" (1280x1024) computer screen which takes all the height o this screen. Then I moved this dialog on a 14" laptop (1366x768) screen. As a matter of fact the dialog looses about 12% of its height from bottom. I wonder whether there exists a simple way to scale-down the dialog, when moved to the laptop. Thanks in advanced for any advice.
#2
Function Dialog176
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 1132 584 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040300 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

;OutWinMsg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_EXITSIZEMOVE EnsureWindowInScreen(hDlg 1)
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
Gintaras, thank you very much indeed. Best Regards.
#4
Dear Gintaras, let me return again to this issue, with a specific case-study.

Function Dialog33_Long
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 370 371 "Dialog"
;3 Static 0x54000000 0x0 257 391 48 12 "Bottom"
;4 Static 0x54000000 0x0 14 8 48 12 "Top"
;5 Edit 0x54030080 0x200 120 188 96 12 ""
;6 Static 0x54000000 0x0 132 298 114 14 "bottom in Lin0"
;7 Static 0x54000000 0x0 132 320 114 14 "bottom in Lin1"
;8 Static 0x54000000 0x0 132 340 114 14 "bottom in Lin2"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

str controls = "5"
str e5
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,EnsureWindowInScreen hDlg 1|32
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

This dialog is displayed properly in a PC's screen, but it is cut at the bottom at another screen. Is it possible to follow any simple method to display it in any screen by zooming by some percentage? Many thanks.
#5
Use function DT_SetAutoSizeControls.
#6
I am sorry, but I failed using function DT_SetAutoSizeControls. Nevertheless, I empirically found that the following code satisfies my needs. As a matter of fact I would appreciate it if you could assist me in rewriting the code by avoiding the arbitrary part in WM_INITDIALOG.

Function Dialog33_Long
Code:
Copy      Help
\Dialog_Editor

;www.quickmacros.com/forum/viewtopic.php?p=29480

str dd=
;BEGIN DIALOG
;0 "" 0x90CC0AC8 0x0 0 0 370 371 "Dialog"
;3 Static 0x54000000 0x0 257 391 48 12 "Bottom"
;4 Static 0x54000000 0x0 14 8 48 12 "Top"
;5 Edit 0x54030080 0x200 120 188 96 12 ""
;6 Static 0x54000000 0x0 132 298 114 14 "bottom in Lin0"
;7 Static 0x54000000 0x0 132 320 114 14 "bottom in Lin1"
;8 Static 0x54000000 0x0 132 340 114 14 "bottom in Lin2"
;9 Static 0x54000000 0x0 132 350 48 12 "Bottom.."
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

str controls = "5"
str e5
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,mov 0 -200 hDlg 1
,lef+ 424 776 hDlg ;; 'Dialog'
,int w2=win("Program Manager" "Progman")
,lef- 764 587 w2 1
;,0.2
,mov 0 5 hDlg 1

,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#7
I am still trying to work-out a way to scale-down a window-dialog, designed in a PC with screen ample to accommodate a high dialog, to another PC with shorter screen, where this dialog is truncated at its bottom. I wonder whether a vertical scroll bar in this dialog could help. I cannot see any example with a vertical scroll bar. Any advice will be highly appreciated.
#8
Maybe better use a multi-page dialog.

Scrolling is possible but then probably will need a child dialog, then not so easy to work with it. Example: Collected QM apps, functions, samples -> Functions... -> ChildDialog.
#9
Dear Gintaras, Many thanks. I have already shifted to a multi-page dialog. I found it easiest and more convenient. Best regards.


Forum Jump:


Users browsing this thread: 1 Guest(s)