Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check Pushlike
#1
hello, i need help with a dialog...

i cannot understand how the check pushlike button starts a macro, then wen it is pressed again, it comes up and stops the macro...i know its possible cannot get it to work tho Sad

plz help

thnxx
#2

If you supply your Dialog then I can show you more easily.
Taking on Quick Macros one day at a time
#3

Something like this?


Attached Files
.qml   QM Expert.qml (Size: 1.03 KB / Downloads: 593)
Taking on Quick Macros one day at a time
#4
Example
Function dialog_check_start_stop_macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str c3Sta
if(!ShowDialog("dialog_check_start_stop_macro" &dialog_check_start_stop_macro &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC4 0x108 0 0 59 24 "Dialog"
;3 Button 0x54013003 0x0 6 6 48 14 "Start"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,if(but(lParam)) ;;checked
,,mac "Macro508"
,,_s="Stop"
,else ;;unchecked
,,shutdown -6 0 "Macro508"
,,_s="Start"
,_s.setwintext(lParam)
,case IDOK
,case IDCANCEL
ret 1
#5
thanks gint that was perfect
#6
I've tried the code above and the macro only ran once. I tried a function and did the same thing. There is no ret or end code in either of them.

Isn't pushing the button stops and/or start running macro or function?

I have tried radio boxes and check boxes and the same result.

Any ideas why?
#7
This code can be used only to start/stop single macro or function. For multiple functions, you need two simple buttons - Start and Stop.
#8
Hi Gintaras:

I tried with:

1. example above
2. checkbox and Cancel button
3. 2 push buttons with Start and Stop
4. radiobox and Cancel button

They all ran the function once. The dialog box remained open, which is what I need. I just can't get the function to run more than once.

Thanks
#9
What do you mean by run more then once?
#10
The file you provided didn't even do what you said it would.

And the one Gintaras showed only ran the function once.

I need the function to continue running until the STOP button is clicked and leave the dialog box open so that the user can click on START button again.

Is this not possible?
#11
this is with 2 simple buttons
Function dialog_start_stop_macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dialog_start_stop_macro" &dialog_start_stop_macro 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC4 0x108 0 0 111 24 "Dialog"
;3 Button 0x54032000 0x0 6 6 48 14 "Start"
;4 Button 0x54032000 0x0 58 6 48 14 "Stop"
;END DIALOG
;DIALOG EDITOR: "" 0x2030006 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "Function75"
,
,case 4
,shutdown -6 0 "Function75"
,
,case IDOK
,case IDCANCEL
ret 1
#12
Press Start, it will start a macro, press stop it will stop it.
you can do it as many times as you want.

Function Function7
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str c3Sta
if(!ShowDialog("Function7" &Function7 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC4 0x108 0 0 59 24 "Dialog"
;3 Button 0x54013003 0x0 6 6 48 14 "Start"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,if(but(lParam)) ;;checked
,,mac "Function57"
,,_s="Stop"
,else ;;unchecked
,,shutdown -6 0 "Function57"
,,_s="Start"
,_s.setwintext(lParam)
,case IDOK
,case IDCANCEL
ret 1
#13
Denise, all the post was about was check pushlike, in order to make a function or macro repeat, you can use a few diffrent methods, click on the help section of your qm or search the site for rep. hope this helps!


Forum Jump:


Users browsing this thread: 1 Guest(s)