Set default box size for boxOpen command?

Started by stevengraff, December 20, 2013, 05:40:04 AM

Previous topic - Next topic

stevengraff

Is there any way I can change the box size for a box created with boxOpen?

snowsnowsnow

The usual WinBatch comments for changing the size of windows should work.

In particular, you can use "" as the "Partial Window Title" to refer to the running WinBatch program.

Deana

Rather than using the generic BoxOpen command, may I recommend that you use the more customized graphical versions of the box functions. See BoxesUp:

Code (winbatch) Select

;; sample script for BoxesUp
Message("WinBatch BoxesUp Example","BoxesUp can display a Small box . ")
BoxesUp("200,200,300,300", @NORMAL)
BoxDrawText(1, "500,200,500,200", "WinBatch Box Example - BoxesUp %@crlf%Small", @FALSE, 1)
BoxCaption(1, "WinBatch BoxesUp Example - Small Box")

Message("WinBatch BoxesUp Example","BoxesUp can display a Medium box . ")
BoxDestroy(1)
BoxesUp("200,200,500,500", @NORMAL)
BoxDrawText(1, "500,200,500,200", "WinBatch Box Example - BoxesUp %@crlf%Medium", @FALSE, 1)
BoxCaption(1, "WinBatch BoxesUp Example - Medium Box")

Message("WinBatch BoxesUp Example","BoxesUp can display a Large box . ")
BoxDestroy(1)
BoxesUp("200,200,800,800", @NORMAL)
BoxDrawText(1, "500,200,500,200", "WinBatch Box Example - BoxesUp %@crlf%Large", @FALSE, 1)
BoxCaption(1, "WinBatch BoxesUp Example - Large Box")
Timedelay(3)



Also you can use the WinPlace functions on boxes, but simply specifying "" for the Window title. A blank window title references the Main WinBatch window which is a Box.

Code (winbatch) Select
BoxOpen('Box Sample','Small Box')
WinPlace( 200, 200, 300, 300,  '' )
TimeDelay(2)
WinPlace( 200, 200, 500, 500,  '' )
BoxText( 'Medium Box')
TimeDelay(2)
WinPlace( 200, 200, 800, 800,  '' )
BoxText( 'Large Box')
TimeDelay(2)
Deana F.
Technical Support
Wilson WindowWare Inc.

stevengraff

Thanks, it seems like WinPlace will do the trick. I assume I'm giving something up by going with the "easiest" solution?

Deana

The graphical box functions are intended for creating highly customized boxes. For an example of what graphical box functions can do, check out C:\Program Files (x86)\WinBatch\Samples\Box Drawing Demo.wbt
Deana F.
Technical Support
Wilson WindowWare Inc.