Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Filling in Button/Edit Text in Dialogs from ini vs macro
#1
Hi Gintaras,

(related to my recent questions on Multi-Tab dialogs)

I am writing a phrase picker/paster dialog. Rather than pull down lists, all the options will be layed out on a bunch of buttons on the dialog with a display box for the full text referenced by each button. I have gotten it so that the user can change either the default button text AND/OR change the full pasted text in the display box (either on a one time basis or "permanently").

I have pasted a shorted version below (full version will have 20 choices per 12-13 tabs).

I fill and rewrite the buttons off of an ini file using rget/rset/setwintext but I fill the text boxes off of simple macros that just contain the text using getmacro/setmacro/setwintext. I would rather do both from an ini file but since the text for the edit box may be multi-line, it screws up my ini file. Is there a way I can keep multi-line text organized in a file outside of QM like an ini file. That way, I could run this as an executable that could still update buton and edit field text by the user i.e. (I think an executable could read and write to an ini file but not to individual macros).

A couple additional dialog case questions: If there are multiple items that have the same action, is there a syntax for:
case 1012 or 1013
I tried "case 1012 1013" and case 1012 or 1013" but both caused problems. The first actually crashes QM.

Also If many items have the same tooltip is there a shorter way of having them share it. You see in my example below, I type it over and over.
I also saw in the forum it was possible to have multi line tooltips but my paragraph signs ("[]) end up showing as boxes rather than line breaks. Is there a different syntax (I am using Windows XP).

Thanks!!!!! (I know this is a lot of questions!!!

Stuart

The Dialog function below refers to an ini file with structure like this:

Quote:[SampleMacros]
EDEC1=Panel A Button 1
EDEC2=Panel A Button 2
EDEC21=Panel B Button 1

and a long series of functions (perhaps should be macros?) in a macro bank (EDEDC1, EDEDC2, etc) simply containing text

eg.

Function EDEC22
Code:
Copy      Help
Sample Multiline Text
This is the second line of sample text

Function MultiTabPhraseFillerMacro
Trigger Wc /WINWORD     Help - how to add the trigger to the macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

class CToolTip m_htt ;;delete this if already declared in init2

str controls = "4 6 7 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320"

str e4 c6Upd c7Upd b1001 b1002 b1003 b1004 b1005 b1006 b1007 b1008 b1009 b1010 b1011 b1012 b1013 b1014 b1015 b1016 b1017 b1018 b1019 b1020 b1101 b1102 b1103 b1104 b1105 b1106 b1107 b1108 b1109 b1110 b1111 b1112 b1113 b1114 b1115 b1116 b1117 b1118 b1119 b1120 b1201 b1202 b1203 b1204 b1205 b1206 b1207 b1208 b1209 b1210 b1211 b1212 b1213 b1214 b1215 b1216 b1217 b1218 b1219 b1220 b1301 b1302 b1303 b1304 b1305 b1306 b1307 b1308 b1309 b1310 b1311 b1312 b1313 b1314 b1315 b1316 b1317 b1318 b1319 b1320

str MacroID
str+ MacroText
str+ MacroID
str+ ButtonSelectedText
int+ ButtonSelectedID
;
rget b1001 "EDEC1" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1002 "EDEC2" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1003 "EDEC3" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1004 "EDEC4" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1005 "EDEC5" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1006 "EDEC6" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1007 "EDEC7" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1008 "EDEC10" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1009 "EDEC9" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1010 "EDEC10" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1011 "EDEC11" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1012 "EDEC12" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1013 "EDEC13" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1014 "EDEC14" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1015 "EDEC15" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1016 "EDEC16" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1017 "EDEC17" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1018 "EDEC18" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1019 "EDEC19" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1020 "EDEC20" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name

rget b1101 "EDEC21" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1102 "EDEC22" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1103 "EDEC23" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1104 "EDEC24" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1105 "EDEC25" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1106 "EDEC26" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1107 "EDEC27" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1108 "EDEC28" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1109 "EDEC29" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1110 "EDEC30" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1111 "EDEC31" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1112 "EDEC32" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1113 "EDEC33" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1114 "EDEC34" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1115 "EDEC35" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1116 "EDEC36" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1117 "EDEC37" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1118 "EDEC38" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1119 "EDEC39" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1120 "EDEC40" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name

rget b1201 "EDEC41" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1202 "EDEC42" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1203 "EDEC43" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1204 "EDEC44" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1205 "EDEC45" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1206 "EDEC46" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1207 "EDEC47" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1208 "EDEC48" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1209 "EDEC49" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1210 "EDEC50" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1211 "EDEC51" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1212 "EDEC52" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1213 "EDEC53" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1214 "EDEC54" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1215 "EDEC55" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1216 "EDEC56" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1217 "EDEC57" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1218 "EDEC58" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1219 "EDEC59" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1220 "EDEC60" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name

rget b1301 "EDEC61" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1302 "EDEC62" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1303 "EDEC63" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1304 "EDEC64" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1305 "EDEC65" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1306 "EDEC66" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1307 "EDEC67" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1308 "EDEC68" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1309 "EDEC69" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1310 "EDEC70" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1311 "EDEC71" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1312 "EDEC72" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1313 "EDEC73" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1314 "EDEC74" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1315 "EDEC75" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1316 "EDEC76" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1317 "EDEC77" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1318 "EDEC78" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1319 "EDEC79" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name
rget b1320 "EDEC80" "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro number/name



if(!ShowDialog("MultiTabPhraseFillerMacro" &MultiTabPhraseFillerMacro &controls)) ret
;g2
;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 476 182 "MultiTabPhraseFillerMacro"
;1 Button 0x54030001 0x4 328 136 48 14 "OK"
;2 Button 0x54030000 0x4 386 136 48 14 "Cancel"
;4 Edit 0x54231044 0x200 272 16 202 112 ""
;6 Button 0x54012000 0x0 340 156 78 16 "Update Macro Text?"
;7 Button 0x40002000 0x0 4 182 1 2 ""
;1001 Button 0x54032000 0x0 6 18 117 14 ""
;1002 Button 0x54032000 0x0 6 32 117 14 ""
;1003 Button 0x54032300 0x0 6 46 117 14 ""
;1004 Button 0x54032300 0x0 6 60 117 14 ""
;1005 Button 0x54032000 0x0 6 74 117 14 ""
;1006 Button 0x54032000 0x0 138 18 117 14 ""
;1007 Button 0x54032000 0x0 138 32 117 14 ""
;1008 Button 0x54032000 0x0 138 46 117 14 ""
;1009 Button 0x54032000 0x0 138 60 117 14 ""
;1010 Button 0x54032000 0x0 138 74 117 14 ""
;1011 Button 0x54032000 0x0 6 100 117 14 ""
;1012 Button 0x54032000 0x0 6 114 117 14 ""
;1013 Button 0x54032000 0x0 6 128 117 14 ""
;1014 Button 0x54032000 0x0 6 142 117 14 ""
;1015 Button 0x54032000 0x0 6 156 117 14 ""
;1016 Button 0x54032000 0x0 138 100 117 14 ""
;1017 Button 0x54032000 0x0 138 114 117 14 ""
;1018 Button 0x54032000 0x0 138 128 117 14 ""
;1019 Button 0x54032000 0x0 138 142 117 14 ""
;1020 Button 0x54032000 0x0 138 156 117 14 ""
;1021 Button 0x54032000 0x0 123 18 10 14 ".."
;1022 Button 0x54032000 0x0 123 32 10 14 ".."
;1023 Button 0x54032000 0x0 123 46 10 14 ".."
;1024 Button 0x54032000 0x0 123 60 10 14 ".."
;1025 Button 0x54032000 0x0 123 74 10 14 ".."
;1026 Button 0x54032000 0x0 255 18 10 14 ".."
;1027 Button 0x54032000 0x0 255 32 10 14 ".."
;1028 Button 0x54032000 0x0 255 46 10 14 ".."
;1029 Button 0x54032000 0x0 255 60 10 14 ".."
;1030 Button 0x54032000 0x0 255 74 10 14 ".."
;1031 Button 0x54032000 0x0 123 100 10 14 ".."
;1032 Button 0x54032000 0x0 123 114 10 14 ".."
;1033 Button 0x54032000 0x0 123 128 10 14 ".."
;1034 Button 0x54032000 0x0 123 142 10 14 ".."
;1035 Button 0x54032000 0x0 123 156 10 14 ".."
;1036 Button 0x54032000 0x0 255 100 10 14 ".."
;1037 Button 0x54032000 0x0 255 114 10 14 ".."
;1038 Button 0x54032000 0x0 255 128 10 14 ".."
;1039 Button 0x54032000 0x0 255 142 10 14 ".."
;1040 Button 0x54032000 0x0 255 156 10 14 ".."
;1101 Button 0x54032000 0x0 6 18 117 14 ""
;1102 Button 0x54032000 0x0 6 32 117 14 ""
;1103 Button 0x54032300 0x0 6 46 117 14 ""
;1104 Button 0x54032300 0x0 6 60 117 14 ""
;1105 Button 0x54032000 0x0 6 74 117 14 ""
;1106 Button 0x54032000 0x0 138 18 117 14 ""
;1107 Button 0x54032000 0x0 138 32 117 14 ""
;1108 Button 0x54032000 0x0 138 46 117 14 ""
;1109 Button 0x54032000 0x0 138 60 117 14 ""
;1110 Button 0x54032000 0x0 138 74 117 14 ""
;1111 Button 0x54032000 0x0 6 100 117 14 ""
;1112 Button 0x54032000 0x0 6 114 117 14 ""
;1113 Button 0x54032000 0x0 6 128 117 14 ""
;1114 Button 0x54032000 0x0 6 142 117 14 ""
;1115 Button 0x54032000 0x0 6 156 117 14 ""
;1116 Button 0x54032000 0x0 138 100 117 14 ""
;1117 Button 0x54032000 0x0 138 114 117 14 ""
;1118 Button 0x54032000 0x0 138 128 117 14 ""
;1119 Button 0x54032000 0x0 138 142 117 14 ""
;1120 Button 0x54032000 0x0 138 156 117 14 ""
;1121 Button 0x54032000 0x0 123 18 10 14 ".."
;1122 Button 0x54032000 0x0 123 32 10 14 ".."
;1123 Button 0x54032000 0x0 123 46 10 14 ".."
;1124 Button 0x54032000 0x0 123 60 10 14 ".."
;1125 Button 0x54032000 0x0 123 74 10 14 ".."
;1126 Button 0x54032000 0x0 255 18 10 14 ".."
;1127 Button 0x54032000 0x0 255 32 10 14 ".."
;1128 Button 0x54032000 0x0 255 46 10 14 ".."
;1129 Button 0x54032000 0x0 255 60 10 14 ".."
;1130 Button 0x54032000 0x0 255 74 10 14 ".."
;1131 Button 0x54032000 0x0 123 100 10 14 ".."
;1132 Button 0x54032000 0x0 123 114 10 14 ".."
;1133 Button 0x54032000 0x0 123 128 10 14 ".."
;1134 Button 0x54032000 0x0 123 142 10 14 ".."
;1135 Button 0x54032000 0x0 123 156 10 14 ".."
;1136 Button 0x54032000 0x0 255 100 10 14 ".."
;1137 Button 0x54032000 0x0 255 114 10 14 ".."
;1138 Button 0x54032000 0x0 255 128 10 14 ".."
;1139 Button 0x54032000 0x0 255 142 10 14 ".."
;1140 Button 0x54032000 0x0 255 156 10 14 ".."
;1201 Button 0x54032000 0x0 6 18 117 14 ""
;1202 Button 0x54032000 0x0 6 32 117 14 ""
;1203 Button 0x54032300 0x0 6 46 117 14 ""
;1204 Button 0x54032300 0x0 6 60 117 14 ""
;1205 Button 0x54032000 0x0 6 74 117 14 ""
;1206 Button 0x54032000 0x0 138 18 117 14 ""
;1207 Button 0x54032000 0x0 138 32 117 14 ""
;1208 Button 0x54032000 0x0 138 46 117 14 ""
;1209 Button 0x54032000 0x0 138 60 117 14 ""
;1210 Button 0x54032000 0x0 138 74 117 14 ""
;1211 Button 0x54032000 0x0 6 100 117 14 ""
;1212 Button 0x54032000 0x0 6 114 117 14 ""
;1213 Button 0x54032000 0x0 6 128 117 14 ""
;1214 Button 0x54032000 0x0 6 142 117 14 ""
;1215 Button 0x54032000 0x0 6 156 117 14 ""
;1216 Button 0x54032000 0x0 138 100 117 14 ""
;1217 Button 0x54032000 0x0 138 114 117 14 ""
;1218 Button 0x54032000 0x0 138 128 117 14 ""
;1219 Button 0x54032000 0x0 138 142 117 14 ""
;1220 Button 0x54032000 0x0 138 156 117 14 ""
;1221 Button 0x54032000 0x0 123 18 10 14 ".."
;1222 Button 0x54032000 0x0 123 32 10 14 ".."
;1223 Button 0x54032000 0x0 123 46 10 14 ".."
;1224 Button 0x54032000 0x0 123 60 10 14 ".."
;1225 Button 0x54032000 0x0 123 74 10 14 ".."
;1226 Button 0x54032000 0x0 255 18 10 14 ".."
;1227 Button 0x54032000 0x0 255 32 10 14 ".."
;1228 Button 0x54032000 0x0 255 46 10 14 ".."
;1229 Button 0x54032000 0x0 255 60 10 14 ".."
;1230 Button 0x54032000 0x0 255 74 10 14 ".."
;1231 Button 0x54032000 0x0 123 100 10 14 ".."
;1232 Button 0x54032000 0x0 123 114 10 14 ".."
;1233 Button 0x54032000 0x0 123 128 10 14 ".."
;1234 Button 0x54032000 0x0 123 142 10 14 ".."
;1235 Button 0x54032000 0x0 123 156 10 14 ".."
;1236 Button 0x54032000 0x0 255 100 10 14 ".."
;1237 Button 0x54032000 0x0 255 114 10 14 ".."
;1238 Button 0x54032000 0x0 255 128 10 14 ".."
;1239 Button 0x54032000 0x0 255 142 10 14 ".."
;1240 Button 0x54032000 0x0 255 156 10 14 ".."
;1301 Button 0x54032000 0x0 6 18 117 14 ""
;1302 Button 0x54032000 0x0 6 32 117 14 ""
;1303 Button 0x54032300 0x0 6 46 117 14 ""
;1304 Button 0x54032300 0x0 6 60 117 14 ""
;1305 Button 0x54032000 0x0 6 74 117 14 ""
;1306 Button 0x54032000 0x0 138 18 117 14 ""
;1307 Button 0x54032000 0x0 138 32 117 14 ""
;1308 Button 0x54032000 0x0 138 46 117 14 ""
;1309 Button 0x54032000 0x0 138 60 117 14 ""
;1310 Button 0x54032000 0x0 138 74 117 14 ""
;1311 Button 0x54032000 0x0 6 100 117 14 ""
;1312 Button 0x54032000 0x0 6 114 117 14 ""
;1313 Button 0x54032000 0x0 6 128 117 14 ""
;1314 Button 0x54032000 0x0 6 142 117 14 ""
;1315 Button 0x54032000 0x0 6 156 117 14 ""
;1316 Button 0x54032000 0x0 138 100 117 14 ""
;1317 Button 0x54032000 0x0 138 114 117 14 ""
;1318 Button 0x54032000 0x0 138 128 117 14 ""
;1319 Button 0x54032000 0x0 138 142 117 14 ""
;1320 Button 0x54032000 0x0 138 156 117 14 ""
;1321 Button 0x54032000 0x0 123 18 10 14 ".."
;1322 Button 0x54032000 0x0 123 32 10 14 ".."
;1323 Button 0x54032000 0x0 123 46 10 14 ".."
;1324 Button 0x54032000 0x0 123 60 10 14 ".."
;1325 Button 0x54032000 0x0 123 74 10 14 ".."
;1326 Button 0x54032000 0x0 255 18 10 14 ".."
;1327 Button 0x54032000 0x0 255 32 10 14 ".."
;1328 Button 0x54032000 0x0 255 46 10 14 ".."
;1329 Button 0x54032000 0x0 255 60 10 14 ".."
;1330 Button 0x54032000 0x0 255 74 10 14 ".."
;1331 Button 0x54032000 0x0 123 100 10 14 ".."
;1332 Button 0x54032000 0x0 123 114 10 14 ".."
;1333 Button 0x54032000 0x0 123 128 10 14 ".."
;1334 Button 0x54032000 0x0 123 142 10 14 ".."
;1335 Button 0x54032000 0x0 123 156 10 14 ".."
;1336 Button 0x54032000 0x0 255 100 10 14 ".."
;1337 Button 0x54032000 0x0 255 114 10 14 ".."
;1338 Button 0x54032000 0x0 255 128 10 14 ".."
;1339 Button 0x54032000 0x0 255 142 10 14 ".."
;1340 Button 0x54032000 0x0 255 156 10 14 ".."
;5 Static 0x54000010 0x20004 6 430 390 1 ""
;3 SysTabControl32 0x54000040 0x0 2 0 492 182 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030000 "" "0" ""

type TCITEM mask dwState dwStateMask $pszText cchTextMax iImage lParam

e4.setclip
act win("Microsoft Word" "OpusApp")
'Ai;;menu for inserting comments into Word Doc
'm;;brings up a new comment dialog in Word
0.5
outp e4
ret
;messages
CToolTip-- tt ;;CToolTip variables usually can be declared with thread scope (- or --). If thread can have multiple instances of the same dialog, use window scope (SetProp/GetProp). Don't use global and local.
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,tt.Create(hDlg)    
,tt.AddTool(hDlg 4 "Text changes apply only for this comment insertion. To permanently change text, Choose Update Macro Text")
,
,tt.AddTools(hDlg "1021 Click to Change Button Text[]1022 Click to Change Button Text[]1023 Click to Change Button Text[]1024 Click to Change Button Text[]1023 Click to Change Button Text[]1025 Click to Change Button Text[]1026 Click to Change Button Text[]1027 Click to Change Button Text[]1028 Click to Change Button Text[]1029 Click to Change Button Text[]1030 Click to Change Button Text[]1031 Click to Change Button Text[]1032 Click to Change Button Text[]1033 Click to Change Button Text[]1034 Click to Change Button Text[]1035 Click to Change Button Text[]1036 Click to Change Button Text[]1037 Click to Change Button Text[]1038 Click to Change Button Text[]1039 Click to Change Button Text[]1040 Click to Change Button Text")
,
,tt.AddTools(hDlg "1121 Click to Change Button Text[]1122 Click to Change Button Text[]1123 Click to Change Button Text[]1124 Click to Change Button Text[]1123 Click to Change Button Text[]1125 Click to Change Button Text[]1126 Click to Change Button Text[]1127 Click to Change Button Text[]1128 Click to Change Button Text[]1129 Click to Change Button Text[]1130 Click to Change Button Text[]1131 Click to Change Button Text[]1132 Click to Change Button Text[]1133 Click to Change Button Text[]1134 Click to Change Button Text[]1135 Click to Change Button Text[]1136 Click to Change Button Text[]1137 Click to Change Button Text[]1138 Click to Change Button Text[]1139 Click to Change Button Text[]1140 Click to Change Button Text")
,
,tt.AddTools(hDlg "1221 Click to Change Button Text[]1222 Click to Change Button Text[]1223 Click to Change Button Text[]1224 Click to Change Button Text[]1223 Click to Change Button Text[]1225 Click to Change Button Text[]1226 Click to Change Button Text[]1227 Click to Change Button Text[]1228 Click to Change Button Text[]1229 Click to Change Button Text[]1230 Click to Change Button Text[]1231 Click to Change Button Text[]1232 Click to Change Button Text[]1233 Click to Change Button Text[]1234 Click to Change Button Text[]1235 Click to Change Button Text[]1236 Click to Change Button Text[]1237 Click to Change Button Text[]1238 Click to Change Button Text[]1239 Click to Change Button Text[]1240 Click to Change Button Text")
,
,tt.AddTools(hDlg "1321 Click to Change Button Text[]1322 Click to Change Button Text[]1323 Click to Change Button Text[]1324 Click to Change Button Text[]1323 Click to Change Button Text[]1325 Click to Change Button Text[]1326 Click to Change Button Text[]1327 Click to Change Button Text[]1328 Click to Change Button Text[]1329 Click to Change Button Text[]1330 Click to Change Button Text[]1331 Click to Change Button Text[]1332 Click to Change Button Text[]1333 Click to Change Button Text[]1334 Click to Change Button Text[]1335 Click to Change Button Text[]1336 Click to Change Button Text[]1337 Click to Change Button Text[]1338 Click to Change Button Text[]1339 Click to Change Button Text[]1340 Click to Change Button Text")
,;
;
,
,int htb=id(3 hDlg)
,TCITEM ti.mask=WINAPI.TCIF_TEXT
,ti.pszText="A"
,SendMessage htb WINAPI.TCM_INSERTITEMA 0 &ti
,ti.pszText="B"
,SendMessage htb WINAPI.TCM_INSERTITEMA 1 &ti
,ti.pszText="C"
,SendMessage htb WINAPI.TCM_INSERTITEMA 2 &ti
,ti.pszText="D"
,SendMessage htb WINAPI.TCM_INSERTITEMA 3 &ti
,ti.pszText="E"
,SendMessage htb WINAPI.TCM_INSERTITEMA 4 &ti
,ti.pszText="F"
,SendMessage htb WINAPI.TCM_INSERTITEMA 5 &ti    
,ti.pszText="G"
,SendMessage htb WINAPI.TCM_INSERTITEMA 6 &ti
,ti.pszText="H"
,SendMessage htb WINAPI.TCM_INSERTITEMA 7 &ti
,ti.pszText="I"
,SendMessage htb WINAPI.TCM_INSERTITEMA 8 &ti
,ti.pszText="J"
,SendMessage htb WINAPI.TCM_INSERTITEMA 9 &ti
,ti.pszText="K"
,SendMessage htb WINAPI.TCM_INSERTITEMA 10 &ti
,ti.pszText="L"
,SendMessage htb WINAPI.TCM_INSERTITEMA 11 &ti
,goto g11
,case WM_DESTROY
,,DT_DeleteData(hDlg)
,,tt.Destroy
,case WM_SETCURSOR
,,tt.OnWmSetcursor(wParam lParam)
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case 6
,,str NewMacroText
,,NewMacroText.getwintext(id(4 hDlg))
,,if(mes("Are you sure you want to permanently change macro text[](i.e. changes will also apply to future sessions)?" "Macro Text Change Confirmation" "OC?")!='O') ret
,,NewMacroText.setmacro(MacroID)
,case 7
,,;g1    
,,str OldButtonText NewButtonText ChangeText
,,OldButtonText.getwintext(id(ButtonSelectedID hDlg))    
,,ChangeText.format("Change button text from ''%s'' to:" OldButtonText)
,,if(!inp(NewButtonText ChangeText "Change Button Text" "Enter new button title here.....")) ret
,,if(mes("Change ''%s'' to ''%s''" "" "OC?" OldButtonText NewButtonText)!='O') ret
,,rset NewButtonText MacroID "SampleMacros" "C:\SampleMacros.ini";err;;ED = macro
,,NewButtonText.setwintext(id(ButtonSelectedID hDlg))
,case 1001    
,,MacroID = "EDEC1"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1002
,,MacroID = "EDEC2"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1003
,,MacroID = "EDEC3"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1004
,,MacroID = "EDEC4"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1005
,,MacroID = "EDEC5"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1006
,,MacroID = "EDEC6"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1007
,,MacroID = "EDEC7"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1008
,,MacroID = "EDEC8"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1009
,,MacroID = "EDEC9"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1010
,,MacroID = "EDEC10"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1011    
,,MacroID = "EDEC11"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1012
,,MacroID = "EDEC12"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1013
,,MacroID = "EDEC13"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1014
,,MacroID = "EDEC14"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1015
,,MacroID = "EDEC15"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1016
,,MacroID = "EDEC16"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1017
,,MacroID = "EDEC17"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1018
,,MacroID = "EDEC18"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1019
,,MacroID = "EDEC19"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1021
,,MacroID="EDEC1"
,,ButtonSelectedID=1001
,,goto g1
,case 1022
,,MacroID="EDEC2"
,,ButtonSelectedID=1002
,,goto g1
,case 1023
,,MacroID="EDEC3"
,,ButtonSelectedID=1003
,,goto g1
,case 1024
,,MacroID="EDEC4"
,,ButtonSelectedID=1004
,,goto g1
,case 1025
,,MacroID="EDEC5"
,,ButtonSelectedID=1005
,,goto g1
,case 1026
,,MacroID="EDEC6"
,,ButtonSelectedID=1006
,,goto g1
,case 1027
,,MacroID="EDEC7"
,,ButtonSelectedID=1007
,,goto g1
,case 1028
,,MacroID="EDEC8"
,,ButtonSelectedID=1008
,,goto g1
,case 1029
,,MacroID="EDEC9"
,,ButtonSelectedID=1009
,,goto g1
,case 1030
,,MacroID="EDEC10"
,,ButtonSelectedID=1010
,,goto g1    
,case 1031
,,MacroID="EDEC11"
,,ButtonSelectedID=1011
,,goto g1
,case 1032
,,MacroID="EDEC12"
,,ButtonSelectedID=1012
,,goto g1
,case 1033
,,MacroID="EDEC13"
,,ButtonSelectedID=1013
,,goto g1
,case 1034
,,MacroID="EDEC14"
,,ButtonSelectedID=1014
,,goto g1
,case 1035
,,MacroID="EDEC15"
,,ButtonSelectedID=1015
,,goto g1
,case 1036
,,MacroID="EDEC16"
,,ButtonSelectedID=1016
,,goto g1
,case 1037
,,MacroID="EDEC17"
,,ButtonSelectedID=1017
,,goto g1
,case 1038
,,MacroID="EDEC18"
,,ButtonSelectedID=1018
,,goto g1
,case 1039
,,MacroID="EDEC19"
,,ButtonSelectedID=1019
,,goto g1
,case 1040
,,MacroID="EDEC20"
,,ButtonSelectedID=1020
,,goto g1    
,case 1101    
,,MacroID = "EDEC21"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1102
,,MacroID = "EDEC22"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1103
,,MacroID = "EDEC23"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1104
,,MacroID = "EDEC24"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1105
,,MacroID = "EDEC25"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1106
,,MacroID = "EDEC26"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1107
,,MacroID = "EDEC27"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1108
,,MacroID = "EDEC28"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1109
,,MacroID = "EDEC29"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1111
,,MacroID = "EDEC30"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1111    
,,MacroID = "EDEC31"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1112
,,MacroID = "EDEC32"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1113
,,MacroID = "EDEC33"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1114
,,MacroID = "EDEC34"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1115
,,MacroID = "EDEC35"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1116
,,MacroID = "EDEC36"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1117
,,MacroID = "EDEC37"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1118
,,MacroID = "EDEC38"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1119
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1120
,,MacroID = "EDEC40"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1121
,,MacroID="EDEC21"
,,ButtonSelectedID=1101
,,goto g1
,case 1122
,,MacroID="EDEC22"
,,ButtonSelectedID=1102
,,goto g1
,case 1123
,,MacroID="EDEC23"
,,ButtonSelectedID=1103
,,goto g1
,case 1124
,,MacroID="EDEC24"
,,ButtonSelectedID=1104
,,goto g1
,case 1125
,,MacroID="EDEC25"
,,ButtonSelectedID=1105
,,goto g1
,case 1126
,,MacroID="EDEC26"
,,ButtonSelectedID=1106
,,goto g1
,case 1127
,,MacroID="EDEC27"
,,ButtonSelectedID=1107
,,goto g1
,case 1128
,,MacroID="EDEC28"
,,ButtonSelectedID=1108
,,goto g1
,case 1129
,,MacroID="EDEC29"
,,ButtonSelectedID=1109
,,goto g1
,case 1130
,,MacroID="EDEC30"
,,ButtonSelectedID=1110
,,goto g1    
,case 1131
,,MacroID="EDEC31"
,,ButtonSelectedID=1111
,,goto g1
,case 1132
,,MacroID="EDEC32"
,,ButtonSelectedID=1112
,,goto g1
,case 1133
,,MacroID="EDEC33"
,,ButtonSelectedID=1113
,,goto g1
,case 1134
,,MacroID="EDEC34"
,,ButtonSelectedID=1114
,,goto g1
,case 1135
,,MacroID="EDEC35"
,,ButtonSelectedID=1115
,,goto g1
,case 1136
,,MacroID="EDEC36"
,,ButtonSelectedID=1116
,,goto g1
,case 1137
,,MacroID="EDEC37"
,,ButtonSelectedID=1117
,,goto g1
,case 1138
,,MacroID="EDEC38"
,,ButtonSelectedID=1118
,,goto g1
,case 1139
,,MacroID="EDEC39"
,,ButtonSelectedID=1119
,,goto g1
,case 1140
,,MacroID="EDEC40"
,,ButtonSelectedID=1120
,,goto g1    
,case 1201
,,MacroID = "EDEC41"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1202
,,MacroID = "EDEC42"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1203
,,MacroID = "EDEC43"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1204
,,MacroID = "EDEC44"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1205
,,MacroID = "EDEC45"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1206
,,MacroID = "EDEC46"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1207
,,MacroID = "EDEC47"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1208
,,MacroID = "EDEC48"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1209
,,MacroID = "EDEC49"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1210
,,MacroID = "EDEC50"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1211
,,MacroID = "EDEC51"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1212
,,MacroID = "EDEC52"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1213
,,MacroID = "EDEC53"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1214
,,MacroID = "EDEC54"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1215
,,MacroID = "EDEC55"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1216
,,MacroID = "EDEC56"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1217
,,MacroID = "EDEC57"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1218
,,MacroID = "EDEC58"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1219
,,MacroID = "EDEC59"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1220
,,MacroID = "EDEC60"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1221
,,MacroID="EDEC41"
,,ButtonSelectedID=1201
,,goto g1
,case 1222
,,MacroID="EDEC42"
,,ButtonSelectedID=1202
,,goto g1
,case 1223
,,MacroID="EDEC43"
,,ButtonSelectedID=1203
,,goto g1
,case 1224
,,MacroID="EDEC44"
,,ButtonSelectedID=1204
,,goto g1
,case 1225
,,MacroID="EDEC45"
,,ButtonSelectedID=1205
,,goto g1
,case 1226
,,MacroID="EDEC46"
,,ButtonSelectedID=1206
,,goto g1
,case 1227
,,MacroID="EDEC47"
,,ButtonSelectedID=1207
,,goto g1
,case 1228
,,MacroID="EDEC48"
,,ButtonSelectedID=1208
,,goto g1
,case 1229
,,MacroID="EDEC49"
,,ButtonSelectedID=1209
,,goto g1
,case 1230
,,MacroID="EDEC50"
,,ButtonSelectedID=1210
,,goto g1    
,case 1231
,,MacroID="EDEC51"
,,ButtonSelectedID=1211
,,goto g1
,case 1232
,,MacroID="EDEC52"
,,ButtonSelectedID=1212
,,goto g1
,case 1233
,,MacroID="EDEC53"
,,ButtonSelectedID=1213
,,goto g1
,case 1234
,,MacroID="EDEC54"
,,ButtonSelectedID=1214
,,goto g1
,case 1235
,,MacroID="EDEC55"
,,ButtonSelectedID=1215
,,goto g1
,case 1236
,,MacroID="EDEC56"
,,ButtonSelectedID=1216
,,goto g1
,case 1237
,,MacroID="EDEC57"
,,ButtonSelectedID=1217
,,goto g1
,case 1238
,,MacroID="EDEC58"
,,ButtonSelectedID=1218
,,goto g1
,case 1239
,,MacroID="EDEC59"
,,ButtonSelectedID=1219
,,goto g1
,case 1240
,,MacroID="EDEC60"
,,ButtonSelectedID=1220
,,goto g1    
,case 1301    
,,MacroID = "EDEC61"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1301
,,MacroID = "EDEC61"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1302
,,MacroID = "EDEC62"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1303
,,MacroID = "EDEC63"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1304
,,MacroID = "EDEC64"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1305
,,MacroID = "EDEC65"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1306
,,MacroID = "EDEC66"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1307
,,MacroID = "EDEC67"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1308
,,MacroID = "EDEC68"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1309
,,MacroID = "EDEC69"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1310
,,MacroID = "EDEC70"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1311
,,MacroID = "EDEC71"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1312
,,MacroID = "EDEC72"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1313
,,MacroID = "EDEC73"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1314
,,MacroID = "EDEC74"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1315
,,MacroID = "EDEC75"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1316
,,MacroID = "EDEC76"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1317
,,MacroID = "EDEC77"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1318
,,MacroID = "EDEC78"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1319
,,MacroID = "EDEC79"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1320
,,MacroID = "EDEC80"
,,MacroText.getmacro(MacroID)
,,MacroText.setwintext(id(4 hDlg))
,case 1321
,,MacroID="EDEC61"
,,ButtonSelectedID=1301
,,goto g1
,case 1322
,,MacroID="EDEC62"
,,ButtonSelectedID=1302
,,goto g1
,case 1323
,,MacroID="EDEC63"
,,ButtonSelectedID=1303
,,goto g1
,case 1324
,,MacroID="EDEC64"
,,ButtonSelectedID=1304
,,goto g1
,case 1325
,,MacroID="EDEC65"
,,ButtonSelectedID=1305
,,goto g1
,case 1326
,,MacroID="EDEC66"
,,ButtonSelectedID=1306
,,goto g1
,case 1327
,,MacroID="EDEC67"
,,ButtonSelectedID=1307
,,goto g1
,case 1328
,,MacroID="EDEC68"
,,ButtonSelectedID=1308
,,goto g1
,case 1329
,,MacroID="EDEC69"
,,ButtonSelectedID=1309
,,goto g1
,case 1330
,,MacroID="EDEC70"
,,ButtonSelectedID=1310
,,goto g1    
,case 1331
,,MacroID="EDEC71"
,,ButtonSelectedID=1311
,,goto g1
,case 1332
,,MacroID="EDEC72"
,,ButtonSelectedID=1312
,,goto g1
,case 1333
,,MacroID="EDEC73"
,,ButtonSelectedID=1313
,,goto g1
,case 1334
,,MacroID="EDEC74"
,,ButtonSelectedID=1314
,,goto g1
,case 1335
,,MacroID="EDEC75"
,,ButtonSelectedID=1315
,,goto g1
,case 1336
,,MacroID="EDEC76"
,,ButtonSelectedID=1316
,,goto g1
,case 1337
,,MacroID="EDEC77"
,,ButtonSelectedID=1317
,,goto g1
,case 1338
,,MacroID="EDEC78"
,,ButtonSelectedID=1318
,,goto g1
,case 1339
,,MacroID="EDEC79"
,,ButtonSelectedID=1319
,,goto g1
,case 1340
,,MacroID="EDEC80"
,,ButtonSelectedID=1320
,,goto g1    
,case IDOK DT_Ok hDlg        
,case IDCANCEL DT_Cancel hDlg
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case WINAPI.TCN_SELCHANGE
,_i=SendMessage(nh.hwndFrom WINAPI.TCM_GETCURSEL 0 0)
,;g11
,DT_Page hDlg _i
,
,
,
,
,
,
,
,
,
,
,
#2
Quote:Is there a way I can keep multi-line text organized in a file outside of QM like an ini file.

Escape it. For example,

str s="multiline[]text"
s.escape(1)
rset ...
...
rget ...
s.escape(0)

Or use an XML file instead of ini and macros. Ini also has more limitations, and maybe you'll see them while developing your macro further. Example XML file, eg "C:\SampleMacros.xml":

<SampleMacros>
<EDEC1>phrase text</EDEC1>
<EDEC2 b="button text">phrase text</EDEC2>
<EDEC3 b="button text">multiline
text</EDEC3>
</SampleMacros>

--
Quote:If there are multiple items that have the same action, is there a syntax for:
case 1012 or 1013

case [1012,1013]

--

Quote:If many items have the same tooltip is there a shorter way of having them share it

for i idfirst idlast+1
,tt.AddTool(hDlg i "text")
#3
I wanted to test the new QM XML functions in real macros. And here is the result. Fully working.

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

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 476 182 "MultiTabPhraseFillerMacro"
;1 Button 0x54030001 0x4 328 136 48 14 "OK"
;2 Button 0x54030000 0x4 386 136 48 14 "Cancel"
;4 Edit 0x54231044 0x200 272 16 202 112 ""
;6 Button 0x54012000 0x0 340 156 78 16 "Update Macro Text?"
;101 Button 0x54032000 0x0 6 18 117 14 ""
;102 Button 0x54032000 0x0 6 32 117 14 ""
;103 Button 0x54032300 0x0 6 46 117 14 ""
;104 Button 0x54032300 0x0 6 60 117 14 ""
;105 Button 0x54032000 0x0 6 74 117 14 ""
;106 Button 0x54032000 0x0 138 18 117 14 ""
;107 Button 0x54032000 0x0 138 32 117 14 ""
;108 Button 0x54032000 0x0 138 46 117 14 ""
;109 Button 0x54032000 0x0 138 60 117 14 ""
;110 Button 0x54032000 0x0 138 74 117 14 ""
;111 Button 0x54032000 0x0 6 100 117 14 ""
;112 Button 0x54032000 0x0 6 114 117 14 ""
;113 Button 0x54032000 0x0 6 128 117 14 ""
;114 Button 0x54032000 0x0 6 142 117 14 ""
;115 Button 0x54032000 0x0 6 156 117 14 ""
;116 Button 0x54032000 0x0 138 100 117 14 ""
;117 Button 0x54032000 0x0 138 114 117 14 ""
;118 Button 0x54032000 0x0 138 128 117 14 ""
;119 Button 0x54032000 0x0 138 142 117 14 ""
;120 Button 0x54032000 0x0 138 156 117 14 ""
;121 Button 0x54032000 0x0 123 18 10 14 ".."
;122 Button 0x54032000 0x0 123 32 10 14 ".."
;123 Button 0x54032000 0x0 123 46 10 14 ".."
;124 Button 0x54032000 0x0 123 60 10 14 ".."
;125 Button 0x54032000 0x0 123 74 10 14 ".."
;126 Button 0x54032000 0x0 255 18 10 14 ".."
;127 Button 0x54032000 0x0 255 32 10 14 ".."
;128 Button 0x54032000 0x0 255 46 10 14 ".."
;129 Button 0x54032000 0x0 255 60 10 14 ".."
;130 Button 0x54032000 0x0 255 74 10 14 ".."
;131 Button 0x54032000 0x0 123 100 10 14 ".."
;132 Button 0x54032000 0x0 123 114 10 14 ".."
;133 Button 0x54032000 0x0 123 128 10 14 ".."
;134 Button 0x54032000 0x0 123 142 10 14 ".."
;135 Button 0x54032000 0x0 123 156 10 14 ".."
;136 Button 0x54032000 0x0 255 100 10 14 ".."
;137 Button 0x54032000 0x0 255 114 10 14 ".."
;138 Button 0x54032000 0x0 255 128 10 14 ".."
;139 Button 0x54032000 0x0 255 142 10 14 ".."
;140 Button 0x54032000 0x0 255 156 10 14 ".."
;5 Static 0x54000010 0x20004 6 430 389 1 ""
;3 SysTabControl32 0x54000040 0x0 2 0 492 182 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "0" ""

class CToolTip m_htt ;;delete this if already declared in init2

str controls = "4"
str e4

str-- tag ;;was MacroID

;load xml file
str-- xmlfile="$desktop$\SampleMacros.xml"
if(!dir(xmlfile)) _s="<SampleMacros></SampleMacros>"; _s.setfile(xmlfile) ;;first time, create new file with no data
IXml-- xml
xml=CreateXml
xml.FromFile(xmlfile)
IXmlNode-- xr=xml.RootElement ;;this will be often used
IXmlNode ne

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

e4.setclip
act win("Microsoft Word" "OpusApp")
'Ai;;menu for inserting comments into Word Doc
'm;;brings up a new comment dialog in Word
0.5
outp e4
ret
;messages
CToolTip-- tt ;;CToolTip variables usually can be declared with thread scope (- or --). If thread can have multiple instances of the same dialog, use window scope (SetProp/GetProp). Don't use global and local.
sel message
,case WM_INITDIALOG
,;tab control
,int i t htb=id(3 hDlg)
,TCITEM ti.mask=TCIF_TEXT
,str st="A[]B[]C[]D[]E[]F[]G[]H[]I[]J[]K[]L"
,foreach(ti.pszText st) SendMessage htb TCM_INSERTITEMA i &ti; i+1
,
,;tooltips
,tt.Create(hDlg)
,tt.AddTool(hDlg 4 "Text changes apply only for this comment insertion. To permanently change text, Choose Update Macro Text")
,for(i 121 141) tt.AddTool(hDlg i "Click to Change Button Text")
,
,t=0; goto g11 ;;select first tab
,case WM_DESTROY
,,tt.Destroy
,case WM_SETCURSOR
,,tt.OnWmSetcursor(wParam lParam)
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case 6
,,if(!tag.len) ret
,,str NewMacroText
,,NewMacroText.getwintext(id(4 hDlg))
,,if(mes("Are you sure you want to permanently change macro text[](i.e. changes will also apply to future sessions)?" "Macro Text Change Confirmation" "OC?")!='O') ret
,,xr.SetChild(tag NewMacroText)
,,xml.ToFile(xmlfile)
,case else
,if(wParam>=101 and wParam<=140)
,,t=SendMessage(id(3 hDlg) TCM_GETCURSEL 0 0) ;;tab
,,
,,if(wParam>=101 and wParam<=120) ;;big button
,,,i=wParam-100
,,,tag.from("e" t*100+i)
,,,_s=xr.Child(tag).Value; err
,,,_s.setwintext(id(4 hDlg))
,,else ;;small [...] button
,,,wParam-20
,,,i=wParam-100
,,,tag.from("e" t*100+i)
,,,str OldButtonText NewButtonText ChangeText
,,,OldButtonText.getwintext(id(wParam hDlg))
,,,ChangeText.format("Change button text from ''%s'' to:" OldButtonText)
,,,if(!inp(NewButtonText ChangeText "Change Button Text" "Enter new button title here.....")) ret
,,,ne=xr.Child(tag); if(!ne) ne=xr.Add(tag)
,,,ne.SetAttribute("b" NewButtonText)
,,,xml.ToFile(xmlfile)
,,,NewButtonText.setwintext(id(wParam hDlg))
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case TCN_SELCHANGE
,t=SendMessage(nh.hwndFrom TCM_GETCURSEL 0 0)
,;g11
,;set text of buttons in this tab
,for i 1 21
,,NewButtonText=xr.Child(_s.from("e" t*100+i)).AttributeValue("b"); err NewButtonText=""
,,NewButtonText.setwintext(id(i+100 hDlg))
,;click first button to update tag and the textbox
,but 101 hDlg
#4
Dear Gintaras,
I can't thank you enough. Everything has worked perfectly as you suggested.
escape is wonderful!!!!!!!! Works perfectly!!!
I am using .ini file for now but will explore your .xml example in the near future. I will have to learn more about why .xml is better than .ini. I geuss for webservices this will be very important.

Thanks a trillion.
Stuart
#5
Hi Gintaras,
When I wrote back to thank you previously, I hadn't realized what you had accomplished with the xml version - so if I didn't seem appreciative enough, let me tell you I now realize that you basically solved all the problems. It's incredible. It's not just an ad hoc solution but a Macro Picker/Inserter Engine!!!
The XML version made it so elegant. I guess you could have done it with .ini file as well. I think the most elegant is how you took all my repeated elements on every screen and made a formula that could account for each one (taking into account the tab number t*100-20, etc, etc)

I don't completely understand how the XML parses the formatting (it doesn't look like anything changes when you look at the XML code but when you look at in a regular editor, more seems to change (line breaks, etc)

I still have to parse in my own brain the new syntax for XML e.g.I will look around for some reading.

I added a button to call up a running text of all the various inserts (see below)... Kind of cute and very helpful for my team since they not only have to mark up the actual document with comments but also create a summary letter with all the comments

Couple questions with this though:

Since this has a different button format, I couldn't make it a tab on the original macro, so it is kind of a popup called as below


Is that a safe or advisable way of doing it?

Also, since I am benefitting from your XML code but haven't mastered the syntax, I am keeping the running comments in a separate .ini file but I will figure out how to integrate it eventually in to the main xml document.

Is it possible to have the dialog float above the Word application (i.e. stays on top) and doesn't close down with OK (i.e. only inserts the comment)
I have tried changing the ret 1 to ret 0 after IDOK but it doesn't seem to work.
Any help would be great.
Thanks so much!!!
Stuart


Function RadEdBoardPhraseFillerXML
Trigger Wc /WINWORD     Help - how to add the trigger to the macro
Code:
Copy      Help
;1001 Button 0x54032000 0x0 358 156 78 16 "View All Comments"



,case 1001
,,mac "RunningCommentsDlg"

Function RunningCommentsDlg2
Code:
Copy      Help
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3 4 8 6"
str b3 b4 e5 b6
str RunningCommentsText
rget RunningCommentsText "RunningComments" "RunningComments" "$Personal$\Macros.ini";err;;EDEC = macro
RunningCommentsText.escape(0)


e5 = RunningCommentsText


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

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 499 320 "Running Comments"
;2 Button 0x54030000 0x4 200 288 102 18 "Close"
;3 Button 0x54032000 0x0 340 260 84 21 "Clear Running Comments"
;4 Button 0x54032000 0x0 74 260 90 21 "Save Running Comments to New File"
;6 Button 0x54032000 0x0 170 260 84 21 "Add Running Comments to Existing File"
;7 Button 0x54032000 0x0 256 260 82 21 "Copy Running Comments to Clipboard"
;8 Edit 0x54601844 0x0 10 6 482 244 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030000 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,,RunningCommentsText = ""    
,,rset RunningCommentsText "RunningComments" "RunningCommentsSection" "$Personal$\Macros.ini";err;;EDEC = macro
,,rget RunningCommentsText "RunningComments" "RunningCommentsSection" "$Personal$\Macros.ini";err;;EDEC = macro
,,RunningCommentsText.setwintext(id(5 hDlg))        
,case 4
,,str RunningCommentsFileName
,,if(!inp(RunningCommentsFileName "Please assign a filename for ''Running Comments''" "Radiology Editorial Board" "Enter filename here.... (don't need to add  ''.doc'')")) ret
,,out RunningCommentsFileName
,,RunningCommentsFileName.ReplaceInvalidFilenameCharacters("_")
,,out RunningCommentsFileName
,,str initdir = "$Personal$"
,,if OpenSaveDialog(1 RunningCommentsFileName "Word Documents[]*.doc; *.doc*[]All files[]*.*" "doc" initdir "Save Copy of Radiology Editorial Board ''Running Comments''")
,,,out RunningCommentsFileName
,,,rget RunningCommentsText "RunningComments" "RunningCommentsSection" "$Personal$\Macros.ini";err;;EDEC = macro
,,,RunningCommentsText.escape(0)
,,,RunningCommentsText.setfile(RunningCommentsFileName 0 -1)
,,,run RunningCommentsFileName
,case 6
,,str ExistingRunningCommentsFileName
,,if OpenSaveDialog(0 ExistingRunningCommentsFileName "Word Documents[]*.doc; *.doc*[]All files[]*.*" "doc" initdir "Select existing ''Running Comments'' file")
,,,out ExistingRunningCommentsFileName
,,,rget RunningCommentsText "RunningComments" "RunningCommentsSection" "$Personal$\Macros.ini";err;;EDEC = macro
,,,RunningCommentsText.escape(0)
,,,RunningCommentsText.setfile(ExistingRunningCommentsFileName -1 -1)
,,,run ExistingRunningCommentsFileName    
,case 7
,,rget RunningCommentsText "RunningComments" "RunningCommentsSection" "$Personal$\Macros.ini";err;;EDEC = macro
,,RunningCommentsText.escape(0)
,,RunningCommentsText.setclip
,case IDOK
,case IDCANCEL
ret 1

;
#6
Quote:Is it possible to have the dialog float above the Word application (i.e. stays on top) and doesn't close down with OK (i.e. only inserts the comment)
I have tried changing the ret 1 to ret 0 after IDOK but it doesn't seem to work.

My code was incorrect. case IDOK and IDCANCEL must be above case else.

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

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 476 182 "MultiTabPhraseFillerMacro"
;1 Button 0x54030001 0x4 328 136 48 14 "OK"
;2 Button 0x54030000 0x4 386 136 48 14 "Cancel"
;4 Edit 0x54231044 0x200 272 16 202 112 ""
;6 Button 0x54012000 0x0 340 156 78 16 "Update Macro Text?"
;101 Button 0x54032000 0x0 6 18 117 14 ""
;102 Button 0x54032000 0x0 6 32 117 14 ""
;103 Button 0x54032300 0x0 6 46 117 14 ""
;104 Button 0x54032300 0x0 6 60 117 14 ""
;105 Button 0x54032000 0x0 6 74 117 14 ""
;106 Button 0x54032000 0x0 138 18 117 14 ""
;107 Button 0x54032000 0x0 138 32 117 14 ""
;108 Button 0x54032000 0x0 138 46 117 14 ""
;109 Button 0x54032000 0x0 138 60 117 14 ""
;110 Button 0x54032000 0x0 138 74 117 14 ""
;111 Button 0x54032000 0x0 6 100 117 14 ""
;112 Button 0x54032000 0x0 6 114 117 14 ""
;113 Button 0x54032000 0x0 6 128 117 14 ""
;114 Button 0x54032000 0x0 6 142 117 14 ""
;115 Button 0x54032000 0x0 6 156 117 14 ""
;116 Button 0x54032000 0x0 138 100 117 14 ""
;117 Button 0x54032000 0x0 138 114 117 14 ""
;118 Button 0x54032000 0x0 138 128 117 14 ""
;119 Button 0x54032000 0x0 138 142 117 14 ""
;120 Button 0x54032000 0x0 138 156 117 14 ""
;121 Button 0x54032000 0x0 123 18 10 14 ".."
;122 Button 0x54032000 0x0 123 32 10 14 ".."
;123 Button 0x54032000 0x0 123 46 10 14 ".."
;124 Button 0x54032000 0x0 123 60 10 14 ".."
;125 Button 0x54032000 0x0 123 74 10 14 ".."
;126 Button 0x54032000 0x0 255 18 10 14 ".."
;127 Button 0x54032000 0x0 255 32 10 14 ".."
;128 Button 0x54032000 0x0 255 46 10 14 ".."
;129 Button 0x54032000 0x0 255 60 10 14 ".."
;130 Button 0x54032000 0x0 255 74 10 14 ".."
;131 Button 0x54032000 0x0 123 100 10 14 ".."
;132 Button 0x54032000 0x0 123 114 10 14 ".."
;133 Button 0x54032000 0x0 123 128 10 14 ".."
;134 Button 0x54032000 0x0 123 142 10 14 ".."
;135 Button 0x54032000 0x0 123 156 10 14 ".."
;136 Button 0x54032000 0x0 255 100 10 14 ".."
;137 Button 0x54032000 0x0 255 114 10 14 ".."
;138 Button 0x54032000 0x0 255 128 10 14 ".."
;139 Button 0x54032000 0x0 255 142 10 14 ".."
;140 Button 0x54032000 0x0 255 156 10 14 ".."
;5 Static 0x54000010 0x20004 6 430 389 1 ""
;3 SysTabControl32 0x54000040 0x0 2 0 492 182 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030001 "" "0" ""

class CToolTip m_htt ;;delete this if already declared in init2

str controls = "4"
str e4

str-- tag ;;was MacroID

;load xml file
str-- xmlfile="$desktop$\SampleMacros.xml"
if(!dir(xmlfile)) _s="<SampleMacros></SampleMacros>"; _s.setfile(xmlfile) ;;first time, create new file with no data
IXml-- xml
xml=CreateXml
xml.FromFile(xmlfile)
IXmlNode-- xr=xml.RootElement ;;this will be often used
IXmlNode ne

if(!ShowDialog("MultiTabPhraseFillerMacro" &MultiTabPhraseFillerMacro &controls win("Word" "OpusApp"))) ret
ret
;messages
CToolTip-- tt ;;CToolTip variables usually can be declared with thread scope (- or --). If thread can have multiple instances of the same dialog, use window scope (SetProp/GetProp). Don't use global and local.
sel message
,case WM_INITDIALOG
,;tab control
,int i t htb=id(3 hDlg)
,TCITEM ti.mask=TCIF_TEXT
,str st="A[]B[]C[]D[]E[]F[]G[]H[]I[]J[]K[]L"
,foreach(ti.pszText st) SendMessage htb TCM_INSERTITEMA i &ti; i+1
,
,;tooltips
,tt.Create(hDlg)
,tt.AddTool(hDlg 4 "Text changes apply only for this comment insertion. To permanently change text, Choose Update Macro Text")
,for(i 121 141) tt.AddTool(hDlg i "Click to Change Button Text")
,
,t=0; goto g11 ;;select first tab
,case WM_DESTROY
,,tt.Destroy
,case WM_SETCURSOR
,,tt.OnWmSetcursor(wParam lParam)
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,DT_GetControls hDlg &controls
,e4.setclip
,act win("Microsoft Word" "OpusApp")
,'Ai;;menu for inserting comments into Word Doc
,'m;;brings up a new comment dialog in Word
,0.5
,outp e4
,ret
,case IDCANCEL
,case 6
,,if(!tag.len) ret
,,str NewMacroText
,,NewMacroText.getwintext(id(4 hDlg))
,,if(mes("Are you sure you want to permanently change macro text[](i.e. changes will also apply to future sessions)?" "Macro Text Change Confirmation" "OC?")!='O') ret
,,xr.SetChild(tag NewMacroText)
,,xml.ToFile(xmlfile)
,case else
,if(wParam>=101 and wParam<=140)
,,t=SendMessage(id(3 hDlg) TCM_GETCURSEL 0 0) ;;tab
,,
,,if(wParam>=101 and wParam<=120) ;;big button
,,,i=wParam-100
,,,tag.from("e" t*100+i)
,,,_s=xr.Child(tag).Value; err
,,,_s.setwintext(id(4 hDlg))
,,else ;;small [...] button
,,,wParam-20
,,,i=wParam-100
,,,tag.from("e" t*100+i)
,,,str OldButtonText NewButtonText ChangeText
,,,OldButtonText.getwintext(id(wParam hDlg))
,,,ChangeText.format("Change button text from ''%s'' to:" OldButtonText)
,,,if(!inp(NewButtonText ChangeText "Change Button Text" "Enter new button title here.....")) ret
,,,ne=xr.Child(tag); if(!ne) ne=xr.Add(tag)
,,,ne.SetAttribute("b" NewButtonText)
,,,xml.ToFile(xmlfile)
,,,NewButtonText.setwintext(id(wParam hDlg))
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case TCN_SELCHANGE
,t=SendMessage(nh.hwndFrom TCM_GETCURSEL 0 0)
,;g11
,;set text of buttons in this tab
,for i 1 21
,,NewButtonText=xr.Child(_s.from("e" t*100+i)).AttributeValue("b"); err NewButtonText=""
,,NewButtonText.setwintext(id(i+100 hDlg))
,;click first button to update tag and the textbox
,but 101 hDlg

Quote:Since this has a different button format, I couldn't make it a tab on the original macro, so it is kind of a popup called as below

Is that a safe or advisable way of doing it?

I think it is safe.
#7
Thanks!!!!!
Stuart
#8
tt.*

Cannot get "Create" or "AddTool" for the CToolTip-- tt instances.

All I get is "m_htt"

Any word on why?

Thanks,
Jimmy Vig
#9
Got it!

In the Resources section of the forum...
Tooltips. For QM < 2.3.4.

Gosh...
#10
I know can you believe how awesome QM is and all the extra gems that are hidden in the forum!! (Gintaras is the man!)

Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)