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.

How to Center and Size Dialog Boxes Created By WIL Dialogue Editor

Keywords:	 center dialog boxes

Question:

  1. How do I center a dialogue box created with WIL Dialogue Editor? I tried actually moving the box around, saving it, copying the script and pasting it into my *.WBT, but when you run the program I wrote, the boxes jump around the screen as they pop up. They are also in different places on different machines. It looks SILLY!

  2. A dialogue box I created to fill a 1024 x 768 screen seems to "overlap" the edges of another 1024 x 768 screen which uses a different VGA adaptor. Is there a way of resizing dialogue boxes automatically in these circumstances, or do I just have to make sure that I don't go right out to the edges in future ??

Answer:

  1. Generally, the Dialog Editor will place a dialog box whereever it was made and saved. The boxes are designed to come up where you have the dialog editor screen. If you change resolutions, then funny things happen.

    If WinBatch sees that the dialog box will be offscreen, it overrides it and centers the dialog box. You can use this to your advantage.

    To center the box automatically, set X and/or Y coordinates to an invalid number, (e.g., -1) or a number which is too large (3000).

    If you look at the dialog script you will see something like:

    	MyDialogX=200
    	MyDialogY=600
    
    Simply set these numbers to something big like:
    	MyDialogX=3000
    	MyDialogY=3000
    
    WinBatch will notice the dialog has gone offscreen and then center it. It so happens that if any part of the dialog if off screen, then we figure something has gone wrong and center the dialog.

  2. I am not sure if there is any perfect way to clean up with a dialog window filling an entire screen, but if the desire is to cover up the entire screen, you may want to do so with Box functions as a backdrop, using the co-ordinates 0,0,1000,1000 to fill the screen and then put a dialog box large enough to contain the info in front of it. If this does not work, then it may be a hardware of device limitation related to the monitors or their controllers.

    Dialog box sizes are related to system font sizes. Apparently one machine is running small fonts and the other large fonts. There is a WinMetrics function in the WIL.HLP file to help you figure out what current Dialog unit size is.


Article ID:   W12829
Filename:   Centering and Size Dialog Editor Boxes.txt
File Created: 1999:04:15:16:49:56
Last Updated: 1999:04:15:16:49:56