Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIALOG AND SPEEDS
#1
I HAVE 4 MACROS I WANT TO ADJUST THE SPEED IN BUT ALL 4 MACROS HAVE TO DIFF SPEEDS IN THEM SO I NEED TO KNOW HOW TO MAKE A DIALOG AND HAVE

MACRO 1 ADJUST SPEED 1 SEC 2SEC 3 SEC
MACRO2 ADJUST SPEED 7MIN 8 MIN 9MIN 10MIN 11 MIN
MACRO 3 ADJUST SPEEDS 0.1 0.2 0,3
MACRO 4 0.9 1.0 1.1
AND SO ON I HAVE BEEN WORKING WITH G_SPEED BUT IF I ADD G SPEED TO THE MACRO WONT IT CONFLICT WITH THE OTHER 3 I NEED TO HAVE 4 DIFF ADJUSTMENTS FOR THE MACROS SO HOW WOULD I GO ABOUT DOING THAT
#2
RIGHT NOW I USE A FUNCTION SO I HAVE TO GO TO THE WAIT FUNCTIONS AND ADJUST THE 4 TIMES THERE I JUST WANT TO MAKE IT WHERE I CAN PUT THE g_speed IN EACH OF THOSE FUNCTIONS AND HAVE IT ADJUST THOSE SPEEDS MY PROBLEM IS IF I ADJUST 1 SPEED IT ADJUST THEM ALL TYVM FOR YOUR HELP 1 LAST THING I REALLY WISH THERE WAS MORE INFO ON THIS DIALOG FOR THE SPEEDS MAYBE I MISSED IT BUT I REALLY HAVE READ ON IT BUUT IM STUCK
#3
i have times and speeds in my dialog as well, but is there a way that when u hit ok that it will save the dialogs settings the way it is instead of making them go to default

ty
#4
to Mr_B

Use rset and rget.
#5
Gintaras Wrote:to Mr_B

Use rset and rget.
ok how do i use this code? can u give me an example dialog plz ty bro
#6
Function Dialog18
Code:
Copy      Help
\Dialog_Editor

str controls = "3 4"
str c3Che e4
rget c3Che "check" "\MyAppName"
rget e4 "edit" "\MyAppName"
if(!ShowDialog("Dialog18" 0 &controls)) ret
rset c3Che "check" "\MyAppName"
rset e4 "edit" "\MyAppName"

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 222 134 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54012003 0x0 10 8 48 12 "Check"
;4 Edit 0x54030080 0x200 8 26 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "" ""
#7
Gintaras Wrote:Function Dialog18
Code:
Copy      Help
\Dialog_Editor

str controls = "3 4"
str c3Che e4
rget c3Che "check" "\MyAppName"
rget e4 "edit" "\MyAppName"
if(!ShowDialog("Dialog18" 0 &controls)) ret
rset c3Che "check" "\MyAppName"
rset e4 "edit" "\MyAppName"

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 222 134 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54012003 0x0 10 8 48 12 "Check"
;4 Edit 0x54030080 0x200 8 26 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "" ""
wow that was really fast bro lol like 5 min, thank you very much your the best 8)
#8
ok im trying this on peeds and im not to sure what im doing wrong heree but it wont save the speed settings for me



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

str controls = "3"
str cb3
rget cb3 "ComboBox" "\test"
cb3="Fast[]Normal[]Slow[]Super Slow"
if(!ShowDialog("c1" &c1 &controls)) ret
rset cb3 "ComboBox" "\test"

BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 220 132 "Settings"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 ComboBox 0x54230243 0x0 34 6 96 213 ""
END DIALOG
DIALOG EDITOR: "" 0x2010900 "" ""

ret
messages
double+ f_speed
sel message
    case WM_INITDIALOG
    DT_Init(hDlg lParam)     
    if(!f_speed) f_speed=0.1
     select item that match current speed
    _i=f_speed*1000
    sel _i
        case 10 _i=0
        case 100 _i=1
        case 1000 _i=2
        case 20000 _i=3
        case else ret 1
    CB_SelectItem(id(3 hDlg) _i)
    
    ret 1
    case WM_DESTROY DT_DeleteData(hDlg)
    case WM_COMMAND goto messages2
