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.

Setting up an ItemSelect Listbox

Keywords:  itemselect listbox  

  1. Launch the dialog editor, which is the \WinBatch\System directory. It will be named either "Dialog.exe" or "WWDLG16I.EXE" in Windows 3.1/3.11, or "WIL Dialog Editor.exe" in Windows 95/NT.

  2. Make a new Dialog, by either left double-clicking on the dialog workspace to bring up the "Dialog Box Caption" window, or clicking on "File" "New" and enter the dialog caption, for example: "File Scanner", and enter the dialog variable name, for example: "scanner" (without the quote marks).

  3. Now to add a control, right double-click on the workspace, to bring up the Control Attributes window. Make an OK button by right-clicking on the workspace, entering the text, "OK", and using "1" for its value. To make the cancel button, right double-click on the workspace, enter "Cancel" as the text, and enter "0" as its value.

  4. Now to make the ItemSelect Listbox, right double-click on the workspace, choose the last control, "ItemSelect Listbox", and enter the variable name, for example: "myfiles".

    You can move the itembox around, and you can size it by putting your cursor on the bottom right corner (or right side) and dragging it to the size you want.

  5. Now what we want to do is to copy this code to the Windows Clipboard, so that we can do some further editing. To do this, go into the "File" menu, and select "Save to Clipboard".

  6. Now open a Windows editor, like Notepad, and paste the clipboard contents into Notepad.

  7. Add the following statements to the file, if you wanted to, for example, scan files on your floppy drive:

    	DirChange("a:\")
    

    Then add a FileItemize line which is saved in a variable with the same name as the name you gave to your ItemSelect Listbox variable, in this case, "myfiles". This line would look like:

    	myfiles=FileItemize("*.*")
    

    Now go to the bottom of the file, and after the ButtonPushed part, add a message statement, so we can see what files have been selected:

    	Message("Files Selected", myfiles)
    

    So the entire .WDL file would look like:

    scannerFormat=`WWWDLGED,5.0`
    
    scannerCaption=`File Scanner`
    scannerX=3
    scannerY=16
    scannerWidth=304
    scannerHeight=196
    scannerNumControls=3
    
    myfiles=FileItemize("*.*")
    
    scanner01=`36,27,51,DEFAULT,PUSHBUTTON,DEFAULT,"OK",1`
    scanner02=`123,27,51,DEFAULT,PUSHBUTTON,DEFAULT,"Cancel",0`
    scanner03=`152,57,113,84,ITEMBOX,myfiles,DEFAULT`
    
    ButtonPushed=Dialog("scanner")
    
    Message("Files Selected", myfiles)
    

Article ID:   W12845
Filename:   How to Set up ItemSelect Listbox in Dialog Editor.txt
File Created: 1999:04:15:16:50:02
Last Updated: 1999:04:15:16:50:02