UI
This module is an object oriented wrapper to the cross platform user interface library libui-ng.
Link https://github.com/libui-ng/libui-ng.
The module is mostly complete except for styled text handling which is currently marked as experimental in the C code.
It is expected that changes are implemented as the library is marked as mid-alpha. Despite this the library is quite stable, atleast on the Windows platform.
Const
ForEachContinue* = UIDll.ForEachContinue;
ForEachStop* = UIDll.ForEachStop;
AlignFill* = UIDll.AlignFill;
AlignStart* = UIDll.AlignStart;
AlignCenter* = UIDll.AlignCenter;
AlignEnd* = UIDll.AlignEnd;
AtLeading* = UIDll.AtLeading;
AtTop* = UIDll.AtTop;
AtTrailing* = UIDll.AtTrailing;
AtBottom* = UIDll.AtBottom;
WindowResizeEdgeLeft* = UIDll.WindowResizeEdgeLeft;
WindowResizeEdgeTop* = UIDll.WindowResizeEdgeTop;
WindowResizeEdgeRight* = UIDll.WindowResizeEdgeRight;
WindowResizeEdgeBottom* = UIDll.WindowResizeEdgeBottom;
WindowResizeEdgeTopLeft* = UIDll.WindowResizeEdgeTopLeft;
WindowResizeEdgeTopRight* = UIDll.WindowResizeEdgeTopRight;
WindowResizeEdgeBottomLeft* = UIDll.WindowResizeEdgeBottomLeft;
WindowResizeEdgeBottomRight* = UIDll.WindowResizeEdgeBottomRight;
BrushTypeSolid* = UIDll.DrawBrushTypeSolid;
BrushTypeLinearGradient* = UIDll.DrawBrushTypeLinearGradient;
BrushTypeRadialGradient* = UIDll.DrawBrushTypeRadialGradient;
BrushTypeImage* = UIDll.DrawBrushTypeImage;
LineCapFlat* = UIDll.DrawLineCapFlat;
LineCapRound* = UIDll.DrawLineCapRound;
LineCapSquare* = UIDll.DrawLineCapSquare;
LineJoinMiter* = UIDll.DrawLineJoinMiter;
LineJoinRound* = UIDll.DrawLineJoinRound;
LineJoinBevel* = UIDll.DrawLineJoinBevel;
FillModeWinding* = UIDll.DrawFillModeWinding;
FillModeAlternate* = UIDll.DrawFillModeAlternate;
TableValueTypeString* = UIDll.TableValueTypeString;
TableValueTypeImage* = UIDll.TableValueTypeImage;
TableValueTypeInt* = UIDll.TableValueTypeInt;
TableValueTypeColor* = UIDll.TableValueTypeColor;
TableModelColumnNeverEditable* = UIDll.TableModelColumnNeverEditable;
TableModelColumnAlwaysEditable* = UIDll.TableModelColumnAlwaysEditable;
TableSelectionModeNone* = UIDll.TableSelectionModeNone;
TableSelectionModeZeroOrOne* = UIDll.TableSelectionModeZeroOrOne;
TableSelectionModeOne* = UIDll.TableSelectionModeOne;
TableSelectionModeZeroOrMany* = UIDll.TableSelectionModeZeroOrMany;
SortIndicatorNone* = UIDll.SortIndicatorNone;
SortIndicatorAscending* = UIDll.SortIndicatorAscending;
SortIndicatorDescending* = UIDll.SortIndicatorDescending;
Types
MouseEvent* = UIDll.AreaMouseEventPtr;
KeyEvent* = UIDll.AreaKeyEventPtr;
App* = POINTER TO AppDesc;
AppDesc* = RECORD opts- : UIDll.InitOptions END;
Control* = POINTER TO ControlDesc;
ControlDesc* = RECORD ptr- : UIDll.ADDRESS END;
Window* = POINTER TO WindowDesc;
WindowDesc* = RECORD(ControlDesc) END;
Button* = POINTER TO ButtonDesc;
ButtonDesc* = RECORD(ControlDesc) END;
Box* = POINTER TO BoxDesc;
BoxDesc* = RECORD(ControlDesc) END;
Checkbox* = POINTER TO CheckboxDesc;
CheckboxDesc* = RECORD(ControlDesc) END;
Entry* = POINTER TO EntryDesc;
EntryDesc* = RECORD(ControlDesc) END;
Label* = POINTER TO LabelDesc;
LabelDesc* = RECORD(ControlDesc) END;
Tab* = POINTER TO TabDesc;
TabDesc* = RECORD(ControlDesc) END;
Group* = POINTER TO GroupDesc;
GroupDesc* = RECORD(ControlDesc) END;
Spinbox* = POINTER TO SpinboxDesc;
SpinboxDesc* = RECORD(ControlDesc) END;
Slider* = POINTER TO SliderDesc;
SliderDesc* = RECORD(ControlDesc) END;
ProgressBar* = POINTER TO ProgressBarDesc;
ProgressBarDesc* = RECORD(ControlDesc) END;
Separator* = POINTER TO SeparatorDesc;
SeparatorDesc* = RECORD(ControlDesc) END;
Combobox* = POINTER TO ComboboxDesc;
ComboboxDesc* = RECORD(ControlDesc) END;
EditableCombobox* = POINTER TO EditableComboboxDesc;
EditableComboboxDesc* = RECORD(ControlDesc) END;
RadioButtons* = POINTER TO RadioButtonsDesc;
RadioButtonsDesc* = RECORD(ControlDesc) END;
DateTimePicker* = POINTER TO DateTimePickerDesc;
DateTimePickerDesc* = RECORD(ControlDesc) END;
MultilineEntry* = POINTER TO MultilineEntryDesc;
MultilineEntryDesc* = RECORD(ControlDesc) END;
MenuItem* = POINTER TO MenuItemDesc;
MenuItemDesc* = RECORD(ControlDesc) END;
Menu* = POINTER TO MenuDesc;
MenuDesc* = RECORD(ControlDesc) END;
DrawContext* = POINTER TO DrawContextDesc;
DrawContextDesc* = RECORD
ptr- : UIDll.ADDRESS;
AreaWidth* : LONGREAL;
AreaHeight* : LONGREAL;
ClipX* : LONGREAL;
ClipY* : LONGREAL;
ClipWidth* : LONGREAL;
ClipHeight* : LONGREAL;
END;
Area* = POINTER TO AreaDesc;
AreaDesc* = RECORD(ControlDesc)
ah : UIDll.AreaHandler;
END;
Path* = POINTER TO PathDesc;
PathDesc* = RECORD ptr- : UIDll.ADDRESS END;
Brush* = UIDll.DrawBrush;
Stroke* = UIDll.DrawStrokeParams;
Matrix* = RECORD m* : UIDll.DrawMatrix END;
ColorButton* = POINTER TO ColorButtonDesc;
ColorButtonDesc* = RECORD(ControlDesc) END;
Form* = POINTER TO FormDesc;
FormDesc* = RECORD(ControlDesc) END;
Grid* = POINTER TO GridDesc;
GridDesc* = RECORD(ControlDesc) END;
Image* = POINTER TO ImageDesc;
ImageDesc* = RECORD ptr- : UIDll.ADDRESS END;
TableValue* = POINTER TO TableValueDesc;
TableValueDesc* = RECORD ptr- : UIDll.ADDRESS END;
TableModel* = POINTER TO TableModelDesc;
TableModelDesc* = RECORD
ptr- : UIDll.ADDRESS;
mh : UIDll.TableModelHandler;
END;
Table* = POINTER TO TableDesc;
TableDesc* = RECORD (ControlDesc)
tp : UIDll.TableParams;
END;
Procedures
Quit
PROCEDURE Quit*();
OpenFile
File chooser dialog window to select a single file.
PROCEDURE OpenFile*(parent : Window): String.STRING;
OpenFolder
Folder chooser dialog window to select a single folder.
PROCEDURE OpenFolder*(parent : Window): String.STRING;
SaveFile
Save file dialog window.
PROCEDURE SaveFile*(parent : Window): String.STRING;
MsgBox
Message box dialog window.
PROCEDURE MsgBox*(parent : Window; title- : ARRAY OF CHAR; description- : ARRAY OF CHAR);
MsgBoxError
Message box dialog window.
PROCEDURE MsgBoxError*(parent : Window; title- : ARRAY OF CHAR; description- : ARRAY OF CHAR);
App.Main
Start main loop
PROCEDURE (this : App) Main*();
App.Destroy
Deallocate resources
PROCEDURE (this : App) Destroy*();
InitApp
Initialize App
PROCEDURE InitApp*(a : App);
Control.Destroy
Dispose Control and all allocated resources
PROCEDURE (this : Control) Destroy*();
Control.IsTopLevel
Returns TRUE if control is a top level control.
PROCEDURE (this : Control) IsTopLevel*(): BOOLEAN;
Control.IsVisible
Returns TRUE if control is visible
PROCEDURE (this : Control) IsVisible*(): BOOLEAN;
Control.Show
Shows the control
PROCEDURE (this : Control) Show*();
Control.Hide
Hides the control
PROCEDURE (this : Control) Hide*();
Control.IsEnabled
Returns TRUE if the control is enabled
PROCEDURE (this : Control) IsEnabled*(): BOOLEAN;
Control.Enable
Enable control
PROCEDURE (this : Control) Enable*();
Control.Disable
Disable control
PROCEDURE (this : Control) Disable*();
Window.Title
Returns Window title
PROCEDURE (this : Window) Title*(): String.STRING;
Window.SetTitle
Set Window title
PROCEDURE (this : Window) SetTitle*(title- : ARRAY OF CHAR);
Window.Position
Get Window position
PROCEDURE (this : Window) Position*(VAR x : LONGINT; VAR y : LONGINT);
Window.SetPosition
Set Window position
PROCEDURE (this : Window) SetPosition*(x, y : LONGINT);
Window.OnPositionChanged
On position change callback.
PROCEDURE (this : Window) OnPositionChanged*();
Window.ContentSize
Get Window content size
PROCEDURE (this : Window) ContentSize*(VAR width : LONGINT; VAR height : LONGINT);
Window.SetContentSize
Set Window content size
PROCEDURE (this : Window) SetContentSize*(width, height : LONGINT);
Window.IsFullScreen
Returns TRUE if the control is fullscreen
PROCEDURE (this : Window) IsFullScreen*(): BOOLEAN;
Window.SetFullscreen
Set Window fullscreen
PROCEDURE (this : Window) SetFullscreen*(fullscreen : BOOLEAN);
Window.OnContentSizeChanged
On content size change callback.
PROCEDURE (this : Window) OnContentSizeChanged*();
Window.OnClosing
On close callback.
PROCEDURE (this : Window) OnClosing*(): BOOLEAN;
Window.OnFocusChanged
On focus change callback.
PROCEDURE (this : Window) OnFocusChanged*();
Window.IsFocused
Returns TRUE if the control has focus
PROCEDURE (this : Window) IsFocused*(): BOOLEAN;
Window.IsBorderless
Returns TRUE if the control is borderless
PROCEDURE (this : Window) IsBorderless*(): BOOLEAN;
Window.SetBorderless
Set Window bordless flag
PROCEDURE (this : Window) SetBorderless*(borderless : BOOLEAN);
Window.SetChild
Set child control
PROCEDURE (this : Window) SetChild*(child : Control);
Window.IsMargined
Returns TRUE if the control is margined
PROCEDURE (this : Window) IsMargined*(): BOOLEAN;
Window.SetMargined
Set Window margined flag
PROCEDURE (this : Window) SetMargined*(margined : BOOLEAN);
Window.IsResizeable
Returns TRUE if the control is resizeable
PROCEDURE (this : Window) IsResizeable*(): BOOLEAN;
Window.SetResizeable
Set Window resizeable flag
PROCEDURE (this : Window) SetResizeable*(resizeable : BOOLEAN);
InitWindow
Initialize Window
PROCEDURE InitWindow*(w : Window; title- : ARRAY OF CHAR; width, height : LONGINT; hasMenubar : BOOLEAN);
Box.Append
Append control to Box. If stretchy is TRUE the Control expand to the remaining space. If multiple strechy Controls exists the space is equally shared.
PROCEDURE (this : Box) Append*(child : Control; stretchy : BOOLEAN);
Box.NumChildren
Returns the number of controls contained within the box.
PROCEDURE (this : Box) NumChildren*():LONGINT;
Box.Delete
Removes the Control at index
PROCEDURE (this : Box) Delete*(index : LONGINT);
Box.IsPadded
Returns TRUE if the Box is padded
PROCEDURE (this : Box) IsPadded*(): BOOLEAN;
Box.SetPadded
Set Box padded flag
PROCEDURE (this : Box) SetPadded*(padded : BOOLEAN);
InitVerticalBox
Initialize vertical Box
PROCEDURE InitVerticalBox*(b : Box);
InitHorizontalBox
Initialize horizontal Box
PROCEDURE InitHorizontalBox*(b : Box);
Checkbox.Text
Returns Checkbox text
PROCEDURE (this : Checkbox) Text*(): String.STRING;
Checkbox.SetText
Set Checkbox text
PROCEDURE (this : Checkbox) SetText*(text- : ARRAY OF CHAR);
Checkbox.OnToggled
Checkbox toggled callback
PROCEDURE (this : Checkbox) OnToggled*();
Checkbox.IsChecked
Returns TRUE if the Checkbox is checked
PROCEDURE (this : Checkbox) IsChecked*(): BOOLEAN;
Checkbox.SetChecked
Set Checkbox checked flag
PROCEDURE (this : Checkbox) SetChecked*(checked : BOOLEAN);
InitCheckbox
Initialize Checkbox
PROCEDURE InitCheckbox*(c : Checkbox; text- : ARRAY OF CHAR);
Entry.Text
Returns Entry text
PROCEDURE (this : Entry) Text*(): String.STRING;
Entry.SetText
Set Entry text
PROCEDURE (this : Entry) SetText*(text- : ARRAY OF CHAR);
Entry.OnChanged
Entry change callback
PROCEDURE (this : Entry) OnChanged*();
Entry.IsReadOnly
Returns TRUE if the Entry is readonly
PROCEDURE (this : Entry) IsReadOnly*(): BOOLEAN;
Entry.SetReadOnly
Set Entry readonly flag
PROCEDURE (this : Entry) SetReadOnly*(readonly : BOOLEAN);
InitEntry
Initialize Entry
PROCEDURE InitEntry*(e : Entry);
InitPasswordEntry
Initialize password Entry
PROCEDURE InitPasswordEntry*(e : Entry);
InitSearchEntry
Initialize search Entry
PROCEDURE InitSearchEntry*(e : Entry);
Label.Text
Returns Label text
PROCEDURE (this : Label) Text*(): String.STRING;
Label.SetText
Set Label text
PROCEDURE (this : Label) SetText*(text- : ARRAY OF CHAR);
InitLabel
Initialize Label
PROCEDURE InitLabel*(l : Label; text- : ARRAY OF CHAR);
Tab.Append
Appends a control in form of a page/tab with label.
PROCEDURE (this : Tab) Append*(name- : ARRAY OF CHAR; control : Control);
Tab.InsertAt
Inserts a control in form of a page/tab with label at index.
PROCEDURE (this : Tab) InsertAt*(name- : ARRAY OF CHAR; index : LONGINT; control : Control);
Tab.Delete
Removes the control at index.
PROCEDURE (this : Tab) Delete*(index : LONGINT);
Tab.NumPages
Returns the number of pages contained.
PROCEDURE (this : Tab) NumPages*(): LONGINT;
Tab.IsMargined
Returns whether or not the page/tab at index has a margin.
PROCEDURE (this : Tab) IsMargined*(index : LONGINT): BOOLEAN;
Tab.SetMargined
Sets whether or not the page/tab at index has a margin.
PROCEDURE (this : Tab) SetMargined*(index : LONGINT; margined : BOOLEAN);
InitTab
Initialize Tab
PROCEDURE InitTab*(t : Tab);
Group.Title
Returns Group title
PROCEDURE (this : Group) Title*(): String.STRING;
Label.SetTitle
Set Group title
PROCEDURE (this : Label) SetTitle*(title- : ARRAY OF CHAR);
Label.SetChild
Set child control
PROCEDURE (this : Label) SetChild*(control : Control);
Label.IsMargined
Returns TRUE if the control is margined
PROCEDURE (this : Label) IsMargined*(): BOOLEAN;
Label.SetMargined
Set Window margined flag
PROCEDURE (this : Label) SetMargined*(margined : BOOLEAN);
Spinbox.Value
Returns the Spinbox value.
PROCEDURE (this : Spinbox) Value*():LONGINT;
Spinbox.SetValue
Sets the spinbox value.
PROCEDURE (this : Spinbox) SetValue*(value : LONGINT);
Spinbox.OnChanged
Entry change callback
PROCEDURE (this : Spinbox) OnChanged*();
InitSpinbox
Initialize Spinbox
PROCEDURE InitSpinbox*(s : Spinbox; min, max : LONGINT);
Slider.Value
Returns the Slider value.
PROCEDURE (this : Slider) Value*():LONGINT;
Slider.SetValue
Sets the Slider value.
PROCEDURE (this : Slider) SetValue*(value : LONGINT);
Slider.HasToolTip
Returns whether or not the slider has a tool tip.
PROCEDURE (this : Slider) HasToolTip*(): BOOLEAN;
Slider.SetHasToolTip
Sets whether or not the slider has a tool tip.
PROCEDURE (this : Slider) SetHasToolTip*(hasToolTip : BOOLEAN);
Slider.OnChanged
Entry change callback
PROCEDURE (this : Slider) OnChanged*();
Slider.OnReleased
Callback for when the slider is released from dragging.
PROCEDURE (this : Slider) OnReleased*();
Slider.SetRange
Sets the slider range.
PROCEDURE (this : Slider) SetRange*(min, max : LONGINT);
InitSlider
Initialize Slider
PROCEDURE InitSlider*(s : Slider; min, max : LONGINT);
ProgressBar.Value
Returns the ProgressBar value.
PROCEDURE (this : ProgressBar) Value*():LONGINT;
ProgressBar.SetValue
Sets the ProgressBar value.
PROCEDURE (this : ProgressBar) SetValue*(value : LONGINT);
InitProgressBar
Initialize ProgressBar
PROCEDURE InitProgressBar*(p : ProgressBar);
InitHorizontalSeparator
Initialize horizontal separator.
PROCEDURE InitHorizontalSeparator*(s : Separator);
InitVerticalSeparator
Initialize vertical separator.
PROCEDURE InitVerticalSeparator*(s : Separator);
Combobox.Append
Appends an item to the combo box.
PROCEDURE (this : Combobox) Append*(text- : ARRAY OF CHAR);
Combobox.InsertAt
Inserts an item at index to the combo box.
PROCEDURE (this : Combobox) InsertAt*(index : LONGINT; text- : ARRAY OF CHAR);
Combobox.Delete
Deletes an item at index from the combo box.
PROCEDURE (this : Combobox) Delete*(index : LONGINT);
Combobox.Clear
Deletes all items from the combo box.
PROCEDURE (this : Combobox) Clear*;
Combobox.NumItems
Returns the number of items contained within the combo box.
PROCEDURE (this : Combobox) NumItems*():LONGINT;
Combobox.Selected
Returns the index of the item selected.
PROCEDURE (this : Combobox) Selected*():LONGINT;
Combobox.SetSelected
Sets the item selected.
PROCEDURE (this : Combobox) SetSelected*(index : LONGINT);
Combobox.OnSelected
Selected item callback
PROCEDURE (this : Combobox) OnSelected*();
InitCombobox
Initialize Combobox
PROCEDURE InitCombobox*(c : Combobox);
EditableCombobox.Append
Appends an item to the editable combo box.
PROCEDURE (this : EditableCombobox) Append*(text- : ARRAY OF CHAR);
EditableCombobox.Text
Returns the text of the editable combo box.
PROCEDURE (this : EditableCombobox) Text*(): String.STRING;
EditableCombobox.SetText
Sets the editable combo box text.
PROCEDURE (this : EditableCombobox) SetText*(text- : ARRAY OF CHAR);
EditableCombobox.OnChanged
Editable combo box change callback
PROCEDURE (this : EditableCombobox) OnChanged*();
InitEditableCombobox
Initialize Combobox
PROCEDURE InitEditableCombobox*(c : EditableCombobox);
DateTimePicker.Time
Returns date and time stored in the data time picker.
PROCEDURE (this : DateTimePicker) Time*():DateTime.DATETIME;
DateTimePicker.SetTime
Sets date and time of the data time picker.
PROCEDURE (this : DateTimePicker) SetTime*(time : DateTime.DATETIME);
DateTimePicker.OnChanged
DateTimePicker change callback
PROCEDURE (this : DateTimePicker) OnChanged*();
InitDatePicker
Initialize a new date picker.
PROCEDURE InitDatePicker*(d : DateTimePicker);
InitTimePicker
Initialize a new time picker.
PROCEDURE InitTimePicker*(d : DateTimePicker);
InitDateTimePicker
Initialize a new date picker.
PROCEDURE InitDateTimePicker*(d : DateTimePicker);
MultilineEntry.Text
Returns MultilineEntry text
PROCEDURE (this : MultilineEntry) Text*(): String.STRING;
MultilineEntry.SetText
Set MultilineEntry text
PROCEDURE (this : MultilineEntry) SetText*(text- : ARRAY OF CHAR);
MultilineEntry.Append
Append MultilineEntry text
PROCEDURE (this : MultilineEntry) Append*(text- : ARRAY OF CHAR);
MultilineEntry.OnChanged
MultilineEntry change callback
PROCEDURE (this : MultilineEntry) OnChanged*();
MultilineEntry.IsReadOnly
Returns TRUE if the MultilineEntry is readonly
PROCEDURE (this : MultilineEntry) IsReadOnly*(): BOOLEAN;
MultilineEntry.SetReadOnly
Set MultilineEntry readonly flag
PROCEDURE (this : MultilineEntry) SetReadOnly*(readonly : BOOLEAN);
InitMultilineEntry
Initialize a new MultilineEntry.
PROCEDURE InitMultilineEntry*(e : MultilineEntry);
InitNonWrappingMultilineEntry
Initialize a new non-wrapping MultilineEntry.
PROCEDURE InitNonWrappingMultilineEntry*(e : MultilineEntry);
Area.SetSize
–
PROCEDURE (this : Area) SetSize*(width : LONGINT; height : LONGINT);
Area.QueueRedrawAll
PROCEDURE (this : Area) QueueRedrawAll*();
Area.Draw
Draw callback
PROCEDURE (this : Area) Draw*(context : DrawContext);
Area.MouseEvent
MouseEvent callback
PROCEDURE (this : Area) MouseEvent*(event : MouseEvent);
Area.MouseCrossed
MouseCrossed callback
PROCEDURE (this : Area) MouseCrossed*(left : LONGINT);
Area.DragBroken
DragBroken callback
PROCEDURE (this : Area) DragBroken*();
Area.KeyEvent
MouseEvent callback
PROCEDURE (this : Area) KeyEvent*(event : KeyEvent) : LONGINT;
InitArea
Initialize Area
PROCEDURE InitArea*(a : Area);
InitScrollingArea
Initialize ScrollingArea
PROCEDURE InitScrollingArea*(a : Area; width : LONGINT; height : LONGINT);
Path.Destroy
Deallocate resources
PROCEDURE (this : Path) Destroy*();
Path.NewFigure
PROCEDURE (this : Path) NewFigure*(x : LONGREAL; y : LONGREAL);
Path.NewFigureWithArc
PROCEDURE (this : Path) NewFigureWithArc*(xCenter : LONGREAL; yCenter : LONGREAL; radius : LONGREAL; startAngle : LONGREAL; sweep : LONGREAL; negative : BOOLEAN);
Path.LineTo
PROCEDURE (this : Path) LineTo*(x : LONGREAL; y : LONGREAL);
Path.ArcTo
PROCEDURE (this : Path) ArcTo*(xCenter : LONGREAL; yCenter : LONGREAL; radius : LONGREAL; startAngle : LONGREAL; sweep : LONGREAL; negative : BOOLEAN);
Path.CloseFigure
PROCEDURE (this : Path) CloseFigure*();
Path.AddRectangle
PROCEDURE (this : Path) AddRectangle*(x : LONGREAL; y : LONGREAL; width : LONGREAL; height : LONGREAL);
Path.IsEnded
PROCEDURE (this : Path) IsEnded*() : BOOLEAN;
Path.End
PROCEDURE (this : Path) End*();
InitPath
Initialize Path
PROCEDURE InitPath*(dp : Path; fillMode := FillModeWinding : LONGINT);
InitSolidBrush
Initialize Solid Brush
PROCEDURE InitSolidBrush*(VAR brush : Brush; r, g, b : LONGREAL; a := 1.0 : LONGREAL);
InitStroke
Initialize Stroke
PROCEDURE InitStroke*(VAR stroke : Stroke; cap, join : LONGINT; thickness : LONGREAL);
Matrix.SetIdentity
–
PROCEDURE (VAR this : Matrix) SetIdentity*();
Matrix.Translate
PROCEDURE (VAR this : Matrix) Translate*(x, y : LONGREAL);
Matrix.Scale
PROCEDURE (VAR this : Matrix) Scale*(xCenter, yCenter, x, y : LONGREAL);
Matrix.Rotate
PROCEDURE (VAR this : Matrix) Rotate*(x, y, amount : LONGREAL);
Matrix.Skew
PROCEDURE (VAR this : Matrix) Skew*(x, y, xamount, yamount : LONGREAL);
Matrix.Multiply
PROCEDURE (VAR this : Matrix) Multiply*(VAR src : Matrix);
Matrix.IsInvertible
PROCEDURE (VAR this : Matrix) IsInvertible*() : BOOLEAN;
Matrix.Invert
PROCEDURE (VAR this : Matrix) Invert*() : BOOLEAN;
Matrix.TransformPoint
PROCEDURE (VAR this : Matrix) TransformPoint*(VAR x : LONGREAL; VAR y : LONGREAL);
Matrix.TransformSize
PROCEDURE (VAR this : Matrix) TransformSize*(VAR x : LONGREAL; VAR y : LONGREAL);
DrawContext.Save
–
PROCEDURE (this : DrawContext) Save*();
DrawContext.Restore
PROCEDURE (this : DrawContext) Restore*();
DrawContext.Transform
PROCEDURE (this : DrawContext) Transform *(matrix- : Matrix);
DrawContext.Clip
PROCEDURE (this : DrawContext) Clip*(path : Path);
DrawContext.Fill
PROCEDURE (this : DrawContext) Fill*(path : Path; VAR b : Brush);
DrawContext.Stroke
PROCEDURE (this : DrawContext) Stroke*(path : Path; VAR b : Brush; VAR s : Stroke);
Form.Append
Appends a control with a label to the form.
PROCEDURE (this : Form) Append*(name- : ARRAY OF CHAR; control : Control; stretchy : BOOLEAN);
Form.NumChildren
Returns the number of controls contained within the form.
PROCEDURE (this : Form) NumChildren*(): LONGINT;
Form.Delete
Removes the control at index from the form.
PROCEDURE (this : Form) Delete*(index : LONGINT);
Form.IsPadded
Returns whether or not controls within the form are padded.
PROCEDURE (this : Form) IsPadded*(): BOOLEAN;
Form.SetPadded
Sets whether or not controls within the box are padded.
PROCEDURE (this : Form) SetPadded*(padded : BOOLEAN);
InitForm
Initialize Form
PROCEDURE InitForm*(f : Form);
Grid.Append
Appends a control to the grid.
PROCEDURE (this : Grid) Append*(control : Control; left, top, xpan, yspan, hexpand, halign, vexpand, valign : LONGINT);
Grid.InsertAt
Inserts a control positioned in relation to another control within the grid.
PROCEDURE (this : Grid) InsertAt*(control, existing : Control; at, xpan, yspan, hexpand, halign, vexpand, valign : LONGINT);
Grid.IsPadded
Returns whether or not controls within the grid are padded.
PROCEDURE (this : Grid) IsPadded*(): BOOLEAN;
Grid.SetPadded
Sets whether or not controls within the grid are padded.
PROCEDURE (this : Grid) SetPadded*(padded : BOOLEAN);
InitGrid
Initialize Grid
PROCEDURE InitGrid*(g : Grid);
Image.Append
Appends a new image representation.
PROCEDURE (this : Image) Append*(pixels- : ARRAY OF SYSTEM.BYTE; pixelWidth, pixelHeight, byteStride : LONGINT);
Image.Destroy
Deallocate resources
PROCEDURE (this : Image) Destroy*();
InitImage
Initialize Image
PROCEDURE InitImage*(i : Image; width, height :LONGREAL);
TableValue.GetType
Gets the TableValue type.
PROCEDURE (this : TableValue) GetType*(): LONGINT;
TableValue.Text
Returns the string value.
PROCEDURE (this : TableValue) Text*(): String.STRING;
TableValue.Image
Returns the image value.
PROCEDURE (this : TableValue) Image*(): Image;
TableValue.Int
Returns the integer value.
PROCEDURE (this : TableValue) Int*(): LONGINT;
TableValue.Color
Returns the color value.
PROCEDURE (this : TableValue) Color*(VAR r : LONGREAL; VAR g : LONGREAL; VAR b : LONGREAL; VAR a : LONGREAL);
InitTableValueString
Creates a new table value to store a text string.
PROCEDURE InitTableValueString*(tv : TableValue; str- : ARRAY OF CHAR);
InitTableValueImage
Creates a new table value to store an image.
PROCEDURE InitTableValueImage*(tv : TableValue; img : Image);
InitTableValueInt
Creates a new table value to store an integer.
PROCEDURE InitTableValueInt*(tv : TableValue; i : LONGINT);
InitTableValueColor
Creates a new table value to store a color in.
PROCEDURE InitTableValueColor*(tv : TableValue; r, g, b, a : LONGREAL);
TableModel.Destroy
Frees the table model.
PROCEDURE (this : TableModel) Destroy*();
TableModel.RowInserted
Informs all associated uiTable views that a new row has been added.
PROCEDURE (this : TableModel) RowInserted*(newIndex : LONGINT);
TableModel.RowChanged
Informs all associated uiTable views that a row has been changed.
PROCEDURE (this : TableModel) RowChanged*(index : LONGINT);
TableModel.RowDeleted
Informs all associated uiTable views that a row has been deleted.
PROCEDURE (this : TableModel) RowDeleted*(oldIndex : LONGINT);
TableModel.NumColumns
Returns the number of columns
PROCEDURE (this : TableModel) NumColumns*(): LONGINT;
TableModel.TableValueType
Returns the column type
PROCEDURE (this : TableModel) TableValueType*(column : LONGINT): LONGINT;
TableModel.NumRows
Returns the number of columns
PROCEDURE (this : TableModel) NumRows*(): LONGINT;
TableModel.CellValue
Returns the cell value for (row, column).
PROCEDURE (this : TableModel) CellValue*(row, column : LONGINT): TableValue;
TableModel.SetCellValue
Sets the cell value for (row, column).
PROCEDURE (this : TableModel) SetCellValue*(row, column : LONGINT; value : TableValue);
InitTableModel
Initialize TableModel
PROCEDURE InitTableModel*(t : TableModel);
Table.AppendTextColumn
Appends a text column to the table.
PROCEDURE (this : Table) AppendTextColumn*(name : ARRAY OF CHAR; textModelColumn : LONGINT; textEditableModelColumn := TableModelColumnNeverEditable : LONGINT);
Table.AppendImageColumn
Appends an image column to the table.
PROCEDURE (this : Table) AppendImageColumn*(name : ARRAY OF CHAR; imageModelColumn : LONGINT);
Table.AppendImageTextColumn
Appends a column to the table that displays both an image and text.
PROCEDURE (this : Table) AppendImageTextColumn*(name : ARRAY OF CHAR; imageModelColumn : LONGINT; textModelColumn : LONGINT; textEditableModelColumn := TableModelColumnNeverEditable : LONGINT);
Table.AppendCheckboxColumn
Appends a column to the table containing a checkbox.
PROCEDURE (this : Table) AppendCheckboxColumn*(name : ARRAY OF CHAR; checkboxModelColumn : LONGINT; checkboxEditableModelColumn := TableModelColumnNeverEditable : LONGINT);
Table.AppendCheckboxTextColumn
Appends a column to the table containing a checkbox and text.
PROCEDURE (this : Table) AppendCheckboxTextColumn*(name : ARRAY OF CHAR; checkboxModelColumn : LONGINT; checkboxEditableModelColumn : LONGINT; textModelColumn : LONGINT; textEditableModelColumn : LONGINT);
Table.AppendProgressBarColumn
Appends a column to the table containing a progress bar.
PROCEDURE (this : Table) AppendProgressBarColumn*(name : ARRAY OF CHAR; progressModelColumn : LONGINT);
Table.IsHeaderVisible
Returns whether or not the table header is visible.
PROCEDURE (this : Table) IsHeaderVisible*(): BOOLEAN;
Table.SetHeaderVisible
Sets whether or not the table header is visible.
PROCEDURE (this : Table) SetHeaderVisible*(visible : BOOLEAN);
Table.HeaderSortIndicator
Returns the column’s sort indicator displayed in the table header.
PROCEDURE (this : Table) HeaderSortIndicator*(column : LONGINT) : LONGINT;
Table.HeaderSetSortIndicator
Sets the column’s sort indicator displayed in the table header.
PROCEDURE (this : Table) HeaderSetSortIndicator*(column : LONGINT; indicator : LONGINT);
Table.ColumnWidth
Returns the table column width.
PROCEDURE (this : Table) ColumnWidth*(column : LONGINT) : LONGINT;
Table.ColumnSetWidth
Sets the table column width.
PROCEDURE (this : Table) ColumnSetWidth*(column : LONGINT; width : LONGINT);
InitTable
Initialize Table
PROCEDURE InitTable*(t : Table ; tm : TableModel; RowBackgroundColorModelColumn := -1 : LONGINT);
Example
Draw Example
<* +MAIN *>
MODULE UIDrawExample;
IMPORT UI, String;
TYPE
MyArea* = POINTER TO MyAreaDesc;
MyAreaDesc* = RECORD(UI.AreaDesc)
Width : LONGREAL;
Height : LONGREAL;
END;
PROCEDURE (this : MyArea) Draw*(context : UI.DrawContext);
VAR
path : UI.Path;
brush : UI.Brush;
stroke : UI.Stroke;
matrix : UI.Matrix;
BEGIN
NEW(path); UI.InitPath(path, UI.FillModeWinding);
path.AddRectangle(0., 0., this.Width, this.Height);
path.End();
UI.InitSolidBrush(brush, 1.0, 0.0, 0.0);
UI.InitStroke(stroke, UI.LineCapFlat, UI.LineJoinMiter, 10.0);
matrix.SetIdentity();
matrix.Scale(0.0, 0.0, 0.5, 0.5);
context.Transform(matrix);
context.Fill(path, brush);
UI.InitSolidBrush(brush, 0.0, 0.0, 1.0);
context.Stroke(path, brush, stroke);
END Draw;
PROCEDURE (this : MyArea) MouseEvent*(event : UI.MouseEvent);
BEGIN
this.Width := event.AreaWidth;
this.Height := event.AreaHeight;
this.QueueRedrawAll();
END MouseEvent;
PROCEDURE Test();
VAR
a : UI.App; w : UI.Window;
area : MyArea;
s : String.STRING;
BEGIN
NEW(a); UI.InitApp(a);
NEW(area); UI.InitArea(area );
NEW(w); UI.InitWindow(w, "Hello World!", 300, 300, FALSE);
w.SetMargined(TRUE);
w.SetChild(area);
w.Show();
area.QueueRedrawAll();
a.Main();
END Test;
BEGIN
Test();
END UIDrawExample.
Table Example
<* +MAIN *>
MODULE UITableExample;
IMPORT UI, String;
TYPE
MyTableModel* = POINTER TO MyTableModelDesc;
MyTableModelDesc* = RECORD(UI.TableModelDesc) END;
PROCEDURE (this : MyTableModel) NumColumns*(): LONGINT;
BEGIN RETURN 10 END NumColumns;
PROCEDURE (this : MyTableModel) TableValueType*(column : LONGINT): LONGINT;
BEGIN RETURN UI.TableValueTypeString END TableValueType;
PROCEDURE (this : MyTableModel) NumRows*(): LONGINT;
BEGIN RETURN 10 END NumRows;
PROCEDURE (this : MyTableModel) CellValue*(row, column : LONGINT): UI.TableValue;
VAR
ret : UI.TableValue;
s : String.STRING;
BEGIN
NEW(ret);
String.Format(s, "%d,%d", row, column);
UI.InitTableValueString(ret, s^);
RETURN ret
END CellValue;
PROCEDURE Test();
VAR
a : UI.App; w : UI.Window;
t : UI.Table; model : MyTableModel;
s : String.STRING;
BEGIN
NEW(a); UI.InitApp(a);
NEW(w); UI.InitWindow(w, "Hello World!", 300, 30, FALSE);
NEW(model); UI.InitTableModel(model);
NEW(t); UI.InitTable(t, model);
t.AppendTextColumn("a", 0);
t.AppendTextColumn("b", 1);
w.SetChild(t);
w.Show();
a.Main();
END Test;
BEGIN
Test();
END UITableExample.