ret
messages2
sel wParam
    case CBN_SELENDOK<<16|3
     set speed
    _i=CB_SelectedItem(lParam)
    sel _i
        case 0 f_speed=0.01
        case 1 f_speed=0.1
        case 2 f_speed=1
        case 3 f_speed=20


    case IDOK
    DT_Ok hDlg
    case IDCANCEL DT_Cancel hDlg
ret 1
#9
Gintaras Wrote:to Mr_B

Use rset and rget.
Hey ginatrass, ty this works for my check, but.... how can i get it to work for ComboBox. i tried doing the same thing as check but its much more difficult.
tyvm bro
#10
Function CB_InitDialogVariable
Code:
Copy      Help
;/
function# str&cbVar selItem

;To initialize a combo box, before ShowDialog you assign a list of items to the variable, eg cb3="item0[]item1[]item2".
;To select an item, is used & at the beginning of the line, eg cb3="item0[]&item1[]item2".
;This function inserts & into cbVar so that item selItem would be selected.
;Returns 1 if successful, 0 if selItem is invalid.


;cbVar - combo box variable. Should not have lines that begin with &.
;selItem - 0-based item index.


;EXAMPLE
;str controls = "3"
;str cb3
;cb3="item 0[]item 1[]item 2"
;int i; rget i "cb" "\MyAppName" 0 0; if(i>2) i=2
;CB_InitDialogVariable cb3 i
;if(!ShowDialog("" 0 &controls)) ret
;i=val(cb3); rset i "cb" "\MyAppName" 0 0



ARRAY(str) a=cbVar
a[selItem]-"&"; err ret
cbVar=a
ret 1
#11
Gintaras Wrote:Function CB_InitDialogVariable
Code:
Copy      Help
;/
function# str&cbVar selItem

;To initialize a combo box, before ShowDialog you assign a list of items to the variable, eg cb3="item0[]item1[]item2".
;To select an item, is used & at the beginning of the line, eg cb3="item0[]&item1[]item2".
;This function inserts & into cbVar so that item selItem would be selected.
;Returns 1 if successful, 0 if selItem is invalid.


;cbVar - combo box variable. Should not have lines that begin with &.
;selItem - 0-based item index.


;EXAMPLE
;str controls = "3"
;str cb3
;cb3="item 0[]item 1[]item 2"
;int i; rget i "cb" "\MyAppName" 0 0; if(i>2) i=2
;CB_InitDialogVariable cb3 i
;if(!ShowDialog("" 0 &controls)) ret
;i=val(cb3); rset i "cb" "\MyAppName" 0 0



ARRAY(str) a=cbVar
a[selItem]-"&"; err ret
cbVar=a
ret 1
tyvm bro u have been most helpful
#12
i dont get this bro, what am i doing wrong?
str controls = "8 9 10 19 18 17 22 23 13 14 15"
str cb8dd cb9w cb10SS cb19n cb18sp cb17d o22Spa o23Spa o13Sit o14Sit o15Sit
cb10SS = "0.0001[]0.0002[]0.0003[]0.0004[]0.0005[]0.0006[]0.0007[]0.0008[]0.0009"
int i; rget i "SS" "\MyAppName" 0 0; if(i>2) i=2
if(!ShowDialog("TAAP_DIALOG" &TAAP_DIALOG &controls)) ret
i=val(cb10SS); rset i "SS" "\MyAppName"

i want my combo to save when i do this but it dont save Sad ty for help
#13
CB_InitDialogVariable is missing in the code.
#14
Gintaras Wrote:CB_InitDialogVariable is missing in the code.
i know. but when i put that into there it said Error : Unknown identifyer..... so do i gota change it? or somthing like that. or just leave it as CB_InitDialogVariable ,,, or CB_cb10SS
#15
this is the exact error im geting

Error in ACV3_DIALOG: unknown identifier.
#16
did you name the function "CB_InitDialogVariable"?
An old blog on QM coding and automation.

The Macro Hook
#17
ken gray Wrote:did you name the function "CB_InitDialogVariable"?
no... lol ill try that
#18
im trying to get this to work and it just shuts down QM on me... this is what i have:

Function: CB_InitDialogVariable -


function# str&cbVar selItem
str controls = "7"
str cb7
cb7="&0.001[]0.002[]0.003[]0.004[]0.005[]0.006[]0.007[]0.008[]0.009"
int i; rget i "cb" "\MyAppName" 0 0; if(i>2) i=2
CB_InitDialogVariable cb7 i
if(!ShowDialog("" 0 &controls)) ret
i=val(cb7); rset i "cb" "\MyAppName" 0 0
GdiObject- brush=CreateSolidBrush(ColorFromRGB(50 75 125))
if(!ShowDialog("TEST" &TEST &controls 0 0 0 0 0 794 528 0)) ret
ARRAY(str) a=cbVar
a[selItem]-"&"; err ret
cbVar=a
ret 1


