Index
The Dialog and how to create it
The Parameters
Dialog Functions
Important Info

The Dialog and how to create it

The Dialog inherits from the same class as the Form. It doesnt support adding controls like the form does, but looks like a Form and
acts like a Form. It is used to input and display information to the user in the form of a popup. Also the dialog does not support
maximizeing, resizeing or icons. Currently there are two types, the Dialog and the inputDialog. I will be adding several befor the full release.

--Dialog:
dialogD = dialog( 1, 1, "Hello", "dialogD", color.black, color.white, color.black, true)
--inputDialog:
iDialog = inputDialog(1, 1, "Hello", "inputDialog", color.black, color.white, color.black, true, actn)

The first version is the text only dialog and the second is an input dialog. As always you can declare any class two ways and if you dont remember
how, read the forms reference here: Forms
The two images below show the dialog and the input dialog.

Figure 2:

dialog Image

Figure 3:

dialog Image

The Parameters

The Dialogs 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.
string title Sets the title to the string that was entered.
color backcolor Sets the titlebar and frames color.
color titlecolor Sets the title strings text color.
color bodytextcolor Sets the text color of the dialogs text.
bool isdrawn True allows the form to be drawn onto the screen and accept events.
function action *Applies only to inputDialogs* The action that is called when the OK button is clicked
The default function close the dialog.

If you dont know the keywords, go here: Forms

Form Functions

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

Function Description Call example
dialog:getFocus() Gives a form focus by returning true. dialog_name.focused = dialog_name:getFocus()
curwin() Returns the curently focused window or nil. wndI = curwin()
findwndInd(dialog d) Finds the dialogs index in wndTbl. wInd = findwndInd(curwin())
dialog:close() Closes a dialog. dialog_name:close()
dialog:setText(string text) Sets the inputDialogs textboxes text. dialog_name:setText("Hello World!")
dialog:getText() Gets the inputDialogs textboxes text. dialog_name:getText()

Important Info

You should never just set a dialog to focused, you have to call getFocus() otherwise you will screw up the drawing
processes and how dialogs get events.