| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

Window Package

Functions in the package interact with a Lua callback function that should deal with eight parameters with the first being the message as string, the second as the Window's handle, the third to fifth as the wParam and its lower- and higher-order bytes, and the sixth to eigth as lParam and its lower- and higher-order bytes. Controls on the main window should be create in the "SIZE" message loop. Functions include create, choosecolor, choosefile, blank, button, label, checkbox, combobox, desktop, groupbox, radiobox, textbox, whitebox, gettext, settext, ischecked, message, move, menu, resize, setchecked, setunchecked, timer.

.create(callback, width, heigh)

Creates a window of specified width and height.

.blank(hwnd, x0, y0, width, height)

Creates a static blank rectangle box in the window identified by hwnd. Returns the handle to the control.

.button(hwnd, x0, y0, width, height, string)

Creates a command button control in the window identified by hwnd. Returns the handle to the control.

.choosecolor()

Shows a color-picking disloag and return the red, green, and blue components of the selected color.

.choosefile([ext, mode])

Shows a file open/save (mode="open" or "save") dialog and return the full path and file name as string. It may show only files with the specified extension.

.checkbox(hwnd, x0, y0, width, height, string)

Creates a checkbox control in the window identified by hwnd. Returns the handle to the control.

.combobox(hwnd, x0, y0, width, height, string1, string2, ...)

Creates a combobox control in the window identified by hwnd. You can add as many item as necessary. The first item will has the ID of 1; the second of 2; and so on. Return the handle to the control.

.desktop()

Returns the width and height of the desktop window.

.gettext(hwnd)

Gets the text of the window identified by hwnd, which may be the lable or selected item

.groupbox(hwnd, x0, y0, width, height, string)

Create a groupbox control in the window identified by hwnd. Returns the handle to the control.

.ischeked(hwnd)

Queries whether the control identified by hwnd is checked.

.label(hwnd, x0, y0, width, height, string)

Creates a static label control in the window identified by hwnd. Returns the handle to the control.

.message(string)

Shows a message dialog box with the string in it. Multi-lines of texts are supported by embedding "\n" in the string.

.move(hwnd, x, y)

Moves the top-left corner or the window identified by hwnd to (x, y).

.menu(hwnd, string1, string2, ...)

Creates a popup menu in the window identified by hwnd. You add as many items as necessary. The first item will has the ID of 1; the second of 2; and so on.

.radiobox(hwnd, x0, y0, width, height, string)

Creates a radiobox control in the window identified by hwnd. Returns the handle to the control.

.resize(hwnd, x0, y0, with, height)

Move and resizes the window identified by hwnd to the specified position, width, and height.

.setchecked(hwnd)

Sets the control identified by hwnd as checked.

.setuncheked(hwnd)

Sets the control identified by hwnd as unchecked.

.settext(hwnd, string)

Uses the string as the text of the window identified by hwnd.

.textbox(hwnd, x0, y0, width, height)

Create a textbox control in the window identified by hwnd. Returns the handle to the control.

.timer(millisecond)

Creates a timer that will inform the callback function when the specified interval is passed.

.whitebox(hwnd, x0, y0, width, height)

Creates a static white rectangle box with sunken edges in the window identified by hwnd. Returns the handle to the control.