Posts: 1,058
Threads: 367
Joined: Oct 2007
I wonder whether - and if yes how - it is possible to start the folllowing dialog, with the mouse on combobox pushbutton. Thanks for any advice.
Function Dialog52
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;5 ComboBox 0x54230242 0x0 11 54 96 212 ""
;4 Edit 0x54030080 0x200 10 33 96 12 ""
;3 Button 0x54032000 0x0 10 9 48 14 "Button"
;1 Button 0x54030000 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "4 5"
str e4 cb5
cb5="1[]2[]a[]c"
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 IDOK
,case IDCANCEL
ret 1
Posts: 1,338
Threads: 61
Joined: Jul 2006
07-09-2018, 06:27 AM
(This post was last modified: 07-09-2018, 06:30 AM by Kevin.)
,case WM_INITDIALOG
,mou 136 9 id(5 hDlg) 1 ;;combo box, push button 'Open'
Posts: 1,058
Threads: 367
Joined: Oct 2007
07-09-2018, 07:32 AM
(This post was last modified: 07-09-2018, 07:34 AM by ssimop.)
Thank you, however, it does not work. Please advise.
Posts: 1,338
Threads: 61
Joined: Jul 2006
working for me moves mouse to down arrow on combobox
maybe need to adjust coordinates.
Posts: 1,058
Threads: 367
Joined: Oct 2007
07-09-2018, 07:48 AM
(This post was last modified: 07-09-2018, 07:49 AM by ssimop.)
I have already adjusted coordinates, but it does not work. Nevertheless, it works if I click on button3, ie.
case 3
mou 150 9 id(5 hDlg) 1 ;;combo box, push button 'Open'
Posts: 1,338
Threads: 61
Joined: Jul 2006
07-09-2018, 07:50 AM
(This post was last modified: 07-09-2018, 07:56 AM by Kevin.)
are you just wanting to move the mouse to the combo or open the dropdown list in the combo?
try this
using WM_TIMER adjust timer length if needs more time
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 100 0
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,mou 136 9 id(5 hDlg) 1 ;;combo box, push button 'Open'
Posts: 1,058
Threads: 367
Joined: Oct 2007
07-09-2018, 07:57 AM
(This post was last modified: 07-09-2018, 08:03 AM by ssimop.)
I want just to move it there. The following work-around works. It seem that it needs a short delay :
Function Dialog52
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;5 ComboBox 0x54230242 0x0 11 54 96 212 ""
;4 Edit 0x54030080 0x200 10 33 96 12 ""
;3 Button 0x54032000 0x0 10 9 48 14 "Button"
;1 Button 0x54030000 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "5 4"
str cb5 e4
cb5="1[]2[]a[]c"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,mac "sub.mm" "" hDlg
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,
,case IDOK
,case IDCANCEL
ret 1
#sub mm
function int'hDlg
0.1
mou 150 9 id(5 hDlg) 1 ;;combo box, push button 'Open'
Thank you for your last advice (WM_TIMER ). It works perfectly. Best Regards.
Posts: 1,338
Threads: 61
Joined: Jul 2006
yes that or my previous example using SetTimer
|