Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get state of control (listbox, editfield,...) hidden/enabled
#1
Is it possible to get the state of an control from a QM generated dialog?
In other words: check if a QM listbox, editfield, checkbox, ...etc.. is hidden or visible AND if it is enabled or disabled.

I read here about "State&STATE_SYSTEM_INVISIBLE":
Tweak GetChildObjects routine
But I do not know if it is applicable on my situation.
#2
Floating toolbar -> Windows,controls -> Window/control actions.

Function Dialog156
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 8 8 48 14 "Disable"
;4 Button 0x54012003 0x0 72 8 48 10 "Check"
;5 Button 0x54032000 0x0 8 28 48 14 "Hide"
;6 Edit 0x54030080 0x200 72 28 96 13 ""
;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 = "3 6"
str c3Che e6
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,int hCheck=id(4 hDlg)
,if(IsWindowEnabled(hCheck)) EnableWindow hCheck 0; SetDlgItemText hDlg 3 "Enable"
,else EnableWindow hCheck 1; SetDlgItemText hDlg 3 "Disable"
,
,case 5
,int hEdit=id(6 hDlg)
,if(IsWindowVisible(hEdit)) ShowWindow hEdit SW_HIDE; SetDlgItemText hDlg 5 "Show"
,else ShowWindow hEdit SW_SHOW; SetDlgItemText hDlg 5 "Hide"
,
,;;or
,;if(hid(hEdit)) hid- hEdit; SetDlgItemText hDlg 5 "Hide"
,;else hid hEdit; SetDlgItemText hDlg 5 "Show"
ret 1
#3
THANK YOU!!


Forum Jump:


Users browsing this thread: 1 Guest(s)