Index
The Form and how to create it
The Parameters
Icons
Form Functions
Important Info

The Form and how to create it

The Form is the most essential part of a WZGUILIB application. They holds all of the controls in your application, and are how users
input information in your program. There are two ways to declare a form as with all of the other controls.

--first way:
form1 = form(10, 10, 100, 100, false, "Main", color.white, color.AirForceBlue, true, false, false, false, false, false, true)
--second way:
form(10, 10, 100, 100, false, "Main", color.white, color.AirForceBlue, true, false, false, false, false, false, true)

The first way returns a handle for you to call the form with. The second way is also a possible way to create a form, but I dont suggest it
because you would have to scan the form container, table wndTbl, to find your specific form.
Figure 1 shows what the program will look like when it is ran.

Figure 1:

Form Image

The Parameters

The forms parameters are as follows:

Parameter Description
int x The x location of the form on the screen.
int y The y location of the form on the screen.
int width The width of the forms body.
int height The height of the forms body.
(Note that the titlebar is 20 pixles above the form body)
bool fullscreen True will set the form to fullscreen at initializeation.
(currently only one form should be fullscreen at a time)
string title Sets the title to the string that was entered.
color titlecolor Sets the title strings color.
color bordercolor Sets the titlebar and frames color.
bool isdrawn True allows the form to be drawn onto the screen and accept events.
bool contextmenu True allows the form to have a context menu. (Next parameter required if true)
table cmtable The table to be used for the context menu.
bool hassb Form has a status bar. (Currently not available)
bool hasIcon True allows the form to have an icon. (Next parameter required if true)
TI-Image iconimg An image to be used as an Icon. (see Icons)
bool draggable True allows the form to be drag resizeable.

It is very obvious what the parameters are supposed to do, but for all of you non C based language programmers, here are what some of the keywords mean:

The others are just discriptive names that I gave to them.

Icons

Icons are just a 12x12 TI-Image.

Form Functions

Here are the diffrent functions that you can call that do something with forms:

Function Description Call example
form:getFocus() Gives a form focus by returning true. form_name.focused = form_name:getFocus()
form:getControlInd(control c) Returns the index of c in form.controls cI = form_name:getControlInd(control_name)
form:getSelectedControl() Returns the currently selected control or nil c = form_name:getSelectedControl()
form:removeControl(control c) Removes the control from the form. form_name:removeControl(control_name)
curwin() Returns the curently focused window or nil. wndI = curwin()
findwndInd(form f) Finds the forms index in wndTbl. wInd = findwndInd(curwin())
form:I() Invalidates the forms body. form_name:I()
form:close() Closes a form. form_name:close()
form:setFull() Sets a form to fullscreen. form_name:setFull()
form:restoreSettings() Sets the form from fullscreen to its normal size. form_name:restoreSettings

Important Info

A form set to fullscreen will be the only form visible and the only form that can rescieve events. You should never just set a form to focused
you have to call getFocus() otherwise you will screw up the drawing processes and how forms get events. You should never set a form to fullscreen
outside of initializeation, use setFull() instead. Also never just reset fullscreen use restoreSettings().