Look at the above examples and you'll
quickly realize how easy and straight-forward it is to
make a user interface for Lua scripts or other plugins and
programs with user-selectable parameters and input when
they use the GUI server. Below is a description of the
functionality offered through the GUI server's API.
Also look for examples and
details at http://mark0.net/plugins-doglua-ref3.html
Others may follow soon, such
as Artweaver at www.artweaver.de
is for programming the GUI_Server component. It is an ActiveX compatible
software interface. Any
program that can access ActiveX components should be
able to program the GUI server.
For this reference, Longs
are 32 bit long.
Button Types (specified as a text
These are the types of controls that can be created and
used. Typically it starts with AddControl to create a
control of a type listed here, and receive a handle to
that created control (slider, button, ...)
Button (a button)
Scroller (a horizontal scrollbar)
Check (a checkbox)
Text (a text box)
Number (a text box that only accepts numbers)
TextLabel (a text string to
provide information to the user.
It's not editable by the user, and doesn't
return an event)
ComboBox (a combobox that can have multipe items in a
ColorBox (a color selector or "swatch")
Line (a simple separator. It
has no events and isn't editable by the user)
Example in DogLua:
create a checkbox labelled 'inverted' and receive its
handle in variable h1
-- the initial value (state) is checked (1)
h1 = GUI_AddControl("Check", "inverted",
Functions or "Methods":
AddControl(ControlType As String, Text As String, Value As
As Long, Max As Long, Flags As Long) As Long
returns the index of a control that is added. You can use the returned index
to reference these controls in the future.
a control of a named type to the panel.
name of the control type you want to create and add
(as a string)
Text. The text (label) you want
displayed in or near your control if supported. A caption.
Value. The initial
value for the control, if supported.
Min/Max. If supported,
the min and max values of the control.
Use this with the scroller (slider) control.
additional settings. Currently
a bitmap to the top of your panel for a logo. It should be added before any
The filename specifies the name of the bmp
file. Jpegs, tiffs, and gifs are
also somewhat supported. (not with all their respective
specifies a string
for the title in the panels titlebar.
This can be added at any time, before or after
opening the panel.
can set the caption of the panel at any time...
OpenPanel / ClosePanel
all of your conrols have been added, you can open your
panel with OpenPanel. It
will then be visible to the user. Once
opened, you should wait for events from it with the WaitOnEvents
you are finished with the panel and have read all the
settings that you require, you can close it with ClosePanel. This frees the GUI_Server
program from memory.
Example in DogLua:
ready to show the panel:
-- all done, bye bye now
WaitOnEvent (ByRef Returned_Value As Long,
ByRef Returned_String As String) As Long
Waits for an event to occur. Call
this in a loop after your panel is setup and opened. If Ok or Cancel was pressed,
the value returned by the function will be a negative
number, -1 if Ok, and
-2 if Cancel. Otherwise,
it will be the index (handle) of the control that
generated the event.
There are two variables that you pass to the function. They can be empty. They are used to return
additional information. Returned_Value
receive any value that is generated by the control that
caused the event. If the
control does not generate a numerical value, then it
will be returned as a string. the
text control is an example of a control that returns a
string instead of a value.
Example in DogLua:
idx, retval, retstr = GUI_WaitOnEvent()
until idx < 0
GetSettings(Index As Long, ByRef
Returned_Value As Long, ByRef Returned_String As String)
return settings from a control that generated an event. If you want to get settings
from other controls, you can use GetSettings.
Index is the
index of the control you want to set.
recieve the numeric value of this control, if any. Otherwise, Returned_String will
SetSettings(Index As Long, ByRef Set_Value
As Long, ByRef Set_String As String)
this function to set attributes to a control after it
has been created. You may
sometimes want to programatically change the values of a
SetList(Index As Long, element As
Long, ByRef Set_List As String)
combo boxes, you can set multiple items in a list. Here, Index is the index of
the control. Element is the
number of the item on the list, starting at 0. Set_List is the text string
that will appear on the list.
set the currently sellected text string for a combo box,
use SetSettings. be sure to
do it after the list is settup or it will be