Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialogue displaying calculations
#1
I'm trying to get a dialogue that will do conversions with mm, inches, meter, feet, and yards (and maybe more).

id like to put the value in one of the top row boxes, then hit the tab key and the code would clear the value put in the one top box and then execute the code for each of the bottom boxes filling in the value.

is there anyway to do this?

i cant seem to make the 2nd row update at all. i have the calculations necessary but just don't know how to show the values.


Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3 4 5 6 7 13 14 15"
str e3 e4 e5 e6 e7 e13 e14 e15
if(!ShowDialog("Conversion" &Conversion &controls)) ret

;This function allows to execute code whenever some event
;(dialog created, button clicked, etc) occurs in dialog.
;The code must follow appropriate case statements.
;To add case statements for various messages (events), you
;can use the Events button in the Dialog Editor. Read more in Help.


;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "Form"
;3 Edit 0x54030080 0x204 2 12 42 14 ""
;7 Edit 0x54030080 0x200 2 32 42 14 ""
;4 Edit 0x54030080 0x204 56 12 42 14 ""
;13 Edit 0x54030080 0x200 56 32 42 14 ""
;5 Edit 0x54030080 0x204 110 12 42 14 ""
;14 Edit 0x54030080 0x200 110 32 42 14 ""
;6 Edit 0x54030080 0x204 164 12 42 14 ""
;15 Edit 0x54030080 0x200 164 32 42 14 ""
;11 Button 0x54032001 0x4 62 116 48 14 "Calc"
;1 Button 0x54030000 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;8 Static 0x54000000 0x4 0 0 48 12 "      cm"
;9 Static 0x54000000 0x4 52 0 48 12 "       in"
;10 Static 0x54000000 0x4 106 0 48 12 "       ft"
;12 Static 0x54000000 0x4 162 0 48 12 "      yard"
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "" ""


ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 11
,,bee "C:\downloads\sounds\system\voybadge.wav"
,,;e7=e3
,,out e3
,,;val(e3)*7
,
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
#2
Code:
Copy      Help
,case 11
,str s.getwintext(id(3 hDlg))
,double d=val(s 2)
,d*2.5
,s=d
,s.setwintext(id(4 hDlg))
,;an so on


Forum Jump:


Users browsing this thread: 1 Guest(s)