Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog with RichEdit
#1
Hello i have a dialog with a richedit, but i don't know how to make it so when i type something it will save it in the dialog so next time i open dialog what i have writen will be there could someone please point me in the right direction or show me how to do this..
Thanks
#2
Hi i still need help Sad i been reading up on the rget and rset and i just don't know how to use it with my dialog don't know where to put it or know what to put here is my code can someone show me what to do so it saves what i type in all the editables when i close dialog so it will be there next time i open dialog..
Hope someone can help Smile Thanks

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"
str lb3 e1005 e1006 e1007 e1012 e1013 e1014 e1015 sb1018 e1103 e1104 e1107 e1109 e1111 e1112
lb3="&BPKBETS[]WEEKLY"
sb1018="C:\Documents and Settings\Owner\My Documents\My QM\tab2.bmp"
if(!ShowDialog("TAB1" &TAB1 &controls)) ret


;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 319 152 "Form"
;3 ListBox 0x54230101 0x204 8 116 40 29 ""
;1201 Static 0x44020000 0x4 106 4 48 13 "Page2"
;2 Button 0x54030000 0x4 52 134 48 10 "Cancel"
;1002 Static 0x54000000 0x0 8 12 60 10 "Brent's Winning's"
;1003 Static 0x54000000 0x0 8 40 60 10 "Paul's Winning's"
;1004 Static 0x54000000 0x0 8 68 60 10 "Kirky's Winning's"
;1005 Edit 0x54030080 0x200 8 22 54 12 ""
;1006 Edit 0x54030080 0x200 8 50 54 13 ""
;1007 Edit 0x54030080 0x200 8 78 54 12 ""
;1008 Static 0x54000000 0x0 86 12 50 10 "Spent"
;1009 Static 0x54000000 0x0 86 40 50 10 "Banked"
;1010 Static 0x54000000 0x0 146 12 50 10 "Winning's"
;1011 Static 0x54000000 0x0 146 40 50 10 "Total"
;1012 Edit 0x54030080 0x200 86 22 50 12 ""
;1013 Edit 0x54030080 0x200 86 50 50 13 ""
;1014 Edit 0x54030080 0x200 146 22 50 12 ""
;1015 Edit 0x54030080 0x200 146 50 50 13 ""
;1018 Static 0x5400100E 0x20000 208 12 98 45 ""
;1102 Static 0x54000000 0x0 16 14 32 10 "Brents"
;1103 Edit 0x54030844 0x20000 8 24 42 90 "5 January[]27 January[]16 February[]9 March[]30 March[]20 April[]5 May[]25 May[][]"
;1104 Edit 0x54231044 0x200 50 24 54 90 "[]"
;1105 Static 0x54000000 0x0 58 14 34 12 "Winnings"
;1107 Edit 0x54030844 0x20000 112 24 42 90 "12 January[]2 February[]23 February[]16 March[]7 April[]27 April[]19 May[]8 June"
;1108 Static 0x54000000 0x0 120 14 32 10 "Paul's"
;1109 Edit 0x54231044 0x200 154 24 54 90 ""
;1111 Edit 0x54030844 0x20000 216 24 42 90 "19 January[]9 February[]2 March[]23 March[]14 April[]12 May[]1 June[]22 June"
;1112 Edit 0x54231044 0x200 258 24 54 90 ""
;1113 Static 0x54000000 0x0 224 14 32 10 "Kirky's"
;1114 Static 0x54000000 0x0 162 14 34 10 "Winning's"
;1115 Static 0x54000000 0x0 266 14 32 10 "Winning's"
;1110 Static 0x54000011 0x20000 212 6 1 107 ""
;1106 Static 0x54000011 0x20000 108 6 1 108 ""
;1101 Button 0x54020007 0x0 4 0 314 148 "Weekly Results"
;1017 Static 0x54000010 0x20000 8 96 291 1 ""
;1016 Static 0x54000011 0x20000 76 6 1 85 ""
;1001 Button 0x54020007 0x0 4 0 310 148 "BPKBETS"
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "*" "1 "


ret
;messages
sel message
,case WM_INITDIALOG
,goto selectpage
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3
,;selectpage
,_i=LB_SelectedItem(id(3 hDlg))
,DT_Page hDlg _i
ret 1
#3
Use rget (for each variable that must be saved) before ShowDialog, and rset after ShowDialog. Also, your dialog does not have OK button, and therefore dialog variables are not populated.
#4
hello can someone help me or show me how i would go about adding dollar amounts up that are entered in to my dialog..in my dialog i have a page with weekly results and i want it to add all entries in each persons winning column and put the amount in the total..
Thanks...

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"
if(!ShowDialog("test" &test &controls)) ret


;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
,goto selectpage
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case LBN_SELCHANGE<<16|3
,;selectpage
,_i=LB_SelectedItem(id(3 hDlg))
,DT_Page hDlg _i
ret 1
#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.
#6
Thanks for the help Gintaras but is there a way so when i type it in like this $99.99 or what ever amount, At the moment it don't work when i put $ and . in....
thanks
hope i'm not bothering u to much :oops:
#7
Change

val(s)

to

val(s.trim(" $"))
#8
Hi again Gintaras hope you aren't busy and i thank u for the help..but i'm not getting it..i want it so when i type a dollar amount in the winning box i want to type it like $13.45 or what ever it to be with the dollar sign and the decimal and put it in the total with the $ and decimal. At the moment it lets me type in like $13.45 but in the total box it puts just 13 not the 45 only way it puts in 13.45 is if i don;t use the deciaml but then it looks like 1345..
Thanks for all your help Smile
#9
Code:
Copy      Help
;/
function hDlg idlist idsum

str s ss.getwintext(id(idlist hDlg))
double sum
foreach(s ss) sum+val(s.trim(" $") 2)
s=sum; s.setwintext(id(idsum hDlg))
#10
Gintaras thats perfect thanks for taking the time to help and being so fast..have a goodday(night)..bye Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)