Dialog Editor with File Editor Window
Keywords: dialog editor
Question:
In looking at the Dialog Editor for WinBatch I find no way to create a TextBox in the Dialog Box. Am I missing something here or how do I use the Dialog Editor to create a Dialog box that lets me view or edit a text file?An example might be that I want to view and edit BAT files or INI files.
Or am I confused about the purpose of the Dialog Editor?
Answer:
Giving you the ability to set up a small editor is beyond the capabilities of WinBatch.Of course, you could have one of the buttons on the Dialog designed to call AskTextBox,or open up a notepad or whatever editor you desire, and have your code set up so that you come back to the Dialog when done, eg:
DialogFormat=`WWWDLGED,5.0` ; NOTE: buttons, all controls, etc go here in this section ; this may include a filelistbox (returning "filename") While @TRUE Button = Dialog("Dialog") Switch Button Case 1 ; pressed "OK" goto Done Case 2 ; pressed "Edit" RunShell("notepad",filename,"",@NORMAL,@WAIT) Break EndSwitch EndWhile :DoneIf you want to get fancy you can size the notepad with WinPlace(), so that it goes, say, to the immediate right of the dialog.
Article ID: W12833Filename: Dialog Box with File Editor Window.txt