1232 lines
55 KiB
HTML
1232 lines
55 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Common Properties, Events, and Methods</title>
|
|
<style>
|
|
body { font-family: sans-serif; margin: 0; padding: 0; display: flex; }
|
|
nav { width: 250px; min-width: 250px; background: #f0f0f0; padding: 16px;
|
|
border-right: 1px solid #ccc; height: 100vh; overflow-y: auto;
|
|
position: sticky; top: 0; box-sizing: border-box; }
|
|
nav ul { list-style: none; padding-left: 16px; margin: 4px 0; }
|
|
nav > ul { padding-left: 0; }
|
|
nav a { text-decoration: none; color: #0066cc; }
|
|
nav a:hover { text-decoration: underline; }
|
|
main { flex: 1; padding: 24px 32px; max-width: 800px; }
|
|
h1 { border-bottom: 2px solid #333; padding-bottom: 4px; }
|
|
h2 { border-bottom: 1px solid #999; padding-bottom: 2px; margin-top: 32px; }
|
|
h3 { margin-top: 24px; }
|
|
pre { background: #f8f8f8; border: 1px solid #ddd; padding: 8px;
|
|
overflow-x: auto; font-size: 14px; }
|
|
blockquote { background: #fffde7; border-left: 4px solid #ffc107;
|
|
padding: 8px 12px; margin: 12px 0; }
|
|
hr { border: none; border-top: 1px solid #ccc; margin: 24px 0; }
|
|
img { max-width: 100%; }
|
|
.topic { margin-bottom: 48px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav>
|
|
<h3>Contents</h3>
|
|
<ul>
|
|
<li><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></li>
|
|
<li><a href="#ctrl.form">Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.form">Form</a></li>
|
|
<li><a href="#ctrl.button">CommandButton</a></li>
|
|
<li><a href="#ctrl.label">Label</a></li>
|
|
<li><a href="#ctrl.textbox">TextBox</a></li>
|
|
<li><a href="#ctrl.textarea">TextArea</a></li>
|
|
<li><a href="#ctrl.checkbox">CheckBox</a></li>
|
|
<li><a href="#ctrl.optionbutton">OptionButton</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.frame">Container Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.frame">Frame</a></li>
|
|
<li><a href="#ctrl.vbox">VBox</a></li>
|
|
<li><a href="#ctrl.hbox">HBox</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.listbox">List and Selection Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.listbox">ListBox</a></li>
|
|
<li><a href="#ctrl.combobox">ComboBox</a></li>
|
|
<li><a href="#ctrl.dropdown">DropDown</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.hscrollbar">Value Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.hscrollbar">HScrollBar</a></li>
|
|
<li><a href="#ctrl.spinbutton">SpinButton</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.timer">Non-Visual Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.timer">Timer</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.picturebox">Graphics Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.picturebox">PictureBox</a></li>
|
|
<li><a href="#ctrl.image">Image</a></li>
|
|
<li><a href="#ctrl.imagebutton">ImageButton</a></li>
|
|
<li><a href="#ctrl.progressbar">ProgressBar</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.listview">Data Display Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.listview">ListView</a></li>
|
|
<li><a href="#ctrl.treeview">TreeView</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.tabstrip">Tabbed and Split Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.tabstrip">TabStrip</a></li>
|
|
<li><a href="#ctrl.splitter">Splitter</a></li>
|
|
<li><a href="#ctrl.scrollpane">ScrollPane</a></li>
|
|
<li><a href="#ctrl.wrapbox">WrapBox</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.line">Decorative Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.line">Line</a></li>
|
|
<li><a href="#ctrl.spacer">Spacer</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.toolbar">Bar Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.toolbar">Toolbar</a></li>
|
|
<li><a href="#ctrl.statusbar">StatusBar</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.terminal">Special Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.terminal">Terminal</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.data">Data Controls</a>
|
|
<ul>
|
|
<li><a href="#ctrl.data">Data</a></li>
|
|
<li><a href="#ctrl.dbgrid">DBGrid</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#ctrl.databinding">Data Binding</a></li>
|
|
<li><a href="#ctrl.menus">Menu System</a></li>
|
|
<li><a href="#ctrl.arrays">Control Arrays</a></li>
|
|
<li><a href="#ctrl.frm">FRM File Format</a></li>
|
|
</ul>
|
|
<h3>Index</h3>
|
|
<ul>
|
|
<li><a href="#ctrl.common.props">Common Properties</a></li>
|
|
<li><a href="#ctrl.common.props">Common Events</a></li>
|
|
<li><a href="#ctrl.common.props">Common Methods</a></li>
|
|
<li><a href="#ctrl.common.props">Properties</a></li>
|
|
<li><a href="#ctrl.common.props">Events</a></li>
|
|
<li><a href="#ctrl.common.props">Methods</a></li>
|
|
<li><a href="#ctrl.form">Form</a></li>
|
|
<li><a href="#ctrl.form">Window</a></li>
|
|
<li><a href="#ctrl.form">Caption</a></li>
|
|
<li><a href="#ctrl.form">AutoSize</a></li>
|
|
<li><a href="#ctrl.form">Resizable</a></li>
|
|
<li><a href="#ctrl.form">Load</a></li>
|
|
<li><a href="#ctrl.form">Unload</a></li>
|
|
<li><a href="#ctrl.form">Show</a></li>
|
|
<li><a href="#ctrl.form">Hide</a></li>
|
|
<li><a href="#ctrl.button">CommandButton</a></li>
|
|
<li><a href="#ctrl.button">Button</a></li>
|
|
<li><a href="#ctrl.button">Click</a></li>
|
|
<li><a href="#ctrl.label">Label</a></li>
|
|
<li><a href="#ctrl.label">Caption</a></li>
|
|
<li><a href="#ctrl.label">Alignment</a></li>
|
|
<li><a href="#ctrl.textbox">TextBox</a></li>
|
|
<li><a href="#ctrl.textbox">Text</a></li>
|
|
<li><a href="#ctrl.textbox">DataSource</a></li>
|
|
<li><a href="#ctrl.textbox">DataField</a></li>
|
|
<li><a href="#ctrl.textarea">TextArea</a></li>
|
|
<li><a href="#ctrl.checkbox">CheckBox</a></li>
|
|
<li><a href="#ctrl.checkbox">Value</a></li>
|
|
<li><a href="#ctrl.optionbutton">OptionButton</a></li>
|
|
<li><a href="#ctrl.optionbutton">Radio Button</a></li>
|
|
<li><a href="#ctrl.optionbutton">SetSelected</a></li>
|
|
<li><a href="#ctrl.frame">Frame</a></li>
|
|
<li><a href="#ctrl.frame">Container</a></li>
|
|
<li><a href="#ctrl.vbox">VBox</a></li>
|
|
<li><a href="#ctrl.vbox">Vertical Layout</a></li>
|
|
<li><a href="#ctrl.hbox">HBox</a></li>
|
|
<li><a href="#ctrl.hbox">Horizontal Layout</a></li>
|
|
<li><a href="#ctrl.listbox">ListBox</a></li>
|
|
<li><a href="#ctrl.listbox">ListIndex</a></li>
|
|
<li><a href="#ctrl.listbox">ListCount</a></li>
|
|
<li><a href="#ctrl.listbox">AddItem</a></li>
|
|
<li><a href="#ctrl.listbox">RemoveItem</a></li>
|
|
<li><a href="#ctrl.combobox">ComboBox</a></li>
|
|
<li><a href="#ctrl.dropdown">DropDown</a></li>
|
|
<li><a href="#ctrl.hscrollbar">HScrollBar</a></li>
|
|
<li><a href="#ctrl.hscrollbar">Slider</a></li>
|
|
<li><a href="#ctrl.spinbutton">SpinButton</a></li>
|
|
<li><a href="#ctrl.spinbutton">Spinner</a></li>
|
|
<li><a href="#ctrl.spinbutton">SetRange</a></li>
|
|
<li><a href="#ctrl.spinbutton">SetStep</a></li>
|
|
<li><a href="#ctrl.spinbutton">RealMode</a></li>
|
|
<li><a href="#ctrl.spinbutton">Decimals</a></li>
|
|
<li><a href="#ctrl.timer">Timer</a></li>
|
|
<li><a href="#ctrl.timer">Interval</a></li>
|
|
<li><a href="#ctrl.timer">Start</a></li>
|
|
<li><a href="#ctrl.timer">Stop</a></li>
|
|
<li><a href="#ctrl.picturebox">PictureBox</a></li>
|
|
<li><a href="#ctrl.picturebox">Canvas</a></li>
|
|
<li><a href="#ctrl.picturebox">Drawing</a></li>
|
|
<li><a href="#ctrl.image">Image</a></li>
|
|
<li><a href="#ctrl.image">Picture</a></li>
|
|
<li><a href="#ctrl.image">BMP</a></li>
|
|
<li><a href="#ctrl.imagebutton">ImageButton</a></li>
|
|
<li><a href="#ctrl.progressbar">ProgressBar</a></li>
|
|
<li><a href="#ctrl.listview">ListView</a></li>
|
|
<li><a href="#ctrl.listview">Multi-Column List</a></li>
|
|
<li><a href="#ctrl.treeview">TreeView</a></li>
|
|
<li><a href="#ctrl.tabstrip">TabStrip</a></li>
|
|
<li><a href="#ctrl.tabstrip">TabControl</a></li>
|
|
<li><a href="#ctrl.tabstrip">SetActive</a></li>
|
|
<li><a href="#ctrl.splitter">Splitter</a></li>
|
|
<li><a href="#ctrl.splitter">Split Pane</a></li>
|
|
<li><a href="#ctrl.scrollpane">ScrollPane</a></li>
|
|
<li><a href="#ctrl.scrollpane">Scrollable Container</a></li>
|
|
<li><a href="#ctrl.wrapbox">WrapBox</a></li>
|
|
<li><a href="#ctrl.wrapbox">Flow Layout</a></li>
|
|
<li><a href="#ctrl.line">Line</a></li>
|
|
<li><a href="#ctrl.line">Separator</a></li>
|
|
<li><a href="#ctrl.spacer">Spacer</a></li>
|
|
<li><a href="#ctrl.toolbar">Toolbar</a></li>
|
|
<li><a href="#ctrl.statusbar">StatusBar</a></li>
|
|
<li><a href="#ctrl.terminal">Terminal</a></li>
|
|
<li><a href="#ctrl.terminal">ANSI Terminal</a></li>
|
|
<li><a href="#ctrl.terminal">VT100</a></li>
|
|
<li><a href="#ctrl.data">Data</a></li>
|
|
<li><a href="#ctrl.data">Database</a></li>
|
|
<li><a href="#ctrl.data">SQLite</a></li>
|
|
<li><a href="#ctrl.data">DatabaseName</a></li>
|
|
<li><a href="#ctrl.data">RecordSource</a></li>
|
|
<li><a href="#ctrl.data">MoveFirst</a></li>
|
|
<li><a href="#ctrl.data">MoveNext</a></li>
|
|
<li><a href="#ctrl.data">AddNew</a></li>
|
|
<li><a href="#ctrl.data">Reposition</a></li>
|
|
<li><a href="#ctrl.data">Validate</a></li>
|
|
<li><a href="#ctrl.dbgrid">DBGrid</a></li>
|
|
<li><a href="#ctrl.dbgrid">Data-Bound Grid</a></li>
|
|
<li><a href="#ctrl.databinding">Data Binding</a></li>
|
|
<li><a href="#ctrl.databinding">DataSource</a></li>
|
|
<li><a href="#ctrl.databinding">DataField</a></li>
|
|
<li><a href="#ctrl.databinding">Master-Detail</a></li>
|
|
<li><a href="#ctrl.menus">Menu</a></li>
|
|
<li><a href="#ctrl.menus">Menu Bar</a></li>
|
|
<li><a href="#ctrl.menus">Submenu</a></li>
|
|
<li><a href="#ctrl.menus">Separator</a></li>
|
|
<li><a href="#ctrl.arrays">Control Arrays</a></li>
|
|
<li><a href="#ctrl.arrays">Index Property</a></li>
|
|
<li><a href="#ctrl.frm">FRM</a></li>
|
|
<li><a href="#ctrl.frm">.frm</a></li>
|
|
<li><a href="#ctrl.frm">Form File</a></li>
|
|
</ul>
|
|
</nav>
|
|
<main>
|
|
<div class="topic" id="ctrl.common.props">
|
|
<h1>Common Properties, Events, and Methods</h1>
|
|
<h2>Common Properties, Events, and Methods</h2>
|
|
<p>Every control in DVX BASIC inherits a set of common properties, events, and
|
|
methods. These are handled by the form runtime before dispatching to
|
|
widget-specific interface descriptors.</p>
|
|
<h3>Common Properties</h3>
|
|
<pre> Property Type R/W Description
|
|
---------- ------- --- -------------------------------------------
|
|
Name String R The control's name (e.g. "Command1"). Read-only at runtime.
|
|
Left Integer R/W X position in pixels relative to the parent container.
|
|
Top Integer R/W Y position in pixels relative to the parent container.
|
|
Width Integer R/W Current width in pixels. Setting this changes the minimum width constraint.
|
|
Height Integer R/W Current height in pixels. Setting this changes the minimum height constraint.
|
|
MinWidth Integer R/W Minimum width for layout. Alias for Width in the setter.
|
|
MinHeight Integer R/W Minimum height for layout. Alias for Height in the setter.
|
|
MaxWidth Integer R/W Maximum width cap (0 = no limit, stretch to fill).
|
|
MaxHeight Integer R/W Maximum height cap (0 = no limit, stretch to fill).
|
|
Weight Integer R/W Layout weight. 0 = fixed size, >0 = share extra space proportionally.
|
|
Visible Boolean R/W Whether the control is visible.
|
|
Enabled Boolean R/W Whether the control accepts user input.
|
|
BackColor Long R/W Background color as a 32-bit ARGB value.
|
|
ForeColor Long R/W Foreground (text) color as a 32-bit ARGB value.
|
|
TabIndex Integer R Accepted for VB compatibility but ignored. DVX has no tab order.</pre>
|
|
<h3>Common Events</h3>
|
|
<p>These events are wired on every control loaded from a .frm file. Controls
|
|
created dynamically at runtime via code only receive Click, DblClick,
|
|
Change, GotFocus, and LostFocus; the keyboard, mouse, and scroll events
|
|
below require the control to be defined in the .frm file.</p>
|
|
<pre> Event Parameters Description
|
|
--------- ------------------------------------------- -------------------------------------------
|
|
Click (none) Fires when the control is clicked.
|
|
DblClick (none) Fires when the control is double-clicked.
|
|
Change (none) Fires when the control's value or text changes.
|
|
GotFocus (none) Fires when the control receives keyboard focus.
|
|
LostFocus (none) Fires when the control loses keyboard focus.
|
|
KeyPress KeyAscii As Integer Fires when a printable key is pressed. KeyAscii is the ASCII code.
|
|
KeyDown KeyCode As Integer, Shift As Integer Fires when any key is pressed down. KeyCode is the scan code; Shift indicates modifier keys.
|
|
KeyUp KeyCode As Integer, Shift As Integer Fires when a key is released.
|
|
MouseDown Button As Integer, X As Integer, Y As Integer Fires when a mouse button is pressed over the control.
|
|
MouseUp Button As Integer, X As Integer, Y As Integer Fires when a mouse button is released over the control.
|
|
MouseMove Button As Integer, X As Integer, Y As Integer Fires when the mouse moves over the control.
|
|
Scroll Delta As Integer Fires when the control is scrolled (mouse wheel or scrollbar).</pre>
|
|
<h3>Common Methods</h3>
|
|
<pre> Method Parameters Description
|
|
-------- ---------- -------------------------------------------
|
|
SetFocus (none) Gives keyboard focus to this control.
|
|
Refresh (none) Forces the control to repaint.</pre>
|
|
<p><a href="#ctrl.form">Form</a></p>
|
|
<p><a href="#ctrl.databinding">Data Binding</a></p>
|
|
<p><a href="#ctrl.frm">FRM File Format</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.form">
|
|
<h1>Form</h1>
|
|
<h2>Form</h2>
|
|
<p>VB Equivalent: Form -- DVX Widget: Window + VBox/HBox root</p>
|
|
<p>The Form is the top-level container representing a DVX window. It is
|
|
declared in the .frm file with Begin Form FormName. All controls are
|
|
children of the form's content box, which uses either VBox (default) or HBox
|
|
layout.</p>
|
|
<h3>Form Properties</h3>
|
|
<pre> Property Type Default Description
|
|
---------- ------- -------------- -------------------------------------------
|
|
Name String "Form1" The form's name, used for event dispatch and Load statement.
|
|
Caption String (same as Name) Window title bar text.
|
|
Width Integer 400 Window width in pixels. Setting this disables AutoSize.
|
|
Height Integer 300 Window height in pixels. Setting this disables AutoSize.
|
|
Left Integer 0 Initial X position. Used when Centered is False.
|
|
Top Integer 0 Initial Y position. Used when Centered is False.
|
|
Layout String "VBox" Content box layout: "VBox" (vertical) or "HBox" (horizontal).
|
|
AutoSize Boolean True When True, the window shrink-wraps to fit its content.
|
|
Resizable Boolean True Whether the user can resize the window at runtime.
|
|
Centered Boolean True When True, the window is centered on screen. When False, Left/Top are used.</pre>
|
|
<h3>Form Events</h3>
|
|
<pre> Event Parameters Description
|
|
----------- --------------------- -------------------------------------------
|
|
Load (none) Fires after the form and all controls are created. This is the default event.
|
|
Unload (none) Fires when the form is being closed or unloaded.
|
|
QueryUnload Cancel As Integer Fires before Unload. Set Cancel = 1 to abort the close.
|
|
Resize (none) Fires when the window is resized by the user.
|
|
Activate (none) Fires when the window gains focus.
|
|
Deactivate (none) Fires when the window loses focus.</pre>
|
|
<h3>Form Methods</h3>
|
|
<pre> Statement Description
|
|
------------------ -------------------------------------------
|
|
Load FormName Load the form (creates the window and controls, fires Load event).
|
|
Unload FormName Unload the form (fires Unload, destroys window).
|
|
FormName.Show Make the form visible.
|
|
FormName.Show 1 Show as modal dialog (blocks until closed).
|
|
FormName.Hide Hide the form without unloading it.</pre>
|
|
<h3>Example</h3>
|
|
<pre><code>Sub Form_Load ()
|
|
Form1.Caption = "Hello World"
|
|
Print "Form loaded!"
|
|
End Sub
|
|
|
|
Sub Form_QueryUnload (Cancel As Integer)
|
|
If MsgBox("Really quit?", 4) <> 6 Then
|
|
Cancel = 1
|
|
End If
|
|
End Sub
|
|
|
|
Sub Form_Resize ()
|
|
Print "Window resized"
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.frm">FRM File Format</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.button">
|
|
<h1>CommandButton</h1>
|
|
<h2>CommandButton</h2>
|
|
<p>VB Equivalent: CommandButton -- DVX Widget: button | Name Prefix: Command</p>
|
|
<p>A push button that triggers an action when clicked. Created with
|
|
wgtButton(parent, text).</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------ -------------------------------------------
|
|
Caption String The text displayed on the button. Use & for accelerator keys (e.g. "&OK").</pre>
|
|
<p>No additional type-specific properties beyond common properties and Caption.</p>
|
|
<p>Default Event: Click</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin Form Form1
|
|
Caption = "Button Demo"
|
|
Begin CommandButton Command1
|
|
Caption = "&Click Me!"
|
|
End
|
|
End
|
|
|
|
Sub Command1_Click ()
|
|
MsgBox "Button was clicked!"
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.label">
|
|
<h1>Label</h1>
|
|
<h2>Label</h2>
|
|
<p>VB Equivalent: Label -- DVX Widget: label</p>
|
|
<p>A static text label. Supports left, center, and right alignment.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ---- -------------------------------------------
|
|
Caption String The text displayed by the label.
|
|
Alignment Enum Text alignment: Left (default), Center, or Right.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin Label Label1
|
|
Caption = "Hello, World!"
|
|
Alignment = "Center"
|
|
End</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.textbox">
|
|
<h1>TextBox</h1>
|
|
<h2>TextBox</h2>
|
|
<p>VB Equivalent: TextBox -- DVX Widget: textbox (single-line text input, max
|
|
256 chars)</p>
|
|
<p>A single-line text input field. Supports data binding via DataSource and
|
|
DataField properties.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
---------- ------ -------------------------------------------
|
|
Text String The text content of the input field.
|
|
DataSource String Name of a Data control for data binding.
|
|
DataField String Column name for data binding.</pre>
|
|
<p>Default Event: Change</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin TextBox Text1
|
|
Text = "Enter text here"
|
|
End
|
|
|
|
Sub Text1_Change ()
|
|
Label1.Caption = "You typed: " & Text1.Text
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.databinding">Data Binding</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.textarea">
|
|
<h1>TextArea</h1>
|
|
<h2>TextArea</h2>
|
|
<p>VB Equivalent: TextArea (DVX extension) -- DVX Widget: textarea (multi-line
|
|
text input, max 4096 chars)</p>
|
|
<p>A multi-line text editing area. This is a DVX extension with no direct VB3
|
|
equivalent (VB uses a TextBox with MultiLine=True). Supports syntax
|
|
colorization, line numbers, auto-indent, and find/replace via the C API.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------ -------------------------------------------
|
|
Text String The full text content.</pre>
|
|
<p>Default Event: Change</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.checkbox">
|
|
<h1>CheckBox</h1>
|
|
<h2>CheckBox</h2>
|
|
<p>VB Equivalent: CheckBox -- DVX Widget: checkbox</p>
|
|
<p>A toggle control with a label. Checked state is exposed as a Boolean.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Caption String The text displayed next to the checkbox.
|
|
Value Boolean True if checked, False if unchecked.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin CheckBox Check1
|
|
Caption = "Enable feature"
|
|
End
|
|
|
|
Sub Check1_Click ()
|
|
If Check1.Value Then
|
|
Label1.Caption = "Feature ON"
|
|
Else
|
|
Label1.Caption = "Feature OFF"
|
|
End If
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.optionbutton">
|
|
<h1>OptionButton</h1>
|
|
<h2>OptionButton</h2>
|
|
<p>VB Equivalent: OptionButton -- DVX Widget: radio (radio group + radio
|
|
button) | Name Prefix: Option</p>
|
|
<p>A radio button for mutually exclusive choices. DVX uses a radio group
|
|
container; individual OptionButtons are children of the group. The Value
|
|
property returns the button's index within its group.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Caption String The text displayed next to the radio button.
|
|
Value Integer The index of this radio button within its group (read-only).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
----------- ----------------- -------------------------------------------
|
|
SetSelected Index As Integer Select the radio button at the given index within the group.</pre>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.frame">
|
|
<h1>Frame</h1>
|
|
<h2>Frame</h2>
|
|
<p>VB Equivalent: Frame -- DVX Widget: frame (titled VBox container)</p>
|
|
<p>A container with a titled border. Child controls are placed inside the frame
|
|
using VBox layout. In the .frm file, nest Begin/End blocks inside the Frame
|
|
block.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------ -------------------------------------------
|
|
Caption String The title displayed in the frame border.</pre>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin Frame Frame1
|
|
Caption = "Options"
|
|
Begin CheckBox Check1
|
|
Caption = "Option A"
|
|
End
|
|
Begin CheckBox Check2
|
|
Caption = "Option B"
|
|
End
|
|
End</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.vbox">
|
|
<h1>VBox</h1>
|
|
<h2>VBox</h2>
|
|
<p>DVX Extension -- DVX Widget: vbox (vertical layout container)</p>
|
|
<p>A container that arranges its children vertically, top to bottom. No title
|
|
or border. Use Weight on children to distribute extra space.</p>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<p>No type-specific properties.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.hbox">HBox</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.hbox">
|
|
<h1>HBox</h1>
|
|
<h2>HBox</h2>
|
|
<p>DVX Extension -- DVX Widget: hbox (horizontal layout container)</p>
|
|
<p>A container that arranges its children horizontally, left to right. Use
|
|
Weight on children to distribute extra space.</p>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<p>No type-specific properties.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.vbox">VBox</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.listbox">
|
|
<h1>ListBox</h1>
|
|
<h2>ListBox</h2>
|
|
<p>VB Equivalent: ListBox -- DVX Widget: listbox</p>
|
|
<p>A scrollable list of selectable items. Items are managed via methods
|
|
(AddItem, RemoveItem, Clear). Supports single and multi-select modes.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
ListIndex Integer Index of the currently selected item (-1 = no selection).
|
|
ListCount Integer Number of items in the list (read-only).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
--------------- --------------------------------------- -------------------------------------------
|
|
AddItem Text As String Add an item to the end of the list.
|
|
RemoveItem Index As Integer Remove the item at the given index.
|
|
Clear (none) Remove all items from the list.
|
|
List Index As Integer Return the text of the item at the given index.
|
|
SelectAll (none) Select all items (multi-select mode).
|
|
ClearSelection (none) Deselect all items.
|
|
SetMultiSelect Multi As Boolean Enable or disable multi-select mode.
|
|
SetReorderable Reorderable As Boolean Enable or disable drag-to-reorder.
|
|
IsItemSelected Index As Integer Returns True if the item at Index is selected.
|
|
SetItemSelected Index As Integer, Selected As Boolean Select or deselect a specific item.</pre>
|
|
<p>Default Event: Click</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Sub Form_Load ()
|
|
List1.AddItem "Apple"
|
|
List1.AddItem "Banana"
|
|
List1.AddItem "Cherry"
|
|
End Sub
|
|
|
|
Sub List1_Click ()
|
|
Dim idx As Integer
|
|
idx = List1.ListIndex
|
|
If idx >= 0 Then
|
|
Label1.Caption = "Selected: " & List1.List(idx)
|
|
End If
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.combobox">ComboBox</a></p>
|
|
<p><a href="#ctrl.dropdown">DropDown</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.combobox">
|
|
<h1>ComboBox</h1>
|
|
<h2>ComboBox</h2>
|
|
<p>VB Equivalent: ComboBox -- DVX Widget: combobox (editable text field +
|
|
drop-down list, max 256 chars)</p>
|
|
<p>A combination of a text input and a drop-down list. The user can type text
|
|
or select from the list. Supports the same AddItem/RemoveItem/Clear/List
|
|
methods as ListBox.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
Text String The text in the editable field.
|
|
ListIndex Integer Index of the currently selected list item (-1 = none).
|
|
ListCount Integer Number of items in the drop-down list (read-only).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<p>Same as .link ctrl.listbox ListBox : AddItem, RemoveItem, Clear, List.</p>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.dropdown">
|
|
<h1>DropDown</h1>
|
|
<h2>DropDown</h2>
|
|
<p>DVX Extension -- DVX Widget: dropdown (non-editable drop-down list)</p>
|
|
<p>A read-only drop-down list. Unlike ComboBox, the user cannot type free text;
|
|
they can only select from the provided items. Supports
|
|
AddItem/RemoveItem/Clear/List.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
ListIndex Integer Index of the currently selected item.
|
|
ListCount Integer Number of items (read-only).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<p>Same as .link ctrl.listbox ListBox : AddItem, RemoveItem, Clear, List.</p>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.hscrollbar">
|
|
<h1>HScrollBar</h1>
|
|
<h2>HScrollBar</h2>
|
|
<p>VB Equivalent: HScrollBar -- DVX Widget: slider | Name Prefix: HScroll</p>
|
|
<p>A horizontal slider/scrollbar control. The value ranges between a minimum
|
|
and maximum set at creation time (default 0 to 100).</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Value Integer The current slider position (clamped to min/max range).</pre>
|
|
<p>Default Event: Change</p>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin HScrollBar HScroll1
|
|
MinWidth = 200
|
|
End
|
|
|
|
Sub HScroll1_Change ()
|
|
Label1.Caption = "Value: " & Str$(HScroll1.Value)
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.spinbutton">
|
|
<h1>SpinButton</h1>
|
|
<h2>SpinButton</h2>
|
|
<p>DVX Extension -- DVX Widget: spinner | Name Prefix: Spin</p>
|
|
<p>A numeric input with up/down buttons. Supports integer mode (default) and
|
|
real-number mode with configurable decimal places.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Value Integer Current integer value (in integer mode).
|
|
RealMode Boolean True to use floating-point mode; False for integer mode.
|
|
Decimals Integer Number of decimal places shown in real mode.</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
-------- ------------------------------ -------------------------------------------
|
|
SetRange Min As Integer, Max As Integer Set the allowed value range.
|
|
SetStep Step As Integer Set the increment per button click.</pre>
|
|
<p>Default Event: Change</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.timer">
|
|
<h1>Timer</h1>
|
|
<h2>Timer</h2>
|
|
<p>VB Equivalent: Timer -- DVX Widget: timer (non-visual)</p>
|
|
<p>A non-visual control that fires its event at a regular interval. The Timer
|
|
widget is invisible at runtime -- it has no on-screen representation.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Enabled Boolean True to start the timer, False to stop it.
|
|
Interval Integer Timer interval in milliseconds (write-only from BASIC).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
------ ---------- -------------------------------------------
|
|
Start (none) Start the timer.
|
|
Stop (none) Stop the timer.</pre>
|
|
<h3>Type-Specific Events</h3>
|
|
<pre> Event Parameters Description
|
|
----- ---------- -------------------------------------------
|
|
Timer (none) Fires each time the interval elapses. This is the default event.</pre>
|
|
<blockquote><strong>Note:</strong> The Timer control fires the Timer event instead of Change. The onChange
|
|
callback on the underlying widget is remapped automatically.</blockquote>
|
|
<h3>Example</h3>
|
|
<pre><code>Begin Timer Timer1
|
|
Interval = 1000
|
|
Enabled = True
|
|
End
|
|
|
|
Dim counter As Integer
|
|
|
|
Sub Timer1_Timer ()
|
|
counter = counter + 1
|
|
Label1.Caption = "Ticks: " & Str$(counter)
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.picturebox">
|
|
<h1>PictureBox</h1>
|
|
<h2>PictureBox</h2>
|
|
<p>VB Equivalent: PictureBox -- DVX Widget: canvas | Name Prefix: Picture</p>
|
|
<p>A drawing surface (canvas). Supports drawing lines, rectangles, circles,
|
|
text, and individual pixels. Can save and load BMP images. The default
|
|
canvas size is 64x64 pixels.</p>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
------ ---------------- -------------------------------------------
|
|
Clear Color As Integer Fill the entire canvas with the specified color.</pre>
|
|
<p>Additional drawing methods (DrawLine, DrawRect, FillRect, FillCircle,
|
|
SetPixel, GetPixel, DrawText, Save, Load) are available through the C API
|
|
but not currently exposed through BASIC interface descriptors.</p>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.image">
|
|
<h1>Image</h1>
|
|
<h2>Image</h2>
|
|
<p>VB Equivalent: Image -- DVX Widget: image</p>
|
|
<p>A static image display control. Loads BMP images from file. Cannot be placed
|
|
via the designer toolbox (requires pixel data at creation time); typically
|
|
created in code or loaded via the Picture property.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
----------- ------- -------------------------------------------
|
|
Picture String Path to a BMP file to load (write-only).
|
|
ImageWidth Integer Width of the loaded image in pixels (read-only).
|
|
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.imagebutton">
|
|
<h1>ImageButton</h1>
|
|
<h2>ImageButton</h2>
|
|
<p>DVX Extension -- DVX Widget: imagebutton</p>
|
|
<p>A button that displays an image instead of text. Like Image, it requires
|
|
pixel data at creation time and is typically loaded via the Picture
|
|
property.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
----------- ------- -------------------------------------------
|
|
Picture String Path to a BMP file to load (write-only).
|
|
ImageWidth Integer Width of the loaded image in pixels (read-only).
|
|
ImageHeight Integer Height of the loaded image in pixels (read-only).</pre>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.progressbar">
|
|
<h1>ProgressBar</h1>
|
|
<h2>ProgressBar</h2>
|
|
<p>VB Equivalent: ProgressBar -- DVX Widget: progressbar</p>
|
|
<p>A horizontal progress indicator bar.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Value Integer Current progress value (0-100).</pre>
|
|
<p>No type-specific events or methods. No default event.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.listview">
|
|
<h1>ListView</h1>
|
|
<h2>ListView</h2>
|
|
<p>VB Equivalent: ListView -- DVX Widget: listview</p>
|
|
<p>A multi-column list with column headers. Supports sorting, multi-select, and
|
|
drag-to-reorder. Columns are configured via the C API (SetColumns, SetData).</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ------- -------------------------------------------
|
|
ListIndex Integer Index of the currently selected row (-1 = none).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
--------------- --------------------------------------- -------------------------------------------
|
|
SelectAll (none) Select all rows.
|
|
ClearSelection (none) Deselect all rows.
|
|
SetMultiSelect Multi As Boolean Enable or disable multi-select.
|
|
SetReorderable Reorderable As Boolean Enable or disable row reordering.
|
|
IsItemSelected Index As Integer Returns True if the row at Index is selected.
|
|
SetItemSelected Index As Integer, Selected As Boolean Select or deselect a specific row.</pre>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.treeview">
|
|
<h1>TreeView</h1>
|
|
<h2>TreeView</h2>
|
|
<p>VB Equivalent: TreeView -- DVX Widget: treeview</p>
|
|
<p>A hierarchical tree of expandable/collapsible nodes. Nodes are created via
|
|
the C API (wgtTreeItem). Supports multi-select and drag-to-reorder.</p>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
-------------- ---------------------- -------------------------------------------
|
|
SetMultiSelect Multi As Boolean Enable or disable multi-select mode.
|
|
SetReorderable Reorderable As Boolean Enable or disable node reordering.</pre>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.tabstrip">
|
|
<h1>TabStrip</h1>
|
|
<h2>TabStrip</h2>
|
|
<p>VB Equivalent: TabStrip -- DVX Widget: tabcontrol</p>
|
|
<p>A tabbed container. Each tab page is a separate container that holds child
|
|
controls. Switching tabs shows one page and hides others.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
TabIndex Integer Index of the active tab (0-based). Note: this property name collides with the common VB-compatibility TabIndex property, which shadows it at runtime. Use the SetActive method instead to switch tabs.</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
--------- ----------------- -------------------------------------------
|
|
SetActive Index As Integer Switch to the tab at the given index. This is the recommended way to change tabs at runtime (the TabIndex property is shadowed by the common property handler).</pre>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<blockquote><strong>Warning:</strong> The TabIndex property is shadowed by the common property handler at runtime.
|
|
Use the SetActive method to change tabs programmatically.</blockquote>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.splitter">
|
|
<h1>Splitter</h1>
|
|
<h2>Splitter</h2>
|
|
<p>DVX Extension -- DVX Widget: splitter</p>
|
|
<p>A resizable split pane. Holds exactly two child widgets separated by a
|
|
draggable divider. Default orientation is vertical (top/bottom split).</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Position Integer Position of the divider in pixels from the top (or left).</pre>
|
|
<p>Container: Yes</p>
|
|
<p>No default event.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.scrollpane">
|
|
<h1>ScrollPane</h1>
|
|
<h2>ScrollPane</h2>
|
|
<p>DVX Extension -- DVX Widget: scrollpane | Name Prefix: Scroll</p>
|
|
<p>A scrollable container. Place child controls inside and the ScrollPane
|
|
automatically provides scrollbars when the content exceeds the visible area.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
NoBorder Boolean When True, suppresses the border around the scroll pane.</pre>
|
|
<p>Container: Yes</p>
|
|
<p>No default event.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.wrapbox">
|
|
<h1>WrapBox</h1>
|
|
<h2>WrapBox</h2>
|
|
<p>DVX Extension -- DVX Widget: wrapbox</p>
|
|
<p>A container that arranges children in a flowing layout, wrapping to the next
|
|
row when the available width is exceeded. Similar to CSS flexbox with
|
|
flex-wrap: wrap.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
--------- ---- -------------------------------------------
|
|
Alignment Enum Horizontal alignment of items: Left, Center, or Right.</pre>
|
|
<p>Container: Yes</p>
|
|
<p>Default Event: Click</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.line">
|
|
<h1>Line</h1>
|
|
<h2>Line</h2>
|
|
<p>VB Equivalent: Line -- DVX Widget: separator</p>
|
|
<p>A visual separator line. The underlying widget supports both horizontal and
|
|
vertical orientations. The default (via BASIC) is horizontal.</p>
|
|
<p>No type-specific properties, events, or methods.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.spacer">
|
|
<h1>Spacer</h1>
|
|
<h2>Spacer</h2>
|
|
<p>DVX Extension -- DVX Widget: spacer</p>
|
|
<p>An invisible layout spacer. Takes up space in the layout without rendering
|
|
anything. Useful for pushing controls apart. Give it a Weight to absorb
|
|
extra space.</p>
|
|
<p>No type-specific properties, events, or methods.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.toolbar">
|
|
<h1>Toolbar</h1>
|
|
<h2>Toolbar</h2>
|
|
<p>VB Equivalent: Toolbar -- DVX Widget: toolbar</p>
|
|
<p>A horizontal container styled as a toolbar, with compact padding and
|
|
spacing. Place buttons, labels, or other controls inside.</p>
|
|
<p>Container: Yes</p>
|
|
<p>No type-specific properties, events, or methods.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.statusbar">
|
|
<h1>StatusBar</h1>
|
|
<h2>StatusBar</h2>
|
|
<p>VB Equivalent: StatusBar -- DVX Widget: statusbar</p>
|
|
<p>A horizontal container styled as a status bar, typically placed at the
|
|
bottom of a form. At the C API level it accepts child widgets, but it is not
|
|
registered as a container in the form runtime, so child controls cannot be
|
|
nested inside it in .frm files. Set its Caption property to display status
|
|
text.</p>
|
|
<p>No type-specific properties, events, or methods.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.terminal">
|
|
<h1>Terminal</h1>
|
|
<h2>Terminal</h2>
|
|
<p>DVX Extension -- DVX Widget: ansiterm (ANSI terminal emulator)</p>
|
|
<p>A VT100/ANSI terminal emulator widget. Supports ANSI escape sequences,
|
|
scrollback buffer, and serial communication. Default size is 80 columns by
|
|
25 rows.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
---------- ------- -------------------------------------------
|
|
Cols Integer Number of character columns (read-only).
|
|
Rows Integer Number of character rows (read-only).
|
|
Scrollback Integer Number of scrollback lines (write-only).</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
------ --------------- -------------------------------------------
|
|
Clear (none) Clear the terminal screen.
|
|
Write Text As String Write text (with ANSI escape processing) to the terminal.</pre>
|
|
<p>No default event.</p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.data">
|
|
<h1>Data</h1>
|
|
<h2>Data</h2>
|
|
<p>VB Equivalent: Data -- DVX Widget: data (database record navigator)</p>
|
|
<p>A data access control that connects to a SQLite database and provides record
|
|
navigation. Other controls can bind to a Data control via their DataSource
|
|
and DataField properties. See .link ctrl.databinding Data Binding for
|
|
details.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type R/W Description
|
|
------------ ------- --- -------------------------------------------
|
|
DatabaseName String R/W Path to the SQLite database file.
|
|
RecordSource String R/W Table name or SQL SELECT query for the recordset.
|
|
KeyColumn String R/W Primary key column name (used for UPDATE/DELETE operations).
|
|
Caption String R/W Text displayed on the navigator bar.
|
|
BOF Boolean R True if the current position is before the first record (read-only).
|
|
EOF Boolean R True if the current position is past the last record (read-only).
|
|
MasterSource String R/W Name of a master Data control (for master-detail binding).
|
|
MasterField String R/W Column in the master recordset to filter by.
|
|
DetailField String R/W Column in this recordset that matches the master field.</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
------------ ---------- -------------------------------------------
|
|
MoveFirst (none) Navigate to the first record.
|
|
MoveLast (none) Navigate to the last record.
|
|
MoveNext (none) Navigate to the next record.
|
|
MovePrevious (none) Navigate to the previous record.
|
|
AddNew (none) Add a new blank record.
|
|
Delete (none) Delete the current record.
|
|
Refresh (none) Re-query the database and reload records.
|
|
Update (none) Write pending changes to the database.</pre>
|
|
<h3>Type-Specific Events</h3>
|
|
<pre> Event Parameters Description
|
|
---------- ----------------- -------------------------------------------
|
|
Reposition (none) Fires after the current record changes (navigation). This is the default event.
|
|
Validate Cancel As Integer Fires before writing a record. Set Cancel = 1 to abort.</pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.databinding">Data Binding</a></p>
|
|
<p><a href="#ctrl.dbgrid">DBGrid</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.dbgrid">
|
|
<h1>DBGrid</h1>
|
|
<h2>DBGrid</h2>
|
|
<p>VB Equivalent: DBGrid -- DVX Widget: dbgrid</p>
|
|
<p>A data-bound grid that displays records from a Data control in a tabular
|
|
format. Columns are auto-generated from the query results. Bind it using the
|
|
DataSource property.</p>
|
|
<h3>Type-Specific Properties</h3>
|
|
<pre> Property Type Description
|
|
---------- ------- -------------------------------------------
|
|
DataSource String Name of the Data control that supplies records.
|
|
GridLines Boolean Show or hide grid lines between cells.</pre>
|
|
<h3>Type-Specific Methods</h3>
|
|
<pre> Method Parameters Description
|
|
------- ---------- -------------------------------------------
|
|
Refresh (none) Reload and redraw the grid from the Data control.</pre>
|
|
<h3>Type-Specific Events</h3>
|
|
<pre> Event Parameters Description
|
|
-------- ---------- -------------------------------------------
|
|
Click (none) Fires when a cell is clicked.
|
|
DblClick (none) Fires when a cell is double-clicked. This is the default event.</pre>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.data">Data</a></p>
|
|
<p><a href="#ctrl.databinding">Data Binding</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.databinding">
|
|
<h1>Data Binding</h1>
|
|
<h2>Data Binding</h2>
|
|
<p>DVX BASIC provides VB3-style data binding through three properties that can
|
|
be set on most controls:</p>
|
|
<pre> Property Set On Description
|
|
---------- ----------- -------------------------------------------
|
|
DataSource Any control Name of the Data control to bind to (e.g. "Data1").
|
|
DataField Any control Column name from the Data control's recordset to display.</pre>
|
|
<h3>How It Works</h3>
|
|
<ul>
|
|
<li>Place a Data control on the form and set its DatabaseName and RecordSource
|
|
properties.</li>
|
|
<li>Place one or more display/edit controls (TextBox, Label, etc.) and set
|
|
their DataSource to the Data control's name and DataField to a column
|
|
name.</li>
|
|
<li>When the form loads, the Data control auto-refreshes: it opens the
|
|
database, runs the query, and navigates to the first record.</li>
|
|
<li>Bound controls are updated automatically each time the Data control
|
|
repositions (the Reposition event fires, and the runtime pushes the
|
|
current record's field values into all bound controls).</li>
|
|
</ul>
|
|
<p>When a bound control loses focus (LostFocus), its current text is written
|
|
back to the Data control's record cache, and Update is called automatically
|
|
to persist changes.</p>
|
|
<h3>Master-Detail Binding</h3>
|
|
<p>For hierarchical data (e.g. orders and order items), use two Data controls:</p>
|
|
<ul>
|
|
<li>A master Data control bound to the parent table.</li>
|
|
</ul>
|
|
<p>A detail Data control with its MasterSource set to the master's name,
|
|
MasterField set to the key column in the master, and DetailField set to the
|
|
foreign key column in the detail table.</p>
|
|
<p>When the master record changes, the detail Data control automatically
|
|
re-queries using the master's current value for filtering. All controls
|
|
bound to the detail are refreshed.</p>
|
|
<h3>DBGrid Binding</h3>
|
|
<p>Set the DBGrid's DataSource to a Data control name. The grid auto-populates
|
|
columns from the query results and refreshes whenever the Data control
|
|
refreshes.</p>
|
|
<h3>Example</h3>
|
|
<pre><code>VERSION DVX 1.00
|
|
Begin Form frmData
|
|
Caption = "Data Binding Example"
|
|
AutoSize = False
|
|
Width = 400
|
|
Height = 280
|
|
Begin Data Data1
|
|
DatabaseName = "myapp.db"
|
|
RecordSource = "customers"
|
|
End
|
|
Begin Label lblName
|
|
Caption = "Name:"
|
|
End
|
|
Begin TextBox txtName
|
|
DataSource = "Data1"
|
|
DataField = "name"
|
|
End
|
|
Begin Label lblEmail
|
|
Caption = "Email:"
|
|
End
|
|
Begin TextBox txtEmail
|
|
DataSource = "Data1"
|
|
DataField = "email"
|
|
End
|
|
End
|
|
|
|
Sub Data1_Reposition ()
|
|
Print "Current record changed"
|
|
End Sub
|
|
|
|
Sub Data1_Validate (Cancel As Integer)
|
|
If txtName.Text = "" Then
|
|
MsgBox "Name cannot be empty!"
|
|
Cancel = 1
|
|
End If
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.data">Data</a></p>
|
|
<p><a href="#ctrl.dbgrid">DBGrid</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.menus">
|
|
<h1>Menu System</h1>
|
|
<h2>Menu System</h2>
|
|
<p>Menus are defined in the .frm file using Begin Menu blocks. Each menu item
|
|
has a name, caption, and nesting level. Menu items fire Click events
|
|
dispatched as MenuName_Click.</p>
|
|
<h3>FRM Syntax</h3>
|
|
<pre><code>Begin Form Form1
|
|
Caption = "Menu Demo"
|
|
|
|
Begin Menu mnuFile
|
|
Caption = "&File"
|
|
Begin Menu mnuOpen
|
|
Caption = "&Open"
|
|
End
|
|
Begin Menu mnuSave
|
|
Caption = "&Save"
|
|
End
|
|
Begin Menu mnuSep1
|
|
Caption = "-"
|
|
End
|
|
Begin Menu mnuExit
|
|
Caption = "E&xit"
|
|
End
|
|
End
|
|
|
|
Begin Menu mnuEdit
|
|
Caption = "&Edit"
|
|
Begin Menu mnuCopy
|
|
Caption = "&Copy"
|
|
End
|
|
Begin Menu mnuPaste
|
|
Caption = "&Paste"
|
|
End
|
|
End
|
|
End</code></pre>
|
|
<h3>Menu Item Properties</h3>
|
|
<pre> Property Type Description
|
|
-------- ------- -------------------------------------------
|
|
Caption String The text displayed. Use & for accelerator key. Set to "-" for a separator.
|
|
Checked Boolean Whether the menu item shows a checkmark.
|
|
Enabled Boolean Whether the menu item is enabled (default True).</pre>
|
|
<h3>Nesting</h3>
|
|
<p>Menu items are nested by placing Begin Menu blocks inside other Begin Menu
|
|
blocks:</p>
|
|
<ul>
|
|
<li>Level 0: top-level menu bar headers (e.g. "File", "Edit").</li>
|
|
<li>Level 1: items within a top-level menu.</li>
|
|
</ul>
|
|
<p>Level 2+: submenu items.</p>
|
|
<p>A level-0 menu that contains children becomes a top-level menu header. A
|
|
non-level-0 menu that contains children becomes a submenu.</p>
|
|
<h3>Event Dispatch</h3>
|
|
<p>Each clickable menu item (not headers, not separators) receives a unique
|
|
numeric ID at load time. When clicked, the form's onMenu handler maps the ID
|
|
to the menu item's name and fires MenuName_Click.</p>
|
|
<pre><code>Sub mnuOpen_Click ()
|
|
MsgBox "Open was clicked"
|
|
End Sub
|
|
|
|
Sub mnuExit_Click ()
|
|
Unload Form1
|
|
End Sub</code></pre>
|
|
<p><a href="#ctrl.form">Form</a></p>
|
|
<p><a href="#ctrl.frm">FRM File Format</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.arrays">
|
|
<h1>Control Arrays</h1>
|
|
<h2>Control Arrays</h2>
|
|
<p>DVX BASIC supports VB-style control arrays. Multiple controls can share the
|
|
same name, differentiated by an Index property. When an event fires on a
|
|
control array element, the element's index is passed as the first parameter.</p>
|
|
<h3>Defining Control Arrays in FRM</h3>
|
|
<pre><code>Begin CommandButton Command1
|
|
Caption = "Button A"
|
|
Index = 0
|
|
End
|
|
Begin CommandButton Command1
|
|
Caption = "Button B"
|
|
Index = 1
|
|
End
|
|
Begin CommandButton Command1
|
|
Caption = "Button C"
|
|
Index = 2
|
|
End</code></pre>
|
|
<h3>Event Handler Convention</h3>
|
|
<p>When a control has an Index property (>= 0), the event handler receives
|
|
Index As Integer as the first parameter, before any event-specific
|
|
parameters.</p>
|
|
<pre><code>Sub Command1_Click (Index As Integer)
|
|
Select Case Index
|
|
Case 0
|
|
MsgBox "Button A clicked"
|
|
Case 1
|
|
MsgBox "Button B clicked"
|
|
Case 2
|
|
MsgBox "Button C clicked"
|
|
End Select
|
|
End Sub</code></pre>
|
|
<h3>Accessing Array Elements in Code</h3>
|
|
<p>Use the indexed form ControlName(Index) to access a specific element:</p>
|
|
<pre><code>Command1(0).Caption = "New Text"
|
|
Command1(1).Enabled = False</code></pre>
|
|
<blockquote><strong>Note:</strong> Control array elements share the same event handler Sub. The runtime
|
|
prepends the Index argument automatically. If you define parameters on the
|
|
Sub, Index comes first, followed by the event's own parameters (e.g.
|
|
KeyPress would be Sub Ctrl1_KeyPress (Index As Integer, KeyAscii As
|
|
Integer)).</blockquote>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.frm">FRM File Format</a></p>
|
|
</div>
|
|
<div class="topic" id="ctrl.frm">
|
|
<h1>FRM File Format</h1>
|
|
<h2>FRM File Format</h2>
|
|
<p>The .frm file is a text file that describes a form's layout, controls,
|
|
menus, and code. It follows a format compatible with VB3 .frm files, with
|
|
DVX-specific extensions.</p>
|
|
<h3>Structure</h3>
|
|
<pre><code>VERSION DVX 1.00
|
|
Begin Form FormName
|
|
form-level properties...
|
|
|
|
Begin Menu mnuFile
|
|
Caption = "&File"
|
|
Begin Menu mnuOpen
|
|
Caption = "&Open"
|
|
End
|
|
End
|
|
|
|
Begin TypeName ControlName
|
|
property = value
|
|
...
|
|
End
|
|
|
|
Begin Frame Frame1
|
|
Caption = "Group"
|
|
Begin TypeName ChildName
|
|
...
|
|
End
|
|
End
|
|
End
|
|
|
|
BASIC code follows...
|
|
|
|
Sub FormName_Load ()
|
|
...
|
|
End Sub</code></pre>
|
|
<h3>Rules</h3>
|
|
<ul>
|
|
<li>The VERSION line is optional. VERSION DVX 1.00 marks a native DVX form. VB
|
|
forms with version <= 2.0 are accepted for import.</li>
|
|
<li>The form block begins with Begin Form Name and ends with End.</li>
|
|
<li>Controls are nested with Begin TypeName Name / End.</li>
|
|
<li>Container controls (Frame, VBox, HBox, Toolbar, TabStrip, ScrollPane,
|
|
Splitter, WrapBox) can have child controls nested inside them.</li>
|
|
<li>Properties are assigned as Key = Value. String values are optionally
|
|
quoted.</li>
|
|
<li>Everything after the form's closing End is BASIC source code.</li>
|
|
<li>Comments in the form section use ' (single quote).</li>
|
|
</ul>
|
|
<p>Blank lines are ignored in the form section.</p>
|
|
<h3>Common FRM Properties</h3>
|
|
<pre> Property Applies To Description
|
|
----------------------- --------------- -------------------------------------------
|
|
Caption Form, controls Display text or window title.
|
|
Text TextBox, ComboBox Initial text content.
|
|
MinWidth / Width Controls Minimum width. Both names are accepted.
|
|
MinHeight / Height Controls Minimum height. Both names are accepted.
|
|
MaxWidth Controls Maximum width (0 = no cap).
|
|
MaxHeight Controls Maximum height (0 = no cap).
|
|
Weight Controls Layout weight for flexible sizing.
|
|
Left Form, controls X position (used by Form when Centered=False; informational for controls).
|
|
Top Form, controls Y position.
|
|
Index Controls Control array index (-1 or absent = not in array).
|
|
Visible Controls Initial visibility.
|
|
Enabled Controls Initial enabled state.
|
|
Layout Form "VBox" or "HBox".
|
|
AutoSize Form Auto-fit window to content.
|
|
Resizable Form Allow runtime resizing.
|
|
Centered Form Center window on screen.
|
|
DatabaseName Data SQLite database file path.
|
|
RecordSource Data Table name or SQL query.
|
|
DataSource Bound controls Name of the Data control.
|
|
DataField Bound controls Column name in the recordset.</pre>
|
|
<p><a href="#ctrl.form">Form</a></p>
|
|
<p><a href="#ctrl.common.props">Common Properties, Events, and Methods</a></p>
|
|
<p><a href="#ctrl.menus">Menu System</a></p>
|
|
<p><a href="#ctrl.arrays">Control Arrays</a></p>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|