Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog with RichEdit
#5
Create function test_Sum:
Code:
Copy      Help
;/
function hDlg idlist idsum

str s ss.getwintext(id(idlist hDlg))
int sum
foreach(s ss) sum+val(s)
s=sum; s.setwintext(id(idsum hDlg))


In dialog editor, click winnings edit box, click Events, select EN_CHANGE, OK. It inserts some code. Below insert code that calls test_Sum. Also insert the same code below WM_INITDIALOG.

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

str controls = "3 1005 1006 1007 1012 1013 1014 1015 1018 1103 1104 1107 1109 1111 1112 1119 1120 1121"
str lb3 e1005 e1006 e1007 e1012 e1013 e1014 e1015 sb1018 e1103 e1104 e1107 e1109 e1111 e1112 e1119 e1120 e1121
lb3="&BPKBETS[]WEEKLY"
sb1018="C:\Documents and Settings\Owner\My Documents\My QM\tab_header.bmp"
rget e1104 "e1104" "\test"
if(!ShowDialog("test" &test &controls)) ret
rset e1104 "e1104" "\test"


;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 301 157 "Form"
;1 Button 0x54030001 0x4 106 136 48 13 "OK"
;3 ListBox 0x54230101 0x204 4 116 40 29 ""
;1201 Static 0x44020000 0x4 106 4 48 13 "Page2"
;2 Button 0x54030000 0x4 204 136 48 13 "Cancel"
;1002 Static 0x54000000 0x0 2 36 54 10 "Brent's Winning's"
;1003 Static 0x54000000 0x0 2 62 54 10 "Paul's Winning's"
;1004 Static 0x54000000 0x0 2 88 54 10 "Kirky's Winning's"
;1005 Edit 0x54030080 0x200 2 46 54 12 ""
;1006 Edit 0x54030080 0x200 2 72 54 13 ""
;1007 Edit 0x54030080 0x200 2 98 54 12 ""
;1008 Static 0x54000000 0x0 70 36 50 10 "Spent"
;1009 Static 0x54000000 0x0 70 62 50 10 "Banked"
;1010 Static 0x54000000 0x0 126 36 50 10 "Winning's"
;1011 Static 0x54000000 0x0 126 62 50 10 "Total in Bank"
;1012 Edit 0x54030080 0x200 70 46 50 12 ""
;1013 Edit 0x54030080 0x200 70 72 50 13 ""
;1014 Edit 0x54030080 0x200 126 46 50 12 ""
;1015 Edit 0x54030080 0x200 126 72 50 13 ""
;1018 Static 0x5400100E 0x20000 0 0 284 30 ""
;1102 Static 0x54000000 0x0 14 14 32 10 "Brents"
;1103 Edit 0x54230844 0x20000 6 24 52 90 "5 January[]27 January[]16 February[]9 March[]30 March[]20 April[]5 May[]25 May[][][]"
;1104 Edit 0x54231144 0x200 58 24 40 90 "[]"
;1105 Static 0x54000000 0x0 62 14 34 10 "Winnings"
;1107 Edit 0x54230844 0x20000 108 24 50 90 "12 January[]2 February[]23 February[]16 March[]7 April[]27 April[]19 May[]8 June"
;1108 Static 0x54000000 0x0 114 14 32 10 "Paul's"
;1109 Edit 0x54231044 0x200 158 24 40 90 ""
;1111 Edit 0x54230844 0x20000 208 24 50 90 "19 January[]9 February[]2 March[]23 March[]14 April[]12 May[]1 June[]22 June"
;1112 Edit 0x54231044 0x200 258 24 38 90 ""
;1113 Static 0x54000000 0x0 214 14 32 10 "Kirky's"
;1114 Static 0x54000000 0x0 162 14 34 10 "Winning's"
;1115 Static 0x54000000 0x0 262 14 32 10 "Winning's"
;1116 Static 0x54000000 0x0 62 114 24 8 "Total"
;1117 Static 0x54000000 0x0 162 114 24 8 "Total"
;1118 Static 0x54000000 0x0 262 114 22 8 "Total"
;1119 Edit 0x54030080 0x200 60 122 38 12 ""
;1120 Edit 0x54030080 0x200 160 122 38 12 ""
;1121 Edit 0x54030080 0x200 258 122 38 12 ""
;1110 Static 0x54000011 0x20000 202 6 1 103 ""
;1106 Static 0x54000011 0x20000 102 6 1 103 ""
;1101 Button 0x54020007 0x0 2 0 298 152 "Weekly Results"
;1017 Static 0x54000010 0x20000 0 114 232 1 ""
;1016 Static 0x54000011 0x20000 60 34 1 75 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "*" "1 "


ret
;messages
sel message
,case WM_INITDIALOG
,test_Sum hDlg 1104 1119
,goto selectpage
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_CHANGE<<16|1104
,test_Sum hDlg 1104 1119
,,
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3
,;selectpage
,_i=LB_SelectedItem(id(3 hDlg))
,DT_Page hDlg _i
ret 1

Insert similar code (rget, rset, case EN_CHANGE and test_Sum lines) for other two persons.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)