why wouldnt htis work?
#19
Don't place your code in CB_InitDialogVariable. Instead, place CB_InitDialogVariable in your code.
#20
wait im confused so what do i put in my dialog function and what do i put in the
CB_InitDialogVariable function?i have a dialog and then i have a seperate function that shows the dialog as well...

Function 1: shows dialog.


Dialog1: has all the dialog info in it.


CB_InitDialogVariable: ??


where would i reorganize it for it to work?
#21
Don't put into CB_InitDialogVariable function more code than it is in my post. I don't know what to put into your dialog function.
#22
ok i got it to work... but i dont know if this is doing what i thought it did... when i run it the dialog opens up and lets me choose the information from the scroll down list then it moves it and changes the color an what not to how i wanted it after i hit the OK button, but then in the scroll list there is only the one item i chose from the scroll list that came up the first time and the rest of the info in the scroll list is gone? is this what it's suppose to do?
#23
I don't see your code.
#24
ok maybe it would be easier for me to maybe say what i wanted and you could tell me if this would do it?...i just wanted my regular dialog window to come up and then what ever settings i chose i just wanted it to remember them and next time i use the dialog to remember the last settings i had.
#25
Example.

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

str controls = "3"
str cb3

cb3="one[]two[]three"
int i
rget i "cb3" "\MySettings"
CB_InitDialogVariable cb3 i

if(!ShowDialog("Dialog32" &Dialog32 &controls)) ret

rset val(cb3) "cb3" "\MySettings"

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 8 8 96 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020006 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#26
yesss that works thank you very much
#27
Gintaras Wrote:Example.

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

str controls = "3"
str cb3

cb3="one[]two[]three"
int i
rget i "cb3" "\MySettings"
CB_InitDialogVariable cb3 i

if(!ShowDialog("Dialog32" &Dialog32 &controls)) ret

rset val(cb3) "cb3" "\MySettings"

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 8 8 96 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020006 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Is there a way to make it so that this code can save text in an edit box as well?
#28
Function Dialog66
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str e3
rget e3 "e3" "\Ghost\test"
if(!ShowDialog("Dialog66" &Dialog66 &controls)) ret
rset e3 "e3" "\Ghost\test"

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Edit 0x54030080 0x200 14 14 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#29
I'm using the above codes. My problem is when i shutoff Qm and reopen it i have to go set the speed again I thought it was going to save the speed but it doesn't. I wanted to know if i was doing it wrong. My friend and i found a way of doing it but it seems like there would be a better way if you could give me a hint or show me a better way that would be great.
#30
ok this works for me.

Dialog2
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str cb3 = "0.25[]0.50[]0.75[]1[]1.5[]2.0[]2.5.0[]3.0[]3.5"
int i
rget i "cb" "\test"
CB_InitDialogVariable cb3 i
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret
i=val(cb3)
rset i "cb" "\test"
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 142 56 "Save test"
;1 Button 0x54030001 0x4 6 38 48 14 "OK"
;2 Button 0x54030000 0x4 60 38 48 14 "Cancel"
;3 ComboBox 0x54230243 0x0 8 16 66 213 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "" "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|3
,_i=CB_SelectedItem(lParam)
,double g_speed
,sel _i
,,case 0
,,g_speed =0.25
,,case 1
,,g_speed =0.50
,,case 2
,,g_speed =0.75
,,case 3
,,g_speed =1
,,case 4
,,g_speed =1.5
,,case 5
,,g_speed =2
,,case 6
,,g_speed =2.5
,,case 7
,,g_speed =3
,,case 8
,,g_speed =3.5
,str s = g_speed
,double t=val(s 2)
,rset s "waittime" "\test"
,case IDOK
,case IDCANCEL
ret 1


Mywait

Code:
Copy      Help
function wParam

str a
rget a "waittime" "\test"
double t=val(a 2)
wait t


Function?
Code:
Copy      Help
int count
for count 1 10
,out count
,Mywait(wait)


Forum Jump:


Users browsing this thread: 1 Guest(s)