Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Puting a speed and a option to write a number in a part code
#1
Hey i'm wondering how I would put a speed in a dialog and make it work for the macro say I want the macro to run at the speed 0.001 or 0.002 how would I make a dialog for that.

And I would also like to know how to put a thing on a dialog where you can put a "Number" in a box and link it to a code so it can "use that number in the code" instead of it being the same thing all the time so people can change it
#2
That seems like some pretty high tech stuff there!
#3
try using the "listbox" in the dialog.
An old blog on QM coding and automation.

The Macro Hook
#4
Ken I used a list box I got the speed down but how do I get the other thing I was talking about the other thing.????
#5
are you able to retrieve the value from the listbox?
An old blog on QM coding and automation.

The Macro Hook
#6
yes i'm ken here is my dialog

\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str cb3
cb3="0.001[]0.002[]0.003[]0.004[]0.005[]0.006[]0.007[]0.008[]0.009"
if(!ShowDialog("Dialog17" &Dialog17 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 220 132 "SURF"
;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 "Speed"
;6 Static 0x54000000 0x0 2 8 28 12 "Speed"
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""

ret
;messages
double+ g_speed
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam) ;;not necessary in QM >= 2.1.9
,
,if(!g_speed) g_speed=0.1
,;select item that match current speed
,_i=g_speed*1000
,sel _i
,,case 10 _i=0.001
,,case 100 _i=0.002
,,case 1000 _i=0.003
,,case 10000 _i=0.004
,,case 100000 _i=0.005
,,case 1000000 _i=0.006
,,case else ret 1
,CB_SelectItem(id(3 hDlg) _i)
,
,ret 1 ;;not necessary in QM >= 2.1.9
,case WM_DESTROY DT_DeleteData(hDlg) ;;not necessary in QM >= 2.1.9
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case CBN_SELENDOK<<16|3
,;set speed
,_i=CB_SelectedItem(lParam)
,sel _i
,,case 0 g_speed=0.001
,,case 1 g_speed=0.002
,,case 2 g_speed=0.003
,,case 3 g_speed=0.003
,,case 4 g_speed=0.005
,,case 5 g_speed=0.006

,case IDOK
,DT_Ok hDlg ;;not necessary in QM >= 2.1.9
,case IDCANCEL DT_Cancel hDlg ;;not necessary in QM >= 2.1.9
ret 1
#7
I was lookin into it i seen thats what G posted to another member but I don't understand how it makes it work because the dialog always closes wouldent it have to be open all the time for anything in the dialog to work?
#8
could someone please explain how to get the combobox to work in a dialog? i got it in there but i can't get the values to insert into there.


Forum Jump:


Users browsing this thread: 1 Guest(s)