Drawing Stack Management

 

In general, WinBatch lets you draw objects in various boxes using simple linear programming as with true message-based Windows programming. However, there is a fundamental discrepancy between the message-based Windows programming methods, and the traditional linear method used by WinBatch.

 

In a normal Windows application, the application must be ready to redraw all or any portion of its window at any time. This adds considerable complexity to a true Windows program. In WinBatch, the programmer is shielded from the gory details of the dynamic redrawing required by Windows, and maintains the simple, traditional linear programming style.

 

In order to do this, WinBatch maintains a small database of the Box commands requested by the programmer, and refers to this database when Windows requests a redraw. In general, and for simpler applications, the existence of this database is completely transparent to the programmer. There are cases, however, in which the database must be managed by the programmer to avoid reaching the maximum limits of the database. If the maximum limits are reached, the program will die with a Box Stack exceeded error.

 

If there are some objects that constantly change, such that the limit of about 150 Box commands in the stack will be exceeded, then you must manage the Box Data. The idea is to draw all the fixed, non-changing objects first, and then place a "TAG" into the Data stack, using BoxDataTag. Then draw the first version of the constantly changing object(s). When it comes time to update those objects, a BoxDataClear will erase all items added since the (BoxDataTag) "TAG", and all remaining data space will again be available for reuse.

 

The thermometer bar and the text for the note in the setup program use this feature. All of the examples that do continuous screen draws also use these functions

 

 

 

BoxDataClear

BoxDataTag