Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Filling in Button/Edit Text in Dialogs from ini vs macro
#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

;


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)