WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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

	:Done
If 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:   W12833
Filename:   Dialog Box with File Editor Window.txt
File Created: 2001:01:02:15:27:04
Last Updated: 2001:01:02:15:27:04