Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cash Count Out
#11
This is another way.

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

;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 12 8 96 14 ""
;4 Button 0x54032000 0x0 118 8 48 14 "cash count"
;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 4 ;;cash count button clicked
,
,str result
,if(!Cash_Count(0 0 0 &result)) ret
,result.setwintext(id(3 hDlg))

,case IDOK
,case IDCANCEL
ret 1

function Cash_Count
Code:
Copy      Help
/Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 135 135 "Cash Count"
;1101 Edit 0x54030080 0x200 40 6 16 14 ""
;1102 Edit 0x54030080 0x200 40 22 16 14 ""
;1103 Edit 0x54030080 0x200 40 38 16 14 ""
;1104 Edit 0x54030080 0x200 40 54 16 14 ""
;1105 Edit 0x54030080 0x200 40 70 16 14 ""
;1106 Edit 0x54030080 0x200 40 86 16 14 ""
;1107 Edit 0x54030080 0x200 40 102 16 14 ""
;1108 Edit 0x54030080 0x200 94 6 16 14 ""
;1109 Edit 0x54030080 0x200 94 22 16 14 ""
;1110 Edit 0x54030080 0x200 94 38 16 14 ""
;1111 Edit 0x54030080 0x200 94 54 16 14 ""
;1112 Edit 0x54030080 0x200 94 70 16 14 ""
;1113 Edit 0x54030080 0x200 94 86 16 14 ""
;1119 Edit 0x54030080 0x200 94 102 38 14 ""
;1 Button 0x54030001 0x4 22 120 48 14 "OK"
;2 Button 0x54030000 0x0 76 120 48 14 "Cancel"
;20 Static 0x54000000 0x0 12 8 48 12 "$100"
;21 Static 0x54000000 0x0 12 24 48 12 "$50"
;22 Static 0x54000000 0x0 12 40 48 12 "$20"
;23 Static 0x54000000 0x0 12 56 48 12 "$10"
;24 Static 0x54000000 0x0 12 72 48 12 "$5"
;25 Static 0x54000000 0x0 12 88 48 12 "$2"
;26 Static 0x54000000 0x0 12 104 48 12 "$1"
;27 Static 0x54000000 0x0 66 8 48 12 "$1"
;28 Static 0x54000000 0x0 66 24 48 12 "$0.50"
;29 Static 0x54000000 0x0 66 40 48 12 "$0.25"
;30 Static 0x54000000 0x0 66 56 48 12 "$0.10"
;31 Static 0x54000000 0x0 66 72 48 12 "$0.05"
;32 Static 0x54000000 0x0 66 88 48 12 "$0.01"
;33 Static 0x54000000 0x0 66 104 48 12 "TOTAL"
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "*" "1" ""

str controls = "1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119"
str e1101 e1102 e1103 e1104 e1105 e1106 e1107 e1108 e1109 e1110 e1111 e1112 e1113 e1119
e1101="0"
e1102="0"
e1103="0"
e1104="0"
e1105="0"
e1106="0"
e1107="0"
e1108="0"
e1109="0"
e1110="0"
e1111="0"
e1112="0"
e1113="0"

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

str& result=+lParam
result=e1119

ret 1

;messages
sel message
,case WM_INITDIALOG
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_CHANGE<<16|1101
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1102
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1103
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1104
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1105
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1106
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1107
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1108
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1109
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1110
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1111
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1112
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case EN_CHANGE<<16|1113
,Cash_Math hDlg 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1119
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3

ret 1


When you explicitly call a dialog function, like in the example, the first argument must be 0, other arguments can be 0 or used to pass some values or variable addresses. When you pass an address, the function can cast it to a variable reference (eg str& s=+lParam) and store some value into the variable.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)