Help system and viewer seem to be working.
This commit is contained in:
parent
2a641f42c3
commit
10ba408465
91 changed files with 11342 additions and 4702 deletions
41
apps/dvxbasic/controls/button.dhs
Normal file
41
apps/dvxbasic/controls/button.dhs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
.topic ctrl.button
|
||||
.title CommandButton
|
||||
.toc 1 CommandButton
|
||||
.index CommandButton
|
||||
.index Button
|
||||
.index Click
|
||||
|
||||
.h1 CommandButton
|
||||
|
||||
VB Equivalent: CommandButton -- DVX Widget: button | Name Prefix: Command
|
||||
|
||||
A push button that triggers an action when clicked. Created with wgtButton(parent, text).
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------ -------------------------------------------
|
||||
Caption String The text displayed on the button. Use & for accelerator keys (e.g. "&OK").
|
||||
.endtable
|
||||
|
||||
No additional type-specific properties beyond common properties and Caption.
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
Begin Form Form1
|
||||
Caption = "Button Demo"
|
||||
Begin CommandButton Command1
|
||||
Caption = "&Click Me!"
|
||||
End
|
||||
End
|
||||
|
||||
Sub Command1_Click ()
|
||||
MsgBox "Button was clicked!"
|
||||
End Sub
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
40
apps/dvxbasic/controls/checkbox.dhs
Normal file
40
apps/dvxbasic/controls/checkbox.dhs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
.topic ctrl.checkbox
|
||||
.title CheckBox
|
||||
.toc 1 CheckBox
|
||||
.index CheckBox
|
||||
.index Value
|
||||
|
||||
.h1 CheckBox
|
||||
|
||||
VB Equivalent: CheckBox -- DVX Widget: checkbox
|
||||
|
||||
A toggle control with a label. Checked state is exposed as a Boolean.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
Caption String The text displayed next to the checkbox.
|
||||
Value Boolean True if checked, False if unchecked.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.h2 Example
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
30
apps/dvxbasic/controls/combobox.dhs
Normal file
30
apps/dvxbasic/controls/combobox.dhs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
.topic ctrl.combobox
|
||||
.title ComboBox
|
||||
.toc 1 ComboBox
|
||||
.index ComboBox
|
||||
|
||||
.h1 ComboBox
|
||||
|
||||
VB Equivalent: ComboBox -- DVX Widget: combobox (editable text field + drop-down list, max 256 chars)
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
Same as ListBox: AddItem, RemoveItem, Clear, List.
|
||||
|
||||
.link ctrl.listbox See ListBox for details
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
66
apps/dvxbasic/controls/data.dhs
Normal file
66
apps/dvxbasic/controls/data.dhs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
.topic ctrl.data
|
||||
.title Data
|
||||
.toc 1 Data Controls
|
||||
.toc 1 Data
|
||||
.index Data
|
||||
.index Database
|
||||
.index SQLite
|
||||
.index DatabaseName
|
||||
.index RecordSource
|
||||
.index MoveFirst
|
||||
.index MoveNext
|
||||
.index AddNew
|
||||
.index Reposition
|
||||
.index Validate
|
||||
|
||||
.h1 Data
|
||||
|
||||
VB Equivalent: Data -- DVX Widget: data (database record navigator)
|
||||
|
||||
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.
|
||||
|
||||
.link ctrl.databinding See Data Binding for details
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Events
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.databinding Data Binding
|
||||
.link ctrl.dbgrid DBGrid
|
||||
41
apps/dvxbasic/controls/dbgrid.dhs
Normal file
41
apps/dvxbasic/controls/dbgrid.dhs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
.topic ctrl.dbgrid
|
||||
.title DBGrid
|
||||
.toc 1 DBGrid
|
||||
.index DBGrid
|
||||
.index Data-Bound Grid
|
||||
|
||||
.h1 DBGrid
|
||||
|
||||
VB Equivalent: DBGrid -- DVX Widget: dbgrid
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
---------- ------- -------------------------------------------
|
||||
DataSource String Name of the Data control that supplies records.
|
||||
GridLines Boolean Show or hide grid lines between cells.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
------- ---------- -------------------------------------------
|
||||
Refresh (none) Reload and redraw the grid from the Data control.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Events
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.data Data
|
||||
.link ctrl.databinding Data Binding
|
||||
29
apps/dvxbasic/controls/dropdown.dhs
Normal file
29
apps/dvxbasic/controls/dropdown.dhs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
.topic ctrl.dropdown
|
||||
.title DropDown
|
||||
.toc 1 DropDown
|
||||
.index DropDown
|
||||
|
||||
.h1 DropDown
|
||||
|
||||
DVX Extension -- DVX Widget: dropdown (non-editable drop-down list)
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
--------- ------- -------------------------------------------
|
||||
ListIndex Integer Index of the currently selected item.
|
||||
ListCount Integer Number of items (read-only).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
Same as ListBox: AddItem, RemoveItem, Clear, List.
|
||||
|
||||
.link ctrl.listbox See ListBox for details
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
82
apps/dvxbasic/controls/form.dhs
Normal file
82
apps/dvxbasic/controls/form.dhs
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
.topic ctrl.form
|
||||
.title Form
|
||||
.toc 1 Form
|
||||
.index Form
|
||||
.index Window
|
||||
.index Caption
|
||||
.index AutoSize
|
||||
.index Resizable
|
||||
.index Load
|
||||
.index Unload
|
||||
.index Show
|
||||
.index Hide
|
||||
|
||||
.h1 Form
|
||||
|
||||
VB Equivalent: Form -- DVX Widget: Window + VBox/HBox root
|
||||
|
||||
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.
|
||||
|
||||
.h2 Form Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Form Events
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Form Methods
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Example
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.frm FRM File Format
|
||||
39
apps/dvxbasic/controls/frame.dhs
Normal file
39
apps/dvxbasic/controls/frame.dhs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
.topic ctrl.frame
|
||||
.title Frame
|
||||
.toc 1 Frame
|
||||
.index Frame
|
||||
.index Container
|
||||
|
||||
.h1 Frame
|
||||
|
||||
VB Equivalent: Frame -- DVX Widget: frame (titled VBox container)
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------ -------------------------------------------
|
||||
Caption String The title displayed in the frame border.
|
||||
.endtable
|
||||
|
||||
Container: Yes
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
Begin Frame Frame1
|
||||
Caption = "Options"
|
||||
Begin CheckBox Check1
|
||||
Caption = "Option A"
|
||||
End
|
||||
Begin CheckBox Check2
|
||||
Caption = "Option B"
|
||||
End
|
||||
End
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
20
apps/dvxbasic/controls/hbox.dhs
Normal file
20
apps/dvxbasic/controls/hbox.dhs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
.topic ctrl.hbox
|
||||
.title HBox
|
||||
.toc 1 HBox
|
||||
.index HBox
|
||||
.index Horizontal Layout
|
||||
|
||||
.h1 HBox
|
||||
|
||||
DVX Extension -- DVX Widget: hbox (horizontal layout container)
|
||||
|
||||
A container that arranges its children horizontally, left to right. Use Weight on children to distribute extra space.
|
||||
|
||||
Container: Yes
|
||||
|
||||
Default Event: Click
|
||||
|
||||
No type-specific properties.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.vbox VBox
|
||||
35
apps/dvxbasic/controls/hscroll.dhs
Normal file
35
apps/dvxbasic/controls/hscroll.dhs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
.topic ctrl.hscrollbar
|
||||
.title HScrollBar
|
||||
.toc 1 HScrollBar
|
||||
.index HScrollBar
|
||||
.index Slider
|
||||
|
||||
.h1 HScrollBar
|
||||
|
||||
VB Equivalent: HScrollBar -- DVX Widget: slider | Name Prefix: HScroll
|
||||
|
||||
A horizontal slider/scrollbar control. The value ranges between a minimum and maximum set at creation time (default 0 to 100).
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
Value Integer The current slider position (clamped to min/max range).
|
||||
.endtable
|
||||
|
||||
Default Event: Change
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
Begin HScrollBar HScroll1
|
||||
MinWidth = 200
|
||||
End
|
||||
|
||||
Sub HScroll1_Change ()
|
||||
Label1.Caption = "Value: " & Str$(HScroll1.Value)
|
||||
End Sub
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
26
apps/dvxbasic/controls/image.dhs
Normal file
26
apps/dvxbasic/controls/image.dhs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
.topic ctrl.image
|
||||
.title Image
|
||||
.toc 1 Image
|
||||
.index Image
|
||||
.index Picture
|
||||
.index BMP
|
||||
|
||||
.h1 Image
|
||||
|
||||
VB Equivalent: Image -- DVX Widget: image
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
24
apps/dvxbasic/controls/imgbtn.dhs
Normal file
24
apps/dvxbasic/controls/imgbtn.dhs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
.topic ctrl.imagebutton
|
||||
.title ImageButton
|
||||
.toc 1 ImageButton
|
||||
.index ImageButton
|
||||
|
||||
.h1 ImageButton
|
||||
|
||||
DVX Extension -- DVX Widget: imagebutton
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
34
apps/dvxbasic/controls/label.dhs
Normal file
34
apps/dvxbasic/controls/label.dhs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
.topic ctrl.label
|
||||
.title Label
|
||||
.toc 1 Label
|
||||
.index Label
|
||||
.index Caption
|
||||
.index Alignment
|
||||
|
||||
.h1 Label
|
||||
|
||||
VB Equivalent: Label -- DVX Widget: label
|
||||
|
||||
A static text label. Supports left, center, and right alignment.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
--------- ---- -------------------------------------------
|
||||
Caption String The text displayed by the label.
|
||||
Alignment Enum Text alignment: Left (default), Center, or Right.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
Begin Label Label1
|
||||
Caption = "Hello, World!"
|
||||
Alignment = "Center"
|
||||
End
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
16
apps/dvxbasic/controls/line.dhs
Normal file
16
apps/dvxbasic/controls/line.dhs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
.topic ctrl.line
|
||||
.title Line
|
||||
.toc 1 Decorative Controls
|
||||
.toc 1 Line
|
||||
.index Line
|
||||
.index Separator
|
||||
|
||||
.h1 Line
|
||||
|
||||
VB Equivalent: Line -- DVX Widget: separator
|
||||
|
||||
A visual separator line. The underlying widget supports both horizontal and vertical orientations. The default (via BASIC) is horizontal.
|
||||
|
||||
No type-specific properties, events, or methods.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
64
apps/dvxbasic/controls/listbox.dhs
Normal file
64
apps/dvxbasic/controls/listbox.dhs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
.topic ctrl.listbox
|
||||
.title ListBox
|
||||
.toc 1 ListBox
|
||||
.index ListBox
|
||||
.index ListIndex
|
||||
.index ListCount
|
||||
.index AddItem
|
||||
.index RemoveItem
|
||||
|
||||
.h1 ListBox
|
||||
|
||||
VB Equivalent: ListBox -- DVX Widget: listbox
|
||||
|
||||
A scrollable list of selectable items. Items are managed via methods (AddItem, RemoveItem, Clear). Supports single and multi-select modes.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
--------- ------- -------------------------------------------
|
||||
ListIndex Integer Index of the currently selected item (-1 = no selection).
|
||||
ListCount Integer Number of items in the list (read-only).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.h2 Example
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.combobox ComboBox
|
||||
.link ctrl.dropdown DropDown
|
||||
37
apps/dvxbasic/controls/listview.dhs
Normal file
37
apps/dvxbasic/controls/listview.dhs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
.topic ctrl.listview
|
||||
.title ListView
|
||||
.toc 1 Data Display Controls
|
||||
.toc 1 ListView
|
||||
.index ListView
|
||||
.index Multi-Column List
|
||||
|
||||
.h1 ListView
|
||||
|
||||
VB Equivalent: ListView -- DVX Widget: listview
|
||||
|
||||
A multi-column list with column headers. Supports sorting, multi-select, and drag-to-reorder. Columns are configured via the C API (SetColumns, SetData).
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
--------- ------- -------------------------------------------
|
||||
ListIndex Integer Index of the currently selected row (-1 = none).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
33
apps/dvxbasic/controls/optbtn.dhs
Normal file
33
apps/dvxbasic/controls/optbtn.dhs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
.topic ctrl.optionbutton
|
||||
.title OptionButton
|
||||
.toc 1 OptionButton
|
||||
.index OptionButton
|
||||
.index Radio Button
|
||||
.index SetSelected
|
||||
|
||||
.h1 OptionButton
|
||||
|
||||
VB Equivalent: OptionButton -- DVX Widget: radio (radio group + radio button) | Name Prefix: Option
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
----------- ----------------- -------------------------------------------
|
||||
SetSelected Index As Integer Select the radio button at the given index within the group.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
26
apps/dvxbasic/controls/picbox.dhs
Normal file
26
apps/dvxbasic/controls/picbox.dhs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
.topic ctrl.picturebox
|
||||
.title PictureBox
|
||||
.toc 1 PictureBox
|
||||
.index PictureBox
|
||||
.index Canvas
|
||||
.index Drawing
|
||||
|
||||
.h1 PictureBox
|
||||
|
||||
VB Equivalent: PictureBox -- DVX Widget: canvas | Name Prefix: Picture
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
------ ---------------- -------------------------------------------
|
||||
Clear Color As Integer Fill the entire canvas with the specified color.
|
||||
.endtable
|
||||
|
||||
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.
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
22
apps/dvxbasic/controls/progress.dhs
Normal file
22
apps/dvxbasic/controls/progress.dhs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.topic ctrl.progressbar
|
||||
.title ProgressBar
|
||||
.toc 1 ProgressBar
|
||||
.index ProgressBar
|
||||
|
||||
.h1 ProgressBar
|
||||
|
||||
VB Equivalent: ProgressBar -- DVX Widget: progressbar
|
||||
|
||||
A horizontal progress indicator bar.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
Value Integer Current progress value (0-100).
|
||||
.endtable
|
||||
|
||||
No type-specific events or methods. No default event.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
25
apps/dvxbasic/controls/scrlpane.dhs
Normal file
25
apps/dvxbasic/controls/scrlpane.dhs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
.topic ctrl.scrollpane
|
||||
.title ScrollPane
|
||||
.toc 1 ScrollPane
|
||||
.index ScrollPane
|
||||
.index Scrollable Container
|
||||
|
||||
.h1 ScrollPane
|
||||
|
||||
DVX Extension -- DVX Widget: scrollpane | Name Prefix: Scroll
|
||||
|
||||
A scrollable container. Place child controls inside and the ScrollPane automatically provides scrollbars when the content exceeds the visible area.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
NoBorder Boolean When True, suppresses the border around the scroll pane.
|
||||
.endtable
|
||||
|
||||
Container: Yes
|
||||
|
||||
No default event.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
14
apps/dvxbasic/controls/spacer.dhs
Normal file
14
apps/dvxbasic/controls/spacer.dhs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.topic ctrl.spacer
|
||||
.title Spacer
|
||||
.toc 1 Spacer
|
||||
.index Spacer
|
||||
|
||||
.h1 Spacer
|
||||
|
||||
DVX Extension -- DVX Widget: spacer
|
||||
|
||||
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.
|
||||
|
||||
No type-specific properties, events, or methods.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
38
apps/dvxbasic/controls/spinbtn.dhs
Normal file
38
apps/dvxbasic/controls/spinbtn.dhs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
.topic ctrl.spinbutton
|
||||
.title SpinButton
|
||||
.toc 1 SpinButton
|
||||
.index SpinButton
|
||||
.index Spinner
|
||||
.index SetRange
|
||||
.index SetStep
|
||||
.index RealMode
|
||||
.index Decimals
|
||||
|
||||
.h1 SpinButton
|
||||
|
||||
DVX Extension -- DVX Widget: spinner | Name Prefix: Spin
|
||||
|
||||
A numeric input with up/down buttons. Supports integer mode (default) and real-number mode with configurable decimal places.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
Default Event: Change
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
25
apps/dvxbasic/controls/splitter.dhs
Normal file
25
apps/dvxbasic/controls/splitter.dhs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
.topic ctrl.splitter
|
||||
.title Splitter
|
||||
.toc 1 Splitter
|
||||
.index Splitter
|
||||
.index Split Pane
|
||||
|
||||
.h1 Splitter
|
||||
|
||||
DVX Extension -- DVX Widget: splitter
|
||||
|
||||
A resizable split pane. Holds exactly two child widgets separated by a draggable divider. Default orientation is vertical (top/bottom split).
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
Position Integer Position of the divider in pixels from the top (or left).
|
||||
.endtable
|
||||
|
||||
Container: Yes
|
||||
|
||||
No default event.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
14
apps/dvxbasic/controls/statbar.dhs
Normal file
14
apps/dvxbasic/controls/statbar.dhs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.topic ctrl.statusbar
|
||||
.title StatusBar
|
||||
.toc 1 StatusBar
|
||||
.index StatusBar
|
||||
|
||||
.h1 StatusBar
|
||||
|
||||
VB Equivalent: StatusBar -- DVX Widget: statusbar
|
||||
|
||||
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.
|
||||
|
||||
No type-specific properties, events, or methods.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
39
apps/dvxbasic/controls/tabstrip.dhs
Normal file
39
apps/dvxbasic/controls/tabstrip.dhs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
.topic ctrl.tabstrip
|
||||
.title TabStrip
|
||||
.toc 1 Tabbed and Split Controls
|
||||
.toc 1 TabStrip
|
||||
.index TabStrip
|
||||
.index TabControl
|
||||
.index SetActive
|
||||
|
||||
.h1 TabStrip
|
||||
|
||||
VB Equivalent: TabStrip -- DVX Widget: tabcontrol
|
||||
|
||||
A tabbed container. Each tab page is a separate container that holds child controls. Switching tabs shows one page and hides others.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
Container: Yes
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.note warning
|
||||
The TabIndex property is shadowed by the common property handler at runtime. Use the SetActive method to change tabs programmatically.
|
||||
.endnote
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
36
apps/dvxbasic/controls/terminal.dhs
Normal file
36
apps/dvxbasic/controls/terminal.dhs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
.topic ctrl.terminal
|
||||
.title Terminal
|
||||
.toc 1 Special Controls
|
||||
.toc 1 Terminal
|
||||
.index Terminal
|
||||
.index ANSI Terminal
|
||||
.index VT100
|
||||
|
||||
.h1 Terminal
|
||||
|
||||
DVX Extension -- DVX Widget: ansiterm (ANSI terminal emulator)
|
||||
|
||||
A VT100/ANSI terminal emulator widget. Supports ANSI escape sequences, scrollback buffer, and serial communication. Default size is 80 columns by 25 rows.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
------ --------------- -------------------------------------------
|
||||
Clear (none) Clear the terminal screen.
|
||||
Write Text As String Write text (with ANSI escape processing) to the terminal.
|
||||
.endtable
|
||||
|
||||
No default event.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
22
apps/dvxbasic/controls/textarea.dhs
Normal file
22
apps/dvxbasic/controls/textarea.dhs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.topic ctrl.textarea
|
||||
.title TextArea
|
||||
.toc 1 TextArea
|
||||
.index TextArea
|
||||
|
||||
.h1 TextArea
|
||||
|
||||
VB Equivalent: TextArea (DVX extension) -- DVX Widget: textarea (multi-line text input, max 4096 chars)
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------ -------------------------------------------
|
||||
Text String The full text content.
|
||||
.endtable
|
||||
|
||||
Default Event: Change
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
40
apps/dvxbasic/controls/textbox.dhs
Normal file
40
apps/dvxbasic/controls/textbox.dhs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
.topic ctrl.textbox
|
||||
.title TextBox
|
||||
.toc 1 TextBox
|
||||
.index TextBox
|
||||
.index Text
|
||||
.index DataSource
|
||||
.index DataField
|
||||
|
||||
.h1 TextBox
|
||||
|
||||
VB Equivalent: TextBox -- DVX Widget: textbox (single-line text input, max 256 chars)
|
||||
|
||||
A single-line text input field. Supports data binding via DataSource and DataField properties.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
Default Event: Change
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
Begin TextBox Text1
|
||||
Text = "Enter text here"
|
||||
End
|
||||
|
||||
Sub Text1_Change ()
|
||||
Label1.Caption = "You typed: " & Text1.Text
|
||||
End Sub
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.databinding Data Binding
|
||||
61
apps/dvxbasic/controls/timer.dhs
Normal file
61
apps/dvxbasic/controls/timer.dhs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
.topic ctrl.timer
|
||||
.title Timer
|
||||
.toc 1 Timer
|
||||
.index Timer
|
||||
.index Interval
|
||||
.index Start
|
||||
.index Stop
|
||||
|
||||
.h1 Timer
|
||||
|
||||
VB Equivalent: Timer -- DVX Widget: timer (non-visual)
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
-------- ------- -------------------------------------------
|
||||
Enabled Boolean True to start the timer, False to stop it.
|
||||
Interval Integer Timer interval in milliseconds (write-only from BASIC).
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
------ ---------- -------------------------------------------
|
||||
Start (none) Start the timer.
|
||||
Stop (none) Stop the timer.
|
||||
.endtable
|
||||
|
||||
.h2 Type-Specific Events
|
||||
|
||||
.table
|
||||
Event Parameters Description
|
||||
----- ---------- -------------------------------------------
|
||||
Timer (none) Fires each time the interval elapses. This is the default event.
|
||||
.endtable
|
||||
|
||||
.note info
|
||||
The Timer control fires the Timer event instead of Change. The onChange callback on the underlying widget is remapped automatically.
|
||||
.endnote
|
||||
|
||||
.h2 Example
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
17
apps/dvxbasic/controls/toolbar.dhs
Normal file
17
apps/dvxbasic/controls/toolbar.dhs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
.topic ctrl.toolbar
|
||||
.title Toolbar
|
||||
.toc 1 Bar Controls
|
||||
.toc 1 Toolbar
|
||||
.index Toolbar
|
||||
|
||||
.h1 Toolbar
|
||||
|
||||
VB Equivalent: Toolbar -- DVX Widget: toolbar
|
||||
|
||||
A horizontal container styled as a toolbar, with compact padding and spacing. Place buttons, labels, or other controls inside.
|
||||
|
||||
Container: Yes
|
||||
|
||||
No type-specific properties, events, or methods.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
23
apps/dvxbasic/controls/treeview.dhs
Normal file
23
apps/dvxbasic/controls/treeview.dhs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
.topic ctrl.treeview
|
||||
.title TreeView
|
||||
.toc 1 TreeView
|
||||
.index TreeView
|
||||
|
||||
.h1 TreeView
|
||||
|
||||
VB Equivalent: TreeView -- DVX Widget: treeview
|
||||
|
||||
A hierarchical tree of expandable/collapsible nodes. Nodes are created via the C API (wgtTreeItem). Supports multi-select and drag-to-reorder.
|
||||
|
||||
.h2 Type-Specific Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
-------------- ---------------------- -------------------------------------------
|
||||
SetMultiSelect Multi As Boolean Enable or disable multi-select mode.
|
||||
SetReorderable Reorderable As Boolean Enable or disable node reordering.
|
||||
.endtable
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
20
apps/dvxbasic/controls/vbox.dhs
Normal file
20
apps/dvxbasic/controls/vbox.dhs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
.topic ctrl.vbox
|
||||
.title VBox
|
||||
.toc 1 VBox
|
||||
.index VBox
|
||||
.index Vertical Layout
|
||||
|
||||
.h1 VBox
|
||||
|
||||
DVX Extension -- DVX Widget: vbox (vertical layout container)
|
||||
|
||||
A container that arranges its children vertically, top to bottom. No title or border. Use Weight on children to distribute extra space.
|
||||
|
||||
Container: Yes
|
||||
|
||||
Default Event: Click
|
||||
|
||||
No type-specific properties.
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.hbox HBox
|
||||
25
apps/dvxbasic/controls/wrapbox.dhs
Normal file
25
apps/dvxbasic/controls/wrapbox.dhs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
.topic ctrl.wrapbox
|
||||
.title WrapBox
|
||||
.toc 1 WrapBox
|
||||
.index WrapBox
|
||||
.index Flow Layout
|
||||
|
||||
.h1 WrapBox
|
||||
|
||||
DVX Extension -- DVX Widget: wrapbox
|
||||
|
||||
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.
|
||||
|
||||
.h2 Type-Specific Properties
|
||||
|
||||
.table
|
||||
Property Type Description
|
||||
--------- ---- -------------------------------------------
|
||||
Alignment Enum Horizontal alignment of items: Left, Center, or Right.
|
||||
.endtable
|
||||
|
||||
Container: Yes
|
||||
|
||||
Default Event: Click
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
397
apps/dvxbasic/ctrlover.dhs
Normal file
397
apps/dvxbasic/ctrlover.dhs
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
.topic ctrl.common.props
|
||||
.title Common Properties, Events, and Methods
|
||||
.toc 0 Common Properties, Events, and Methods
|
||||
.default
|
||||
.index Common Properties
|
||||
.index Common Events
|
||||
.index Common Methods
|
||||
.index Properties
|
||||
.index Events
|
||||
.index Methods
|
||||
|
||||
.h1 Common Properties, Events, and Methods
|
||||
|
||||
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.
|
||||
|
||||
.h2 Common Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 Common Events
|
||||
|
||||
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.
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
.h2 Common Methods
|
||||
|
||||
.table
|
||||
Method Parameters Description
|
||||
-------- ---------- -------------------------------------------
|
||||
SetFocus (none) Gives keyboard focus to this control.
|
||||
Refresh (none) Forces the control to repaint.
|
||||
.endtable
|
||||
|
||||
.link ctrl.form Form
|
||||
.link ctrl.databinding Data Binding
|
||||
.link ctrl.frm FRM File Format
|
||||
|
||||
|
||||
.topic ctrl.databinding
|
||||
.title Data Binding
|
||||
.toc 1 Data Binding
|
||||
.index Data Binding
|
||||
.index DataSource
|
||||
.index DataField
|
||||
.index Master-Detail
|
||||
|
||||
.h1 Data Binding
|
||||
|
||||
DVX BASIC provides VB3-style data binding through three properties that can be set on most controls:
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.h2 How It Works
|
||||
|
||||
.list
|
||||
.item Place a Data control on the form and set its DatabaseName and RecordSource properties.
|
||||
.item 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.
|
||||
.item When the form loads, the Data control auto-refreshes: it opens the database, runs the query, and navigates to the first record.
|
||||
.item 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).
|
||||
.item 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.
|
||||
.endlist
|
||||
|
||||
.h2 Master-Detail Binding
|
||||
|
||||
For hierarchical data (e.g. orders and order items), use two Data controls:
|
||||
|
||||
.list
|
||||
.item A master Data control bound to the parent table.
|
||||
.item 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.
|
||||
.endlist
|
||||
|
||||
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.
|
||||
|
||||
.h2 DBGrid Binding
|
||||
|
||||
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.
|
||||
|
||||
.h2 Example
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.link ctrl.data Data
|
||||
.link ctrl.dbgrid DBGrid
|
||||
|
||||
|
||||
.topic ctrl.menus
|
||||
.title Menu System
|
||||
.toc 1 Menu System
|
||||
.index Menu
|
||||
.index Menu Bar
|
||||
.index Submenu
|
||||
.index Separator
|
||||
|
||||
.h1 Menu System
|
||||
|
||||
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.
|
||||
|
||||
.h2 FRM Syntax
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.h2 Menu Item Properties
|
||||
|
||||
.table
|
||||
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).
|
||||
.endtable
|
||||
|
||||
.h2 Nesting
|
||||
|
||||
Menu items are nested by placing Begin Menu blocks inside other Begin Menu blocks:
|
||||
|
||||
.list
|
||||
.item Level 0: top-level menu bar headers (e.g. "File", "Edit").
|
||||
.item Level 1: items within a top-level menu.
|
||||
.item Level 2+: submenu items.
|
||||
.endlist
|
||||
|
||||
A level-0 menu that contains children becomes a top-level menu header. A non-level-0 menu that contains children becomes a submenu.
|
||||
|
||||
.h2 Event Dispatch
|
||||
|
||||
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.
|
||||
|
||||
.code
|
||||
Sub mnuOpen_Click ()
|
||||
MsgBox "Open was clicked"
|
||||
End Sub
|
||||
|
||||
Sub mnuExit_Click ()
|
||||
Unload Form1
|
||||
End Sub
|
||||
.endcode
|
||||
|
||||
.link ctrl.form Form
|
||||
.link ctrl.frm FRM File Format
|
||||
|
||||
|
||||
.topic ctrl.arrays
|
||||
.title Control Arrays
|
||||
.toc 1 Control Arrays
|
||||
.index Control Arrays
|
||||
.index Index Property
|
||||
|
||||
.h1 Control Arrays
|
||||
|
||||
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.
|
||||
|
||||
.h2 Defining Control Arrays in FRM
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.h2 Event Handler Convention
|
||||
|
||||
When a control has an Index property (>= 0), the event handler receives Index As Integer as the first parameter, before any event-specific parameters.
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.h2 Accessing Array Elements in Code
|
||||
|
||||
Use the indexed form ControlName(Index) to access a specific element:
|
||||
|
||||
.code
|
||||
Command1(0).Caption = "New Text"
|
||||
Command1(1).Enabled = False
|
||||
.endcode
|
||||
|
||||
.note info
|
||||
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)).
|
||||
.endnote
|
||||
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.frm FRM File Format
|
||||
|
||||
|
||||
.topic ctrl.frm
|
||||
.title FRM File Format
|
||||
.toc 1 FRM File Format
|
||||
.index FRM
|
||||
.index .frm
|
||||
.index Form File
|
||||
|
||||
.h1 FRM File Format
|
||||
|
||||
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.
|
||||
|
||||
.h2 Structure
|
||||
|
||||
.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
|
||||
.endcode
|
||||
|
||||
.h2 Rules
|
||||
|
||||
.list
|
||||
.item The VERSION line is optional. VERSION DVX 1.00 marks a native DVX form. VB forms with version <= 2.0 are accepted for import.
|
||||
.item The form block begins with Begin Form Name and ends with End.
|
||||
.item Controls are nested with Begin TypeName Name / End.
|
||||
.item Container controls (Frame, VBox, HBox, Toolbar, TabStrip, ScrollPane, Splitter, WrapBox) can have child controls nested inside them.
|
||||
.item Properties are assigned as Key = Value. String values are optionally quoted.
|
||||
.item Everything after the form's closing End is BASIC source code.
|
||||
.item Comments in the form section use ' (single quote).
|
||||
.item Blank lines are ignored in the form section.
|
||||
.endlist
|
||||
|
||||
.h2 Common FRM Properties
|
||||
|
||||
.table
|
||||
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.
|
||||
.endtable
|
||||
|
||||
.link ctrl.form Form
|
||||
.link ctrl.common.props Common Properties, Events, and Methods
|
||||
.link ctrl.menus Menu System
|
||||
.link ctrl.arrays Control Arrays
|
||||
|
|
@ -110,6 +110,8 @@
|
|||
#define CMD_WIN_WATCH 154
|
||||
#define CMD_WIN_BREAKPOINTS 155
|
||||
#define CMD_DEBUG_LAYOUT 156
|
||||
#define CMD_HELP_CONTENTS 157
|
||||
#define CMD_HELP_API 158
|
||||
#define IDE_MAX_IMM 1024
|
||||
#define IDE_DESIGN_W 400
|
||||
#define IDE_DESIGN_H 300
|
||||
|
|
@ -560,6 +562,9 @@ int32_t appMain(DxeAppContextT *ctx) {
|
|||
sCtx = ctx;
|
||||
sAc = ctx->shellCtx;
|
||||
|
||||
// Set help file for F1
|
||||
snprintf(ctx->helpFile, sizeof(ctx->helpFile), "%s%c%s", ctx->appDir, DVX_PATH_SEP, "dvxbasic.hlp");
|
||||
|
||||
basStringSystemInit();
|
||||
prjInit(&sProject);
|
||||
buildWindow();
|
||||
|
|
@ -740,6 +745,9 @@ static void buildWindow(void) {
|
|||
wmAddMenuCheckItem(toolsMenu, "Debug &Layout", CMD_DEBUG_LAYOUT, false);
|
||||
|
||||
MenuT *helpMenu = wmAddMenu(menuBar, "&Help");
|
||||
wmAddMenuItem(helpMenu, "&DVX BASIC Help\tF1", CMD_HELP_CONTENTS);
|
||||
wmAddMenuItem(helpMenu, "DVX &API Reference", CMD_HELP_API);
|
||||
wmAddMenuSeparator(helpMenu);
|
||||
wmAddMenuItem(helpMenu, "&About DVX BASIC...", CMD_HELP_ABOUT);
|
||||
|
||||
AccelTableT *accel = dvxCreateAccelTable();
|
||||
|
|
@ -4537,6 +4545,22 @@ static void onMenu(WindowT *win, int32_t menuId) {
|
|||
wgtSetDebugLayout(sAc, wmMenuItemIsChecked(sWin->menuBar, CMD_DEBUG_LAYOUT));
|
||||
}
|
||||
|
||||
if (menuId == CMD_HELP_CONTENTS) {
|
||||
char hlpPath[DVX_MAX_PATH];
|
||||
char viewerPath[DVX_MAX_PATH];
|
||||
snprintf(hlpPath, sizeof(hlpPath), "%s%c%s", sCtx->appDir, DVX_PATH_SEP, "dvxbasic.hlp");
|
||||
snprintf(viewerPath, sizeof(viewerPath), "APPS%cDVXHELP%cDVXHELP.APP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
shellLoadAppWithArgs(sAc, viewerPath, hlpPath);
|
||||
}
|
||||
|
||||
if (menuId == CMD_HELP_API) {
|
||||
char viewerPath[DVX_MAX_PATH];
|
||||
char sysHlp[DVX_MAX_PATH];
|
||||
snprintf(viewerPath, sizeof(viewerPath), "APPS%cDVXHELP%cDVXHELP.APP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
snprintf(sysHlp, sizeof(sysHlp), "APPS%cPROGMAN%cDVXHELP.HLP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
shellLoadAppWithArgs(sAc, viewerPath, sysHlp);
|
||||
}
|
||||
|
||||
if (menuId == CMD_HELP_ABOUT) {
|
||||
dvxMessageBox(sAc, "About DVX BASIC",
|
||||
"DVX BASIC 1.0\n"
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.file
|
||||
.title File Menu
|
||||
.toc 0 Menu Reference
|
||||
.toc 1 File Menu
|
||||
.toc 1 Menu Reference
|
||||
.toc 2 File Menu
|
||||
.index File Menu
|
||||
.index New Project
|
||||
.index Open Project
|
||||
|
|
@ -97,7 +97,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.edit
|
||||
.title Edit Menu
|
||||
.toc 1 Edit Menu
|
||||
.toc 2 Edit Menu
|
||||
.index Edit Menu
|
||||
.index Cut
|
||||
.index Copy
|
||||
|
|
@ -131,7 +131,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.run
|
||||
.title Run Menu
|
||||
.toc 1 Run Menu
|
||||
.toc 2 Run Menu
|
||||
.index Run Menu
|
||||
.index Run
|
||||
.index Debug
|
||||
|
|
@ -172,7 +172,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.view
|
||||
.title View Menu
|
||||
.toc 1 View Menu
|
||||
.toc 2 View Menu
|
||||
.index View Menu
|
||||
.index Code View
|
||||
.index Design View
|
||||
|
|
@ -199,7 +199,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.window
|
||||
.title Window Menu
|
||||
.toc 1 Window Menu
|
||||
.toc 2 Window Menu
|
||||
.index Window Menu
|
||||
|
||||
.h1 Window Menu
|
||||
|
|
@ -225,7 +225,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.tools
|
||||
.title Tools Menu
|
||||
.toc 1 Tools Menu
|
||||
.toc 2 Tools Menu
|
||||
.index Tools Menu
|
||||
.index Preferences
|
||||
.index Debug Layout
|
||||
|
|
@ -245,7 +245,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.menu.help
|
||||
.title Help Menu
|
||||
.toc 1 Help Menu
|
||||
.toc 2 Help Menu
|
||||
.index Help Menu
|
||||
.index About
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ The IDE compiles BASIC source into bytecode and runs it in an integrated virtual
|
|||
|
||||
.topic ide.toolbar
|
||||
.title Toolbar
|
||||
.toc 0 Toolbar
|
||||
.toc 1 Toolbar
|
||||
.index Toolbar
|
||||
|
||||
.h1 Toolbar
|
||||
|
|
@ -311,7 +311,7 @@ The toolbar is organized into four groups separated by vertical dividers. Each b
|
|||
|
||||
.topic ide.editor
|
||||
.title Code Editor
|
||||
.toc 0 Code Editor
|
||||
.toc 1 Code Editor
|
||||
.index Code Editor
|
||||
.index Syntax Highlighting
|
||||
.index Object Dropdown
|
||||
|
|
@ -363,7 +363,7 @@ The editor applies real-time syntax coloring as you type. The following categori
|
|||
|
||||
.topic ide.designer
|
||||
.title Form Designer
|
||||
.toc 0 Form Designer
|
||||
.toc 1 Form Designer
|
||||
.index Form Designer
|
||||
.index Design Surface
|
||||
.index Grid Snapping
|
||||
|
|
@ -397,7 +397,7 @@ Forms have the following design-time properties: Name, Caption, Width, Height, L
|
|||
|
||||
.topic ide.project
|
||||
.title Project System
|
||||
.toc 0 Project System
|
||||
.toc 1 Project System
|
||||
.index Project System
|
||||
.index Project Files
|
||||
.index .dbp Files
|
||||
|
|
@ -443,7 +443,7 @@ The Project Explorer is a tree view window listing all project files. Double-cli
|
|||
|
||||
.topic ide.properties
|
||||
.title Properties Panel
|
||||
.toc 0 Properties Panel
|
||||
.toc 1 Properties Panel
|
||||
.index Properties Panel
|
||||
.index Control Properties
|
||||
.index Property List
|
||||
|
|
@ -465,7 +465,7 @@ Each control type exposes different properties (e.g., Caption, Text, Width, Heig
|
|||
|
||||
.topic ide.toolbox
|
||||
.title Toolbox
|
||||
.toc 0 Toolbox
|
||||
.toc 1 Toolbox
|
||||
.index Toolbox
|
||||
.index Controls
|
||||
.index Widget Palette
|
||||
|
|
@ -520,7 +520,7 @@ Click a tool to select it (the active tool name is stored in the designer state)
|
|||
|
||||
.topic ide.debugger
|
||||
.title Debugger
|
||||
.toc 0 Debugger
|
||||
.toc 1 Debugger
|
||||
.index Debugger
|
||||
.index Breakpoints
|
||||
.index Stepping
|
||||
|
|
@ -618,8 +618,8 @@ Press Esc or click the Stop toolbar button at any time to halt execution. The VM
|
|||
|
||||
.topic ide.debug.locals
|
||||
.title Locals Window
|
||||
.toc 0 Debug Windows
|
||||
.toc 1 Locals Window
|
||||
.toc 1 Debug Windows
|
||||
.toc 2 Locals Window
|
||||
.index Locals Window
|
||||
.index Variable Inspection
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ Up to 64 variables are displayed. The window is resizable.
|
|||
|
||||
.topic ide.debug.callstack
|
||||
.title Call Stack Window
|
||||
.toc 1 Call Stack Window
|
||||
.toc 2 Call Stack Window
|
||||
.index Call Stack
|
||||
.index Stack Trace
|
||||
|
||||
|
|
@ -674,7 +674,7 @@ The current location is shown first, followed by each caller in the call stack (
|
|||
|
||||
.topic ide.debug.watch
|
||||
.title Watch Window
|
||||
.toc 1 Watch Window
|
||||
.toc 2 Watch Window
|
||||
.index Watch Window
|
||||
.index Watch Expressions
|
||||
|
||||
|
|
@ -717,7 +717,7 @@ Watch expressions support:
|
|||
|
||||
.topic ide.debug.breakpoints
|
||||
.title Breakpoints Window
|
||||
.toc 1 Breakpoints Window
|
||||
.toc 2 Breakpoints Window
|
||||
.index Breakpoints Window
|
||||
|
||||
.h1 Breakpoints Window
|
||||
|
|
@ -742,7 +742,7 @@ Lists all set breakpoints as a three-column ListView:
|
|||
|
||||
.topic ide.immediate
|
||||
.title Immediate Window
|
||||
.toc 0 Immediate Window
|
||||
.toc 1 Immediate Window
|
||||
.index Immediate Window
|
||||
.index REPL
|
||||
.index Expression Evaluation
|
||||
|
|
@ -801,7 +801,7 @@ If the assignment target cannot be resolved (unknown variable, out-of-bounds ind
|
|||
|
||||
.topic ide.output
|
||||
.title Output Window
|
||||
.toc 0 Output Window
|
||||
.toc 1 Output Window
|
||||
.index Output Window
|
||||
.index PRINT Output
|
||||
.index Runtime Errors
|
||||
|
|
@ -825,7 +825,7 @@ INPUT statements prompt the user via a modal InputBox dialog; the prompt text is
|
|||
|
||||
.topic ide.findreplace
|
||||
.title Find / Replace
|
||||
.toc 0 Find / Replace
|
||||
.toc 1 Find / Replace
|
||||
.index Find
|
||||
.index Replace
|
||||
.index Find Next
|
||||
|
|
@ -866,7 +866,7 @@ F3 repeats the last search (Find Next) without opening the dialog.
|
|||
|
||||
.topic ide.preferences
|
||||
.title Preferences
|
||||
.toc 0 Preferences
|
||||
.toc 1 Preferences
|
||||
.index Preferences
|
||||
.index Settings
|
||||
.index Tab Width
|
||||
|
|
@ -905,7 +905,7 @@ These fields set the default values for new project metadata:
|
|||
|
||||
.topic ide.shortcuts
|
||||
.title Keyboard Shortcuts
|
||||
.toc 0 Keyboard Shortcuts
|
||||
.toc 1 Keyboard Shortcuts
|
||||
.index Keyboard Shortcuts
|
||||
.index Hotkeys
|
||||
.index Accelerators
|
||||
|
|
@ -73,7 +73,7 @@ When mixing types in expressions, values are automatically promoted to a common
|
|||
|
||||
.topic lang.operators
|
||||
.title Operators
|
||||
.toc 0 Operators
|
||||
.toc 1 Operators
|
||||
.index Operators
|
||||
.index Precedence
|
||||
.index AND
|
||||
|
|
@ -116,7 +116,7 @@ result$ = firstName$ & " " & lastName$
|
|||
|
||||
.topic lang.statements
|
||||
.title Statements Overview
|
||||
.toc 0 Statements
|
||||
.toc 1 Statements
|
||||
.index Statements
|
||||
.index REM
|
||||
.index Comments
|
||||
|
|
@ -135,7 +135,7 @@ Multiple statements can appear on one line separated by :. Lines can be continue
|
|||
|
||||
.topic lang.declarations
|
||||
.title Declaration Statements
|
||||
.toc 1 Declarations
|
||||
.toc 2 Declarations
|
||||
.index DIM
|
||||
.index REDIM
|
||||
.index CONST
|
||||
|
|
@ -352,7 +352,7 @@ ERASE arrayName
|
|||
|
||||
.topic lang.conditionals
|
||||
.title Conditional Statements
|
||||
.toc 1 Conditionals
|
||||
.toc 2 Conditionals
|
||||
.index IF
|
||||
.index THEN
|
||||
.index ELSE
|
||||
|
|
@ -438,7 +438,7 @@ CASE items can be combined with commas. The IS keyword allows comparison operato
|
|||
|
||||
.topic lang.loops
|
||||
.title Loop Statements
|
||||
.toc 1 Loops
|
||||
.toc 2 Loops
|
||||
.index FOR
|
||||
.index NEXT
|
||||
.index STEP
|
||||
|
|
@ -521,7 +521,7 @@ Wend
|
|||
|
||||
.topic lang.procedures
|
||||
.title Procedures
|
||||
.toc 1 Procedures
|
||||
.toc 2 Procedures
|
||||
.index SUB
|
||||
.index END SUB
|
||||
.index FUNCTION
|
||||
|
|
@ -586,7 +586,7 @@ Print FnSquare(5) ' prints 25
|
|||
|
||||
.topic lang.flow
|
||||
.title Flow Control
|
||||
.toc 1 Flow Control
|
||||
.toc 2 Flow Control
|
||||
.index EXIT
|
||||
.index CALL
|
||||
.index GOTO
|
||||
|
|
@ -653,7 +653,7 @@ If the expression evaluates to 1, control goes to the first label; 2, the second
|
|||
|
||||
.topic lang.io
|
||||
.title Input/Output Statements
|
||||
.toc 1 Input/Output
|
||||
.toc 2 Input/Output
|
||||
.index PRINT
|
||||
.index INPUT
|
||||
.index DATA
|
||||
|
|
@ -731,7 +731,7 @@ Restore
|
|||
|
||||
.topic lang.misc
|
||||
.title Miscellaneous Statements
|
||||
.toc 1 Miscellaneous Statements
|
||||
.toc 2 Miscellaneous Statements
|
||||
.index ON ERROR
|
||||
.index RESUME
|
||||
.index RESUME NEXT
|
||||
|
|
@ -809,7 +809,7 @@ END
|
|||
|
||||
.topic lang.fileio
|
||||
.title File I/O
|
||||
.toc 0 File I/O
|
||||
.toc 1 File I/O
|
||||
.index OPEN
|
||||
.index CLOSE
|
||||
.index PRINT #
|
||||
|
|
@ -914,8 +914,8 @@ pos = SEEK(channel) ' Function: get current position
|
|||
|
||||
.topic lang.func.string
|
||||
.title String Functions
|
||||
.toc 0 Built-in Functions
|
||||
.toc 1 String Functions
|
||||
.toc 1 Built-in Functions
|
||||
.toc 2 String Functions
|
||||
.index ASC
|
||||
.index CHR$
|
||||
.index FORMAT$
|
||||
|
|
@ -971,7 +971,7 @@ Mid$(s$, 3, 2) = "XY" ' Replace 2 characters starting at position 3
|
|||
|
||||
.topic lang.func.math
|
||||
.title Math Functions
|
||||
.toc 1 Math Functions
|
||||
.toc 2 Math Functions
|
||||
.index ABS
|
||||
.index ATN
|
||||
.index COS
|
||||
|
|
@ -1012,7 +1012,7 @@ RND with a negative argument seeds and returns. RND(0) returns the previous valu
|
|||
|
||||
.topic lang.func.conversion
|
||||
.title Conversion Functions
|
||||
.toc 1 Conversion Functions
|
||||
.toc 2 Conversion Functions
|
||||
.index CDBL
|
||||
.index CINT
|
||||
.index CLNG
|
||||
|
|
@ -1033,7 +1033,7 @@ RND with a negative argument seeds and returns. RND(0) returns the previous valu
|
|||
|
||||
.topic lang.func.fileio
|
||||
.title File I/O Functions
|
||||
.toc 1 File I/O Functions
|
||||
.toc 2 File I/O Functions
|
||||
.index EOF
|
||||
.index FREEFILE
|
||||
.index INPUT$
|
||||
|
|
@ -1059,7 +1059,7 @@ RND with a negative argument seeds and returns. RND(0) returns the previous valu
|
|||
|
||||
.topic lang.func.misc
|
||||
.title Miscellaneous Functions
|
||||
.toc 1 Miscellaneous Functions
|
||||
.toc 2 Miscellaneous Functions
|
||||
.index DATE$
|
||||
.index TIME$
|
||||
.index ENVIRON$
|
||||
|
|
@ -1077,7 +1077,7 @@ RND with a negative argument seeds and returns. RND(0) returns the previous valu
|
|||
|
||||
.topic lang.forms
|
||||
.title Form and Control Statements
|
||||
.toc 0 Form and Control Statements
|
||||
.toc 1 Form and Control Statements
|
||||
.index LOAD
|
||||
.index UNLOAD
|
||||
.index Show
|
||||
|
|
@ -1254,7 +1254,7 @@ End Sub
|
|||
|
||||
.topic lang.sql
|
||||
.title SQL Functions
|
||||
.toc 0 SQL Functions
|
||||
.toc 1 SQL Functions
|
||||
.index SQLOpen
|
||||
.index SQLClose
|
||||
.index SQLExec
|
||||
|
|
@ -1433,7 +1433,7 @@ SQLClose db
|
|||
|
||||
.topic lang.app
|
||||
.title App Object
|
||||
.toc 0 App Object
|
||||
.toc 1 App Object
|
||||
.index App
|
||||
.index App.Path
|
||||
.index App.Config
|
||||
|
|
@ -1459,7 +1459,7 @@ Print "Running from: " & App.Path
|
|||
|
||||
.topic lang.ini
|
||||
.title INI Functions
|
||||
.toc 0 INI Functions
|
||||
.toc 1 INI Functions
|
||||
.index IniRead
|
||||
.index IniWrite
|
||||
.index INI
|
||||
|
|
@ -1496,7 +1496,7 @@ IniWrite App.Config & "\app.ini", "Display", "FontSize", Str$(fontSize)
|
|||
|
||||
.topic lang.constants
|
||||
.title Predefined Constants
|
||||
.toc 0 Predefined Constants
|
||||
.toc 1 Predefined Constants
|
||||
.index vbOKOnly
|
||||
.index vbOKCancel
|
||||
.index vbYesNo
|
||||
|
|
@ -46,15 +46,17 @@
|
|||
#define HELP_SPLITTER_POS 160
|
||||
#define HELP_TOC_MIN_W 100
|
||||
#define HELP_CONTENT_PAD 6
|
||||
#define HELP_HEADING1_PAD 4
|
||||
#define HELP_HEADING2_PAD 2
|
||||
#define HELP_PARA_SPACING 12
|
||||
#define HELP_HEADING1_TOP 24
|
||||
#define HELP_HEADING1_PAD 6
|
||||
#define HELP_HEADING2_TOP 16
|
||||
#define HELP_HEADING2_PAD 4
|
||||
#define HELP_HEADING3_TOP 8
|
||||
#define HELP_LINK_PAD_X 2
|
||||
#define HELP_LINK_PAD_Y 1
|
||||
#define HELP_NOTE_PAD 6
|
||||
#define HELP_NOTE_PREFIX_W 4
|
||||
#define HELP_CODE_PAD 4
|
||||
#define HELP_LIST_INDENT 12
|
||||
#define HELP_LIST_BULLET_W 8
|
||||
|
||||
#define MAX_HISTORY 64
|
||||
#define MAX_SEARCH_BUF 128
|
||||
|
|
@ -63,6 +65,7 @@
|
|||
#define CMD_FORWARD 101
|
||||
#define CMD_INDEX 102
|
||||
#define CMD_SEARCH 103
|
||||
#define CMD_EXIT 104
|
||||
|
||||
// ============================================================
|
||||
// Module state
|
||||
|
|
@ -91,6 +94,12 @@ static int32_t sHistoryPos = -1;
|
|||
static int32_t sHistoryCount = 0;
|
||||
static int32_t sCurrentTopic = -1;
|
||||
|
||||
// Viewport wrap width — the width text should wrap at, derived from the
|
||||
// ScrollPane's inner area. Updated when the window is first laid out and
|
||||
// on resize. Wrapping widgets use this instead of w->parent->w so that
|
||||
// wide tables/code don't inflate the wrap width.
|
||||
static int32_t sWrapWidth = 0;
|
||||
|
||||
// Custom widget type IDs
|
||||
static int32_t sHelpTextTypeId = -1;
|
||||
static int32_t sHelpHeadingTypeId = -1;
|
||||
|
|
@ -105,8 +114,10 @@ static int32_t sHelpListItemTypeId = -1;
|
|||
// ============================================================
|
||||
|
||||
typedef struct {
|
||||
char *text;
|
||||
int32_t lineCount;
|
||||
char *text; // original flowing text (no newlines)
|
||||
char *wrapped; // cached wrapped text (with \n), NULL = needs wrap
|
||||
int32_t lineCount; // line count of wrapped text
|
||||
int32_t wrapWidth; // pixel width text was wrapped at (-1 = dirty)
|
||||
} HelpTextDataT;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -121,7 +132,9 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
char *text;
|
||||
char *wrapped;
|
||||
int32_t lineCount;
|
||||
int32_t wrapWidth;
|
||||
uint8_t noteType;
|
||||
} HelpNoteDataT;
|
||||
|
||||
|
|
@ -131,7 +144,10 @@ typedef struct {
|
|||
} HelpCodeDataT;
|
||||
|
||||
typedef struct {
|
||||
char *text;
|
||||
char *text;
|
||||
char *wrapped;
|
||||
int32_t lineCount;
|
||||
int32_t wrapWidth;
|
||||
} HelpListItemDataT;
|
||||
|
||||
// ============================================================
|
||||
|
|
@ -167,7 +183,6 @@ static void helpTextDestroy(WidgetT *w);
|
|||
static void helpTextPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
||||
static void historyPush(int32_t topicIdx);
|
||||
static const char *hlpString(uint32_t offset);
|
||||
static int32_t maxLineWidth(const BitmapFontT *font, const char *text);
|
||||
static void navigateBack(void);
|
||||
static void navigateForward(void);
|
||||
static void navigateToTopic(int32_t topicIdx);
|
||||
|
|
@ -200,16 +215,98 @@ AppDescriptorT appDescriptor = {
|
|||
// Utility helpers
|
||||
// ============================================================
|
||||
|
||||
static int32_t countLines(const char *text) {
|
||||
int32_t count = 1;
|
||||
// Word-wrap flowing text to fit within colWidth characters.
|
||||
// Returns a dvxMalloc'd string with \n at wrap points.
|
||||
// Caller must dvxFree the result.
|
||||
static char *wrapText(const char *text, int32_t colWidth) {
|
||||
if (!text || !text[0] || colWidth < 10) {
|
||||
return dvxStrdup(text ? text : "");
|
||||
}
|
||||
|
||||
for (const char *p = text; *p; p++) {
|
||||
int32_t textLen = (int32_t)strlen(text);
|
||||
char *result = (char *)dvxMalloc(textLen + textLen / colWidth + 16);
|
||||
|
||||
if (!result) {
|
||||
return dvxStrdup(text);
|
||||
}
|
||||
|
||||
int32_t outPos = 0;
|
||||
int32_t col = 0;
|
||||
const char *p = text;
|
||||
|
||||
while (*p) {
|
||||
// Skip leading whitespace at start of line
|
||||
if (col == 0) {
|
||||
while (*p == ' ') {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!*p) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Find end of word
|
||||
const char *wordStart = p;
|
||||
|
||||
while (*p && *p != ' ' && *p != '\n') {
|
||||
p++;
|
||||
}
|
||||
|
||||
int32_t wordLen = (int32_t)(p - wordStart);
|
||||
|
||||
// Check if word fits on current line
|
||||
if (col > 0 && col + 1 + wordLen > colWidth) {
|
||||
result[outPos++] = '\n';
|
||||
col = 0;
|
||||
} else if (col > 0) {
|
||||
result[outPos++] = ' ';
|
||||
col++;
|
||||
}
|
||||
|
||||
memcpy(result + outPos, wordStart, wordLen);
|
||||
outPos += wordLen;
|
||||
col += wordLen;
|
||||
|
||||
// Skip spaces between words
|
||||
while (*p == ' ') {
|
||||
p++;
|
||||
}
|
||||
|
||||
// Explicit newline in source = paragraph break
|
||||
if (*p == '\n') {
|
||||
count++;
|
||||
result[outPos++] = '\n';
|
||||
col = 0;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
result[outPos] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// Ensure a HelpText-style widget's wrapped text is up to date for the given pixel width.
|
||||
// Returns the wrapped text and updates lineCount. Uses cached result if width unchanged.
|
||||
// Wrap text at the given pixel width. Caches the result — only re-wraps
|
||||
// when pixelW changes. Returns the wrapped string.
|
||||
static const char *doWrap(char **wrappedPtr, int32_t *wrapWidthPtr, int32_t *lineCountPtr, const char *text, int32_t pixelW, int32_t charW, int32_t padPixels) {
|
||||
int32_t cols = (pixelW - padPixels) / charW;
|
||||
|
||||
if (cols < 10) {
|
||||
cols = 10;
|
||||
}
|
||||
|
||||
// Return cached result if width hasn't changed
|
||||
if (*wrappedPtr && *wrapWidthPtr == pixelW) {
|
||||
return *wrappedPtr;
|
||||
}
|
||||
|
||||
dvxFree(*wrappedPtr);
|
||||
*wrappedPtr = wrapText(text, cols);
|
||||
*wrapWidthPtr = pixelW;
|
||||
*lineCountPtr = countLines(*wrappedPtr);
|
||||
return *wrappedPtr;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -239,6 +336,23 @@ static int32_t maxLineWidth(const BitmapFontT *font, const char *text) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static int32_t countLines(const char *text) {
|
||||
int32_t count = 1;
|
||||
|
||||
for (const char *p = text; *p; p++) {
|
||||
if (*p == '\n') {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void paintLines(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, int32_t x, int32_t y, const char *text, int32_t lineCount, uint32_t fg) {
|
||||
const char *line = text;
|
||||
|
||||
|
|
@ -259,16 +373,33 @@ static void paintLines(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font
|
|||
// HelpText widget class
|
||||
// ============================================================
|
||||
|
||||
|
||||
// Update sWrapWidth from the ScrollPane's current size.
|
||||
static void updateWrapWidth(void) {
|
||||
// 38 = ScrollPane border (4) + VBox padding (12) + scrollbar (14) + 1 char buffer (8)
|
||||
if (sContentScroll && sContentScroll->w > 38) {
|
||||
sWrapWidth = sContentScroll->w - 38;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void helpTextCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||
HelpTextDataT *td = (HelpTextDataT *)w->data;
|
||||
w->calcMinW = maxLineWidth(font, td->text) + HELP_CONTENT_PAD * 2;
|
||||
updateWrapWidth();
|
||||
|
||||
if (sWrapWidth > 0) {
|
||||
doWrap(&td->wrapped, &td->wrapWidth, &td->lineCount, td->text, sWrapWidth, font->charWidth, 0);
|
||||
}
|
||||
|
||||
w->calcMinW = 0;
|
||||
w->calcMinH = td->lineCount * font->charHeight;
|
||||
}
|
||||
|
||||
|
||||
static void helpTextPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||
HelpTextDataT *td = (HelpTextDataT *)w->data;
|
||||
paintLines(d, ops, font, w->x + HELP_CONTENT_PAD, w->y, td->text, td->lineCount, colors->contentFg);
|
||||
const char *text = td->wrapped ? td->wrapped : td->text;
|
||||
paintLines(d, ops, font, w->x + HELP_CONTENT_PAD, w->y, text, td->lineCount, colors->contentFg);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -276,6 +407,7 @@ static void helpTextDestroy(WidgetT *w) {
|
|||
HelpTextDataT *td = (HelpTextDataT *)w->data;
|
||||
|
||||
if (td) {
|
||||
dvxFree(td->wrapped);
|
||||
dvxFree(td->text);
|
||||
dvxFree(td);
|
||||
w->data = NULL;
|
||||
|
|
@ -286,22 +418,27 @@ static void helpTextDestroy(WidgetT *w) {
|
|||
// HelpHeading widget class
|
||||
// ============================================================
|
||||
|
||||
static bool isFirstChild(WidgetT *w) {
|
||||
return w->parent && w->parent->firstChild == w;
|
||||
}
|
||||
|
||||
|
||||
static void helpHeadingCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||
HelpHeadingDataT *hd = (HelpHeadingDataT *)w->data;
|
||||
int32_t textW = textWidth(font, hd->text);
|
||||
int32_t textH = font->charHeight;
|
||||
bool first = isFirstChild(w);
|
||||
|
||||
w->calcMinW = textW + HELP_CONTENT_PAD * 2;
|
||||
w->calcMinW = 0;
|
||||
|
||||
if (hd->level == 1) {
|
||||
// Full bar with padding above and below
|
||||
w->calcMinH = textH + HELP_HEADING1_PAD * 2 + 2;
|
||||
int32_t top = first ? 0 : HELP_HEADING1_TOP;
|
||||
w->calcMinH = top + textH + HELP_HEADING1_PAD * 2;
|
||||
} else if (hd->level == 2) {
|
||||
// Text with underline
|
||||
w->calcMinH = textH + HELP_HEADING2_PAD + 2;
|
||||
int32_t top = first ? 0 : HELP_HEADING2_TOP;
|
||||
w->calcMinH = top + textH + HELP_HEADING2_PAD + 2;
|
||||
} else {
|
||||
// Plain bold text
|
||||
w->calcMinH = textH + 2;
|
||||
int32_t top = first ? 0 : HELP_HEADING3_TOP;
|
||||
w->calcMinH = top + textH;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -309,21 +446,25 @@ static void helpHeadingCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
|||
static void helpHeadingPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||
HelpHeadingDataT *hd = (HelpHeadingDataT *)w->data;
|
||||
int32_t textLen = (int32_t)strlen(hd->text);
|
||||
bool first = isFirstChild(w);
|
||||
|
||||
if (hd->level == 1) {
|
||||
// Filled bar with title bar colors
|
||||
rectFill(d, ops, w->x, w->y, w->w, w->h, colors->activeTitleBg);
|
||||
int32_t textY = w->y + HELP_HEADING1_PAD;
|
||||
int32_t top = first ? 0 : HELP_HEADING1_TOP;
|
||||
int32_t barY = w->y + top;
|
||||
int32_t barH = w->h - top;
|
||||
rectFill(d, ops, w->x, barY, w->w, barH, colors->activeTitleBg);
|
||||
int32_t textY = barY + HELP_HEADING1_PAD;
|
||||
drawTextN(d, ops, font, w->x + HELP_CONTENT_PAD, textY, hd->text, textLen, colors->activeTitleFg, 0, false);
|
||||
} else if (hd->level == 2) {
|
||||
// Text with underline
|
||||
int32_t textY = w->y;
|
||||
int32_t top = first ? 0 : HELP_HEADING2_TOP;
|
||||
int32_t textY = w->y + top;
|
||||
drawTextN(d, ops, font, w->x + HELP_CONTENT_PAD, textY, hd->text, textLen, colors->contentFg, 0, false);
|
||||
int32_t lineY = textY + font->charHeight + 1;
|
||||
drawHLine(d, ops, w->x + HELP_CONTENT_PAD, lineY, w->w - HELP_CONTENT_PAD * 2, colors->windowShadow);
|
||||
} else {
|
||||
// Plain text
|
||||
drawTextN(d, ops, font, w->x + HELP_CONTENT_PAD, w->y, hd->text, textLen, colors->contentFg, 0, false);
|
||||
int32_t top = first ? 0 : HELP_HEADING3_TOP;
|
||||
int32_t textY = w->y + top;
|
||||
drawTextN(d, ops, font, w->x + HELP_CONTENT_PAD, textY, hd->text, textLen, colors->contentFg, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -343,8 +484,7 @@ static void helpHeadingDestroy(WidgetT *w) {
|
|||
// ============================================================
|
||||
|
||||
static void helpLinkCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||
HelpLinkDataT *ld = (HelpLinkDataT *)w->data;
|
||||
w->calcMinW = textWidth(font, ld->displayText) + HELP_CONTENT_PAD * 2 + HELP_LINK_PAD_X * 2;
|
||||
w->calcMinW = 0;
|
||||
w->calcMinH = font->charHeight + HELP_LINK_PAD_Y * 2;
|
||||
}
|
||||
|
||||
|
|
@ -403,7 +543,14 @@ static void helpLinkDestroy(WidgetT *w) {
|
|||
|
||||
static void helpNoteCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||
HelpNoteDataT *nd = (HelpNoteDataT *)w->data;
|
||||
w->calcMinW = maxLineWidth(font, nd->text) + HELP_CONTENT_PAD * 2 + HELP_NOTE_PAD * 2 + HELP_NOTE_PREFIX_W;
|
||||
updateWrapWidth();
|
||||
|
||||
if (sWrapWidth > 0) {
|
||||
int32_t notePad = HELP_NOTE_PAD * 2 + HELP_NOTE_PREFIX_W;
|
||||
doWrap(&nd->wrapped, &nd->wrapWidth, &nd->lineCount, nd->text, sWrapWidth, font->charWidth, notePad);
|
||||
}
|
||||
|
||||
w->calcMinW = 0;
|
||||
w->calcMinH = nd->lineCount * font->charHeight + HELP_NOTE_PAD * 2;
|
||||
}
|
||||
|
||||
|
|
@ -411,7 +558,6 @@ static void helpNoteCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
|||
static void helpNotePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||
HelpNoteDataT *nd = (HelpNoteDataT *)w->data;
|
||||
|
||||
// Left accent bar color varies by note type; background is always windowFace
|
||||
uint32_t barColor;
|
||||
|
||||
if (nd->noteType == HLP_NOTE_WARNING) {
|
||||
|
|
@ -429,7 +575,8 @@ static void helpNotePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const Bi
|
|||
rectFill(d, ops, boxX, w->y, HELP_NOTE_PREFIX_W, w->h, barColor);
|
||||
|
||||
int32_t textX = boxX + HELP_NOTE_PREFIX_W + HELP_NOTE_PAD;
|
||||
paintLines(d, ops, font, textX, w->y + HELP_NOTE_PAD, nd->text, nd->lineCount, colors->contentFg);
|
||||
const char *text = nd->wrapped ? nd->wrapped : nd->text;
|
||||
paintLines(d, ops, font, textX, w->y + HELP_NOTE_PAD, text, nd->lineCount, colors->contentFg);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -437,6 +584,7 @@ static void helpNoteDestroy(WidgetT *w) {
|
|||
HelpNoteDataT *nd = (HelpNoteDataT *)w->data;
|
||||
|
||||
if (nd) {
|
||||
dvxFree(nd->wrapped);
|
||||
dvxFree(nd->text);
|
||||
dvxFree(nd);
|
||||
w->data = NULL;
|
||||
|
|
@ -503,24 +651,21 @@ static void helpRulePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const Bi
|
|||
|
||||
static void helpListItemCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||
HelpListItemDataT *ld = (HelpListItemDataT *)w->data;
|
||||
w->calcMinW = textWidth(font, ld->text) + HELP_CONTENT_PAD * 2 + HELP_LIST_INDENT;
|
||||
w->calcMinH = font->charHeight;
|
||||
updateWrapWidth();
|
||||
|
||||
if (sWrapWidth > 0) {
|
||||
doWrap(&ld->wrapped, &ld->wrapWidth, &ld->lineCount, ld->text, sWrapWidth, font->charWidth, 0);
|
||||
}
|
||||
|
||||
w->calcMinW = 0;
|
||||
w->calcMinH = ld->lineCount * font->charHeight;
|
||||
}
|
||||
|
||||
|
||||
static void helpListItemPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||
HelpListItemDataT *ld = (HelpListItemDataT *)w->data;
|
||||
int32_t textLen = (int32_t)strlen(ld->text);
|
||||
int32_t bulletX = w->x + HELP_CONTENT_PAD + HELP_LIST_INDENT - HELP_LIST_BULLET_W;
|
||||
int32_t textX = w->x + HELP_CONTENT_PAD + HELP_LIST_INDENT;
|
||||
int32_t textY = w->y;
|
||||
|
||||
// Bullet character
|
||||
drawTextN(d, ops, font, bulletX, textY, "\x07", 1, colors->contentFg, 0, false);
|
||||
|
||||
if (textLen > 0) {
|
||||
drawTextN(d, ops, font, textX, textY, ld->text, textLen, colors->contentFg, 0, false);
|
||||
}
|
||||
const char *text = ld->wrapped ? ld->wrapped : ld->text;
|
||||
paintLines(d, ops, font, w->x + HELP_CONTENT_PAD, w->y, text, ld->lineCount, colors->contentFg);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -528,6 +673,7 @@ static void helpListItemDestroy(WidgetT *w) {
|
|||
HelpListItemDataT *ld = (HelpListItemDataT *)w->data;
|
||||
|
||||
if (ld) {
|
||||
dvxFree(ld->wrapped);
|
||||
dvxFree(ld->text);
|
||||
dvxFree(ld);
|
||||
w->data = NULL;
|
||||
|
|
@ -697,15 +843,38 @@ static void navigateForward(void) {
|
|||
}
|
||||
|
||||
|
||||
// userData stores topicIdx + 1 so that topic 0 doesn't collide with NULL
|
||||
#define TOPIC_TO_USERDATA(idx) ((void *)(intptr_t)((idx) + 1))
|
||||
#define USERDATA_TO_TOPIC(ud) ((int32_t)(intptr_t)(ud) - 1)
|
||||
|
||||
static WidgetT *findTreeItemByTopic(WidgetT *node, int32_t topicIdx) {
|
||||
for (WidgetT *child = node->firstChild; child; child = child->nextSibling) {
|
||||
if (child->userData && USERDATA_TO_TOPIC(child->userData) == topicIdx) {
|
||||
return child;
|
||||
}
|
||||
|
||||
WidgetT *found = findTreeItemByTopic(child, topicIdx);
|
||||
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void navigateToTopic(int32_t topicIdx) {
|
||||
if (topicIdx < 0 || (uint32_t)topicIdx >= sHeader.topicCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (topicIdx == sCurrentTopic) {
|
||||
dvxLog("[WRAP] navigateToTopic: SKIPPED (same topic %d)", (int)topicIdx);
|
||||
return;
|
||||
}
|
||||
|
||||
dvxLog("[WRAP] navigateToTopic: %d -> %d", (int)sCurrentTopic, (int)topicIdx);
|
||||
historyPush(topicIdx);
|
||||
sCurrentTopic = topicIdx;
|
||||
buildContentWidgets();
|
||||
|
|
@ -716,6 +885,20 @@ static void navigateToTopic(int32_t topicIdx) {
|
|||
char winTitle[300];
|
||||
snprintf(winTitle, sizeof(winTitle), "%s - DVX Help", title);
|
||||
dvxSetTitle(sAc, sWin, winTitle);
|
||||
|
||||
// Sync TOC tree selection
|
||||
if (sTocTree) {
|
||||
WidgetT *item = findTreeItemByTopic(sTocTree, topicIdx);
|
||||
dvxLog("[WRAP] treeSync: topicIdx=%d item=%p", (int)topicIdx, (void *)item);
|
||||
|
||||
if (item) {
|
||||
// Suppress onChange to avoid re-entering navigateToTopic
|
||||
void (*savedOnChange)(WidgetT *) = sTocTree->onChange;
|
||||
sTocTree->onChange = NULL;
|
||||
wgtTreeViewSetSelected(sTocTree, item);
|
||||
sTocTree->onChange = savedOnChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -745,7 +928,7 @@ static void displayRecord(const HlpRecordHdrT *hdr, const char *payload) {
|
|||
if (w) {
|
||||
HelpTextDataT *td = (HelpTextDataT *)dvxCalloc(1, sizeof(HelpTextDataT));
|
||||
td->text = dvxStrdup(payload);
|
||||
td->lineCount = countLines(td->text);
|
||||
td->wrapWidth = -1;
|
||||
w->data = td;
|
||||
}
|
||||
|
||||
|
|
@ -768,9 +951,9 @@ static void displayRecord(const HlpRecordHdrT *hdr, const char *payload) {
|
|||
}
|
||||
|
||||
case HLP_REC_LINK: {
|
||||
// Payload: display text \0 target topic ID \0
|
||||
const char *displayText = payload;
|
||||
const char *targetTopicId = payload + strlen(payload) + 1;
|
||||
// Payload: target topic ID \0 display text \0
|
||||
const char *targetTopicId = payload;
|
||||
const char *displayText = payload + strlen(payload) + 1;
|
||||
WidgetT *w = widgetAlloc(sContentBox, sHelpLinkTypeId);
|
||||
|
||||
if (w) {
|
||||
|
|
@ -819,8 +1002,18 @@ static void displayRecord(const HlpRecordHdrT *hdr, const char *payload) {
|
|||
|
||||
if (w) {
|
||||
HelpListItemDataT *ld = (HelpListItemDataT *)dvxCalloc(1, sizeof(HelpListItemDataT));
|
||||
ld->text = dvxStrdup(payload);
|
||||
w->data = ld;
|
||||
// Prepend bullet + space to the text
|
||||
int32_t pLen = (int32_t)strlen(payload);
|
||||
ld->text = (char *)dvxMalloc(pLen + 3);
|
||||
|
||||
if (ld->text) {
|
||||
ld->text[0] = '\x07';
|
||||
ld->text[1] = ' ';
|
||||
memcpy(ld->text + 2, payload, pLen + 1);
|
||||
}
|
||||
|
||||
ld->wrapWidth = -1;
|
||||
w->data = ld;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -837,7 +1030,7 @@ static void displayRecord(const HlpRecordHdrT *hdr, const char *payload) {
|
|||
if (w) {
|
||||
HelpNoteDataT *nd = (HelpNoteDataT *)dvxCalloc(1, sizeof(HelpNoteDataT));
|
||||
nd->text = dvxStrdup(payload);
|
||||
nd->lineCount = countLines(nd->text);
|
||||
nd->wrapWidth = -1;
|
||||
nd->noteType = hdr->flags;
|
||||
w->data = nd;
|
||||
}
|
||||
|
|
@ -875,6 +1068,8 @@ static void displayRecord(const HlpRecordHdrT *hdr, const char *payload) {
|
|||
}
|
||||
|
||||
|
||||
// Re-wrap all text content widgets at the current content box width.
|
||||
|
||||
static void buildContentWidgets(void) {
|
||||
if (!sContentBox || sCurrentTopic < 0) {
|
||||
return;
|
||||
|
|
@ -927,12 +1122,25 @@ static void buildContentWidgets(void) {
|
|||
dvxFree(payload);
|
||||
}
|
||||
|
||||
// Scroll to top by scrolling the first child into view
|
||||
if (sContentScroll && sContentBox->firstChild) {
|
||||
wgtScrollPaneScrollToChild(sContentScroll, sContentBox->firstChild);
|
||||
// Compute viewport wrap width from the ScrollPane.
|
||||
// ScrollPane border = 2*2 = 4, vertical scrollbar = 14, VBox padding = 2*6 = 12.
|
||||
// Total overhead = 30. This is approximate but stable.
|
||||
if (sContentScroll && sContentScroll->w > 30) {
|
||||
updateWrapWidth();
|
||||
}
|
||||
|
||||
wgtInvalidate(sContentBox);
|
||||
// Reset scroll to top
|
||||
if (sContentScroll) {
|
||||
wgtScrollPaneScrollToTop(sContentScroll);
|
||||
}
|
||||
|
||||
// Two invalidate passes: the first does measure+layout which may change
|
||||
// scrollbar visibility (altering available width). The second re-measures
|
||||
// at the corrected width so heights match the actual layout.
|
||||
if (sContentScroll) {
|
||||
wgtInvalidate(sContentScroll);
|
||||
wgtInvalidate(sContentScroll);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
|
@ -965,8 +1173,8 @@ static void populateToc(void) {
|
|||
WidgetT *item = wgtTreeItem(parent, title);
|
||||
|
||||
if (item) {
|
||||
// Store topic index in userData for selection callback
|
||||
item->userData = (void *)(intptr_t)entry->topicIdx;
|
||||
// Store topic index in userData (+1 so topic 0 != NULL)
|
||||
item->userData = TOPIC_TO_USERDATA(entry->topicIdx);
|
||||
|
||||
// Update parent for next deeper level
|
||||
if (depth + 1 < MAX_TOC_DEPTH) {
|
||||
|
|
@ -1168,6 +1376,12 @@ static void onMenu(WindowT *win, int32_t menuId) {
|
|||
case CMD_SEARCH:
|
||||
onSearch(NULL);
|
||||
break;
|
||||
|
||||
case CMD_EXIT:
|
||||
if (sWin) {
|
||||
onClose(sWin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1262,13 +1476,13 @@ static void onSearch(WidgetT *w) {
|
|||
static void onTocChange(WidgetT *w) {
|
||||
WidgetT *selected = wgtTreeViewGetSelected(w);
|
||||
|
||||
if (!selected) {
|
||||
if (!selected || !selected->userData) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t topicIdx = (int32_t)(intptr_t)selected->userData;
|
||||
int32_t topicIdx = USERDATA_TO_TOPIC(selected->userData);
|
||||
|
||||
if (topicIdx == 0xFFFF) {
|
||||
if (topicIdx < 0 || topicIdx >= (int32_t)sHeader.topicCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1324,8 +1538,8 @@ int32_t appMain(DxeAppContextT *ctx) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
sWin->onClose = onClose;
|
||||
sWin->onMenu = onMenu;
|
||||
sWin->onClose = onClose;
|
||||
sWin->onMenu = onMenu;
|
||||
|
||||
// Menu bar
|
||||
MenuBarT *menuBar = wmAddMenuBar(sWin);
|
||||
|
|
@ -1336,6 +1550,8 @@ int32_t appMain(DxeAppContextT *ctx) {
|
|||
wmAddMenuSeparator(navMenu);
|
||||
wmAddMenuItem(navMenu, "&Index...", CMD_INDEX);
|
||||
wmAddMenuItem(navMenu, "&Search...", CMD_SEARCH);
|
||||
wmAddMenuSeparator(navMenu);
|
||||
wmAddMenuItem(navMenu, "E&xit", CMD_EXIT);
|
||||
|
||||
// Widget tree
|
||||
WidgetT *root = wgtInitWindow(sAc, sWin);
|
||||
|
|
@ -1370,7 +1586,7 @@ int32_t appMain(DxeAppContextT *ctx) {
|
|||
sContentScroll->weight = 100;
|
||||
|
||||
sContentBox = wgtVBox(sContentScroll);
|
||||
sContentBox->spacing = wgtPixels(2);
|
||||
sContentBox->spacing = wgtPixels(HELP_PARA_SPACING);
|
||||
sContentBox->padding = wgtPixels(HELP_CONTENT_PAD);
|
||||
|
||||
wgtSplitterSetPos(splitter, HELP_SPLITTER_POS);
|
||||
|
|
|
|||
216
apps/dvxhelp/help.dhs
Normal file
216
apps/dvxhelp/help.dhs
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
.topic help.overview
|
||||
.title DVX Help Viewer
|
||||
.toc 0 DVX Help Viewer
|
||||
.default
|
||||
.index DVX Help
|
||||
.index Help Viewer
|
||||
|
||||
.h1 DVX Help Viewer
|
||||
|
||||
The DVX Help Viewer displays .hlp help files compiled from .dhs source documents. It provides a tree-based table of contents, scrollable content with word-wrapped text, clickable hyperlinks, full-text search, and a keyword index.
|
||||
|
||||
.h2 Opening Help
|
||||
|
||||
Press F1 from any DVX application to open context-sensitive help. Applications can register their own help file and topic so F1 opens the relevant page.
|
||||
|
||||
You can also launch the help viewer from an application's Help menu, or by clicking the DVX Help icon in the Program Manager.
|
||||
|
||||
.h2 Navigation
|
||||
|
||||
.list
|
||||
.item Click a topic in the tree on the left to display it
|
||||
.item Click underlined links in the content to jump to other topics
|
||||
.item Use the Back and Forward buttons (or Navigate menu) to retrace your steps
|
||||
.item Use Navigate > Index to browse an alphabetical keyword list
|
||||
.item Use Navigate > Search to find topics by keyword
|
||||
.endlist
|
||||
|
||||
.h2 Keyboard Shortcuts
|
||||
|
||||
.table
|
||||
Alt+Left Back
|
||||
Alt+Right Forward
|
||||
Ctrl+F Search
|
||||
Escape Close viewer
|
||||
.endtable
|
||||
|
||||
.topic help.format
|
||||
.title Help Source Format (.dhs)
|
||||
.toc 0 Help Source Format
|
||||
.index .dhs
|
||||
.index Source Format
|
||||
.index Directives
|
||||
|
||||
.h1 Help Source Format (.dhs)
|
||||
|
||||
Help files are authored as plain text .dhs source files using a simple line-oriented directive format. Lines beginning with a period at column 0 are directives. All other lines are body text, which is automatically word-wrapped by the viewer at display time.
|
||||
|
||||
.h2 Topic Directives
|
||||
|
||||
.table
|
||||
.topic <id> Start a new topic with a unique string ID
|
||||
.title <text> Set the topic's display title
|
||||
.toc <depth> <text> Add a table of contents entry (0=root, 1=child, etc.)
|
||||
.default Mark this topic as the one shown when the file opens
|
||||
.endtable
|
||||
|
||||
.h2 Content Directives
|
||||
|
||||
.table
|
||||
.h1 <text> Level 1 heading (colored bar)
|
||||
.h2 <text> Level 2 heading (underlined)
|
||||
.h3 <text> Level 3 heading (plain)
|
||||
.hr Horizontal rule
|
||||
.link <id> <text> Hyperlink to another topic
|
||||
.image <file.bmp> Inline image (BMP format)
|
||||
.endtable
|
||||
|
||||
.h2 Block Directives
|
||||
|
||||
.table
|
||||
.list Start a bulleted list
|
||||
.item <text> List item (must be inside .list)
|
||||
.endlist End the bulleted list
|
||||
.table Start a preformatted table block
|
||||
.endtable End table block
|
||||
.code Start a preformatted code block
|
||||
.endcode End code block
|
||||
.note [info|tip|warning] Start a callout box
|
||||
.endnote End callout box
|
||||
.endtable
|
||||
|
||||
.h2 Index Directives
|
||||
|
||||
.table
|
||||
.index <keyword> Add a keyword to the index pointing to this topic
|
||||
.endtable
|
||||
|
||||
.h2 Example
|
||||
|
||||
.code
|
||||
.topic intro
|
||||
.title Welcome
|
||||
.toc 0 Welcome
|
||||
.default
|
||||
.index Welcome
|
||||
|
||||
.h1 Welcome
|
||||
|
||||
This is a paragraph of body text. It will be
|
||||
automatically word-wrapped by the viewer.
|
||||
|
||||
.list
|
||||
.item First item
|
||||
.item Second item
|
||||
.endlist
|
||||
|
||||
.link other.topic See also: Other Topic
|
||||
|
||||
.note info
|
||||
This is an informational note.
|
||||
.endnote
|
||||
|
||||
.note tip
|
||||
This is a helpful tip.
|
||||
.endnote
|
||||
|
||||
.note warning
|
||||
This is a warning message.
|
||||
.endnote
|
||||
.endcode
|
||||
|
||||
.h2 Callout Boxes
|
||||
|
||||
Three types of callout boxes are available, each with a distinct colored accent bar:
|
||||
|
||||
.note info
|
||||
Use info notes for general supplementary information.
|
||||
.endnote
|
||||
|
||||
.note tip
|
||||
Use tip notes for helpful suggestions and best practices.
|
||||
.endnote
|
||||
|
||||
.note warning
|
||||
Use warning notes for important cautions the reader should be aware of.
|
||||
.endnote
|
||||
|
||||
.topic help.compiler
|
||||
.title Help Compiler (dvxhlpc)
|
||||
.toc 0 Help Compiler
|
||||
.index dvxhlpc
|
||||
.index Compiler
|
||||
|
||||
.h1 Help Compiler (dvxhlpc)
|
||||
|
||||
The dvxhlpc tool runs on the host (Linux) and compiles .dhs source files into binary .hlp files for the viewer, and optionally into self-contained HTML.
|
||||
|
||||
.h2 Usage
|
||||
|
||||
.code
|
||||
dvxhlpc -o output.hlp [-i imagedir] [--html out.html] input.dhs [...]
|
||||
.endcode
|
||||
|
||||
.h2 Options
|
||||
|
||||
.table
|
||||
-o output.hlp Output binary help file (required)
|
||||
-i imagedir Directory to find .image files (default: current dir)
|
||||
--html out.html Also emit a self-contained HTML file
|
||||
.endtable
|
||||
|
||||
Multiple input files are merged into a single help file. This allows per-widget or per-feature documentation fragments to be combined automatically.
|
||||
|
||||
.h2 Build Integration
|
||||
|
||||
The standard build pattern globs all fragments:
|
||||
|
||||
.code
|
||||
dvxhlpc -o dvxhelp.hlp docs/src/overview.dhs widgets/*/*.dhs
|
||||
.endcode
|
||||
|
||||
New widgets or features just drop a .dhs file in their source directory and it appears in the help on the next build.
|
||||
|
||||
.h2 HTML Output
|
||||
|
||||
The --html flag produces a single self-contained HTML file with a sidebar table of contents, styled headings, lists, code blocks, notes, and embedded images (base64 data URIs). This is useful for viewing documentation on the host machine without running the DOS help viewer.
|
||||
|
||||
.topic help.integration
|
||||
.title Application Integration
|
||||
.toc 0 Application Integration
|
||||
.index F1
|
||||
.index Context Help
|
||||
.index helpFile
|
||||
.index helpTopic
|
||||
.index shellLoadAppWithArgs
|
||||
|
||||
.h1 Application Integration
|
||||
|
||||
Any DVX application can provide context-sensitive help via the F1 key.
|
||||
|
||||
.h2 Setting Up Help
|
||||
|
||||
In your appMain, set the help file path on the app context:
|
||||
|
||||
.code
|
||||
snprintf(ctx->helpFile, sizeof(ctx->helpFile),
|
||||
"%s%cMYAPP.HLP", ctx->appDir, DVX_PATH_SEP);
|
||||
.endcode
|
||||
|
||||
.h2 Context-Sensitive Topics
|
||||
|
||||
Update helpTopic as the user navigates your application:
|
||||
|
||||
.code
|
||||
snprintf(ctx->helpTopic, sizeof(ctx->helpTopic), "settings.video");
|
||||
.endcode
|
||||
|
||||
When the user presses F1, the shell launches the help viewer with your help file opened to the specified topic.
|
||||
|
||||
.h2 Launching Help from Menus
|
||||
|
||||
To add a Help menu item that opens your help file:
|
||||
|
||||
.code
|
||||
shellLoadAppWithArgs(ctx, viewerPath, helpFilePath);
|
||||
.endcode
|
||||
|
|
@ -71,7 +71,6 @@ typedef struct {
|
|||
uint32_t imagePoolOffset;
|
||||
uint32_t imagePoolSize;
|
||||
uint32_t defaultTopicStr; // string table offset of default topic ID
|
||||
uint32_t wrapWidth; // column width text was pre-wrapped at
|
||||
} HlpHeaderT;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
#define CMD_ABOUT 300
|
||||
#define CMD_TASK_MGR 301
|
||||
#define CMD_SYSINFO 302
|
||||
#define CMD_HELP 303
|
||||
|
||||
// ============================================================
|
||||
// Module state
|
||||
|
|
@ -179,6 +180,8 @@ static void buildPmWindow(void) {
|
|||
wmAddMenuItem(windowMenu, "Tile &Vertically", CMD_TILE_V);
|
||||
|
||||
MenuT *helpMenu = wmAddMenu(menuBar, "&Help");
|
||||
wmAddMenuItem(helpMenu, "&DVX Help\tF1", CMD_HELP);
|
||||
wmAddMenuSeparator(helpMenu);
|
||||
wmAddMenuItem(helpMenu, "&About DVX...", CMD_ABOUT);
|
||||
wmAddMenuItem(helpMenu, "&System Information...", CMD_SYSINFO);
|
||||
wmAddMenuSeparator(helpMenu);
|
||||
|
|
@ -360,6 +363,15 @@ static void onPmMenu(WindowT *win, int32_t menuId) {
|
|||
prefsSave(sPrefs);
|
||||
break;
|
||||
|
||||
case CMD_HELP: {
|
||||
char viewerPath[DVX_MAX_PATH];
|
||||
char sysHlp[DVX_MAX_PATH];
|
||||
snprintf(viewerPath, sizeof(viewerPath), "APPS%cDVXHELP%cDVXHELP.APP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
snprintf(sysHlp, sizeof(sysHlp), "%s%c%s", sCtx->appDir, DVX_PATH_SEP, "dvxhelp.hlp");
|
||||
shellLoadAppWithArgs(sAc, viewerPath, sysHlp);
|
||||
break;
|
||||
}
|
||||
|
||||
case CMD_ABOUT:
|
||||
showAboutDialog();
|
||||
break;
|
||||
|
|
@ -555,6 +567,9 @@ int32_t appMain(DxeAppContextT *ctx) {
|
|||
sCtx = ctx;
|
||||
sAc = ctx->shellCtx;
|
||||
|
||||
// Set help file for F1 — system help lives in progman's app directory
|
||||
snprintf(ctx->helpFile, sizeof(ctx->helpFile), "%s%c%s", ctx->appDir, DVX_PATH_SEP, "dvxhelp.hlp");
|
||||
|
||||
// Load saved preferences
|
||||
char prefsPath[DVX_MAX_PATH];
|
||||
shellConfigPath(sCtx, "progman.ini", prefsPath, sizeof(prefsPath));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ The DVX GUI is built as a five-layer architecture. Each layer is defined in its
|
|||
|
||||
.topic api.types
|
||||
.title dvxTypes.h -- Shared Type Definitions
|
||||
.toc 0 dvxTypes.h -- Shared Type Definitions
|
||||
.toc 1 dvxTypes.h -- Shared Type Definitions
|
||||
.index dvxTypes.h
|
||||
.index PixelFormatT
|
||||
.index DisplayT
|
||||
|
|
@ -412,7 +412,7 @@ Software-rendered 16x16 cursor using AND/XOR mask encoding.
|
|||
|
||||
.topic api.cursor
|
||||
.title dvxCursor.h -- Cursor Definitions
|
||||
.toc 0 dvxCursor.h -- Cursor Definitions
|
||||
.toc 1 dvxCursor.h -- Cursor Definitions
|
||||
.index dvxCursor.h
|
||||
.index Cursor Shapes
|
||||
.index CURSOR_ARROW
|
||||
|
|
@ -445,7 +445,7 @@ Static const array of CursorT structs, indexed by CURSOR_xxx constants. Each ent
|
|||
|
||||
.topic api.video
|
||||
.title dvxVideo.h -- Layer 1: VESA VBE Video Backend
|
||||
.toc 0 dvxVideo.h -- Layer 1: Video Backend
|
||||
.toc 1 dvxVideo.h -- Layer 1: Video Backend
|
||||
.index dvxVideo.h
|
||||
.index videoInit
|
||||
.index videoShutdown
|
||||
|
|
@ -539,7 +539,7 @@ Reset the clip rectangle to the full display dimensions.
|
|||
|
||||
.topic api.draw
|
||||
.title dvxDraw.h -- Layer 2: Drawing Primitives
|
||||
.toc 0 dvxDraw.h -- Layer 2: Drawing Primitives
|
||||
.toc 1 dvxDraw.h -- Layer 2: Drawing Primitives
|
||||
.index dvxDraw.h
|
||||
.index drawInit
|
||||
.index rectFill
|
||||
|
|
@ -881,7 +881,7 @@ Draw a vertical line (1px wide).
|
|||
|
||||
.topic api.comp
|
||||
.title dvxComp.h -- Layer 3: Dirty Rectangle Compositor
|
||||
.toc 0 dvxComp.h -- Layer 3: Compositor
|
||||
.toc 1 dvxComp.h -- Layer 3: Compositor
|
||||
.index dvxComp.h
|
||||
.index dirtyListInit
|
||||
.index dirtyListAdd
|
||||
|
|
@ -1002,7 +1002,7 @@ Returns: true if w <= 0 or h <= 0.
|
|||
|
||||
.topic api.wm
|
||||
.title dvxWm.h -- Layer 4: Window Manager
|
||||
.toc 0 dvxWm.h -- Layer 4: Window Manager
|
||||
.toc 1 dvxWm.h -- Layer 4: Window Manager
|
||||
.index dvxWm.h
|
||||
.index wmInit
|
||||
.index wmCreateWindow
|
||||
|
|
@ -1823,7 +1823,7 @@ Returns: 0 on success, -1 on failure.
|
|||
|
||||
.topic api.app
|
||||
.title dvxApp.h -- Layer 5: Application API
|
||||
.toc 0 dvxApp.h -- Layer 5: Application API
|
||||
.toc 1 dvxApp.h -- Layer 5: Application API
|
||||
.index dvxApp.h
|
||||
.index AppContextT
|
||||
.index dvxInit
|
||||
|
|
@ -2869,7 +2869,7 @@ Returns: 32-bit hash value.
|
|||
|
||||
.topic api.widget
|
||||
.title dvxWidget.h -- Widget System
|
||||
.toc 0 dvxWidget.h -- Widget System
|
||||
.toc 1 dvxWidget.h -- Widget System
|
||||
.index dvxWidget.h
|
||||
.index WidgetT
|
||||
.index WidgetClassT
|
||||
|
|
@ -27,23 +27,20 @@ The runtime environment consists of a bootstrap loader (dvx.exe) that loads core
|
|||
|
||||
.h2 Contents
|
||||
|
||||
.list
|
||||
.item .link arch.overview System Overview
|
||||
.item .link arch.layers Five-Layer Architecture
|
||||
.item .link arch.pipeline Display Pipeline
|
||||
.item .link arch.windows Window System
|
||||
.item .link arch.widgets Widget System
|
||||
.item .link arch.dxe DXE Module System
|
||||
.item .link arch.events Event Model
|
||||
.item .link arch.fonts Font System
|
||||
.item .link arch.colors Color System
|
||||
.item .link arch.platform Platform Layer
|
||||
.item .link arch.build Build System
|
||||
.endlist
|
||||
.link arch.layers Five-Layer Architecture
|
||||
.link arch.pipeline Display Pipeline
|
||||
.link arch.windows Window System
|
||||
.link arch.widgets Widget System
|
||||
.link arch.dxe DXE Module System
|
||||
.link arch.events Event Model
|
||||
.link arch.fonts Font System
|
||||
.link arch.colors Color System
|
||||
.link arch.platform Platform Layer
|
||||
.link arch.build Build System
|
||||
|
||||
.topic arch.layers
|
||||
.title Five-Layer Architecture
|
||||
.toc 0 Five-Layer Architecture
|
||||
.toc 1 Five-Layer Architecture
|
||||
.index Layers
|
||||
.index dvxVideo
|
||||
.index dvxDraw
|
||||
|
|
@ -102,7 +99,7 @@ DVX is organized into five layers, each implemented as a single .h/.c pair. Ever
|
|||
|
||||
.topic arch.pipeline
|
||||
.title Display Pipeline
|
||||
.toc 0 Display Pipeline
|
||||
.toc 1 Display Pipeline
|
||||
.index Display Pipeline
|
||||
.index Backbuffer
|
||||
.index Linear Framebuffer
|
||||
|
|
@ -166,7 +163,7 @@ DirtyListT -- Fixed-capacity dynamic array of RectT. Linear scanning for merge c
|
|||
|
||||
.topic arch.windows
|
||||
.title Window System
|
||||
.toc 0 Window System
|
||||
.toc 1 Window System
|
||||
.index Window
|
||||
.index WindowT
|
||||
.index Z-Order
|
||||
|
|
@ -258,7 +255,7 @@ Minimized windows display as 64x64 icons at the bottom of the screen with bevele
|
|||
|
||||
.topic arch.widgets
|
||||
.title Widget System
|
||||
.toc 0 Widget System
|
||||
.toc 1 Widget System
|
||||
.index Widgets
|
||||
.index WidgetT
|
||||
.index WidgetClassT
|
||||
|
|
@ -360,7 +357,7 @@ Each widget can register an interface descriptor that describes its BASIC-facing
|
|||
|
||||
.topic arch.dxe
|
||||
.title DXE Module System
|
||||
.toc 0 DXE Module System
|
||||
.toc 1 DXE Module System
|
||||
.index DXE
|
||||
.index DXE3
|
||||
.index Modules
|
||||
|
|
@ -433,7 +430,7 @@ All allocations route through dvxMalloc/dvxFree wrappers that prepend a 16-byte
|
|||
|
||||
.topic arch.events
|
||||
.title Event Model
|
||||
.toc 0 Event Model
|
||||
.toc 1 Event Model
|
||||
.index Events
|
||||
.index Input
|
||||
.index Mouse
|
||||
|
|
@ -497,7 +494,7 @@ Timestamp-based: two clicks on the same target (title bar, minimized icon, close
|
|||
|
||||
.topic arch.fonts
|
||||
.title Font System
|
||||
.toc 0 Font System
|
||||
.toc 1 Font System
|
||||
.index Fonts
|
||||
.index Bitmap Font
|
||||
.index BitmapFontT
|
||||
|
|
@ -546,7 +543,7 @@ AppContextT stores a fixed-point 16.16 reciprocal of font.charHeight (charHeight
|
|||
|
||||
.topic arch.colors
|
||||
.title Color System
|
||||
.toc 0 Color System
|
||||
.toc 1 Color System
|
||||
.index Colors
|
||||
.index Pixel Format
|
||||
.index PixelFormatT
|
||||
|
|
@ -603,7 +600,7 @@ Bevels are the defining visual element of the Motif aesthetic. Convenience macro
|
|||
|
||||
.topic arch.platform
|
||||
.title Platform Layer
|
||||
.toc 0 Platform Layer
|
||||
.toc 1 Platform Layer
|
||||
.index Platform Layer
|
||||
.index dvxPlatform
|
||||
.index VESA
|
||||
|
|
@ -658,7 +655,7 @@ platformRegisterDxeExports() -- register C runtime and platform symbols for DXE
|
|||
|
||||
.topic arch.build
|
||||
.title Build System
|
||||
.toc 0 Build System
|
||||
.toc 1 Build System
|
||||
.index Build
|
||||
.index Makefile
|
||||
.index Cross-Compilation
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -29,7 +29,8 @@ img { max-width: 100%; }
|
|||
<nav>
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#arch.overview">System Overview</a></li>
|
||||
<li><a href="#arch.overview">System Overview</a>
|
||||
<ul>
|
||||
<li><a href="#arch.layers">Five-Layer Architecture</a></li>
|
||||
<li><a href="#arch.pipeline">Display Pipeline</a></li>
|
||||
<li><a href="#arch.windows">Window System</a></li>
|
||||
|
|
@ -41,6 +42,8 @@ img { max-width: 100%; }
|
|||
<li><a href="#arch.platform">Platform Layer</a></li>
|
||||
<li><a href="#arch.build">Build System</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Index</h3>
|
||||
<ul>
|
||||
<li><a href="#arch.overview">DVX</a></li>
|
||||
|
|
@ -131,49 +134,32 @@ img { max-width: 100%; }
|
|||
<h1>DVX Architecture Overview</h1>
|
||||
<h2>DVX Architecture Overview</h2>
|
||||
<p>DOS Visual eXecutive -- A Windowing GUI for DJGPP/DPMI</p>
|
||||
<p>DVX (DOS Visual eXecutive) is a complete windowing GUI compositor targeting
|
||||
DJGPP/DPMI on DOS. It provides overlapping windows with Motif-style chrome,
|
||||
a retained-mode widget toolkit, cooperative multitasking of DXE-loaded
|
||||
applications, and a dirty-rectangle compositor optimized for 486/Pentium
|
||||
hardware.</p>
|
||||
<p>DVX (DOS Visual eXecutive) is a complete windowing GUI compositor targeting DJGPP/DPMI on DOS. It provides overlapping windows with Motif-style chrome, a retained-mode widget toolkit, cooperative multitasking of DXE-loaded applications, and a dirty-rectangle compositor optimized for 486/Pentium hardware.</p>
|
||||
<h3>Key Design Constraints</h3>
|
||||
<ul>
|
||||
<li>VESA VBE 2.0+ LFB only -- no bank switching. If the hardware cannot
|
||||
provide a linear framebuffer, initialization fails.</li>
|
||||
<li>486 baseline -- all hot paths are written to be fast on a 486, with
|
||||
Pentium-specific paths where the gain is significant.</li>
|
||||
<li>Single-tasking cooperative model -- applications yield the CPU via
|
||||
tsYield(); there is no preemptive scheduler.</li>
|
||||
<li>86Box is the trusted reference platform for testing. DOSBox-X is not used;
|
||||
any bugs observed are treated as DVX bugs.</li>
|
||||
<li>VESA VBE 2.0+ LFB only -- no bank switching. If the hardware cannot provide a linear framebuffer, initialization fails.</li>
|
||||
<li>486 baseline -- all hot paths are written to be fast on a 486, with Pentium-specific paths where the gain is significant.</li>
|
||||
<li>Single-tasking cooperative model -- applications yield the CPU via tsYield(); there is no preemptive scheduler.</li>
|
||||
<li>86Box is the trusted reference platform for testing. DOSBox-X is not used; any bugs observed are treated as DVX bugs.</li>
|
||||
</ul>
|
||||
<p>No external font or cursor files -- all bitmaps are compiled in as static
|
||||
const data.</p>
|
||||
<p>The runtime environment consists of a bootstrap loader (dvx.exe) that loads
|
||||
core DXE libraries, widget plugins, and the shell, which in turn loads and
|
||||
manages DXE application modules.</p>
|
||||
<p>No external font or cursor files -- all bitmaps are compiled in as static const data.</p>
|
||||
<p>The runtime environment consists of a bootstrap loader (dvx.exe) that loads core DXE libraries, widget plugins, and the shell, which in turn loads and manages DXE application modules.</p>
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li>.link arch.overview System Overview</li>
|
||||
<li>.link arch.layers Five-Layer Architecture</li>
|
||||
<li>.link arch.pipeline Display Pipeline</li>
|
||||
<li>.link arch.windows Window System</li>
|
||||
<li>.link arch.widgets Widget System</li>
|
||||
<li>.link arch.dxe DXE Module System</li>
|
||||
<li>.link arch.events Event Model</li>
|
||||
<li>.link arch.fonts Font System</li>
|
||||
<li>.link arch.colors Color System</li>
|
||||
<li>.link arch.platform Platform Layer</li>
|
||||
</ul>
|
||||
<p>.link arch.build Build System</p>
|
||||
<p><a href="#arch.layers">Five-Layer Architecture</a></p>
|
||||
<p><a href="#arch.pipeline">Display Pipeline</a></p>
|
||||
<p><a href="#arch.windows">Window System</a></p>
|
||||
<p><a href="#arch.widgets">Widget System</a></p>
|
||||
<p><a href="#arch.dxe">DXE Module System</a></p>
|
||||
<p><a href="#arch.events">Event Model</a></p>
|
||||
<p><a href="#arch.fonts">Font System</a></p>
|
||||
<p><a href="#arch.colors">Color System</a></p>
|
||||
<p><a href="#arch.platform">Platform Layer</a></p>
|
||||
<p><a href="#arch.build">Build System</a></p>
|
||||
</div>
|
||||
<div class="topic" id="arch.layers">
|
||||
<h1>Five-Layer Architecture</h1>
|
||||
<h2>Five-Layer Architecture</h2>
|
||||
<p>DVX is organized into five layers, each implemented as a single .h/.c pair.
|
||||
Every header includes dvxTypes.h (the shared type definitions) to avoid
|
||||
circular dependencies. The layers are strictly stacked: each layer depends
|
||||
only on the layers below it.</p>
|
||||
<p>DVX is organized into five layers, each implemented as a single .h/.c pair. Every header includes dvxTypes.h (the shared type definitions) to avoid circular dependencies. The layers are strictly stacked: each layer depends only on the layers below it.</p>
|
||||
<pre><code> Applications (DXE .app modules)
|
||||
==================================================
|
||||
| |
|
||||
|
|
@ -216,13 +202,8 @@ only on the layers below it.</p>
|
|||
<div class="topic" id="arch.pipeline">
|
||||
<h1>Display Pipeline</h1>
|
||||
<h2>Display Pipeline</h2>
|
||||
<p>The double-buffer strategy is the single most important performance decision
|
||||
in DVX. All drawing goes to a system RAM backbuffer (DisplayT.backBuf); only
|
||||
dirty rectangles are flushed to the linear framebuffer (DisplayT.lfb) in
|
||||
video memory.</p>
|
||||
<p>This matters because writes to video memory over the PCI bus are 10-50x
|
||||
slower than writes to main RAM on 486/Pentium hardware for random-access
|
||||
patterns.</p>
|
||||
<p>The double-buffer strategy is the single most important performance decision in DVX. All drawing goes to a system RAM backbuffer (DisplayT.backBuf); only dirty rectangles are flushed to the linear framebuffer (DisplayT.lfb) in video memory.</p>
|
||||
<p>This matters because writes to video memory over the PCI bus are 10-50x slower than writes to main RAM on 486/Pentium hardware for random-access patterns.</p>
|
||||
<h3>Per-Frame Compositing Pipeline</h3>
|
||||
<pre><code> 1. Input poll (mouse, keyboard)
|
||||
|
|
||||
|
|
@ -246,27 +227,16 @@ patterns.</p>
|
|||
|
|
||||
7. Yield (platformYield)</code></pre>
|
||||
<h3>Key Data Structures</h3>
|
||||
<p>DisplayT -- Central display context: width, height, pitch, pixel format, LFB
|
||||
pointer, backbuffer pointer, palette, clip rectangle. Passed by pointer
|
||||
through every layer -- no globals.</p>
|
||||
<p>BlitOpsT -- Vtable of span fill/copy function pointers resolved at init time
|
||||
for the active pixel depth. On DOS these dispatch to hand-written rep stosl
|
||||
/ rep movsd asm inner loops.</p>
|
||||
<p>DirtyListT -- Fixed-capacity dynamic array of RectT. Linear scanning for
|
||||
merge candidates is cache-friendly at typical sizes (under 128 rects). If
|
||||
the list fills up, the compositor merges aggressively or falls back to
|
||||
full-screen repaint.</p>
|
||||
<p>DisplayT -- Central display context: width, height, pitch, pixel format, LFB pointer, backbuffer pointer, palette, clip rectangle. Passed by pointer through every layer -- no globals.</p>
|
||||
<p>BlitOpsT -- Vtable of span fill/copy function pointers resolved at init time for the active pixel depth. On DOS these dispatch to hand-written rep stosl / rep movsd asm inner loops.</p>
|
||||
<p>DirtyListT -- Fixed-capacity dynamic array of RectT. Linear scanning for merge candidates is cache-friendly at typical sizes (under 128 rects). If the list fills up, the compositor merges aggressively or falls back to full-screen repaint.</p>
|
||||
<h3>Why This Works on a 486</h3>
|
||||
<ul>
|
||||
<li>A full 640x480x32bpp frame is 1.2 MB -- far too much to flush every frame
|
||||
over a slow PCI bus.</li>
|
||||
<li>A typical dirty region during normal interaction (typing, menu open) is a
|
||||
few KB.</li>
|
||||
<li>Merging overlapping dirty rects into larger rects reduces per-rect
|
||||
overhead and improves bus utilization.</li>
|
||||
<li>A full 640x480x32bpp frame is 1.2 MB -- far too much to flush every frame over a slow PCI bus.</li>
|
||||
<li>A typical dirty region during normal interaction (typing, menu open) is a few KB.</li>
|
||||
<li>Merging overlapping dirty rects into larger rects reduces per-rect overhead and improves bus utilization.</li>
|
||||
</ul>
|
||||
<p>Per-window content buffers persist across frames, so windows don't repaint
|
||||
on expose -- only when their own content changes.</p>
|
||||
<p>Per-window content buffers persist across frames, so windows don't repaint on expose -- only when their own content changes.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.windows">
|
||||
<h1>Window System</h1>
|
||||
|
|
@ -282,15 +252,13 @@ on expose -- only when their own content changes.</p>
|
|||
Widget tree (widgetRoot) Root of the retained-mode widget tree (NULL if using raw callbacks).
|
||||
Callbacks onPaint, onKey, onKeyUp, onMouse, onResize, onClose, onMenu, onScroll, onFocus, onBlur, onCursorQuery.</pre>
|
||||
<h3>Window Stack (Z-Order)</h3>
|
||||
<p>WindowStackT is an array of WindowT* ordered front-to-back: index count-1 is
|
||||
the topmost window. This allows:</p>
|
||||
<p>WindowStackT is an array of WindowT* ordered front-to-back: index count-1 is the topmost window. This allows:</p>
|
||||
<ul>
|
||||
<li>Back-to-front iteration for painting (painter's algorithm).</li>
|
||||
<li>Front-to-back iteration for hit testing (first hit wins).</li>
|
||||
</ul>
|
||||
<p>Reordering by pointer swap (no copying of large WindowT structs).</p>
|
||||
<p>Only one drag/resize/scroll operation can be active system-wide at a time
|
||||
(single mouse), so that state lives on the stack, not on individual windows.</p>
|
||||
<p>Only one drag/resize/scroll operation can be active system-wide at a time (single mouse), so that state lives on the stack, not on individual windows.</p>
|
||||
<h3>Chrome Layout</h3>
|
||||
<pre><code> +-------------------------------------------+
|
||||
| 4px outer border (raised bevel) |
|
||||
|
|
@ -319,56 +287,29 @@ the topmost window. This allows:</p>
|
|||
SCROLLBAR_WIDTH = 16px
|
||||
CHROME_CLOSE_BTN_SIZE = 16px</code></pre>
|
||||
<h3>Hit Test Regions</h3>
|
||||
<p>wmHitTest() iterates the stack front-to-back and returns a hit-part
|
||||
identifier: HIT_CONTENT, HIT_TITLE, HIT_CLOSE, HIT_RESIZE, HIT_MENU,
|
||||
HIT_VSCROLL, HIT_HSCROLL, HIT_MINIMIZE, HIT_MAXIMIZE. Resize edge detection
|
||||
returns a bitmask of RESIZE_LEFT, RESIZE_RIGHT, RESIZE_TOP, RESIZE_BOTTOM
|
||||
(corners combine two edges).</p>
|
||||
<p>wmHitTest() iterates the stack front-to-back and returns a hit-part identifier: HIT_CONTENT, HIT_TITLE, HIT_CLOSE, HIT_RESIZE, HIT_MENU, HIT_VSCROLL, HIT_HSCROLL, HIT_MINIMIZE, HIT_MAXIMIZE. Resize edge detection returns a bitmask of RESIZE_LEFT, RESIZE_RIGHT, RESIZE_TOP, RESIZE_BOTTOM (corners combine two edges).</p>
|
||||
<h3>Menu System</h3>
|
||||
<p>Menus use fixed-size arrays with inline char buffers (no heap strings). Up
|
||||
to 8 menus per bar, items dynamically allocated. Supports cascading submenus
|
||||
via MenuItemT.subMenu pointer. Item types: normal, checkbox, radio.
|
||||
Separators are non-interactive items. The popup state (PopupStateT) tracks a
|
||||
stack of parent frames for cascading submenu nesting.</p>
|
||||
<p>Menus use fixed-size arrays with inline char buffers (no heap strings). Up to 8 menus per bar, items dynamically allocated. Supports cascading submenus via MenuItemT.subMenu pointer. Item types: normal, checkbox, radio. Separators are non-interactive items. The popup state (PopupStateT) tracks a stack of parent frames for cascading submenu nesting.</p>
|
||||
<h3>Minimized Windows</h3>
|
||||
<p>Minimized windows display as 64x64 icons at the bottom of the screen with
|
||||
beveled borders, similar to a classic desktop icon bar. Icons show a
|
||||
scaled-down preview of the window's content buffer, refreshed one per frame
|
||||
in a round-robin fashion to amortize the scaling cost.</p>
|
||||
<p>Minimized windows display as 64x64 icons at the bottom of the screen with beveled borders, similar to a classic desktop icon bar. Icons show a scaled-down preview of the window's content buffer, refreshed one per frame in a round-robin fashion to amortize the scaling cost.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.widgets">
|
||||
<h1>Widget System</h1>
|
||||
<h2>Widget System</h2>
|
||||
<p>The widget system (dvxWidget.h) is a retained-mode toolkit layered on top of
|
||||
the window manager. Widgets form a tree rooted at a per-window VBox
|
||||
container.</p>
|
||||
<p>The widget system (dvxWidget.h) is a retained-mode toolkit layered on top of the window manager. Widgets form a tree rooted at a per-window VBox container.</p>
|
||||
<h3>WidgetT Base Structure</h3>
|
||||
<p>Every widget shares the same WidgetT struct. The type field is a
|
||||
runtime-assigned integer ID. The wclass pointer references the widget's
|
||||
WidgetClassT vtable. Widget-specific private data is stored in w->data
|
||||
(opaque void*).</p>
|
||||
<p>Tree linkage: parent, firstChild, lastChild, nextSibling. No prevSibling --
|
||||
this halves pointer overhead and removal is still O(n) for typical tree
|
||||
depths of 5-10.</p>
|
||||
<p>Every widget shares the same WidgetT struct. The type field is a runtime-assigned integer ID. The wclass pointer references the widget's WidgetClassT vtable. Widget-specific private data is stored in w->data (opaque void*).</p>
|
||||
<p>Tree linkage: parent, firstChild, lastChild, nextSibling. No prevSibling -- this halves pointer overhead and removal is still O(n) for typical tree depths of 5-10.</p>
|
||||
<h3>Layout Engine</h3>
|
||||
<p>Two-pass flexbox-like algorithm:</p>
|
||||
<ul>
|
||||
<li>Bottom-up (calcMinSize) -- compute minimum sizes for every widget,
|
||||
starting from leaves.</li>
|
||||
<li>Bottom-up (calcMinSize) -- compute minimum sizes for every widget, starting from leaves.</li>
|
||||
</ul>
|
||||
<p>Top-down (layout) -- allocate space within available bounds, distributing
|
||||
extra space according to weight values (0 = fixed, 100 = normal stretch).</p>
|
||||
<p>Size hints use a tagged encoding: the top 2 bits of an int32_t select the
|
||||
unit (pixels, character widths, or percentage of parent), the low 30 bits
|
||||
hold the value. Macros: wgtPixels(v), wgtChars(v), wgtPercent(v).</p>
|
||||
<p>Top-down (layout) -- allocate space within available bounds, distributing extra space according to weight values (0 = fixed, 100 = normal stretch).</p>
|
||||
<p>Size hints use a tagged encoding: the top 2 bits of an int32_t select the unit (pixels, character widths, or percentage of parent), the low 30 bits hold the value. Macros: wgtPixels(v), wgtChars(v), wgtPercent(v).</p>
|
||||
<h3>Widget Class Dispatch (WidgetClassT)</h3>
|
||||
<p>Each widget type provides a WidgetClassT with a handlers[] array indexed by
|
||||
stable method IDs. Method IDs are never reordered or reused -- new methods
|
||||
append at the end. This provides ABI-stable dispatch so that widget DXEs
|
||||
compiled against an older DVX version continue to work.</p>
|
||||
<p>Methods include: PAINT, PAINT_OVERLAY, CALC_MIN_SIZE, LAYOUT, ON_MOUSE,
|
||||
ON_KEY, ON_ACCEL_ACTIVATE, DESTROY, GET_TEXT, SET_TEXT, POLL, and more (21
|
||||
defined, room for 32).</p>
|
||||
<p>Each widget type provides a WidgetClassT with a handlers[] array indexed by stable method IDs. Method IDs are never reordered or reused -- new methods append at the end. This provides ABI-stable dispatch so that widget DXEs compiled against an older DVX version continue to work.</p>
|
||||
<p>Methods include: PAINT, PAINT_OVERLAY, CALC_MIN_SIZE, LAYOUT, ON_MOUSE, ON_KEY, ON_ACCEL_ACTIVATE, DESTROY, GET_TEXT, SET_TEXT, POLL, and more (21 defined, room for 32).</p>
|
||||
<h4>Class Flags</h4>
|
||||
<pre> Flag Meaning
|
||||
---- -------
|
||||
|
|
@ -414,26 +355,14 @@ defined, room for 32).</p>
|
|||
TreeView Hierarchical tree display
|
||||
WrapBox Flow layout (wrapping horizontal container)</pre>
|
||||
<h3>Widget API Registry</h3>
|
||||
<p>Each widget DXE registers a small API struct under a name during
|
||||
wgtRegister(). Callers retrieve it via wgtGetApi("button") and cast to the
|
||||
widget-specific API type. Per-widget headers provide typed accessors so
|
||||
callers avoid manual casts. Adding a new widget requires zero changes to the
|
||||
core.</p>
|
||||
<p>Each widget DXE registers a small API struct under a name during wgtRegister(). Callers retrieve it via wgtGetApi("button") and cast to the widget-specific API type. Per-widget headers provide typed accessors so callers avoid manual casts. Adding a new widget requires zero changes to the core.</p>
|
||||
<h3>Widget Interface Descriptors (WgtIfaceT)</h3>
|
||||
<p>Each widget can register an interface descriptor that describes its
|
||||
BASIC-facing properties, methods, and events. These descriptors are used by
|
||||
the form runtime and IDE for generic dispatch and property panel
|
||||
enumeration. Properties have typed getters/setters (WGT_IFACE_STRING,
|
||||
WGT_IFACE_INT, WGT_IFACE_BOOL, WGT_IFACE_ENUM).</p>
|
||||
<p>Each widget can register an interface descriptor that describes its BASIC-facing properties, methods, and events. These descriptors are used by the form runtime and IDE for generic dispatch and property panel enumeration. Properties have typed getters/setters (WGT_IFACE_STRING, WGT_IFACE_INT, WGT_IFACE_BOOL, WGT_IFACE_ENUM).</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.dxe">
|
||||
<h1>DXE Module System</h1>
|
||||
<h2>DXE Module System</h2>
|
||||
<p>DVX uses DJGPP's DXE3 (Dynamic eXtension) format for all loadable modules.
|
||||
DXE3 supports RTLD_GLOBAL symbol sharing -- symbols exported by one module
|
||||
are visible to all subsequently loaded modules. This is critical: widget
|
||||
DXEs call core API functions (e.g. rectFill, wgtInvalidate) that are
|
||||
exported by the core library DXE.</p>
|
||||
<p>DVX uses DJGPP's DXE3 (Dynamic eXtension) format for all loadable modules. DXE3 supports RTLD_GLOBAL symbol sharing -- symbols exported by one module are visible to all subsequently loaded modules. This is critical: widget DXEs call core API functions (e.g. rectFill, wgtInvalidate) that are exported by the core library DXE.</p>
|
||||
<h3>Module Types</h3>
|
||||
<pre> Extension Directory Purpose Examples
|
||||
--------- --------- ------- --------
|
||||
|
|
@ -464,41 +393,22 @@ exported by the core library DXE.</p>
|
|||
<h3>Application Lifecycle</h3>
|
||||
<p>Two kinds of DXE apps:</p>
|
||||
<h4>Callback-only (hasMainLoop = false)</h4>
|
||||
<p>appMain() creates windows, registers callbacks, and returns. The app lives
|
||||
through GUI callbacks driven by the shell's main loop. Lifecycle ends when
|
||||
the last window is closed. No extra task stack needed -- simpler and
|
||||
cheaper.</p>
|
||||
<p>appMain() creates windows, registers callbacks, and returns. The app lives through GUI callbacks driven by the shell's main loop. Lifecycle ends when the last window is closed. No extra task stack needed -- simpler and cheaper.</p>
|
||||
<h4>Main-loop (hasMainLoop = true)</h4>
|
||||
<p>A dedicated cooperative task is created. appMain() runs in that task with
|
||||
its own loop, calling tsYield() to share CPU. Needed for apps with
|
||||
continuous work (terminal emulators, games). Lifecycle ends when appMain()
|
||||
returns.</p>
|
||||
<p>A dedicated cooperative task is created. appMain() runs in that task with its own loop, calling tsYield() to share CPU. Needed for apps with continuous work (terminal emulators, games). Lifecycle ends when appMain() returns.</p>
|
||||
<h3>Crash Recovery</h3>
|
||||
<p>The platform layer installs signal handlers for SIGSEGV, SIGFPE, SIGILL. On
|
||||
crash, the handler logs platform-specific diagnostics (register dump on
|
||||
DJGPP), then longjmps back to the shell's main loop. The crashed app is
|
||||
killed; other apps and the shell survive. This provides Windows 3.1-style
|
||||
fault tolerance.</p>
|
||||
<p>The platform layer installs signal handlers for SIGSEGV, SIGFPE, SIGILL. On crash, the handler logs platform-specific diagnostics (register dump on DJGPP), then longjmps back to the shell's main loop. The crashed app is killed; other apps and the shell survive. This provides Windows 3.1-style fault tolerance.</p>
|
||||
<h3>Per-App Memory Tracking</h3>
|
||||
<p>All allocations route through dvxMalloc/dvxFree wrappers that prepend a
|
||||
16-byte header recording the owning app ID and allocation size. The Task
|
||||
Manager displays per-app memory usage, and leaks are detected at app
|
||||
termination.</p>
|
||||
<p>All allocations route through dvxMalloc/dvxFree wrappers that prepend a 16-byte header recording the owning app ID and allocation size. The Task Manager displays per-app memory usage, and leaks are detected at app termination.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.events">
|
||||
<h1>Event Model</h1>
|
||||
<h2>Event Model</h2>
|
||||
<p>DVX uses a cooperative polling model. The main loop (dvxRun / dvxUpdate)
|
||||
runs this cycle each frame:</p>
|
||||
<p>DVX uses a cooperative polling model. The main loop (dvxRun / dvxUpdate) runs this cycle each frame:</p>
|
||||
<ul>
|
||||
<li>Poll mouse -- platformMousePoll() returns position and button bitmask.
|
||||
Compare with previous frame for press/release edge detection.</li>
|
||||
<li>Poll keyboard -- platformKeyboardRead() returns ASCII + scancode.
|
||||
Non-blocking; returns false if buffer is empty.</li>
|
||||
<li>Dispatch to focused window -- the event loop fires window callbacks
|
||||
(onKey, onMouse, etc.) on the focused window. If the window has a widget
|
||||
tree, the widget system's installed handlers dispatch to individual
|
||||
widgets.</li>
|
||||
<li>Poll mouse -- platformMousePoll() returns position and button bitmask. Compare with previous frame for press/release edge detection.</li>
|
||||
<li>Poll keyboard -- platformKeyboardRead() returns ASCII + scancode. Non-blocking; returns false if buffer is empty.</li>
|
||||
<li>Dispatch to focused window -- the event loop fires window callbacks (onKey, onMouse, etc.) on the focused window. If the window has a widget tree, the widget system's installed handlers dispatch to individual widgets.</li>
|
||||
<li>Compositor pass -- merge dirty rects, composite, flush to LFB.</li>
|
||||
</ul>
|
||||
<p>Yield -- platformYield() or idle callback.</p>
|
||||
|
|
@ -521,27 +431,16 @@ runs this cycle each frame:</p>
|
|||
|
|
||||
Universal callbacks (onClick, onChange, etc.)</code></pre>
|
||||
<h3>Accelerator Tables</h3>
|
||||
<p>Per-window accelerator tables map key + modifier combinations to command
|
||||
IDs. The runtime normalizes key/modifier at registration time (uppercase
|
||||
key, strip shift from modifiers) so matching at dispatch time is two integer
|
||||
comparisons per entry. Matched accelerators fire the window's onMenu
|
||||
callback with the command ID, unifying the menu and hotkey code paths.</p>
|
||||
<p>Per-window accelerator tables map key + modifier combinations to command IDs. The runtime normalizes key/modifier at registration time (uppercase key, strip shift from modifiers) so matching at dispatch time is two integer comparisons per entry. Matched accelerators fire the window's onMenu callback with the command ID, unifying the menu and hotkey code paths.</p>
|
||||
<h3>Mouse Cursor</h3>
|
||||
<p>Software-rendered cursor using the classic AND/XOR mask approach. Seven
|
||||
cursor shapes are compiled in: arrow, horizontal resize, vertical resize,
|
||||
NW-SE diagonal resize, NE-SW diagonal resize, busy (hourglass), and
|
||||
crosshair. The cursor is painted into the backbuffer on top of the
|
||||
composited frame and the affected region is flushed to the LFB each frame.</p>
|
||||
<p>Software-rendered cursor using the classic AND/XOR mask approach. Seven cursor shapes are compiled in: arrow, horizontal resize, vertical resize, NW-SE diagonal resize, NE-SW diagonal resize, busy (hourglass), and crosshair. The cursor is painted into the backbuffer on top of the composited frame and the affected region is flushed to the LFB each frame.</p>
|
||||
<h3>Double-Click Detection</h3>
|
||||
<p>Timestamp-based: two clicks on the same target (title bar, minimized icon,
|
||||
close gadget) within the configurable double-click interval trigger the
|
||||
double-click action. Separate tracking for each target type.</p>
|
||||
<p>Timestamp-based: two clicks on the same target (title bar, minimized icon, close gadget) within the configurable double-click interval trigger the double-click action. Separate tracking for each target type.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.fonts">
|
||||
<h1>Font System</h1>
|
||||
<h2>Font System</h2>
|
||||
<p>DVX uses fixed-width 8-pixel-wide bitmap fonts only. One size is provided:
|
||||
8x16, matching the standard VGA ROM font and CP437 encoding (256 glyphs).</p>
|
||||
<p>DVX uses fixed-width 8-pixel-wide bitmap fonts only. One size is provided: 8x16, matching the standard VGA ROM font and CP437 encoding (256 glyphs).</p>
|
||||
<h3>BitmapFontT</h3>
|
||||
<pre><code> typedef struct {
|
||||
int32_t charWidth; // fixed width per glyph (always 8)
|
||||
|
|
@ -557,35 +456,20 @@ double-click action. Separate tracking for each target type.</p>
|
|||
<li>Each scanline of a glyph is exactly one byte (1bpp at 8 pixels wide).</li>
|
||||
<li>No glyph-width tables, kerning, or per-character positioning needed.</li>
|
||||
</ul>
|
||||
<p>8-pixel width aligns with byte boundaries -- no bit shifting in per-scanline
|
||||
rendering.</p>
|
||||
<p>8-pixel width aligns with byte boundaries -- no bit shifting in per-scanline rendering.</p>
|
||||
<h3>Text Rendering Functions</h3>
|
||||
<p>drawChar() -- Renders a single character. Supports opaque (background fill)
|
||||
and transparent modes.</p>
|
||||
<p>drawTextN() -- Optimized batch rendering for a known character count. Clips
|
||||
once for the entire run, fills background in a single rectFill, then
|
||||
overlays glyph foreground pixels. Significantly faster than per-character
|
||||
rendering for long runs.</p>
|
||||
<p>drawTermRow() -- Renders an 80-column terminal row in a single pass, with
|
||||
per-cell foreground/background from a 16-color palette, blink attribute
|
||||
support, and cursor rendering. Exists because per-character terminal
|
||||
rendering is unacceptably slow on target hardware.</p>
|
||||
<p>drawTextAccel() -- Renders text with & accelerator markers. The character
|
||||
after & is underlined to indicate the keyboard shortcut.</p>
|
||||
<p>drawChar() -- Renders a single character. Supports opaque (background fill) and transparent modes.</p>
|
||||
<p>drawTextN() -- Optimized batch rendering for a known character count. Clips once for the entire run, fills background in a single rectFill, then overlays glyph foreground pixels. Significantly faster than per-character rendering for long runs.</p>
|
||||
<p>drawTermRow() -- Renders an 80-column terminal row in a single pass, with per-cell foreground/background from a 16-color palette, blink attribute support, and cursor rendering. Exists because per-character terminal rendering is unacceptably slow on target hardware.</p>
|
||||
<p>drawTextAccel() -- Renders text with & accelerator markers. The character after & is underlined to indicate the keyboard shortcut.</p>
|
||||
<h3>Performance Optimization</h3>
|
||||
<p>AppContextT stores a fixed-point 16.16 reciprocal of font.charHeight
|
||||
(charHeightRecip) so that dividing by charHeight (for pixel-to-row
|
||||
conversion in terminal/text widgets) becomes a multiply+shift instead of an
|
||||
integer divide, which costs 40+ cycles on a 486.</p>
|
||||
<p>AppContextT stores a fixed-point 16.16 reciprocal of font.charHeight (charHeightRecip) so that dividing by charHeight (for pixel-to-row conversion in terminal/text widgets) becomes a multiply+shift instead of an integer divide, which costs 40+ cycles on a 486.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.colors">
|
||||
<h1>Color System</h1>
|
||||
<h2>Color System</h2>
|
||||
<h3>Pixel Format</h3>
|
||||
<p>PixelFormatT describes the active VESA mode's pixel encoding. Populated once
|
||||
from the VBE mode info block. Stores shift, mask, and bit count for each
|
||||
channel so packColor() can convert RGB to native format with shift-and-mask
|
||||
arithmetic -- no per-pixel computation.</p>
|
||||
<p>PixelFormatT describes the active VESA mode's pixel encoding. Populated once from the VBE mode info block. Stores shift, mask, and bit count for each channel so packColor() can convert RGB to native format with shift-and-mask arithmetic -- no per-pixel computation.</p>
|
||||
<p>Supported depths:</p>
|
||||
<pre> Depth Bytes/Pixel Notes
|
||||
----- ----------- -----
|
||||
|
|
@ -594,10 +478,7 @@ arithmetic -- no per-pixel computation.</p>
|
|||
16 bpp 2 5-6-5 RGB.
|
||||
32 bpp 4 8-8-8 RGB (8 bits unused).</pre>
|
||||
<h3>ColorSchemeT -- Theming</h3>
|
||||
<p>All 20 UI colors are pre-packed into display pixel format at init time.
|
||||
Every color is a uint32_t that can be written directly to the framebuffer
|
||||
with zero per-pixel conversion. The scheme must be regenerated on video mode
|
||||
change, but mode changes require re-init anyway.</p>
|
||||
<p>All 20 UI colors are pre-packed into display pixel format at init time. Every color is a uint32_t that can be written directly to the framebuffer with zero per-pixel conversion. The scheme must be regenerated on video mode change, but mode changes require re-init anyway.</p>
|
||||
<p>Color roles mirror classic Motif/Windows 3.x conventions:</p>
|
||||
<ul>
|
||||
<li>desktop -- desktop background</li>
|
||||
|
|
@ -609,13 +490,9 @@ change, but mode changes require re-init anyway.</p>
|
|||
<li>scrollbarBg/Fg/Trough -- scrollbar components</li>
|
||||
</ul>
|
||||
<p>cursorFg/Bg -- mouse cursor colors</p>
|
||||
<p>Source RGB values are kept in AppContextT.colorRgb[] for theme save/load.
|
||||
Themes are stored as INI files with a [colors] section. The API provides
|
||||
dvxLoadTheme(), dvxSaveTheme(), dvxSetColor(), and dvxResetColorScheme().</p>
|
||||
<p>Source RGB values are kept in AppContextT.colorRgb[] for theme save/load. Themes are stored as INI files with a [colors] section. The API provides dvxLoadTheme(), dvxSaveTheme(), dvxSetColor(), and dvxResetColorScheme().</p>
|
||||
<h3>Bevel Styles</h3>
|
||||
<p>Bevels are the defining visual element of the Motif aesthetic. Convenience
|
||||
macros create bevel style descriptors by swapping highlight and shadow
|
||||
colors:</p>
|
||||
<p>Bevels are the defining visual element of the Motif aesthetic. Convenience macros create bevel style descriptors by swapping highlight and shadow colors:</p>
|
||||
<pre><code> BEVEL_RAISED(colorScheme, borderWidth) -- raised 3D look
|
||||
BEVEL_SUNKEN(colorScheme, face, borderWidth) -- sunken/inset look
|
||||
BEVEL_TROUGH(colorScheme) -- 1px scrollbar trough
|
||||
|
|
@ -624,47 +501,32 @@ colors:</p>
|
|||
<div class="topic" id="arch.platform">
|
||||
<h1>Platform Layer</h1>
|
||||
<h2>Platform Layer</h2>
|
||||
<p>All OS-specific and CPU-specific code is isolated behind dvxPlatform.h. To
|
||||
port DVX, implement a new dvxPlatformXxx.c against this header.</p>
|
||||
<p>All OS-specific and CPU-specific code is isolated behind dvxPlatform.h. To port DVX, implement a new dvxPlatformXxx.c against this header.</p>
|
||||
<h3>Implementations</h3>
|
||||
<pre> File Target Details
|
||||
---- ------ -------
|
||||
dvxPlatformDos.c DJGPP/DPMI Real VESA VBE, INT 33h mouse, INT 16h keyboard, rep movsd/rep stosl asm spans, DPMI physical memory mapping for LFB, INT 9 hook for key-up, CuteMouse Wheel API.</pre>
|
||||
<h3>Abstraction Areas</h3>
|
||||
<h4>Video</h4>
|
||||
<p>platformVideoInit() -- mode probe and framebuffer setup.
|
||||
platformVideoShutdown() -- restore previous mode. platformVideoEnumModes()
|
||||
-- enumerate available modes.</p>
|
||||
<p>platformVideoInit() -- mode probe and framebuffer setup. platformVideoShutdown() -- restore previous mode. platformVideoEnumModes() -- enumerate available modes.</p>
|
||||
<h4>Framebuffer Flush</h4>
|
||||
<p>platformFlushRect() -- copy dirty rect from backBuf to LFB. On DOS, each
|
||||
scanline uses rep movsd for near-optimal aligned 32-bit writes over the PCI
|
||||
bus.</p>
|
||||
<p>platformFlushRect() -- copy dirty rect from backBuf to LFB. On DOS, each scanline uses rep movsd for near-optimal aligned 32-bit writes over the PCI bus.</p>
|
||||
<h4>Optimized Memory Spans</h4>
|
||||
<p>Six functions: platformSpanFill8/16/32() and platformSpanCopy8/16/32().
|
||||
Called once per scanline of every rectangle fill, blit, and text draw. On
|
||||
DOS these use inline assembly for critical inner loops.</p>
|
||||
<p>Six functions: platformSpanFill8/16/32() and platformSpanCopy8/16/32(). Called once per scanline of every rectangle fill, blit, and text draw. On DOS these use inline assembly for critical inner loops.</p>
|
||||
<h4>Mouse Input</h4>
|
||||
<p>Polling model. platformMousePoll() returns position and button bitmask.
|
||||
Wheel support via CuteMouse API.</p>
|
||||
<p>Polling model. platformMousePoll() returns position and button bitmask. Wheel support via CuteMouse API.</p>
|
||||
<h4>Keyboard Input</h4>
|
||||
<p>platformKeyboardRead() -- non-blocking key read. platformKeyUpRead() -- key
|
||||
release detection (requires INT 9 hook on DOS). platformAltScanToChar() --
|
||||
scancode-to-ASCII lookup for Alt+key combinations.</p>
|
||||
<p>platformKeyboardRead() -- non-blocking key read. platformKeyUpRead() -- key release detection (requires INT 9 hook on DOS). platformAltScanToChar() -- scancode-to-ASCII lookup for Alt+key combinations.</p>
|
||||
<h4>Crash Recovery</h4>
|
||||
<p>platformInstallCrashHandler() -- signal handlers + longjmp for fault
|
||||
tolerance.</p>
|
||||
<p>platformInstallCrashHandler() -- signal handlers + longjmp for fault tolerance.</p>
|
||||
<h4>DXE Support</h4>
|
||||
<p>platformRegisterDxeExports() -- register C runtime and platform symbols for
|
||||
DXE resolution. platformRegisterSymOverrides() -- register function pointer
|
||||
overrides for module loader.</p>
|
||||
<p>platformRegisterDxeExports() -- register C runtime and platform symbols for DXE resolution. platformRegisterSymOverrides() -- register function pointer overrides for module loader.</p>
|
||||
</div>
|
||||
<div class="topic" id="arch.build">
|
||||
<h1>Build System</h1>
|
||||
<h2>Build System</h2>
|
||||
<h3>Cross-Compilation</h3>
|
||||
<p>DVX is cross-compiled from Linux using a DJGPP cross-compiler
|
||||
(i586-pc-msdosdjgpp-gcc). The top-level Makefile orchestrates building all
|
||||
subsystems in dependency order.</p>
|
||||
<p>DVX is cross-compiled from Linux using a DJGPP cross-compiler (i586-pc-msdosdjgpp-gcc). The top-level Makefile orchestrates building all subsystems in dependency order.</p>
|
||||
<pre><code> make -- build everything
|
||||
./mkcd.sh -- build + create ISO for 86Box</code></pre>
|
||||
<h3>Build Targets</h3>
|
||||
|
|
@ -684,8 +546,7 @@ subsystems in dependency order.</p>
|
|||
serial serial DXE libs UART driver, HDLC packets, security, seclink
|
||||
sql SQL DXE lib SQLite integration</pre>
|
||||
<h3>DXE3 Build Process</h3>
|
||||
<p>Each DXE module is compiled to an object file with GCC, then linked with
|
||||
dxe3gen:</p>
|
||||
<p>Each DXE module is compiled to an object file with GCC, then linked with dxe3gen:</p>
|
||||
<pre><code> # Compile
|
||||
i586-pc-msdosdjgpp-gcc -O2 -march=i486 -mtune=i586 -c -o widget.o widget.c
|
||||
|
||||
|
|
@ -694,21 +555,15 @@ dxe3gen:</p>
|
|||
|
||||
# Optionally append resources
|
||||
dvxres build widget.wgt widget.res</code></pre>
|
||||
<p>The -E flag specifies exported symbols (prefixed with underscore per DJGPP
|
||||
convention). -U marks unresolved symbols as OK (they'll be resolved at load
|
||||
time from previously loaded DXEs).</p>
|
||||
<p>The -E flag specifies exported symbols (prefixed with underscore per DJGPP convention). -U marks unresolved symbols as OK (they'll be resolved at load time from previously loaded DXEs).</p>
|
||||
<h3>Deployment (mkcd.sh)</h3>
|
||||
<ul>
|
||||
<li>Runs make all.</li>
|
||||
<li>Verifies critical outputs exist (dvx.exe, libtasks.lib, libdvx.lib,
|
||||
dvxshell.lib).</li>
|
||||
<li>Verifies critical outputs exist (dvx.exe, libtasks.lib, libdvx.lib, dvxshell.lib).</li>
|
||||
<li>Counts widget modules.</li>
|
||||
<li>Creates an ISO 9660 image from bin/ using mkisofs: -iso-level 1 (strict
|
||||
8.3 filenames for DOS), -J (Joliet extensions for long names), -V DVX
|
||||
(volume label).</li>
|
||||
<li>Creates an ISO 9660 image from bin/ using mkisofs: -iso-level 1 (strict 8.3 filenames for DOS), -J (Joliet extensions for long names), -V DVX (volume label).</li>
|
||||
</ul>
|
||||
<p>Places the ISO at ~/.var/app/net._86box._86Box/data/86Box/dvx.iso for 86Box
|
||||
to mount as CD-ROM.</p>
|
||||
<p>Places the ISO at ~/.var/app/net._86box._86Box/data/86Box/dvx.iso for 86Box to mount as CD-ROM.</p>
|
||||
<h3>Compiler Flags</h3>
|
||||
<pre><code> -O2 Optimization level 2
|
||||
-march=i486 486 instruction set baseline
|
||||
|
|
|
|||
3699
docs/dvx_help.html
Normal file
3699
docs/dvx_help.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -303,15 +303,9 @@ img { max-width: 100%; }
|
|||
<div class="topic" id="widget.base">
|
||||
<h1>Base WidgetT (Common Properties, Events, and Operations)</h1>
|
||||
<h2>DVX Widget Reference</h2>
|
||||
<p>Complete reference for the DVX GUI widget toolkit. All widgets are
|
||||
implemented as dynamically loaded DXE modules. They are created via
|
||||
convenience macros that wrap the per-widget API function tables. The base
|
||||
WidgetT structure is defined in core/dvxWidget.h; individual widget headers
|
||||
live in widgets/.</p>
|
||||
<p>Complete reference for the DVX GUI widget toolkit. All widgets are implemented as dynamically loaded DXE modules. They are created via convenience macros that wrap the per-widget API function tables. The base WidgetT structure is defined in core/dvxWidget.h; individual widget headers live in widgets/.</p>
|
||||
<h3>Base WidgetT (Common Properties, Events, and Operations)</h3>
|
||||
<p>Every widget inherits from the WidgetT structure defined in
|
||||
core/dvxWidget.h. The fields and callbacks listed here are available on all
|
||||
widget types.</p>
|
||||
<p>Every widget inherits from the WidgetT structure defined in core/dvxWidget.h. The fields and callbacks listed here are available on all widget types.</p>
|
||||
<h4>Common Properties</h4>
|
||||
<pre> Field Type Description
|
||||
----- ---- -----------
|
||||
|
|
@ -341,8 +335,7 @@ widget types.</p>
|
|||
wgtChars(v) Size in character widths (multiplied by font charWidth).
|
||||
wgtPercent(v) Size as a percentage of parent dimension.</pre>
|
||||
<h4>Common Events (Callbacks)</h4>
|
||||
<p>These callback function pointers are available on every WidgetT. Set them
|
||||
directly on the widget struct.</p>
|
||||
<p>These callback function pointers are available on every WidgetT. Set them directly on the widget struct.</p>
|
||||
<pre> Callback Signature Description
|
||||
-------- --------- -----------
|
||||
onClick void (*)(WidgetT *w) Fires on mouse click / activation.
|
||||
|
|
@ -381,13 +374,7 @@ directly on the widget struct.</p>
|
|||
<div class="topic" id="widget.ansiterm">
|
||||
<h1>AnsiTerm</h1>
|
||||
<h3>AnsiTerm</h3>
|
||||
<p>A VT100/ANSI-compatible terminal emulator widget designed for connecting to
|
||||
BBS systems over the serial link. Uses a traditional text-mode cell buffer
|
||||
(character + attribute byte pairs) with the CP437 character set and 16-color
|
||||
CGA palette. Supports cursor movement, screen/line erase, scrolling regions,
|
||||
SGR colors, and scrollback history. Communication is abstracted through
|
||||
read/write function pointers, allowing the terminal to work with raw serial
|
||||
ports, the secLink encrypted channel, or any other byte-oriented transport.</p>
|
||||
<p>A VT100/ANSI-compatible terminal emulator widget designed for connecting to BBS systems over the serial link. Uses a traditional text-mode cell buffer (character + attribute byte pairs) with the CP437 character set and 16-color CGA palette. Supports cursor movement, screen/line erase, scrolling regions, SGR colors, and scrollback history. Communication is abstracted through read/write function pointers, allowing the terminal to work with raw serial ports, the secLink encrypted channel, or any other byte-oriented transport.</p>
|
||||
<p>Header: widgets/widgetAnsiTerm.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *term = wgtAnsiTerm(parent, 80, 25);</code></pre>
|
||||
|
|
@ -419,10 +406,7 @@ ports, the secLink encrypted channel, or any other byte-oriented transport.</p>
|
|||
<div class="topic" id="widget.box">
|
||||
<h1>Box (VBox / HBox / Frame)</h1>
|
||||
<h3>Box (VBox / HBox / Frame)</h3>
|
||||
<p>Container widgets that arrange their children in a vertical column (VBox),
|
||||
horizontal row (HBox), or a titled group box (Frame). These are the primary
|
||||
layout building blocks. Children are laid out using a flexbox-like algorithm
|
||||
with weight-based extra-space distribution.</p>
|
||||
<p>Container widgets that arrange their children in a vertical column (VBox), horizontal row (HBox), or a titled group box (Frame). These are the primary layout building blocks. Children are laid out using a flexbox-like algorithm with weight-based extra-space distribution.</p>
|
||||
<p>Header: widgets/widgetBox.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -445,8 +429,7 @@ with weight-based extra-space distribution.</p>
|
|||
<div class="topic" id="widget.button">
|
||||
<h1>Button</h1>
|
||||
<h3>Button</h3>
|
||||
<p>A push button with a text label. Fires onClick when pressed and released.
|
||||
Supports keyboard activation via accelerator keys.</p>
|
||||
<p>A push button with a text label. Fires onClick when pressed and released. Supports keyboard activation via accelerator keys.</p>
|
||||
<p>Header: widgets/widgetButton.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *btn = wgtButton(parent, "OK");</code></pre>
|
||||
|
|
@ -455,8 +438,7 @@ Supports keyboard activation via accelerator keys.</p>
|
|||
----- -----------
|
||||
wgtButton(parent, text) Create a push button with the given label text.</pre>
|
||||
<h4>Properties</h4>
|
||||
<p>Uses common WidgetT properties. Set accelKey for keyboard shortcut. Use
|
||||
wgtSetText() / wgtGetText() to change the label.</p>
|
||||
<p>Uses common WidgetT properties. Set accelKey for keyboard shortcut. Use wgtSetText() / wgtGetText() to change the label.</p>
|
||||
<h4>Events</h4>
|
||||
<pre> Callback Description
|
||||
-------- -----------
|
||||
|
|
@ -466,10 +448,7 @@ wgtSetText() / wgtGetText() to change the label.</p>
|
|||
<div class="topic" id="widget.label">
|
||||
<h1>Label</h1>
|
||||
<h3>Label</h3>
|
||||
<p>A static text label. Does not accept keyboard focus. Typically used to
|
||||
describe other widgets. Supports text alignment and accelerator keys (with
|
||||
WCLASS_FOCUS_FORWARD, the accelerator moves focus to the next focusable
|
||||
sibling).</p>
|
||||
<p>A static text label. Does not accept keyboard focus. Typically used to describe other widgets. Supports text alignment and accelerator keys (with WCLASS_FOCUS_FORWARD, the accelerator moves focus to the next focusable sibling).</p>
|
||||
<p>Header: widgets/widgetLabel.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *lbl = wgtLabel(parent, "Name:");</code></pre>
|
||||
|
|
@ -479,8 +458,7 @@ sibling).</p>
|
|||
wgtLabel(parent, text) Create a text label.
|
||||
wgtLabelSetAlign(w, align) Set the text alignment (AlignStartE, AlignCenterE, AlignEndE).</pre>
|
||||
<h4>Properties</h4>
|
||||
<p>Use wgtSetText() / wgtGetText() to change the text. Set accelKey for
|
||||
accelerator support (focus forwards to next focusable widget).</p>
|
||||
<p>Use wgtSetText() / wgtGetText() to change the text. Set accelKey for accelerator support (focus forwards to next focusable widget).</p>
|
||||
<h4>Events</h4>
|
||||
<p>Labels use the common events only. Typically no callbacks are set on labels.</p>
|
||||
<h4>Properties (BASIC Interface)</h4>
|
||||
|
|
@ -492,9 +470,7 @@ accelerator support (focus forwards to next focusable widget).</p>
|
|||
<div class="topic" id="widget.textinput">
|
||||
<h1>TextInput / TextArea</h1>
|
||||
<h3>TextInput / TextArea</h3>
|
||||
<p>Single-line text input, password input, masked input, and multi-line text
|
||||
area with optional syntax colorization, line numbers, find/replace, and
|
||||
gutter decorators.</p>
|
||||
<p>Single-line text input, password input, masked input, and multi-line text area with optional syntax colorization, line numbers, find/replace, and gutter decorators.</p>
|
||||
<p>Header: widgets/widgetTextInput.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -529,8 +505,7 @@ gutter decorators.</p>
|
|||
<div class="topic" id="widget.checkbox">
|
||||
<h1>Checkbox</h1>
|
||||
<h3>Checkbox</h3>
|
||||
<p>A toggle control with a text label. Clicking toggles between checked and
|
||||
unchecked states.</p>
|
||||
<p>A toggle control with a text label. Clicking toggles between checked and unchecked states.</p>
|
||||
<p>Header: widgets/widgetCheckbox.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *cb = wgtCheckbox(parent, "Enable logging");</code></pre>
|
||||
|
|
@ -554,9 +529,7 @@ unchecked states.</p>
|
|||
<div class="topic" id="widget.radio">
|
||||
<h1>Radio Button</h1>
|
||||
<h3>Radio Button</h3>
|
||||
<p>A mutually exclusive selection control. Radio buttons must be placed inside
|
||||
a radio group container. Only one radio button within a group can be
|
||||
selected at a time.</p>
|
||||
<p>A mutually exclusive selection control. Radio buttons must be placed inside a radio group container. Only one radio button within a group can be selected at a time.</p>
|
||||
<p>Header: widgets/widgetRadio.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *grp = wgtRadioGroup(parent);
|
||||
|
|
@ -587,9 +560,7 @@ WidgetT *r2 = wgtRadio(grp, "Option B");</code></pre>
|
|||
<div class="topic" id="widget.dropdown">
|
||||
<h1>Dropdown</h1>
|
||||
<h3>Dropdown</h3>
|
||||
<p>A drop-down list that displays a single selected item and expands to show
|
||||
all options when clicked. Read-only selection (the user cannot type into
|
||||
it).</p>
|
||||
<p>A drop-down list that displays a single selected item and expands to show all options when clicked. Read-only selection (the user cannot type into it).</p>
|
||||
<p>Header: widgets/widgetDropdown.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *dd = wgtDropdown(parent);
|
||||
|
|
@ -615,9 +586,7 @@ wgtDropdownSetItems(dd, items, 3);</code></pre>
|
|||
<div class="topic" id="widget.combobox">
|
||||
<h1>ComboBox</h1>
|
||||
<h3>ComboBox</h3>
|
||||
<p>A combination of a text input and a dropdown list. The user can either type
|
||||
a value or select from a list of predefined options. Unlike Dropdown, the
|
||||
text field is editable.</p>
|
||||
<p>A combination of a text input and a dropdown list. The user can either type a value or select from a list of predefined options. Unlike Dropdown, the text field is editable.</p>
|
||||
<p>Header: widgets/widgetComboBox.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *cb = wgtComboBox(parent, 128);
|
||||
|
|
@ -643,11 +612,7 @@ wgtComboBoxSetItems(cb, items, 3);</code></pre>
|
|||
<div class="topic" id="widget.datactrl">
|
||||
<h1>DataCtrl</h1>
|
||||
<h3>DataCtrl</h3>
|
||||
<p>A VB3-style Data control for database binding. Displays a visible navigation
|
||||
bar that connects to a SQLite database via dvxSql* functions. Reads all rows
|
||||
from the RecordSource query into an in-memory cache for bidirectional
|
||||
navigation. Fires Reposition events when the cursor moves so bound controls
|
||||
can update. Supports master-detail linking between Data controls.</p>
|
||||
<p>A VB3-style Data control for database binding. Displays a visible navigation bar that connects to a SQLite database via dvxSql* functions. Reads all rows from the RecordSource query into an in-memory cache for bidirectional navigation. Fires Reposition events when the cursor moves so bound controls can update. Supports master-detail linking between Data controls.</p>
|
||||
<p>Header: widgets/widgetDataCtrl.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *data = wgtDataCtrl(parent);</code></pre>
|
||||
|
|
@ -705,12 +670,7 @@ can update. Supports master-detail linking between Data controls.</p>
|
|||
<div class="topic" id="widget.dbgrid">
|
||||
<h1>DbGrid</h1>
|
||||
<h3>DbGrid</h3>
|
||||
<p>A database grid widget that displays all records from a Data control in a
|
||||
scrollable, sortable table. Columns auto-populate from the Data control's
|
||||
column names and can be hidden, resized, and renamed by the application.
|
||||
Clicking a column header sorts the display. Selecting a row syncs the Data
|
||||
control's cursor position. The grid reads directly from the Data control's
|
||||
cached rows, so there is no separate copy of the data.</p>
|
||||
<p>A database grid widget that displays all records from a Data control in a scrollable, sortable table. Columns auto-populate from the Data control's column names and can be hidden, resized, and renamed by the application. Clicking a column header sorts the display. Selecting a row syncs the Data control's cursor position. The grid reads directly from the Data control's cached rows, so there is no separate copy of the data.</p>
|
||||
<p>Header: widgets/widgetDbGrid.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *grid = wgtDbGrid(parent);
|
||||
|
|
@ -743,8 +703,7 @@ wgtDbGridSetDataWidget(grid, dataCtrl);</code></pre>
|
|||
<div class="topic" id="widget.listbox">
|
||||
<h1>ListBox</h1>
|
||||
<h3>ListBox</h3>
|
||||
<p>A scrollable list of text items. Supports single and multi-selection modes
|
||||
and drag-to-reorder.</p>
|
||||
<p>A scrollable list of text items. Supports single and multi-selection modes and drag-to-reorder.</p>
|
||||
<p>Header: widgets/widgetListBox.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *lb = wgtListBox(parent);
|
||||
|
|
@ -787,10 +746,7 @@ wgtListBoxSetItems(lb, items, 3);</code></pre>
|
|||
<div class="topic" id="widget.listview">
|
||||
<h1>ListView</h1>
|
||||
<h3>ListView</h3>
|
||||
<p>A multi-column list with sortable headers. Supports single and
|
||||
multi-selection, column alignment, header click sorting, and
|
||||
drag-to-reorder. Data is provided as a flat array of strings (row-major
|
||||
order, one string per cell).</p>
|
||||
<p>A multi-column list with sortable headers. Supports single and multi-selection, column alignment, header click sorting, and drag-to-reorder. Data is provided as a flat array of strings (row-major order, one string per cell).</p>
|
||||
<p>Header: widgets/widgetListView.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *lv = wgtListView(parent);
|
||||
|
|
@ -853,10 +809,7 @@ wgtListViewSetData(lv, cells, 2);</code></pre>
|
|||
<div class="topic" id="widget.treeview">
|
||||
<h1>TreeView</h1>
|
||||
<h3>TreeView</h3>
|
||||
<p>A hierarchical tree control with expandable/collapsible nodes. Supports
|
||||
single and multi-selection and drag-to-reorder. Tree items are added as
|
||||
children of the TreeView or of other tree items to create nested
|
||||
hierarchies.</p>
|
||||
<p>A hierarchical tree control with expandable/collapsible nodes. Supports single and multi-selection and drag-to-reorder. Tree items are added as children of the TreeView or of other tree items to create nested hierarchies.</p>
|
||||
<p>Header: widgets/widgetTreeView.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *tv = wgtTreeView(parent);
|
||||
|
|
@ -891,9 +844,7 @@ WidgetT *child = wgtTreeItem(root, "Child");</code></pre>
|
|||
<div class="topic" id="widget.image">
|
||||
<h1>Image</h1>
|
||||
<h3>Image</h3>
|
||||
<p>Displays a bitmap image. Can be created from raw pixel data or loaded from a
|
||||
BMP file on disk. The image is rendered at its natural size within the
|
||||
widget bounds.</p>
|
||||
<p>Displays a bitmap image. Can be created from raw pixel data or loaded from a BMP file on disk. The image is rendered at its natural size within the widget bounds.</p>
|
||||
<p>Header: widgets/widgetImage.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -920,9 +871,7 @@ widget bounds.</p>
|
|||
<div class="topic" id="widget.imagebutton">
|
||||
<h1>ImageButton</h1>
|
||||
<h3>ImageButton</h3>
|
||||
<p>A clickable button that displays an image instead of text. Has press/release
|
||||
visual feedback like a regular button. Can be created from raw pixel data or
|
||||
a BMP file.</p>
|
||||
<p>A clickable button that displays an image instead of text. Has press/release visual feedback like a regular button. Can be created from raw pixel data or a BMP file.</p>
|
||||
<p>Header: widgets/widgetImageButton.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -949,8 +898,7 @@ a BMP file.</p>
|
|||
<div class="topic" id="widget.slider">
|
||||
<h1>Slider</h1>
|
||||
<h3>Slider</h3>
|
||||
<p>A horizontal slider (track bar) for selecting an integer value within a
|
||||
range. The user drags the thumb or clicks the track to change the value.</p>
|
||||
<p>A horizontal slider (track bar) for selecting an integer value within a range. The user drags the thumb or clicks the track to change the value.</p>
|
||||
<p>Header: widgets/widgetSlider.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *sl = wgtSlider(parent, 0, 100);</code></pre>
|
||||
|
|
@ -973,8 +921,7 @@ range. The user drags the thumb or clicks the track to change the value.</p>
|
|||
<div class="topic" id="widget.spinner">
|
||||
<h1>Spinner</h1>
|
||||
<h3>Spinner</h3>
|
||||
<p>A numeric input with up/down buttons for incrementing and decrementing a
|
||||
value within a range. Supports both integer and floating-point (real) modes.</p>
|
||||
<p>A numeric input with up/down buttons for incrementing and decrementing a value within a range. Supports both integer and floating-point (real) modes.</p>
|
||||
<p>Header: widgets/widgetSpinner.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *sp = wgtSpinner(parent, 0, 100, 1);</code></pre>
|
||||
|
|
@ -1012,8 +959,7 @@ value within a range. Supports both integer and floating-point (real) modes.</p>
|
|||
<div class="topic" id="widget.progressbar">
|
||||
<h1>ProgressBar</h1>
|
||||
<h3>ProgressBar</h3>
|
||||
<p>A visual indicator of progress, displayed as a filled bar. Supports both
|
||||
horizontal and vertical orientations. Value ranges from 0 to 100.</p>
|
||||
<p>A visual indicator of progress, displayed as a filled bar. Supports both horizontal and vertical orientations. Value ranges from 0 to 100.</p>
|
||||
<p>Header: widgets/widgetProgressBar.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -1036,10 +982,7 @@ horizontal and vertical orientations. Value ranges from 0 to 100.</p>
|
|||
<div class="topic" id="widget.canvas">
|
||||
<h1>Canvas</h1>
|
||||
<h3>Canvas</h3>
|
||||
<p>A freeform drawing surface with a fixed-size pixel buffer. Provides drawing
|
||||
primitives (lines, rectangles, circles, text, individual pixels) and
|
||||
supports save/load to BMP files. Mouse interaction is available via a
|
||||
callback.</p>
|
||||
<p>A freeform drawing surface with a fixed-size pixel buffer. Provides drawing primitives (lines, rectangles, circles, text, individual pixels) and supports save/load to BMP files. Mouse interaction is available via a callback.</p>
|
||||
<p>Header: widgets/widgetCanvas.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *cv = wgtCanvas(parent, 320, 200);</code></pre>
|
||||
|
|
@ -1074,9 +1017,7 @@ callback.</p>
|
|||
<div class="topic" id="widget.timer">
|
||||
<h1>Timer</h1>
|
||||
<h3>Timer</h3>
|
||||
<p>A non-visual widget that fires its onClick callback at a regular interval.
|
||||
Useful for animations, polling, and periodic updates. Must be explicitly
|
||||
started after creation.</p>
|
||||
<p>A non-visual widget that fires its onClick callback at a regular interval. Useful for animations, polling, and periodic updates. Must be explicitly started after creation.</p>
|
||||
<p>Header: widgets/widgetTimer.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *tmr = wgtTimer(parent, 1000, true); // 1 second, repeating
|
||||
|
|
@ -1114,9 +1055,7 @@ wgtTimerStart(tmr);</code></pre>
|
|||
<div class="topic" id="widget.toolbar">
|
||||
<h1>Toolbar</h1>
|
||||
<h3>Toolbar</h3>
|
||||
<p>A horizontal container for toolbar buttons and controls. Typically placed at
|
||||
the top of a window. Children (usually ImageButtons or Buttons) are laid out
|
||||
horizontally with toolbar-appropriate spacing.</p>
|
||||
<p>A horizontal container for toolbar buttons and controls. Typically placed at the top of a window. Children (usually ImageButtons or Buttons) are laid out horizontally with toolbar-appropriate spacing.</p>
|
||||
<p>Header: widgets/widgetToolbar.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *tb = wgtToolbar(parent);
|
||||
|
|
@ -1127,18 +1066,15 @@ wgtImageButtonFromFile(tb, "icons/open.bmp");</code></pre>
|
|||
----- -----------
|
||||
wgtToolbar(parent) Create a toolbar container.</pre>
|
||||
<h4>Properties</h4>
|
||||
<p>Uses common container properties. Add children (buttons, separators, etc.)
|
||||
to populate the toolbar.</p>
|
||||
<p>Uses common container properties. Add children (buttons, separators, etc.) to populate the toolbar.</p>
|
||||
<h4>Events</h4>
|
||||
<p>Toolbar itself has no widget-specific events. Events fire on the child
|
||||
widgets.</p>
|
||||
<p>Toolbar itself has no widget-specific events. Events fire on the child widgets.</p>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="topic" id="widget.statusbar">
|
||||
<h1>StatusBar</h1>
|
||||
<h3>StatusBar</h3>
|
||||
<p>A horizontal bar typically placed at the bottom of a window for displaying
|
||||
status text and informational widgets. Children are laid out horizontally.</p>
|
||||
<p>A horizontal bar typically placed at the bottom of a window for displaying status text and informational widgets. Children are laid out horizontally.</p>
|
||||
<p>Header: widgets/widgetStatusBar.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *sb = wgtStatusBar(parent);
|
||||
|
|
@ -1148,19 +1084,15 @@ wgtLabel(sb, "Ready");</code></pre>
|
|||
----- -----------
|
||||
wgtStatusBar(parent) Create a status bar container.</pre>
|
||||
<h4>Properties</h4>
|
||||
<p>Uses common container properties. Add child widgets (labels, progress bars,
|
||||
etc.) to populate.</p>
|
||||
<p>Uses common container properties. Add child widgets (labels, progress bars, etc.) to populate.</p>
|
||||
<h4>Events</h4>
|
||||
<p>StatusBar itself has no widget-specific events. Events fire on the child
|
||||
widgets.</p>
|
||||
<p>StatusBar itself has no widget-specific events. Events fire on the child widgets.</p>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="topic" id="widget.scrollpane">
|
||||
<h1>ScrollPane</h1>
|
||||
<h3>ScrollPane</h3>
|
||||
<p>A scrollable container that provides vertical and/or horizontal scrollbars
|
||||
when its content exceeds the visible area. Place a single child (typically a
|
||||
VBox or HBox) inside the scroll pane.</p>
|
||||
<p>A scrollable container that provides vertical and/or horizontal scrollbars when its content exceeds the visible area. Place a single child (typically a VBox or HBox) inside the scroll pane.</p>
|
||||
<p>Header: widgets/widgetScrollPane.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *sp = wgtScrollPane(parent);
|
||||
|
|
@ -1185,9 +1117,7 @@ WidgetT *content = wgtVBox(sp);
|
|||
<div class="topic" id="widget.splitter">
|
||||
<h1>Splitter</h1>
|
||||
<h3>Splitter</h3>
|
||||
<p>A two-pane container with a draggable divider. The user drags the splitter
|
||||
bar to resize the two panes. Can be oriented vertically (left/right panes)
|
||||
or horizontally (top/bottom panes). Add exactly two children.</p>
|
||||
<p>A two-pane container with a draggable divider. The user drags the splitter bar to resize the two panes. Can be oriented vertically (left/right panes) or horizontally (top/bottom panes). Add exactly two children.</p>
|
||||
<p>Header: widgets/widgetSplitter.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *sp = wgtSplitter(parent, true); // vertical = left|right
|
||||
|
|
@ -1212,9 +1142,7 @@ WidgetT *right = wgtVBox(sp);</code></pre>
|
|||
<div class="topic" id="widget.tabcontrol">
|
||||
<h1>TabControl</h1>
|
||||
<h3>TabControl</h3>
|
||||
<p>A tabbed container that displays one page at a time with clickable tabs
|
||||
along the top. Each tab page is a container that holds its own child
|
||||
widgets.</p>
|
||||
<p>A tabbed container that displays one page at a time with clickable tabs along the top. Each tab page is a container that holds its own child widgets.</p>
|
||||
<p>Header: widgets/widgetTabControl.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *tabs = wgtTabControl(parent);
|
||||
|
|
@ -1245,8 +1173,7 @@ WidgetT *page2 = wgtTabPage(tabs, "Advanced");
|
|||
<div class="topic" id="widget.separator">
|
||||
<h1>Separator</h1>
|
||||
<h3>Separator</h3>
|
||||
<p>A visual dividing line used to separate groups of widgets. Available in
|
||||
horizontal and vertical orientations.</p>
|
||||
<p>A visual dividing line used to separate groups of widgets. Available in horizontal and vertical orientations.</p>
|
||||
<p>Header: widgets/widgetSeparator.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre> Macro Description
|
||||
|
|
@ -1260,9 +1187,7 @@ horizontal and vertical orientations.</p>
|
|||
<div class="topic" id="widget.spacer">
|
||||
<h1>Spacer</h1>
|
||||
<h3>Spacer</h3>
|
||||
<p>An invisible widget used for layout purposes. By default it has weight=100,
|
||||
so it absorbs available extra space. Useful for pushing other widgets apart
|
||||
or aligning them to edges.</p>
|
||||
<p>An invisible widget used for layout purposes. By default it has weight=100, so it absorbs available extra space. Useful for pushing other widgets apart or aligning them to edges.</p>
|
||||
<p>Header: widgets/widgetSpacer.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *row = wgtHBox(parent);
|
||||
|
|
@ -1280,10 +1205,7 @@ wgtButton(row, "Cancel");</code></pre>
|
|||
<div class="topic" id="widget.wrapbox">
|
||||
<h1>WrapBox</h1>
|
||||
<h3>WrapBox</h3>
|
||||
<p>A flow/wrap layout container that arranges children left-to-right, wrapping
|
||||
to the next row when the available width is exceeded. Each row's height is
|
||||
the maximum child height in that row. Supports configurable spacing between
|
||||
items and rows, and per-row alignment for short rows.</p>
|
||||
<p>A flow/wrap layout container that arranges children left-to-right, wrapping to the next row when the available width is exceeded. Each row's height is the maximum child height in that row. Supports configurable spacing between items and rows, and per-row alignment for short rows.</p>
|
||||
<p>Header: widgets/widgetWrapBox.h</p>
|
||||
<h4>Creation</h4>
|
||||
<pre><code>WidgetT *wrap = wgtWrapBox(parent);
|
||||
|
|
@ -1305,8 +1227,7 @@ wgtButton(wrap, "Tag 3");</code></pre>
|
|||
-------- ---- ------ -----------
|
||||
Alignment Enum (Left, Center, Right) Read/Write Row alignment for rows that do not fill the full width.</pre>
|
||||
<h4>Events</h4>
|
||||
<p>WrapBox is a container widget. It uses the common events only. No
|
||||
widget-specific events are defined.</p>
|
||||
<p>WrapBox is a container widget. It uses the common events only. No widget-specific events are defined.</p>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
|||
134
docs/dvx_widget_system.html
Normal file
134
docs/dvx_widget_system.html
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Base WidgetT (Common Properties, Events, and Operations)</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="#widget.base">Widget System</a></li>
|
||||
</ul>
|
||||
<h3>Index</h3>
|
||||
<ul>
|
||||
<li><a href="#widget.base">WidgetT</a></li>
|
||||
<li><a href="#widget.base">Widget Base</a></li>
|
||||
<li><a href="#widget.base">Common Properties</a></li>
|
||||
<li><a href="#widget.base">Common Events</a></li>
|
||||
<li><a href="#widget.base">wgtPixels</a></li>
|
||||
<li><a href="#widget.base">wgtChars</a></li>
|
||||
<li><a href="#widget.base">wgtPercent</a></li>
|
||||
<li><a href="#widget.base">onClick</a></li>
|
||||
<li><a href="#widget.base">onChange</a></li>
|
||||
<li><a href="#widget.base">onKeyPress</a></li>
|
||||
<li><a href="#widget.base">onKeyDown</a></li>
|
||||
<li><a href="#widget.base">onMouseDown</a></li>
|
||||
<li><a href="#widget.base">wgtInitWindow</a></li>
|
||||
<li><a href="#widget.base">wgtGetContext</a></li>
|
||||
<li><a href="#widget.base">wgtInvalidate</a></li>
|
||||
<li><a href="#widget.base">wgtSetText</a></li>
|
||||
<li><a href="#widget.base">wgtGetText</a></li>
|
||||
<li><a href="#widget.base">wgtSetEnabled</a></li>
|
||||
<li><a href="#widget.base">wgtSetFocused</a></li>
|
||||
<li><a href="#widget.base">wgtSetVisible</a></li>
|
||||
<li><a href="#widget.base">wgtFind</a></li>
|
||||
<li><a href="#widget.base">wgtDestroy</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<main>
|
||||
<div class="topic" id="widget.base">
|
||||
<h1>Base WidgetT (Common Properties, Events, and Operations)</h1>
|
||||
<h2>DVX Widget System</h2>
|
||||
<p>Complete reference for the DVX GUI widget toolkit. All widgets are implemented as dynamically loaded DXE modules. They are created via convenience macros that wrap the per-widget API function tables. The base WidgetT structure is defined in core/dvxWidget.h; individual widget headers live in widgets/.</p>
|
||||
<p>Individual widgets are documented in their own sections. See the table of contents for the full list.</p>
|
||||
<h3>Base WidgetT (Common Properties, Events, and Operations)</h3>
|
||||
<p>Every widget inherits from the WidgetT structure defined in core/dvxWidget.h. The fields and callbacks listed here are available on all widget types.</p>
|
||||
<h4>Common Properties</h4>
|
||||
<pre> Field Type Description
|
||||
----- ---- -----------
|
||||
name char[32] Widget name for lookup via wgtFind().
|
||||
x, y, w, h int32_t Computed geometry relative to the window content area (set by layout).
|
||||
minW, minH int32_t (tagged) Minimum size hints. Use wgtPixels(), wgtChars(), or wgtPercent(). 0 = auto.
|
||||
maxW, maxH int32_t (tagged) Maximum size constraints. 0 = no limit.
|
||||
prefW, prefH int32_t (tagged) Preferred size. 0 = auto.
|
||||
weight int32_t Extra-space distribution weight. 0 = fixed, 100 = normal. A widget with weight=200 gets twice the extra space of one with weight=100.
|
||||
align WidgetAlignE Main-axis alignment for children: AlignStartE, AlignCenterE, AlignEndE.
|
||||
spacing int32_t (tagged) Spacing between children (containers only). 0 = default.
|
||||
padding int32_t (tagged) Internal padding (containers only). 0 = default.
|
||||
fgColor uint32_t Foreground color override. 0 = use color scheme default.
|
||||
bgColor uint32_t Background color override. 0 = use color scheme default.
|
||||
visible bool Visibility state.
|
||||
enabled bool Enabled state. Disabled widgets are grayed out and ignore input.
|
||||
readOnly bool Read-only mode: allows scrolling/selection but blocks editing.
|
||||
swallowTab bool When true, Tab key goes to the widget instead of navigating focus.
|
||||
accelKey char Lowercase accelerator character. 0 if none.
|
||||
tooltip const char * Tooltip text. NULL = none. Caller owns the string.
|
||||
contextMenu MenuT * Right-click context menu. NULL = none. Caller owns.
|
||||
userData void * Application-defined user data pointer.</pre>
|
||||
<h4>Size Specification Macros</h4>
|
||||
<pre> Macro Description
|
||||
----- -----------
|
||||
wgtPixels(v) Size in pixels.
|
||||
wgtChars(v) Size in character widths (multiplied by font charWidth).
|
||||
wgtPercent(v) Size as a percentage of parent dimension.</pre>
|
||||
<h4>Common Events (Callbacks)</h4>
|
||||
<p>These callback function pointers are available on every WidgetT. Set them directly on the widget struct.</p>
|
||||
<pre> Callback Signature Description
|
||||
-------- --------- -----------
|
||||
onClick void (*)(WidgetT *w) Fires on mouse click / activation.
|
||||
onDblClick void (*)(WidgetT *w) Fires on double-click.
|
||||
onChange void (*)(WidgetT *w) Fires when the widget's value changes (text, selection, check state, etc.).
|
||||
onFocus void (*)(WidgetT *w) Fires when the widget receives keyboard focus.
|
||||
onBlur void (*)(WidgetT *w) Fires when the widget loses keyboard focus.
|
||||
onKeyPress void (*)(WidgetT *w, int32_t keyAscii) Fires on a printable key press (ASCII value).
|
||||
onKeyDown void (*)(WidgetT *w, int32_t keyCode, int32_t shift) Fires on key down (scan code + shift state).
|
||||
onKeyUp void (*)(WidgetT *w, int32_t keyCode, int32_t shift) Fires on key up.
|
||||
onMouseDown void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse button press.
|
||||
onMouseUp void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse button release.
|
||||
onMouseMove void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse movement over the widget.
|
||||
onScroll void (*)(WidgetT *w, int32_t delta) Fires on mouse wheel scroll.
|
||||
onValidate bool (*)(WidgetT *w) Validation callback. Return false to cancel a pending write.</pre>
|
||||
<h4>Common Operations</h4>
|
||||
<pre> Function Description
|
||||
-------- -----------
|
||||
WidgetT *wgtInitWindow(AppContextT *ctx, WindowT *win) Initialize widgets for a window. Returns the root VBox container.
|
||||
AppContextT *wgtGetContext(const WidgetT *w) Walk up from any widget to retrieve the AppContextT.
|
||||
void wgtInvalidate(WidgetT *w) Mark widget for re-layout and repaint. Propagates to ancestors.
|
||||
void wgtInvalidatePaint(WidgetT *w) Mark widget for repaint only (no layout recalculation).
|
||||
void wgtSetText(WidgetT *w, const char *text) Set widget text (label, button, textinput, etc.).
|
||||
const char *wgtGetText(const WidgetT *w) Get widget text.
|
||||
void wgtSetEnabled(WidgetT *w, bool enabled) Enable or disable a widget.
|
||||
void wgtSetReadOnly(WidgetT *w, bool readOnly) Set read-only mode.
|
||||
void wgtSetFocused(WidgetT *w) Set keyboard focus to a widget.
|
||||
WidgetT *wgtGetFocused(void) Get the currently focused widget.
|
||||
void wgtSetVisible(WidgetT *w, bool visible) Show or hide a widget.
|
||||
void wgtSetName(WidgetT *w, const char *name) Set widget name for lookup.
|
||||
WidgetT *wgtFind(WidgetT *root, const char *name) Find a widget by name in the subtree.
|
||||
void wgtDestroy(WidgetT *w) Destroy a widget and all its children.
|
||||
void wgtSetTooltip(WidgetT *w, const char *text) Set tooltip text. Pass NULL to remove.</pre>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -233,9 +233,7 @@ img { max-width: 100%; }
|
|||
<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>
|
||||
<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
|
||||
---------- ------- --- -------------------------------------------
|
||||
|
|
@ -255,10 +253,7 @@ widget-specific interface descriptors.</p>
|
|||
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>
|
||||
<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.
|
||||
|
|
@ -286,10 +281,7 @@ below require the control to be defined in the .frm file.</p>
|
|||
<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>
|
||||
<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
|
||||
---------- ------- -------------- -------------------------------------------
|
||||
|
|
@ -342,8 +334,7 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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
|
||||
-------- ------ -------------------------------------------
|
||||
|
|
@ -384,10 +375,8 @@ End</code></pre>
|
|||
<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>
|
||||
<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
|
||||
---------- ------ -------------------------------------------
|
||||
|
|
@ -409,11 +398,8 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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
|
||||
-------- ------ -------------------------------------------
|
||||
|
|
@ -449,11 +435,8 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -470,9 +453,7 @@ property returns the button's index within its group.</p>
|
|||
<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>
|
||||
<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
|
||||
-------- ------ -------------------------------------------
|
||||
|
|
@ -495,8 +476,7 @@ End</code></pre>
|
|||
<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>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>
|
||||
|
|
@ -507,8 +487,7 @@ or border. Use Weight on children to distribute extra space.</p>
|
|||
<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>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>
|
||||
|
|
@ -519,8 +498,7 @@ Weight on children to distribute extra space.</p>
|
|||
<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>
|
||||
<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
|
||||
--------- ------- -------------------------------------------
|
||||
|
|
@ -561,11 +539,8 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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
|
||||
--------- ------- -------------------------------------------
|
||||
|
|
@ -573,7 +548,7 @@ methods as ListBox.</p>
|
|||
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>Same as 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>
|
||||
|
|
@ -581,16 +556,14 @@ methods as ListBox.</p>
|
|||
<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>
|
||||
<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>Same as 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>
|
||||
|
|
@ -598,8 +571,7 @@ AddItem/RemoveItem/Clear/List.</p>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -619,8 +591,7 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -639,8 +610,7 @@ real-number mode with configurable decimal places.</p>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -655,8 +625,7 @@ widget is invisible at runtime -- it has no on-screen representation.</p>
|
|||
<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>
|
||||
<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
|
||||
|
|
@ -675,16 +644,12 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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>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>
|
||||
|
|
@ -692,9 +657,7 @@ but not currently exposed through BASIC interface descriptors.</p>
|
|||
<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>
|
||||
<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
|
||||
----------- ------- -------------------------------------------
|
||||
|
|
@ -708,9 +671,7 @@ created in code or loaded via the Picture property.</p>
|
|||
<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>
|
||||
<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
|
||||
----------- ------- -------------------------------------------
|
||||
|
|
@ -736,8 +697,7 @@ property.</p>
|
|||
<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>
|
||||
<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
|
||||
--------- ------- -------------------------------------------
|
||||
|
|
@ -758,8 +718,7 @@ drag-to-reorder. Columns are configured via the C API (SetColumns, SetData).</p>
|
|||
<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>
|
||||
<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
|
||||
-------------- ---------------------- -------------------------------------------
|
||||
|
|
@ -772,8 +731,7 @@ the C API (wgtTreeItem). Supports multi-select and drag-to-reorder.</p>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -784,16 +742,14 @@ controls. Switching tabs shows one page and hides others.</p>
|
|||
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>
|
||||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -806,8 +762,7 @@ draggable divider. Default orientation is vertical (top/bottom split).</p>
|
|||
<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>
|
||||
<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
|
||||
-------- ------- -------------------------------------------
|
||||
|
|
@ -820,9 +775,7 @@ automatically provides scrollbars when the content exceeds the visible area.</p>
|
|||
<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>
|
||||
<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
|
||||
--------- ---- -------------------------------------------
|
||||
|
|
@ -835,8 +788,7 @@ flex-wrap: wrap.</p>
|
|||
<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>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>
|
||||
|
|
@ -844,9 +796,7 @@ vertical orientations. The default (via BASIC) is horizontal.</p>
|
|||
<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>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>
|
||||
|
|
@ -854,8 +804,7 @@ extra space.</p>
|
|||
<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>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>
|
||||
|
|
@ -864,11 +813,7 @@ spacing. Place buttons, labels, or other controls inside.</p>
|
|||
<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>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>
|
||||
|
|
@ -876,9 +821,7 @@ text.</p>
|
|||
<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>
|
||||
<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
|
||||
---------- ------- -------------------------------------------
|
||||
|
|
@ -897,10 +840,8 @@ scrollback buffer, and serial communication. Default size is 80 columns by
|
|||
<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>
|
||||
<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.</p>
|
||||
<p><a href="#ctrl.databinding">See Data Binding for details</a></p>
|
||||
<h3>Type-Specific Properties</h3>
|
||||
<pre> Property Type R/W Description
|
||||
------------ ------- --- -------------------------------------------
|
||||
|
|
@ -937,9 +878,7 @@ details.</p>
|
|||
<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>
|
||||
<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
|
||||
---------- ------- -------------------------------------------
|
||||
|
|
@ -961,43 +900,28 @@ DataSource property.</p>
|
|||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
|
|
@ -1041,9 +965,7 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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"
|
||||
|
|
@ -1081,19 +1003,15 @@ End</code></pre>
|
|||
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>
|
||||
<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>
|
||||
<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>
|
||||
<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
|
||||
|
|
@ -1107,9 +1025,7 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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"
|
||||
|
|
@ -1124,9 +1040,7 @@ Begin CommandButton Command1
|
|||
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>
|
||||
<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
|
||||
|
|
@ -1141,20 +1055,14 @@ End Sub</code></pre>
|
|||
<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>
|
||||
<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>
|
||||
<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
|
||||
|
|
@ -1187,14 +1095,11 @@ 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 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>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>
|
||||
|
|
|
|||
349
docs/dvxbasic_controls_overview.html
Normal file
349
docs/dvxbasic_controls_overview.html
Normal file
|
|
@ -0,0 +1,349 @@
|
|||
<!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>
|
||||
<ul>
|
||||
<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>
|
||||
</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.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.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>
|
||||
2824
docs/dvxbasic_help.html
Normal file
2824
docs/dvxbasic_help.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -29,7 +29,8 @@ img { max-width: 100%; }
|
|||
<nav>
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#ide.overview">Overview</a></li>
|
||||
<li><a href="#ide.overview">Overview</a>
|
||||
<ul>
|
||||
<li><a href="#ide.menu.file">Menu Reference</a>
|
||||
<ul>
|
||||
<li><a href="#ide.menu.file">File Menu</a></li>
|
||||
|
|
@ -62,6 +63,8 @@ img { max-width: 100%; }
|
|||
<li><a href="#ide.preferences">Preferences</a></li>
|
||||
<li><a href="#ide.shortcuts">Keyboard Shortcuts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Index</h3>
|
||||
<ul>
|
||||
<li><a href="#ide.overview">DVX BASIC</a></li>
|
||||
|
|
@ -176,36 +179,22 @@ img { max-width: 100%; }
|
|||
<div class="topic" id="ide.overview">
|
||||
<h1>DVX BASIC IDE Guide</h1>
|
||||
<h2>DVX BASIC IDE Guide</h2>
|
||||
<p>DVX BASIC is a Visual BASIC development environment for the DVX GUI System.
|
||||
It provides a VB3-style integrated development environment with a code
|
||||
editor, form designer, project system, and a full interactive debugger --
|
||||
all running natively on DOS under the DVX windowing system.</p>
|
||||
<p>This guide covers every feature of the IDE: menus, toolbar, editor, form
|
||||
designer, project management, debugger, and auxiliary windows.</p>
|
||||
<p>DVX BASIC is a Visual BASIC development environment for the DVX GUI System. It provides a VB3-style integrated development environment with a code editor, form designer, project system, and a full interactive debugger -- all running natively on DOS under the DVX windowing system.</p>
|
||||
<p>This guide covers every feature of the IDE: menus, toolbar, editor, form designer, project management, debugger, and auxiliary windows.</p>
|
||||
<h3>IDE Windows</h3>
|
||||
<p>The DVX BASIC IDE is modeled after Visual Basic 3.0. It consists of several
|
||||
floating windows arranged on the DVX desktop:</p>
|
||||
<p>The DVX BASIC IDE is modeled after Visual Basic 3.0. It consists of several floating windows arranged on the DVX desktop:</p>
|
||||
<ul>
|
||||
<li>Main Toolbar Window -- anchored at the top of the screen. Contains the
|
||||
menu bar, toolbar buttons, and status bar.</li>
|
||||
<li>Code Editor -- the primary editing surface for BASIC source code, with
|
||||
Object/Event dropdowns, syntax highlighting, and line numbers.</li>
|
||||
<li>Form Designer -- a visual design surface for .frm files, showing a WYSIWYG
|
||||
preview of the form with grab handles for resizing controls.</li>
|
||||
<li>Main Toolbar Window -- anchored at the top of the screen. Contains the menu bar, toolbar buttons, and status bar.</li>
|
||||
<li>Code Editor -- the primary editing surface for BASIC source code, with Object/Event dropdowns, syntax highlighting, and line numbers.</li>
|
||||
<li>Form Designer -- a visual design surface for .frm files, showing a WYSIWYG preview of the form with grab handles for resizing controls.</li>
|
||||
<li>Project Explorer -- a tree view listing all files in the project.</li>
|
||||
<li>Toolbox -- a palette of available controls for placing on forms.</li>
|
||||
<li>Properties Panel -- a tree of controls and a list of editable properties
|
||||
for the selected control.</li>
|
||||
<li>Properties Panel -- a tree of controls and a list of editable properties for the selected control.</li>
|
||||
<li>Output Window -- displays PRINT output and runtime errors.</li>
|
||||
<li>Immediate Window -- an interactive REPL for evaluating expressions and
|
||||
modifying variables at runtime.</li>
|
||||
<li>Immediate Window -- an interactive REPL for evaluating expressions and modifying variables at runtime.</li>
|
||||
</ul>
|
||||
<p>Debug Windows -- Locals, Call Stack, Watch, and Breakpoints windows that
|
||||
appear automatically when debugging.</p>
|
||||
<p>The IDE compiles BASIC source into bytecode and runs it in an integrated
|
||||
virtual machine (VM). Programs execute in cooperative slices (10,000 VM
|
||||
steps per slice), yielding to the DVX event loop between slices so the GUI
|
||||
remains responsive.</p>
|
||||
<p>Debug Windows -- Locals, Call Stack, Watch, and Breakpoints windows that appear automatically when debugging.</p>
|
||||
<p>The IDE compiles BASIC source into bytecode and runs it in an integrated virtual machine (VM). Programs execute in cooperative slices (10,000 VM steps per slice), yielding to the DVX event loop between slices so the GUI remains responsive.</p>
|
||||
<p><a href="#ide.menu.file">File Menu</a></p>
|
||||
<p><a href="#ide.menu.edit">Edit Menu</a></p>
|
||||
<p><a href="#ide.menu.run">Run Menu</a></p>
|
||||
|
|
@ -350,8 +339,7 @@ remains responsive.</p>
|
|||
<div class="topic" id="ide.toolbar">
|
||||
<h1>Toolbar</h1>
|
||||
<h2>Toolbar</h2>
|
||||
<p>The toolbar is organized into four groups separated by vertical dividers.
|
||||
Each button has a tooltip showing its name and keyboard shortcut.</p>
|
||||
<p>The toolbar is organized into four groups separated by vertical dividers. Each button has a tooltip showing its name and keyboard shortcut.</p>
|
||||
<h3>File Group</h3>
|
||||
<pre> Button Shortcut Action
|
||||
------ -------- ------
|
||||
|
|
@ -380,25 +368,16 @@ Each button has a tooltip showing its name and keyboard shortcut.</p>
|
|||
<div class="topic" id="ide.editor">
|
||||
<h1>Code Editor</h1>
|
||||
<h2>Code Editor</h2>
|
||||
<p>The Code Editor is the primary editing window for BASIC source code. It
|
||||
occupies the center of the screen, below the toolbar and above the Output
|
||||
and Immediate windows.</p>
|
||||
<p>The Code Editor is the primary editing window for BASIC source code. It occupies the center of the screen, below the toolbar and above the Output and Immediate windows.</p>
|
||||
<h3>Object and Function Dropdowns</h3>
|
||||
<p>At the top of the Code Editor are two dropdown lists:</p>
|
||||
<ul>
|
||||
<li>Object -- lists (General) plus all objects (form name, control names, menu
|
||||
item names). Selecting an object filters the Function dropdown.</li>
|
||||
<li>Object -- lists (General) plus all objects (form name, control names, menu item names). Selecting an object filters the Function dropdown.</li>
|
||||
</ul>
|
||||
<p>Function -- lists all event handlers (procedures) for the selected object.
|
||||
Implemented handlers are listed first (plain text); unimplemented handlers
|
||||
follow in brackets (e.g., [Click]). Selecting an unimplemented event creates
|
||||
a new event handler stub.</p>
|
||||
<p>The editor shows one procedure at a time. Each procedure has its own buffer,
|
||||
and switching between them is instantaneous. The (General) section contains
|
||||
module-level declarations and code.</p>
|
||||
<p>Function -- lists all event handlers (procedures) for the selected object. Implemented handlers are listed first (plain text); unimplemented handlers follow in brackets (e.g., [Click]). Selecting an unimplemented event creates a new event handler stub.</p>
|
||||
<p>The editor shows one procedure at a time. Each procedure has its own buffer, and switching between them is instantaneous. The (General) section contains module-level declarations and code.</p>
|
||||
<h3>Syntax Highlighting</h3>
|
||||
<p>The editor applies real-time syntax coloring as you type. The following
|
||||
categories are highlighted in distinct colors:</p>
|
||||
<p>The editor applies real-time syntax coloring as you type. The following categories are highlighted in distinct colors:</p>
|
||||
<pre> Category Examples
|
||||
-------- --------
|
||||
Keywords IF, THEN, FOR, NEXT, SUB, FUNCTION, DIM, PRINT, SELECT, CASE, DO, LOOP, WHILE, WEND, END, EXIT, CALL, GOSUB, GOTO, RETURN, DECLARE, CONST, TYPE, AND, OR, NOT, XOR, MOD, etc.
|
||||
|
|
@ -410,46 +389,29 @@ categories are highlighted in distinct colors:</p>
|
|||
<h3>Editor Features</h3>
|
||||
<ul>
|
||||
<li>Line numbers -- displayed in the gutter on the left side.</li>
|
||||
<li>Auto-indent -- new lines are automatically indented to match the previous
|
||||
line.</li>
|
||||
<li>Tab handling -- the Tab key is captured by the editor. Tab width and
|
||||
whether to insert spaces or tab characters are configurable in
|
||||
Preferences (default: 3 spaces).</li>
|
||||
<li>Gutter click -- clicking in the line number gutter toggles a breakpoint on
|
||||
that line.</li>
|
||||
<li>Auto-indent -- new lines are automatically indented to match the previous line.</li>
|
||||
<li>Tab handling -- the Tab key is captured by the editor. Tab width and whether to insert spaces or tab characters are configurable in Preferences (default: 3 spaces).</li>
|
||||
<li>Gutter click -- clicking in the line number gutter toggles a breakpoint on that line.</li>
|
||||
</ul>
|
||||
<p>Line decorations -- breakpoint lines show a red dot in the gutter. The
|
||||
current debug line (when paused) is highlighted with a yellow background.</p>
|
||||
<p>Line decorations -- breakpoint lines show a red dot in the gutter. The current debug line (when paused) is highlighted with a yellow background.</p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.designer">
|
||||
<h1>Form Designer</h1>
|
||||
<h2>Form Designer</h2>
|
||||
<p>The Form Designer provides a visual design surface for editing .frm files.
|
||||
Switch to it with Shift+F7 or the Design toolbar button. It opens in a
|
||||
separate window showing a WYSIWYG preview of the form.</p>
|
||||
<p>The Form Designer provides a visual design surface for editing .frm files. Switch to it with Shift+F7 or the Design toolbar button. It opens in a separate window showing a WYSIWYG preview of the form.</p>
|
||||
<h3>Design Surface</h3>
|
||||
<ul>
|
||||
<li>Grid snapping -- controls snap to an 8-pixel grid (DSGN_GRID_SIZE) when
|
||||
placed or resized.</li>
|
||||
<li>Selection -- click a control to select it. The selected control is
|
||||
highlighted with grab handles.</li>
|
||||
<li>Grab handles -- 6x6 pixel handles appear on the right edge (E), bottom
|
||||
edge (S), and bottom-right corner (SE) of the selected control. Drag a
|
||||
handle to resize the control.</li>
|
||||
<li>Reordering -- drag a control vertically to reorder it within the form's
|
||||
layout (VBox/HBox).</li>
|
||||
<li>Placing controls -- select a control type in the Toolbox, then click on
|
||||
the form to place a new instance. The control is auto-named (e.g.,
|
||||
Command1, Command2). Clicking the same tool again deselects it (toggles
|
||||
back to pointer mode).</li>
|
||||
<li>Menu bar preview -- if the form has menu items (defined via the Menu
|
||||
Editor), a preview menu bar is rendered on the design window.</li>
|
||||
<li>Grid snapping -- controls snap to an 8-pixel grid (DSGN_GRID_SIZE) when placed or resized.</li>
|
||||
<li>Selection -- click a control to select it. The selected control is highlighted with grab handles.</li>
|
||||
<li>Grab handles -- 6x6 pixel handles appear on the right edge (E), bottom edge (S), and bottom-right corner (SE) of the selected control. Drag a handle to resize the control.</li>
|
||||
<li>Reordering -- drag a control vertically to reorder it within the form's layout (VBox/HBox).</li>
|
||||
<li>Placing controls -- select a control type in the Toolbox, then click on the form to place a new instance. The control is auto-named (e.g., Command1, Command2). Clicking the same tool again deselects it (toggles back to pointer mode).</li>
|
||||
<li>Menu bar preview -- if the form has menu items (defined via the Menu Editor), a preview menu bar is rendered on the design window.</li>
|
||||
</ul>
|
||||
<p>Delete key -- removes the selected control from the form.</p>
|
||||
<h3>Form Properties</h3>
|
||||
<p>Forms have the following design-time properties: Name, Caption, Width,
|
||||
Height, Left, Top, Layout (VBox or HBox), Centered, AutoSize, and Resizable.</p>
|
||||
<p>Forms have the following design-time properties: Name, Caption, Width, Height, Left, Top, Layout (VBox or HBox), Centered, AutoSize, and Resizable.</p>
|
||||
<p><a href="#ide.properties">Properties Panel</a></p>
|
||||
<p><a href="#ide.toolbox">Toolbox</a></p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
|
|
@ -458,22 +420,15 @@ Height, Left, Top, Layout (VBox or HBox), Centered, AutoSize, and Resizable.</p>
|
|||
<h1>Project System</h1>
|
||||
<h2>Project System</h2>
|
||||
<h3>Project Files (.dbp)</h3>
|
||||
<p>A DVX BASIC project is stored as a .dbp file (DVX BASIC Project). The
|
||||
project file records:</p>
|
||||
<p>A DVX BASIC project is stored as a .dbp file (DVX BASIC Project). The project file records:</p>
|
||||
<ul>
|
||||
<li>Name -- the project display name (up to 32 characters).</li>
|
||||
<li>Startup Form -- which form to show automatically when the program starts.</li>
|
||||
<li>Metadata -- Author, Company, Version, Copyright, Description, and Icon
|
||||
Path (for compiled binaries).</li>
|
||||
<li>Metadata -- Author, Company, Version, Copyright, Description, and Icon Path (for compiled binaries).</li>
|
||||
</ul>
|
||||
<p>File list -- relative paths (8.3 DOS names) of all .bas and .frm files in
|
||||
the project. Each entry tracks whether it is a form file.</p>
|
||||
<p>File list -- relative paths (8.3 DOS names) of all .bas and .frm files in the project. Each entry tracks whether it is a form file.</p>
|
||||
<h3>Source Map</h3>
|
||||
<p>When the project is compiled, all files are concatenated into a single
|
||||
source stream. A source map tracks which lines belong to which file,
|
||||
enabling accurate error reporting and debugger navigation across multiple
|
||||
files. For .frm files, an injected BEGINFORM directive is prepended to the
|
||||
code section.</p>
|
||||
<p>When the project is compiled, all files are concatenated into a single source stream. A source map tracks which lines belong to which file, enabling accurate error reporting and debugger navigation across multiple files. For .frm files, an injected BEGINFORM directive is prepended to the code section.</p>
|
||||
<h3>Project Operations</h3>
|
||||
<pre> Operation Description
|
||||
--------- -----------
|
||||
|
|
@ -485,10 +440,7 @@ code section.</p>
|
|||
Remove File Removes a file from the project (prompts to save if modified).
|
||||
Project Properties Opens a dialog for editing project metadata (name, author, company, version, copyright, description, icon, startup form).</pre>
|
||||
<h3>Project Explorer</h3>
|
||||
<p>The Project Explorer is a tree view window listing all project files.
|
||||
Double-click a file to open it: .bas files open in Code view, .frm files
|
||||
open in Design view. The selected file in the Project Explorer determines
|
||||
the target for View > Code and View > Designer commands.</p>
|
||||
<p>The Project Explorer is a tree view window listing all project files. Double-click a file to open it: .bas files open in Code view, .frm files open in Design view. The selected file in the Project Explorer determines the target for View > Code and View > Designer commands.</p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.properties">
|
||||
|
|
@ -496,32 +448,18 @@ the target for View > Code and View > Designer commands.</p>
|
|||
<h2>Properties Panel</h2>
|
||||
<p>The Properties panel (Window > Properties) has two sections:</p>
|
||||
<ul>
|
||||
<li>Control tree -- a TreeView at the top listing the form and all its
|
||||
controls in layout order. Click a control name to select it in both the
|
||||
Properties panel and the Form Designer. Drag items in the tree to
|
||||
reorder controls in the form's layout.</li>
|
||||
<li>Control tree -- a TreeView at the top listing the form and all its controls in layout order. Click a control name to select it in both the Properties panel and the Form Designer. Drag items in the tree to reorder controls in the form's layout.</li>
|
||||
</ul>
|
||||
<p>Property list -- a two-column ListView below the tree showing property names
|
||||
and values for the selected control. Double-click a property value to edit
|
||||
it via an InputBox dialog. Changes take effect immediately in the designer
|
||||
preview.</p>
|
||||
<p>Each control type exposes different properties (e.g., Caption, Text, Width,
|
||||
Height, MaxWidth, MaxHeight, Weight, Alignment, Enabled, Visible, and
|
||||
type-specific properties like DataSource and DataField for data-bound
|
||||
controls).</p>
|
||||
<p>Property list -- a two-column ListView below the tree showing property names and values for the selected control. Double-click a property value to edit it via an InputBox dialog. Changes take effect immediately in the designer preview.</p>
|
||||
<p>Each control type exposes different properties (e.g., Caption, Text, Width, Height, MaxWidth, MaxHeight, Weight, Alignment, Enabled, Visible, and type-specific properties like DataSource and DataField for data-bound controls).</p>
|
||||
<p><a href="#ide.designer">Form Designer</a></p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.toolbox">
|
||||
<h1>Toolbox</h1>
|
||||
<h2>Toolbox</h2>
|
||||
<p>The Toolbox (Window > Toolbox) is a floating palette of buttons, one for
|
||||
each available control type. Controls are loaded dynamically from the widget
|
||||
plugin registry -- any widget DXE that provides a basName appears in the
|
||||
toolbox.</p>
|
||||
<p>Click a tool to select it (the active tool name is stored in the designer
|
||||
state), then click on the form to place a new instance. Click the same tool
|
||||
again to deselect it and return to pointer mode.</p>
|
||||
<p>The Toolbox (Window > Toolbox) is a floating palette of buttons, one for each available control type. Controls are loaded dynamically from the widget plugin registry -- any widget DXE that provides a basName appears in the toolbox.</p>
|
||||
<p>Click a tool to select it (the active tool name is stored in the designer state), then click on the form to place a new instance. Click the same tool again to deselect it and return to pointer mode.</p>
|
||||
<h3>Available Controls</h3>
|
||||
<pre> VB Name Description
|
||||
------- -----------
|
||||
|
|
@ -563,8 +501,7 @@ again to deselect it and return to pointer mode.</p>
|
|||
<div class="topic" id="ide.debugger">
|
||||
<h1>Debugger</h1>
|
||||
<h2>Debugger</h2>
|
||||
<p>The DVX BASIC IDE includes a full interactive debugger. The debugger
|
||||
operates as a state machine with three states:</p>
|
||||
<p>The DVX BASIC IDE includes a full interactive debugger. The debugger operates as a state machine with three states:</p>
|
||||
<pre> State Description
|
||||
----- -----------
|
||||
DBG_IDLE No program loaded or running.
|
||||
|
|
@ -572,14 +509,10 @@ operates as a state machine with three states:</p>
|
|||
DBG_PAUSED Execution is paused at a breakpoint or step point. The IDE GUI is fully interactive.</pre>
|
||||
<h3>Starting a Debug Session</h3>
|
||||
<ul>
|
||||
<li>Shift+F5 (Debug) -- compiles the project and starts execution in debug
|
||||
mode. Breakpoints are active but execution does not pause at the first
|
||||
statement.</li>
|
||||
<li>F8 (Step Into) -- if idle, starts a debug session and breaks at the first
|
||||
statement.</li>
|
||||
<li>Shift+F5 (Debug) -- compiles the project and starts execution in debug mode. Breakpoints are active but execution does not pause at the first statement.</li>
|
||||
<li>F8 (Step Into) -- if idle, starts a debug session and breaks at the first statement.</li>
|
||||
</ul>
|
||||
<p>F5 (Run) -- compiles and runs without the debugger. No breakpoints are
|
||||
active. If already paused, resumes execution with debugging disabled.</p>
|
||||
<p>F5 (Run) -- compiles and runs without the debugger. No breakpoints are active. If already paused, resumes execution with debugging disabled.</p>
|
||||
<h3>Breakpoints</h3>
|
||||
<h4>Setting Breakpoints</h4>
|
||||
<ul>
|
||||
|
|
@ -587,8 +520,7 @@ active. If already paused, resumes execution with debugging disabled.</p>
|
|||
</ul>
|
||||
<p>Click in the line number gutter to toggle a breakpoint on that line.</p>
|
||||
<h4>Breakpoint Validation</h4>
|
||||
<p>Not every line can have a breakpoint. The IDE validates the line content and
|
||||
silently refuses to set breakpoints on:</p>
|
||||
<p>Not every line can have a breakpoint. The IDE validates the line content and silently refuses to set breakpoints on:</p>
|
||||
<ul>
|
||||
<li>Blank lines</li>
|
||||
<li>Comment lines (' or REM)</li>
|
||||
|
|
@ -596,18 +528,14 @@ silently refuses to set breakpoints on:</p>
|
|||
</ul>
|
||||
<p>END SUB and END FUNCTION lines</p>
|
||||
<h4>Breakpoint Storage</h4>
|
||||
<p>Each breakpoint records the project file index, the code line number within
|
||||
the file, the procedure index, and the procedure name (as Object.Event).
|
||||
When the project is compiled, breakpoints are converted to concatenated
|
||||
source line numbers that match the VM's OP_LINE opcodes.</p>
|
||||
<p>Each breakpoint records the project file index, the code line number within the file, the procedure index, and the procedure name (as Object.Event). When the project is compiled, breakpoints are converted to concatenated source line numbers that match the VM's OP_LINE opcodes.</p>
|
||||
<h4>Visual Indicators</h4>
|
||||
<ul>
|
||||
<li>Breakpoint lines show a red dot in the gutter.</li>
|
||||
</ul>
|
||||
<p>The current debug line (when paused) has a yellow background.</p>
|
||||
<h4>Breakpoint Adjustment on Edit</h4>
|
||||
<p>When lines are added or removed in the editor, breakpoints below the edit
|
||||
point are automatically shifted to stay on the correct line.</p>
|
||||
<p>When lines are added or removed in the editor, breakpoints below the edit point are automatically shifted to stay on the correct line.</p>
|
||||
<h3>Stepping</h3>
|
||||
<pre> Action Shortcut Behavior
|
||||
------ -------- --------
|
||||
|
|
@ -619,20 +547,12 @@ point are automatically shifted to stay on the correct line.</p>
|
|||
<p>When a program is running in debug mode, the IDE enters a cooperative loop:</p>
|
||||
<ul>
|
||||
<li>The VM executes up to 10,000 steps per slice.</li>
|
||||
<li>If the VM hits a breakpoint (BAS_VM_BREAKPOINT), the state transitions to
|
||||
DBG_PAUSED. The IDE navigates the code editor to the breakpoint line,
|
||||
highlights it in yellow, auto-opens the Locals and Call Stack windows,
|
||||
and updates all debug windows.</li>
|
||||
<li>While paused, the IDE pumps dvxUpdate() continuously, keeping the GUI
|
||||
responsive. The user can inspect variables, modify them in the Immediate
|
||||
window, step, continue, or stop.</li>
|
||||
<li>If the VM hits a breakpoint (BAS_VM_BREAKPOINT), the state transitions to DBG_PAUSED. The IDE navigates the code editor to the breakpoint line, highlights it in yellow, auto-opens the Locals and Call Stack windows, and updates all debug windows.</li>
|
||||
<li>While paused, the IDE pumps dvxUpdate() continuously, keeping the GUI responsive. The user can inspect variables, modify them in the Immediate window, step, continue, or stop.</li>
|
||||
</ul>
|
||||
<p>When the user resumes (F5/Shift+F5/F8/etc.), the state transitions back to
|
||||
DBG_RUNNING and the loop continues.</p>
|
||||
<p>When the user resumes (F5/Shift+F5/F8/etc.), the state transitions back to DBG_RUNNING and the loop continues.</p>
|
||||
<h3>Stopping</h3>
|
||||
<p>Press Esc or click the Stop toolbar button at any time to halt execution.
|
||||
The VM is destroyed, debug state resets to DBG_IDLE, and the IDE restores
|
||||
the designer windows that were hidden at run start.</p>
|
||||
<p>Press Esc or click the Stop toolbar button at any time to halt execution. The VM is destroyed, debug state resets to DBG_IDLE, and the IDE restores the designer windows that were hidden at run start.</p>
|
||||
<p><a href="#ide.debug.locals">Locals Window</a></p>
|
||||
<p><a href="#ide.debug.callstack">Call Stack Window</a></p>
|
||||
<p><a href="#ide.debug.watch">Watch Window</a></p>
|
||||
|
|
@ -642,11 +562,8 @@ the designer windows that were hidden at run start.</p>
|
|||
<div class="topic" id="ide.debug.locals">
|
||||
<h1>Locals Window</h1>
|
||||
<h2>Locals Window</h2>
|
||||
<p>When the debugger pauses, the Locals and Call Stack windows are auto-opened
|
||||
(if not already visible). The Watch and Breakpoints windows can be opened
|
||||
manually from the Window menu.</p>
|
||||
<p>Shows variables for the current execution scope. Displayed as a three-column
|
||||
ListView:</p>
|
||||
<p>When the debugger pauses, the Locals and Call Stack windows are auto-opened (if not already visible). The Watch and Breakpoints windows can be opened manually from the Window menu.</p>
|
||||
<p>Shows variables for the current execution scope. Displayed as a three-column ListView:</p>
|
||||
<pre> Column Content
|
||||
------ -------
|
||||
Name Variable name (internal mangled names like static variable placeholders are filtered out).
|
||||
|
|
@ -657,8 +574,7 @@ ListView:</p>
|
|||
<li>Local variables for the current procedure (matched by proc index).</li>
|
||||
<li>Global (module-level) variables.</li>
|
||||
</ul>
|
||||
<p>Form-scoped variables for the current form (if the program is executing
|
||||
within a form context).</p>
|
||||
<p>Form-scoped variables for the current form (if the program is executing within a form context).</p>
|
||||
<p>Up to 64 variables are displayed. The window is resizable.</p>
|
||||
<p><a href="#ide.debug.callstack">Call Stack Window</a></p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
|
|
@ -671,24 +587,20 @@ within a form context).</p>
|
|||
------ -------
|
||||
Procedure Procedure name (or (module) for module-level code).
|
||||
Line Line number where execution is paused (shown for the topmost frame).</pre>
|
||||
<p>The current location is shown first, followed by each caller in the call
|
||||
stack (walking from the deepest frame back to the module entry point). Up to
|
||||
32 frames are displayed.</p>
|
||||
<p>The current location is shown first, followed by each caller in the call stack (walking from the deepest frame back to the module entry point). Up to 32 frames are displayed.</p>
|
||||
<p><a href="#ide.debug.watch">Watch Window</a></p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.debug.watch">
|
||||
<h1>Watch Window</h1>
|
||||
<h2>Watch Window</h2>
|
||||
<p>Allows monitoring arbitrary expressions while debugging. The window has a
|
||||
text input at the top and a two-column ListView below:</p>
|
||||
<p>Allows monitoring arbitrary expressions while debugging. The window has a text input at the top and a two-column ListView below:</p>
|
||||
<pre> Column Content
|
||||
------ -------
|
||||
Expression The watch expression text.
|
||||
Value Evaluated result (or <error> if evaluation fails). Blank when not paused.</pre>
|
||||
<h3>Adding Watch Expressions</h3>
|
||||
<p>Type an expression in the text input and press Enter. Up to 16 watch
|
||||
expressions can be active at once.</p>
|
||||
<p>Type an expression in the text input and press Enter. Up to 16 watch expressions can be active at once.</p>
|
||||
<h3>Watch Expression Syntax</h3>
|
||||
<p>Watch expressions support:</p>
|
||||
<ul>
|
||||
|
|
@ -697,12 +609,10 @@ expressions can be active at once.</p>
|
|||
<li>UDT field access: player.name</li>
|
||||
<li>Combined: items(i).price</li>
|
||||
</ul>
|
||||
<p>Arbitrary BASIC expressions (compiled and evaluated against the paused VM's
|
||||
state): x + y * 2, Len(name$)</p>
|
||||
<p>Arbitrary BASIC expressions (compiled and evaluated against the paused VM's state): x + y * 2, Len(name$)</p>
|
||||
<h3>Editing and Deleting</h3>
|
||||
<ul>
|
||||
<li>Double-click or press Enter on a watch entry to move it back into the
|
||||
input box for editing.</li>
|
||||
<li>Double-click or press Enter on a watch entry to move it back into the input box for editing.</li>
|
||||
</ul>
|
||||
<p>Press Delete to remove the selected watch expression.</p>
|
||||
<p><a href="#ide.debug.breakpoints">Breakpoints Window</a></p>
|
||||
|
|
@ -727,13 +637,9 @@ state): x + y * 2, Len(name$)</p>
|
|||
<div class="topic" id="ide.immediate">
|
||||
<h1>Immediate Window</h1>
|
||||
<h2>Immediate Window</h2>
|
||||
<p>The Immediate window is an interactive REPL at the bottom-right of the
|
||||
screen. Type a line of BASIC and press Enter to evaluate it. Results appear
|
||||
inline below your input.</p>
|
||||
<p>The Immediate window is an interactive REPL at the bottom-right of the screen. Type a line of BASIC and press Enter to evaluate it. Results appear inline below your input.</p>
|
||||
<h3>Expression Evaluation</h3>
|
||||
<p>If the input is not a recognized statement keyword, it is automatically
|
||||
wrapped in a PRINT statement. For example, typing 2 + 2 evaluates as PRINT 2
|
||||
+ 2 and displays 4.</p>
|
||||
<p>If the input is not a recognized statement keyword, it is automatically wrapped in a PRINT statement. For example, typing 2 + 2 evaluates as PRINT 2 + 2 and displays 4.</p>
|
||||
<p>You can also type full statements:</p>
|
||||
<ul>
|
||||
<li>PRINT x * 2 -- evaluate and print an expression.</li>
|
||||
|
|
@ -742,13 +648,9 @@ wrapped in a PRINT statement. For example, typing 2 + 2 evaluates as PRINT 2
|
|||
<p>LET x = 42 -- explicit assignment (see below).</p>
|
||||
<p>Parse or runtime errors are displayed inline with an Error: prefix.</p>
|
||||
<h3>Inspecting Variables While Paused</h3>
|
||||
<p>When the debugger is paused at a breakpoint, the Immediate window has access
|
||||
to the running VM's state. Global variable values are copied into the
|
||||
evaluation VM, so expressions like count or name$ & " test" display live
|
||||
values.</p>
|
||||
<p>When the debugger is paused at a breakpoint, the Immediate window has access to the running VM's state. Global variable values are copied into the evaluation VM, so expressions like count or name$ & " test" display live values.</p>
|
||||
<h3>Assigning Variables While Paused</h3>
|
||||
<p>When paused, you can modify variables in the running program directly from
|
||||
the Immediate window using assignment syntax:</p>
|
||||
<p>When paused, you can modify variables in the running program directly from the Immediate window using assignment syntax:</p>
|
||||
<pre><code>variableName = newValue</code></pre>
|
||||
<p>The optional LET keyword is also accepted:</p>
|
||||
<pre><code>LET variableName = newValue</code></pre>
|
||||
|
|
@ -759,38 +661,27 @@ the Immediate window using assignment syntax:</p>
|
|||
<li>UDT fields -- player.score = 1000</li>
|
||||
</ul>
|
||||
<p>Combined -- items(0).price = 9.99</p>
|
||||
<p>The new value is written directly into the VM's live variable slot (local,
|
||||
global, or form scope). A confirmation message is displayed, and the Locals
|
||||
and Watch windows update automatically to reflect the change.</p>
|
||||
<p>If the assignment target cannot be resolved (unknown variable, out-of-bounds
|
||||
index, wrong type), an error message is displayed.</p>
|
||||
<p>The new value is written directly into the VM's live variable slot (local, global, or form scope). A confirmation message is displayed, and the Locals and Watch windows update automatically to reflect the change.</p>
|
||||
<p>If the assignment target cannot be resolved (unknown variable, out-of-bounds index, wrong type), an error message is displayed.</p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.output">
|
||||
<h1>Output Window</h1>
|
||||
<h2>Output Window</h2>
|
||||
<p>The Output window is a read-only TextArea at the bottom-left of the screen.
|
||||
It displays:</p>
|
||||
<p>The Output window is a read-only TextArea at the bottom-left of the screen. It displays:</p>
|
||||
<ul>
|
||||
<li>PRINT output -- all PRINT statement output from the running program is
|
||||
appended here.</li>
|
||||
<li>Runtime errors -- if the VM encounters a runtime error (division by zero,
|
||||
out-of-bounds, etc.), the error message and line number are displayed in
|
||||
the output with an Error on line N: prefix.</li>
|
||||
<li>PRINT output -- all PRINT statement output from the running program is appended here.</li>
|
||||
<li>Runtime errors -- if the VM encounters a runtime error (division by zero, out-of-bounds, etc.), the error message and line number are displayed in the output with an Error on line N: prefix.</li>
|
||||
</ul>
|
||||
<p>Compile errors -- if compilation fails, the error message and location are
|
||||
shown.</p>
|
||||
<p>The output buffer holds up to 32,768 characters. Use Run > Clear Output to
|
||||
clear it.</p>
|
||||
<p>INPUT statements prompt the user via a modal InputBox dialog; the prompt
|
||||
text is also echoed to the Output window.</p>
|
||||
<p>Compile errors -- if compilation fails, the error message and location are shown.</p>
|
||||
<p>The output buffer holds up to 32,768 characters. Use Run > Clear Output to clear it.</p>
|
||||
<p>INPUT statements prompt the user via a modal InputBox dialog; the prompt text is also echoed to the Output window.</p>
|
||||
<p><a href="#ide.overview">Back to Overview</a></p>
|
||||
</div>
|
||||
<div class="topic" id="ide.findreplace">
|
||||
<h1>Find / Replace</h1>
|
||||
<h2>Find / Replace</h2>
|
||||
<p>Open with Ctrl+F (Find) or Ctrl+H (Replace). The Find/Replace dialog is
|
||||
modeless -- it stays open while you continue editing.</p>
|
||||
<p>Open with Ctrl+F (Find) or Ctrl+H (Replace). The Find/Replace dialog is modeless -- it stays open while you continue editing.</p>
|
||||
<h3>Dialog Controls</h3>
|
||||
<pre> Control Description
|
||||
------- -----------
|
||||
|
|
@ -813,8 +704,7 @@ modeless -- it stays open while you continue editing.</p>
|
|||
<div class="topic" id="ide.preferences">
|
||||
<h1>Preferences</h1>
|
||||
<h2>Preferences</h2>
|
||||
<p>Open via Tools > Preferences. Settings are saved to dvxbasic.ini in the
|
||||
app's config directory.</p>
|
||||
<p>Open via Tools > Preferences. Settings are saved to dvxbasic.ini in the app's config directory.</p>
|
||||
<h3>Editor Section</h3>
|
||||
<pre> Setting Description Default
|
||||
------- ----------- -------
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ img { max-width: 100%; }
|
|||
<nav>
|
||||
<h3>Contents</h3>
|
||||
<ul>
|
||||
<li><a href="#lang.datatypes">Data Types</a></li>
|
||||
<li><a href="#lang.datatypes">Data Types</a>
|
||||
<ul>
|
||||
<li><a href="#lang.operators">Operators</a></li>
|
||||
<li><a href="#lang.statements">Statements</a>
|
||||
<ul>
|
||||
|
|
@ -58,6 +59,8 @@ img { max-width: 100%; }
|
|||
<li><a href="#lang.ini">INI Functions</a></li>
|
||||
<li><a href="#lang.constants">Predefined Constants</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Index</h3>
|
||||
<ul>
|
||||
<li><a href="#lang.datatypes">Data Types</a></li>
|
||||
|
|
@ -271,8 +274,7 @@ img { max-width: 100%; }
|
|||
<div class="topic" id="lang.datatypes">
|
||||
<h1>Data Types</h1>
|
||||
<h2>Data Types</h2>
|
||||
<p>DVX BASIC supports the following data types. Each type has a corresponding
|
||||
type suffix character that can be appended to variable names.</p>
|
||||
<p>DVX BASIC supports the following data types. Each type has a corresponding type suffix character that can be appended to variable names.</p>
|
||||
<h3>Primary Types</h3>
|
||||
<pre> Type Size Suffix Range / Description
|
||||
---- ---- ------ -------------------
|
||||
|
|
@ -283,8 +285,7 @@ type suffix character that can be appended to variable names.</p>
|
|||
String variable $ Variable-length, reference-counted, dynamic string
|
||||
Boolean 2 bytes (none) True (-1) or False (0)</pre>
|
||||
<h3>Internal Types</h3>
|
||||
<p>These types are not directly declarable but are used internally by the
|
||||
runtime.</p>
|
||||
<p>These types are not directly declarable but are used internally by the runtime.</p>
|
||||
<pre> Internal Type Description
|
||||
------------- -----------
|
||||
Array Reference-counted multi-dimensional array (up to 8 dimensions)
|
||||
|
|
@ -292,8 +293,7 @@ runtime.</p>
|
|||
Object Opaque host object (form reference, control reference)
|
||||
Ref ByRef pointer to a variable slot (used for ByRef parameters)</pre>
|
||||
<h3>Type Suffixes</h3>
|
||||
<p>Type suffixes can be appended to variable names to declare their type
|
||||
implicitly:</p>
|
||||
<p>Type suffixes can be appended to variable names to declare their type implicitly:</p>
|
||||
<pre><code>count% = 42 ' Integer
|
||||
total& = 100000 ' Long
|
||||
rate! = 3.14 ' Single
|
||||
|
|
@ -309,16 +309,13 @@ name$ = "Hello" ' String</code></pre>
|
|||
Single suffix 3.14! Force Single type
|
||||
Double suffix 3.14# Force Double type</pre>
|
||||
<h3>Type Promotion</h3>
|
||||
<p>When mixing types in expressions, values are automatically promoted to a
|
||||
common type: Integer -> Long -> Single -> Double. Strings are not
|
||||
automatically converted to numbers (use VAL and STR$).</p>
|
||||
<p>When mixing types in expressions, values are automatically promoted to a common type: Integer -> Long -> Single -> Double. Strings are not automatically converted to numbers (use VAL and STR$).</p>
|
||||
<p><a href="#lang.func.conversion">See also: Conversion Functions</a></p>
|
||||
</div>
|
||||
<div class="topic" id="lang.operators">
|
||||
<h1>Operators</h1>
|
||||
<h2>Operators</h2>
|
||||
<p>Operators listed from highest precedence (evaluated first) to lowest
|
||||
precedence (evaluated last).</p>
|
||||
<p>Operators listed from highest precedence (evaluated first) to lowest precedence (evaluated last).</p>
|
||||
<pre> Precedence Operator Description
|
||||
---------- -------- -----------
|
||||
1 (highest) ^ Exponentiation
|
||||
|
|
@ -334,16 +331,14 @@ precedence (evaluated last).</p>
|
|||
11 EQV Logical/bitwise equivalence
|
||||
12 (lowest) IMP Logical/bitwise implication</pre>
|
||||
<h3>String Concatenation</h3>
|
||||
<p>Use & to concatenate strings. The + operator also concatenates when both
|
||||
operands are strings.</p>
|
||||
<p>Use & to concatenate strings. The + operator also concatenates when both operands are strings.</p>
|
||||
<pre><code>result$ = "Hello" & " " & "World"
|
||||
result$ = firstName$ & " " & lastName$</code></pre>
|
||||
</div>
|
||||
<div class="topic" id="lang.statements">
|
||||
<h1>Statements Overview</h1>
|
||||
<h2>Statements</h2>
|
||||
<p>Multiple statements can appear on one line separated by :. Lines can be
|
||||
continued with _ at the end. Comments start with ' or REM.</p>
|
||||
<p>Multiple statements can appear on one line separated by :. Lines can be continued with _ at the end. Comments start with ' or REM.</p>
|
||||
<p><a href="#lang.declarations">Declaration Statements (DIM, REDIM, CONST, TYPE)</a></p>
|
||||
<p><a href="#lang.conditionals">Conditional Statements (IF, SELECT CASE)</a></p>
|
||||
<p><a href="#lang.loops">Loop Statements (FOR, DO, WHILE)</a></p>
|
||||
|
|
@ -372,8 +367,7 @@ Dim matrix(1 To 10, 1 To 10) As Single
|
|||
Dim Shared globalFlag As Boolean
|
||||
Dim record As PersonType
|
||||
Dim fixedStr As String * 20</code></pre>
|
||||
<blockquote><strong>Note:</strong> DIM SHARED makes a variable accessible from all procedures without passing
|
||||
it as a parameter.</blockquote>
|
||||
<blockquote><strong>Note:</strong> DIM SHARED makes a variable accessible from all procedures without passing it as a parameter.</blockquote>
|
||||
<h3>REDIM</h3>
|
||||
<p>Reallocates a dynamic array, optionally preserving existing data.</p>
|
||||
<pre><code>REDIM array(newBounds) AS type
|
||||
|
|
@ -381,8 +375,7 @@ REDIM PRESERVE array(newBounds) AS type</code></pre>
|
|||
<pre><code>ReDim items(newSize) As String
|
||||
ReDim Preserve scores(1 To newCount) As Integer</code></pre>
|
||||
<h3>CONST</h3>
|
||||
<p>Declares a named constant. The value must be a literal (integer, float,
|
||||
string, or boolean).</p>
|
||||
<p>Declares a named constant. The value must be a literal (integer, float, string, or boolean).</p>
|
||||
<pre><code>CONST name = value</code></pre>
|
||||
<pre><code>Const MAX_SIZE = 100
|
||||
Const PI = 3.14159265
|
||||
|
|
@ -405,13 +398,11 @@ p.firstName = "Scott"
|
|||
p.age = 30</code></pre>
|
||||
<p>UDT fields can themselves be UDTs (nested types).</p>
|
||||
<h3>DECLARE</h3>
|
||||
<p>Forward-declares a SUB or FUNCTION. Required when a procedure is called
|
||||
before it is defined.</p>
|
||||
<p>Forward-declares a SUB or FUNCTION. Required when a procedure is called before it is defined.</p>
|
||||
<pre><code>DECLARE SUB name ([BYVAL] param AS type, ...)
|
||||
DECLARE FUNCTION name ([BYVAL] param AS type, ...) AS returnType</code></pre>
|
||||
<h3>DECLARE LIBRARY</h3>
|
||||
<p>Declares external native functions from a dynamically loaded library. This
|
||||
allows BASIC programs to call functions exported by DXE libraries.</p>
|
||||
<p>Declares external native functions from a dynamically loaded library. This allows BASIC programs to call functions exported by DXE libraries.</p>
|
||||
<pre><code>DECLARE LIBRARY "libraryName"
|
||||
DECLARE SUB name ([BYVAL] param AS type, ...)
|
||||
DECLARE FUNCTION name ([BYVAL] param AS type, ...) AS returnType
|
||||
|
|
@ -511,8 +502,7 @@ END SELECT</code></pre>
|
|||
Case Else
|
||||
Print "F"
|
||||
End Select</code></pre>
|
||||
<p>CASE items can be combined with commas. The IS keyword allows comparison
|
||||
operators: <, >, <=, >=, =, <>.</p>
|
||||
<p>CASE items can be combined with commas. The IS keyword allows comparison operators: <, >, <=, >=, =, <>.</p>
|
||||
</div>
|
||||
<div class="topic" id="lang.loops">
|
||||
<h1>Loop Statements</h1>
|
||||
|
|
@ -571,8 +561,7 @@ END SUB</code></pre>
|
|||
<pre><code>Sub Greet(ByVal name As String)
|
||||
Print "Hello, " & name
|
||||
End Sub</code></pre>
|
||||
<p>Parameters are passed ByRef by default. Use ByVal for value semantics. Use
|
||||
EXIT SUB to return early.</p>
|
||||
<p>Parameters are passed ByRef by default. Use ByVal for value semantics. Use EXIT SUB to return early.</p>
|
||||
<h3>FUNCTION...END FUNCTION</h3>
|
||||
<p>Defines a function with a return value.</p>
|
||||
<pre><code>FUNCTION name ([BYVAL] param AS type, ...) AS returnType
|
||||
|
|
@ -582,8 +571,7 @@ END FUNCTION</code></pre>
|
|||
<pre><code>Function Square(ByVal n As Double) As Double
|
||||
Square = n * n
|
||||
End Function</code></pre>
|
||||
<p>Assign to the function name to set the return value. Use EXIT FUNCTION to
|
||||
return early.</p>
|
||||
<p>Assign to the function name to set the return value. Use EXIT FUNCTION to return early.</p>
|
||||
<h3>DEF FN</h3>
|
||||
<p>Defines a single-expression function.</p>
|
||||
<pre><code>DEF FNname(params) = expression</code></pre>
|
||||
|
|
@ -600,8 +588,7 @@ EXIT DO
|
|||
EXIT SUB
|
||||
EXIT FUNCTION</code></pre>
|
||||
<h3>CALL</h3>
|
||||
<p>Explicitly calls a subroutine or function. The return value (if any) is
|
||||
discarded.</p>
|
||||
<p>Explicitly calls a subroutine or function. The return value (if any) is discarded.</p>
|
||||
<pre><code>CALL name
|
||||
CALL name(args)</code></pre>
|
||||
<p>Normally you can omit CALL and just use the name directly.</p>
|
||||
|
|
@ -609,9 +596,7 @@ CALL name(args)</code></pre>
|
|||
<pre><code>GOTO label
|
||||
GOSUB label
|
||||
RETURN</code></pre>
|
||||
<p>GOSUB pushes the return address, executes code at the label, and RETURN
|
||||
jumps back. At module level, RETURN returns from a GOSUB. Inside a
|
||||
SUB/FUNCTION, RETURN returns from the procedure.</p>
|
||||
<p>GOSUB pushes the return address, executes code at the label, and RETURN jumps back. At module level, RETURN returns from a GOSUB. Inside a SUB/FUNCTION, RETURN returns from the procedure.</p>
|
||||
<pre><code>GoSub Initialize
|
||||
Print "Done"
|
||||
End
|
||||
|
|
@ -624,8 +609,7 @@ Return</code></pre>
|
|||
<p>Computed branch based on an integer expression.</p>
|
||||
<pre><code>ON expression GOTO label1, label2, ...
|
||||
ON expression GOSUB label1, label2, ...</code></pre>
|
||||
<p>If the expression evaluates to 1, control goes to the first label; 2, the
|
||||
second; and so on. If out of range, execution falls through.</p>
|
||||
<p>If the expression evaluates to 1, control goes to the first label; 2, the second; and so on. If out of range, execution falls through.</p>
|
||||
</div>
|
||||
<div class="topic" id="lang.io">
|
||||
<h1>Input/Output Statements</h1>
|
||||
|
|
@ -661,8 +645,7 @@ Input #1, line$</code></pre>
|
|||
<pre><code>DATA value1, value2, "string", ...
|
||||
READ variable1, variable2, ...
|
||||
RESTORE</code></pre>
|
||||
<p>DATA statements define a pool of values. READ reads the next value from the
|
||||
pool into a variable. RESTORE resets the read pointer to the beginning.</p>
|
||||
<p>DATA statements define a pool of values. READ reads the next value from the pool into a variable. RESTORE resets the read pointer to the beginning.</p>
|
||||
<pre><code>Data 10, 20, 30, "Hello"
|
||||
Read a, b, c, msg$
|
||||
Print a; b; c; msg$
|
||||
|
|
@ -732,8 +715,7 @@ OPEN filename$ FOR BINARY AS #channel</code></pre>
|
|||
<p>Reads an entire line from a file into a string variable.</p>
|
||||
<pre><code>LINE INPUT #channel, variable$</code></pre>
|
||||
<h3>WRITE #</h3>
|
||||
<p>Writes comma-delimited data to a file. Strings are enclosed in quotes,
|
||||
numbers are undecorated. Each statement writes a newline at the end.</p>
|
||||
<p>Writes comma-delimited data to a file. Strings are enclosed in quotes, numbers are undecorated. Each statement writes a newline at the end.</p>
|
||||
<pre><code>WRITE #channel, expr1, expr2, ...</code></pre>
|
||||
<pre><code>Write #1, "Scott", 42, 3.14
|
||||
' Output: "Scott",42,3.14</code></pre>
|
||||
|
|
@ -771,8 +753,7 @@ pos = SEEK(channel) ' Function: get current position</code></pre>
|
|||
UCASE$(s$) String Converts s$ to uppercase
|
||||
VAL(s$) Double Converts string s$ to a numeric value</pre>
|
||||
<h3>MID$ Assignment</h3>
|
||||
<p>MID$ can also be used on the left side of an assignment to replace a portion
|
||||
of a string:</p>
|
||||
<p>MID$ can also be used on the left side of an assignment to replace a portion of a string:</p>
|
||||
<pre><code>Mid$(s$, 3, 2) = "XY" ' Replace 2 characters starting at position 3</code></pre>
|
||||
</div>
|
||||
<div class="topic" id="lang.func.math">
|
||||
|
|
@ -793,8 +774,7 @@ of a string:</p>
|
|||
SQR(n) Double Square root of n
|
||||
TAN(n) Double Tangent of n (radians)
|
||||
TIMER Double Number of seconds since midnight</pre>
|
||||
<blockquote><strong>Note:</strong> RND with a negative argument seeds and returns. RND(0) returns the previous
|
||||
value. Use RANDOMIZE to seed the generator.</blockquote>
|
||||
<blockquote><strong>Note:</strong> RND with a negative argument seeds and returns. RND(0) returns the previous value. Use RANDOMIZE to seed the generator.</blockquote>
|
||||
</div>
|
||||
<div class="topic" id="lang.func.conversion">
|
||||
<h1>Conversion Functions</h1>
|
||||
|
|
@ -834,14 +814,11 @@ value. Use RANDOMIZE to seed the generator.</blockquote>
|
|||
<div class="topic" id="lang.forms">
|
||||
<h1>Form and Control Statements</h1>
|
||||
<h2>Form and Control Statements</h2>
|
||||
<p>DVX BASIC supports Visual Basic-style forms and controls for building
|
||||
graphical user interfaces. Forms are defined in .frm files and loaded at
|
||||
runtime.</p>
|
||||
<p>DVX BASIC supports Visual Basic-style forms and controls for building graphical user interfaces. Forms are defined in .frm files and loaded at runtime.</p>
|
||||
<h3>Loading and Unloading Forms</h3>
|
||||
<pre><code>LOAD FormName
|
||||
UNLOAD FormName</code></pre>
|
||||
<p>LOAD creates the form and its controls in memory. UNLOAD destroys the form
|
||||
and frees its resources.</p>
|
||||
<p>LOAD creates the form and its controls in memory. UNLOAD destroys the form and frees its resources.</p>
|
||||
<h3>Showing and Hiding Forms</h3>
|
||||
<pre><code>FormName.Show [modal]
|
||||
FormName.Hide
|
||||
|
|
@ -862,28 +839,24 @@ x = Text1.Left</code></pre>
|
|||
<pre><code>List1.AddItem "New entry"
|
||||
List1.Clear</code></pre>
|
||||
<h3>Me Keyword</h3>
|
||||
<p>Me refers to the current form. Use it to access the form's own properties,
|
||||
controls, and methods from within event handlers.</p>
|
||||
<p>Me refers to the current form. Use it to access the form's own properties, controls, and methods from within event handlers.</p>
|
||||
<pre><code>Me.Caption = "Updated Title"
|
||||
Me.Text1.Text = ""
|
||||
Me.Hide</code></pre>
|
||||
<h3>Control Arrays</h3>
|
||||
<p>Multiple controls can share a name with unique indices. Access individual
|
||||
controls with parenthesized indices:</p>
|
||||
<p>Multiple controls can share a name with unique indices. Access individual controls with parenthesized indices:</p>
|
||||
<pre><code>Option1(0).Value = True
|
||||
Label1(idx).Caption = "Item " & Str$(idx)
|
||||
Me.Label1(i).Visible = True</code></pre>
|
||||
<h3>DoEvents</h3>
|
||||
<p>Yields control to the DVX event loop, allowing the GUI to process pending
|
||||
events. Call this in long-running loops to keep the UI responsive.</p>
|
||||
<p>Yields control to the DVX event loop, allowing the GUI to process pending events. Call this in long-running loops to keep the UI responsive.</p>
|
||||
<pre><code>DOEVENTS</code></pre>
|
||||
<pre><code>For i = 1 To 10000
|
||||
' process data
|
||||
If i Mod 100 = 0 Then DoEvents
|
||||
Next</code></pre>
|
||||
<h3>MsgBox</h3>
|
||||
<p>Displays a message box dialog. Can be used as a statement (discards result)
|
||||
or as a function (returns the button clicked).</p>
|
||||
<p>Displays a message box dialog. Can be used as a statement (discards result) or as a function (returns the button clicked).</p>
|
||||
<pre><code>MSGBOX message$ [, flags]
|
||||
result = MSGBOX(message$ [, flags])</code></pre>
|
||||
<pre><code>MsgBox "Operation complete"
|
||||
|
|
@ -930,9 +903,7 @@ End Sub</code></pre>
|
|||
<div class="topic" id="lang.sql">
|
||||
<h1>SQL Functions</h1>
|
||||
<h2>SQL Functions</h2>
|
||||
<p>DVX BASIC includes built-in SQLite database support through a set of SQL
|
||||
functions. All functions use database handles and result set handles
|
||||
(integers) returned by SQLOpen and SQLQuery.</p>
|
||||
<p>DVX BASIC includes built-in SQLite database support through a set of SQL functions. All functions use database handles and result set handles (integers) returned by SQLOpen and SQLQuery.</p>
|
||||
<h3>Opening and Closing Databases</h3>
|
||||
<h4>SQLOpen</h4>
|
||||
<p>Opens a SQLite database file and returns a database handle.</p>
|
||||
|
|
@ -943,9 +914,7 @@ functions. All functions use database handles and result set handles
|
|||
<pre><code>SQLCLOSE db</code></pre>
|
||||
<h3>Executing SQL</h3>
|
||||
<h4>SQLExec</h4>
|
||||
<p>Executes a SQL statement that does not return data (INSERT, UPDATE, DELETE,
|
||||
CREATE TABLE, etc.). Can be used as a statement or as a function returning a
|
||||
Boolean success flag.</p>
|
||||
<p>Executes a SQL statement that does not return data (INSERT, UPDATE, DELETE, CREATE TABLE, etc.). Can be used as a statement or as a function returning a Boolean success flag.</p>
|
||||
<pre><code>SQLEXEC db, sql$
|
||||
ok = SQLEXEC(db, sql$)</code></pre>
|
||||
<pre><code>SQLExec db, "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)"
|
||||
|
|
@ -960,8 +929,7 @@ ok = SQLExec(db, "DELETE FROM users WHERE id = 5")</code></pre>
|
|||
<pre><code>rs = SQLQUERY(db, sql$)</code></pre>
|
||||
<pre><code>rs = SQLQuery(db, "SELECT id, name FROM users ORDER BY name")</code></pre>
|
||||
<h4>SQLNext</h4>
|
||||
<p>Advances to the next row in the result set. Can be used as a statement or as
|
||||
a function returning True if a row is available.</p>
|
||||
<p>Advances to the next row in the result set. Can be used as a statement or as a function returning True if a row is available.</p>
|
||||
<pre><code>SQLNEXT rs
|
||||
hasRow = SQLNEXT(rs)</code></pre>
|
||||
<h4>SQLEof</h4>
|
||||
|
|
@ -969,8 +937,7 @@ hasRow = SQLNEXT(rs)</code></pre>
|
|||
<pre><code>done = SQLEOF(rs)</code></pre>
|
||||
<h3>Reading Fields</h3>
|
||||
<h4>SQLField$</h4>
|
||||
<p>Returns a field value as a string. The field can be specified by column
|
||||
index (0-based) or by column name.</p>
|
||||
<p>Returns a field value as a string. The field can be specified by column index (0-based) or by column name.</p>
|
||||
<pre><code>value$ = SQLFIELD$(rs, columnIndex)
|
||||
value$ = SQLFIELD$(rs, "columnName")</code></pre>
|
||||
<pre><code>name$ = SQLField$(rs, "name")
|
||||
|
|
@ -1011,8 +978,7 @@ SQLClose db</code></pre>
|
|||
<div class="topic" id="lang.app">
|
||||
<h1>App Object</h1>
|
||||
<h2>App Object</h2>
|
||||
<p>The App object provides read-only properties for the application's directory
|
||||
paths.</p>
|
||||
<p>The App object provides read-only properties for the application's directory paths.</p>
|
||||
<pre> Property Returns Description
|
||||
-------- ------- -----------
|
||||
App.Path String Directory containing the application's executable
|
||||
|
|
@ -1025,17 +991,14 @@ Print "Running from: " & App.Path</code></pre>
|
|||
<div class="topic" id="lang.ini">
|
||||
<h1>INI Functions</h1>
|
||||
<h2>INI Functions</h2>
|
||||
<p>DVX BASIC provides built-in functions for reading and writing standard INI
|
||||
configuration files.</p>
|
||||
<p>DVX BASIC provides built-in functions for reading and writing standard INI configuration files.</p>
|
||||
<h3>IniRead</h3>
|
||||
<p>Reads a value from an INI file. Returns the default value if the key is not
|
||||
found.</p>
|
||||
<p>Reads a value from an INI file. Returns the default value if the key is not found.</p>
|
||||
<pre><code>value$ = INIREAD(file$, section$, key$, default$)</code></pre>
|
||||
<pre><code>name$ = IniRead(App.Config & "\app.ini", "User", "Name", "Unknown")
|
||||
fontSize = Val(IniRead(App.Config & "\app.ini", "Display", "FontSize", "12"))</code></pre>
|
||||
<h3>IniWrite</h3>
|
||||
<p>Writes a value to an INI file. Creates the file, section, or key if they do
|
||||
not exist.</p>
|
||||
<p>Writes a value to an INI file. Creates the file, section, or key if they do not exist.</p>
|
||||
<pre><code>INIWRITE file$, section$, key$, value$</code></pre>
|
||||
<pre><code>IniWrite App.Config & "\app.ini", "User", "Name", "Scott"
|
||||
IniWrite App.Config & "\app.ini", "Display", "FontSize", Str$(fontSize)</code></pre>
|
||||
|
|
@ -1043,8 +1006,7 @@ IniWrite App.Config & "\app.ini", "Display", "FontS
|
|||
<div class="topic" id="lang.constants">
|
||||
<h1>Predefined Constants</h1>
|
||||
<h2>Predefined Constants</h2>
|
||||
<p>The following constants are predefined by the compiler and available in all
|
||||
programs.</p>
|
||||
<p>The following constants are predefined by the compiler and available in all programs.</p>
|
||||
<h3>MsgBox Button Style Flags</h3>
|
||||
<pre> Constant Value Description
|
||||
-------- ----- -----------
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -91,9 +91,6 @@ static void ctrlEscHandler(void *ctx) {
|
|||
// f1HelpHandler -- system-wide F1 launches context-sensitive help
|
||||
// ============================================================
|
||||
|
||||
#define HELP_VIEWER_PATH "APPS/DVXHELP/DVXHELP.APP"
|
||||
#define SYSTEM_HELP_FILE "APPS/DVXHELP/DVXHELP.HLP"
|
||||
|
||||
static void f1HelpHandler(void *ctx) {
|
||||
AppContextT *ac = (AppContextT *)ctx;
|
||||
|
||||
|
|
@ -120,11 +117,14 @@ static void f1HelpHandler(void *ctx) {
|
|||
}
|
||||
|
||||
// Fall back to system help if no app-specific help
|
||||
char viewerPath[DVX_MAX_PATH];
|
||||
snprintf(viewerPath, sizeof(viewerPath), "APPS%cDVXHELP%cDVXHELP.APP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
|
||||
if (!args[0]) {
|
||||
snprintf(args, sizeof(args), "%s", SYSTEM_HELP_FILE);
|
||||
snprintf(args, sizeof(args), "APPS%cPROGMAN%cDVXHELP.HLP", DVX_PATH_SEP, DVX_PATH_SEP);
|
||||
}
|
||||
|
||||
shellLoadAppWithArgs(ac, HELP_VIEWER_PATH, args);
|
||||
shellLoadAppWithArgs(ac, viewerPath, args);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
137
tools/dvxhlpc.c
137
tools/dvxhlpc.c
|
|
@ -1,6 +1,6 @@
|
|||
// dvxhlpc.c -- DVX Help file compiler
|
||||
//
|
||||
// Host-side tool (Linux) that converts .dvxhelp source files into
|
||||
// Host-side tool (Linux) that converts .dhs source files into
|
||||
// the .hlp binary format consumed by the DVX help viewer.
|
||||
//
|
||||
// Usage:
|
||||
|
|
@ -39,8 +39,6 @@
|
|||
#define MAX_LINE_LEN 1024
|
||||
#define MAX_TRIGRAMS 65536
|
||||
#define MAX_INCLUDE_DEPTH 16
|
||||
#define DEFAULT_WRAP_WIDTH 76
|
||||
#define LIST_INDENT 2
|
||||
#define INITIAL_STRTAB_SIZE 65536
|
||||
#define INITIAL_BUF_SIZE 65536
|
||||
|
||||
|
|
@ -129,7 +127,6 @@ static int32_t strEntryCap = 0;
|
|||
static TrigramT trigrams[MAX_TRIGRAMS];
|
||||
static int32_t trigramCount = 0;
|
||||
|
||||
static int32_t wrapWidth = DEFAULT_WRAP_WIDTH;
|
||||
static char imageDir[260] = ".";
|
||||
static const char *htmlPath = NULL;
|
||||
static int32_t errorCount = 0;
|
||||
|
|
@ -168,7 +165,6 @@ static int pass5Serialize(const char *outputPath);
|
|||
static int emitHtml(const char *outputPath);
|
||||
static int32_t strTableAdd(const char *str);
|
||||
static int32_t strTableFind(const char *str);
|
||||
static char *wordWrap(const char *text, int32_t width, int32_t indent);
|
||||
static void usage(void);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -201,7 +197,7 @@ static void emitWarning(const char *fmt, ...) {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
static void usage(void) {
|
||||
fprintf(stderr, "Usage: dvxhlpc -o output.hlp [-w width] [-i imagedir] [--html out.html] input.dvxhelp [...]\n");
|
||||
fprintf(stderr, "Usage: dvxhlpc -o output.hlp [-i imagedir] [--html out.html] input.dhs [...]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
@ -348,79 +344,6 @@ static void addImageRef(const char *filename) {
|
|||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Word wrap
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static char *wordWrap(const char *text, int32_t width, int32_t indent) {
|
||||
if (!text || !*text) {
|
||||
return strdup("");
|
||||
}
|
||||
|
||||
int32_t textLen = strlen(text);
|
||||
// Worst case: every word on its own line + indent
|
||||
char *result = malloc(textLen * 2 + 1);
|
||||
if (!result) {
|
||||
fprintf(stderr, "fatal: out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int32_t outPos = 0;
|
||||
int32_t col = 0;
|
||||
bool firstLine = true;
|
||||
const char *p = text;
|
||||
|
||||
while (*p) {
|
||||
// Skip leading whitespace
|
||||
while (*p == ' ' || *p == '\t') {
|
||||
p++;
|
||||
}
|
||||
if (!*p) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Find end of word
|
||||
const char *wordStart = p;
|
||||
while (*p && *p != ' ' && *p != '\t' && *p != '\n') {
|
||||
p++;
|
||||
}
|
||||
int32_t wordLen = (int32_t)(p - wordStart);
|
||||
|
||||
// Check if word fits on current line
|
||||
if (col > 0 && col + 1 + wordLen > width) {
|
||||
// Wrap to next line
|
||||
result[outPos++] = '\n';
|
||||
for (int32_t i = 0; i < indent; i++) {
|
||||
result[outPos++] = ' ';
|
||||
}
|
||||
col = indent;
|
||||
firstLine = false;
|
||||
} else if (col > 0) {
|
||||
// Add space between words
|
||||
result[outPos++] = ' ';
|
||||
col++;
|
||||
} else if (!firstLine) {
|
||||
// Start of continuation line
|
||||
for (int32_t i = 0; i < indent; i++) {
|
||||
result[outPos++] = ' ';
|
||||
}
|
||||
col = indent;
|
||||
}
|
||||
|
||||
memcpy(result + outPos, wordStart, wordLen);
|
||||
outPos += wordLen;
|
||||
col += wordLen;
|
||||
|
||||
// Skip newlines in source (join continuation lines)
|
||||
while (*p == '\n') {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
result[outPos] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Paragraph flush
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -674,12 +597,6 @@ static void parseDirective(const char *line, TopicT **curTopic, bool *inList, bo
|
|||
} else if (strcmp(directive, "default") == 0) {
|
||||
(*curTopic)->isDefault = true;
|
||||
|
||||
} else if (strcmp(directive, "wrap") == 0) {
|
||||
int32_t w = atoi(rest);
|
||||
if (w > 0) {
|
||||
wrapWidth = w;
|
||||
}
|
||||
|
||||
} else {
|
||||
emitWarning("unknown directive .%s", directive);
|
||||
}
|
||||
|
|
@ -716,10 +633,17 @@ static void parseFile(const char *path, TopicT **curTopic, bool *inList, bool *i
|
|||
line[--len] = '\0';
|
||||
}
|
||||
|
||||
// Check for directive
|
||||
// Check for directive. Inside code/table blocks, only .endcode/.endtable
|
||||
// are recognized — everything else is verbatim content.
|
||||
if (line[0] == '.') {
|
||||
parseDirective(line, curTopic, inList, inTable, inCode, inNote, noteFlags, para, paraLen, includeDepth);
|
||||
continue;
|
||||
if (*inCode && strncmp(line, ".endcode", 8) != 0) {
|
||||
// Fall through to verbatim handling below
|
||||
} else if (*inTable && strncmp(line, ".endtable", 9) != 0) {
|
||||
// Fall through to verbatim handling below
|
||||
} else {
|
||||
parseDirective(line, curTopic, inList, inTable, inCode, inNote, noteFlags, para, paraLen, includeDepth);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Plain text line
|
||||
|
|
@ -834,28 +758,13 @@ static void pass1Parse(int32_t fileCount, char **files) {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
static void pass2Wrap(void) {
|
||||
fprintf(stderr, "Pass 2: Word wrapping at %d columns...\n", wrapWidth);
|
||||
fprintf(stderr, "Pass 2: Joining paragraph lines...\n");
|
||||
|
||||
for (int32_t t = 0; t < topicCount; t++) {
|
||||
TopicT *topic = &topics[t];
|
||||
for (int32_t r = 0; r < topic->recordCount; r++) {
|
||||
RecordT *rec = &topic->records[r];
|
||||
|
||||
if (rec->type == HLP_REC_TEXT || rec->type == HLP_REC_NOTE) {
|
||||
char *wrapped = wordWrap(rec->data, wrapWidth, 0);
|
||||
free(rec->data);
|
||||
rec->data = wrapped;
|
||||
rec->dataLen = strlen(wrapped);
|
||||
|
||||
} else if (rec->type == HLP_REC_LIST_ITEM) {
|
||||
char *wrapped = wordWrap(rec->data, wrapWidth - LIST_INDENT, LIST_INDENT);
|
||||
free(rec->data);
|
||||
rec->data = wrapped;
|
||||
rec->dataLen = strlen(wrapped);
|
||||
}
|
||||
// CODE, TABLE, HEADING, etc. are not wrapped
|
||||
}
|
||||
}
|
||||
// TEXT, LIST_ITEM, and NOTE records are stored as flowing text.
|
||||
// The viewer wraps them at display time based on actual window width.
|
||||
// Here we only join continuation lines (strip internal newlines from
|
||||
// paragraphs so the text is a single flowing string).
|
||||
// CODE, TABLE, HEADING, etc. are not touched.
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1419,7 +1328,6 @@ static int pass5Serialize(const char *outputPath) {
|
|||
hdr.magic = HLP_MAGIC;
|
||||
hdr.version = HLP_VERSION;
|
||||
hdr.topicCount = topicCount;
|
||||
hdr.wrapWidth = wrapWidth;
|
||||
|
||||
// Find default topic
|
||||
hdr.defaultTopicStr = 0;
|
||||
|
|
@ -1658,15 +1566,6 @@ int main(int argc, char **argv) {
|
|||
usage();
|
||||
}
|
||||
outputPath = argv[i];
|
||||
} else if (strcmp(argv[i], "-w") == 0) {
|
||||
if (++i >= argc) {
|
||||
usage();
|
||||
}
|
||||
wrapWidth = atoi(argv[i]);
|
||||
if (wrapWidth < 20) {
|
||||
fprintf(stderr, "error: wrap width must be >= 20\n");
|
||||
return 1;
|
||||
}
|
||||
} else if (strcmp(argv[i], "-i") == 0) {
|
||||
if (++i >= argc) {
|
||||
usage();
|
||||
|
|
|
|||
63
widgets/ansiTerm/ansiTerm.dhs
Normal file
63
widgets/ansiTerm/ansiTerm.dhs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
.topic widget.ansiterm
|
||||
.title AnsiTerm
|
||||
.toc 1 AnsiTerm
|
||||
.index AnsiTerm
|
||||
.index wgtAnsiTerm
|
||||
.index Terminal
|
||||
.index VT100
|
||||
|
||||
.h2 AnsiTerm
|
||||
|
||||
A VT100/ANSI-compatible terminal emulator widget designed for connecting to BBS systems over the serial link. Uses a traditional text-mode cell buffer (character + attribute byte pairs) with the CP437 character set and 16-color CGA palette. Supports cursor movement, screen/line erase, scrolling regions, SGR colors, and scrollback history. Communication is abstracted through read/write function pointers, allowing the terminal to work with raw serial ports, the secLink encrypted channel, or any other byte-oriented transport.
|
||||
|
||||
Header: widgets/widgetAnsiTerm.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *term = wgtAnsiTerm(parent, 80, 25);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtAnsiTermWrite
|
||||
.index wgtAnsiTermClear
|
||||
.index wgtAnsiTermSetComm
|
||||
.index wgtAnsiTermSetScrollback
|
||||
.index wgtAnsiTermPoll
|
||||
.index wgtAnsiTermRepaint
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtAnsiTerm(parent, cols, rows) Create an ANSI terminal widget with the given column and row dimensions.
|
||||
wgtAnsiTermWrite(w, data, len) Write raw bytes into the terminal's ANSI parser. data is a const uint8_t * buffer, len is the byte count.
|
||||
wgtAnsiTermClear(w) Clear the terminal screen and reset the cursor to the home position.
|
||||
wgtAnsiTermSetComm(w, ctx, readFn, writeFn) Attach a communication channel. readFn and writeFn are I/O callbacks; ctx is passed as their first argument.
|
||||
wgtAnsiTermSetScrollback(w, maxLines) Set the maximum number of scrollback lines. Lines scrolled off the top are saved in a circular buffer.
|
||||
wgtAnsiTermPoll(w) Poll the communication channel for incoming data and feed it into the ANSI parser.
|
||||
wgtAnsiTermRepaint(w, outY, outH) Fast repaint path that renders dirty rows directly into the window's content buffer, bypassing the widget pipeline. Returns the dirty region via outY/outH.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Cols Integer Read-only Number of columns.
|
||||
Rows Integer Read-only Number of rows.
|
||||
Scrollback Integer Write-only Maximum scrollback lines.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
Clear Clear the terminal screen.
|
||||
Write Write a string into the terminal.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
AnsiTerm uses the common events only. No widget-specific events are defined.
|
||||
44
widgets/box/box.dhs
Normal file
44
widgets/box/box.dhs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
.topic widget.box
|
||||
.title Box (VBox / HBox / Frame)
|
||||
.toc 1 Layout Containers
|
||||
.toc 1 Box (VBox / HBox / Frame)
|
||||
.index VBox
|
||||
.index HBox
|
||||
.index Frame
|
||||
.index wgtVBox
|
||||
.index wgtHBox
|
||||
.index wgtFrame
|
||||
.index Layout
|
||||
|
||||
.h2 Box (VBox / HBox / Frame)
|
||||
|
||||
Container widgets that arrange their children in a vertical column (VBox), horizontal row (HBox), or a titled group box (Frame). These are the primary layout building blocks. Children are laid out using a flexbox-like algorithm with weight-based extra-space distribution.
|
||||
|
||||
Header: widgets/widgetBox.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtVBox(parent) Create a vertical box container. Children are stacked top to bottom.
|
||||
wgtHBox(parent) Create a horizontal box container. Children are placed left to right.
|
||||
wgtFrame(parent, title) Create a titled group box (a VBox with a border and label).
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
Box containers use the common WidgetT fields for layout control:
|
||||
|
||||
.table
|
||||
Property Description
|
||||
-------- -----------
|
||||
align Main-axis alignment of children. HBox: Start=left, Center=center, End=right. VBox: Start=top, Center=center, End=bottom.
|
||||
spacing Gap between children (tagged size).
|
||||
padding Internal padding around children (tagged size).
|
||||
weight Controls how the box itself stretches within its parent.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
Containers use the common events only. No widget-specific events.
|
||||
37
widgets/button/button.dhs
Normal file
37
widgets/button/button.dhs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
.topic widget.button
|
||||
.title Button
|
||||
.toc 1 Button
|
||||
.index Button
|
||||
.index wgtButton
|
||||
|
||||
.h2 Button
|
||||
|
||||
A push button with a text label. Fires onClick when pressed and released. Supports keyboard activation via accelerator keys.
|
||||
|
||||
Header: widgets/widgetButton.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *btn = wgtButton(parent, "OK");
|
||||
.endcode
|
||||
|
||||
.h3 Macro
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtButton(parent, text) Create a push button with the given label text.
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
Uses common WidgetT properties. Set accelKey for keyboard shortcut. Use wgtSetText() / wgtGetText() to change the label.
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when the button is clicked (press + release).
|
||||
.endtable
|
||||
69
widgets/canvas/canvas.dhs
Normal file
69
widgets/canvas/canvas.dhs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
.topic widget.canvas
|
||||
.title Canvas
|
||||
.toc 1 Canvas
|
||||
.index Canvas
|
||||
.index wgtCanvas
|
||||
.index wgtCanvasClear
|
||||
.index wgtCanvasDrawLine
|
||||
.index wgtCanvasDrawRect
|
||||
.index wgtCanvasFillRect
|
||||
.index wgtCanvasFillCircle
|
||||
.index wgtCanvasSetPixel
|
||||
.index wgtCanvasGetPixel
|
||||
.index wgtCanvasDrawText
|
||||
.index wgtCanvasSave
|
||||
.index wgtCanvasLoad
|
||||
|
||||
.h2 Canvas
|
||||
|
||||
A freeform drawing surface with a fixed-size pixel buffer. Provides drawing primitives (lines, rectangles, circles, text, individual pixels) and supports save/load to BMP files. Mouse interaction is available via a callback.
|
||||
|
||||
Header: widgets/widgetCanvas.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *cv = wgtCanvas(parent, 320, 200);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtCanvasSetPenColor
|
||||
.index wgtCanvasSetPenSize
|
||||
.index wgtCanvasSetMouseCallback
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtCanvas(parent, w, h) Create a canvas with the given pixel dimensions.
|
||||
wgtCanvasClear(w, color) Fill the entire canvas with a solid color.
|
||||
wgtCanvasSetPenColor(w, color) Set the drawing pen color.
|
||||
wgtCanvasSetPenSize(w, size) Set the drawing pen size in pixels.
|
||||
wgtCanvasDrawLine(w, x0, y0, x1, y1) Draw a line from (x0,y0) to (x1,y1).
|
||||
wgtCanvasDrawRect(w, x, y, width, height) Draw a rectangle outline.
|
||||
wgtCanvasFillRect(w, x, y, width, height) Draw a filled rectangle.
|
||||
wgtCanvasFillCircle(w, cx, cy, radius) Draw a filled circle.
|
||||
wgtCanvasSetPixel(w, x, y, color) Set a single pixel to the given color.
|
||||
wgtCanvasGetPixel(w, x, y) Get the color of a single pixel.
|
||||
wgtCanvasDrawText(w, x, y, text) Draw text at the given position using the current pen color.
|
||||
wgtCanvasSetMouseCallback(w, cb) Set a mouse interaction callback. Signature: void (*cb)(WidgetT *w, int32_t cx, int32_t cy, bool drag). Receives canvas-relative coordinates and whether the mouse is being dragged.
|
||||
wgtCanvasSave(w, path) Save the canvas contents to a BMP file.
|
||||
wgtCanvasLoad(w, path) Load a BMP file into the canvas.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when the canvas is clicked.
|
||||
Mouse callback (via wgtCanvasSetMouseCallback) Fires on mouse down and drag with canvas-local coordinates.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
Clear Clear the canvas to a given color.
|
||||
.endtable
|
||||
46
widgets/checkbox/checkbox.dhs
Normal file
46
widgets/checkbox/checkbox.dhs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
.topic widget.checkbox
|
||||
.title Checkbox
|
||||
.toc 1 Checkbox
|
||||
.index Checkbox
|
||||
.index wgtCheckbox
|
||||
.index wgtCheckboxIsChecked
|
||||
.index wgtCheckboxSetChecked
|
||||
|
||||
.h2 Checkbox
|
||||
|
||||
A toggle control with a text label. Clicking toggles between checked and unchecked states.
|
||||
|
||||
Header: widgets/widgetCheckbox.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *cb = wgtCheckbox(parent, "Enable logging");
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtCheckbox(parent, text) Create a checkbox with the given label text.
|
||||
wgtCheckboxIsChecked(w) Returns true if the checkbox is checked.
|
||||
wgtCheckboxSetChecked(w, checked) Set the checked state programmatically.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when clicked (after toggle).
|
||||
onChange Fires when the checked state changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Value Boolean Read/Write Whether the checkbox is checked.
|
||||
.endtable
|
||||
49
widgets/comboBox/comboBox.dhs
Normal file
49
widgets/comboBox/comboBox.dhs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
.topic widget.combobox
|
||||
.title ComboBox
|
||||
.toc 1 ComboBox
|
||||
.index ComboBox
|
||||
.index wgtComboBox
|
||||
.index wgtComboBoxSetItems
|
||||
.index wgtComboBoxGetSelected
|
||||
.index wgtComboBoxSetSelected
|
||||
|
||||
.h2 ComboBox
|
||||
|
||||
A combination of a text input and a dropdown list. The user can either type a value or select from a list of predefined options. Unlike Dropdown, the text field is editable.
|
||||
|
||||
Header: widgets/widgetComboBox.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *cb = wgtComboBox(parent, 128);
|
||||
const char *items[] = { "Arial", "Courier", "Times" };
|
||||
wgtComboBoxSetItems(cb, items, 3);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtComboBox(parent, maxLen) Create a combo box. maxLen is the maximum text input length.
|
||||
wgtComboBoxSetItems(w, items, count) Set the dropdown items.
|
||||
wgtComboBoxGetSelected(w) Get the index of the selected item (-1 if the text does not match any item).
|
||||
wgtComboBoxSetSelected(w, idx) Set the selected item by index.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the text or selection changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
ListIndex Integer Read/Write Index of the currently selected item.
|
||||
.endtable
|
||||
94
widgets/dataCtrl/dataCtrl.dhs
Normal file
94
widgets/dataCtrl/dataCtrl.dhs
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
.topic widget.datactrl
|
||||
.title DataCtrl
|
||||
.toc 1 Data Widgets
|
||||
.toc 1 DataCtrl
|
||||
.index DataCtrl
|
||||
.index wgtDataCtrl
|
||||
.index Database Binding
|
||||
.index Master-Detail
|
||||
|
||||
.h2 DataCtrl
|
||||
|
||||
A VB3-style Data control for database binding. Displays a visible navigation bar that connects to a SQLite database via dvxSql* functions. Reads all rows from the RecordSource query into an in-memory cache for bidirectional navigation. Fires Reposition events when the cursor moves so bound controls can update. Supports master-detail linking between Data controls.
|
||||
|
||||
Header: widgets/widgetDataCtrl.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *data = wgtDataCtrl(parent);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtDataCtrlRefresh
|
||||
.index wgtDataCtrlMoveFirst
|
||||
.index wgtDataCtrlMoveNext
|
||||
.index wgtDataCtrlGetField
|
||||
.index wgtDataCtrlSetField
|
||||
.index wgtDataCtrlUpdate
|
||||
.index wgtDataCtrlAddNew
|
||||
.index wgtDataCtrlDelete
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtDataCtrl(parent) Create a Data control.
|
||||
wgtDataCtrlRefresh(w) Re-execute the RecordSource query and rebuild the row cache.
|
||||
wgtDataCtrlMoveFirst(w) Move the cursor to the first row.
|
||||
wgtDataCtrlMovePrev(w) Move the cursor to the previous row.
|
||||
wgtDataCtrlMoveNext(w) Move the cursor to the next row.
|
||||
wgtDataCtrlMoveLast(w) Move the cursor to the last row.
|
||||
wgtDataCtrlGetField(w, colName) Get the value of a column in the current row. Returns const char *.
|
||||
wgtDataCtrlSetField(w, colName, value) Set the value of a column in the current row (marks the row dirty).
|
||||
wgtDataCtrlUpdateRow(w) Write the current row's pending changes back to the database.
|
||||
wgtDataCtrlUpdate(w) Flush all pending changes to the database.
|
||||
wgtDataCtrlAddNew(w) Begin a new row. Sets dirty state; call Update to commit.
|
||||
wgtDataCtrlDelete(w) Delete the current row from the database.
|
||||
wgtDataCtrlSetMasterValue(w, val) Set the master-detail filter value for this control.
|
||||
wgtDataCtrlGetRowCount(w) Get the total number of cached rows.
|
||||
wgtDataCtrlGetColCount(w) Get the number of columns in the result set.
|
||||
wgtDataCtrlGetColName(w, col) Get the name of a column by index. Returns const char *.
|
||||
wgtDataCtrlGetCellText(w, row, col) Get the text of a specific cell by row and column index. Returns const char *.
|
||||
wgtDataCtrlSetCurrentRow(w, row) Set the current row by index (0-based).
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
DatabaseName String Read/Write Path to the SQLite database file.
|
||||
RecordSource String Read/Write SQL query or table name for the result set.
|
||||
KeyColumn String Read/Write Primary key column name (used for UPDATE/DELETE).
|
||||
MasterSource String Read/Write Name of the master Data control for master-detail linking.
|
||||
MasterField String Read/Write Column in the master control to read for the filter value.
|
||||
DetailField String Read/Write Column in this table to filter by the master value.
|
||||
Caption String Read/Write Text displayed on the navigation bar.
|
||||
BOF Boolean Read-only True when the cursor is before the first row.
|
||||
EOF Boolean Read-only True when the cursor is past the last row.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
AddNew Begin a new row.
|
||||
Delete Delete the current row.
|
||||
MoveFirst Move to the first row.
|
||||
MoveLast Move to the last row.
|
||||
MoveNext Move to the next row.
|
||||
MovePrevious Move to the previous row.
|
||||
Refresh Re-execute the query and rebuild the cache.
|
||||
Update Write pending changes to the database.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Event Description
|
||||
----- -----------
|
||||
Reposition Fires when the current row changes (navigation, refresh, etc.). Default event.
|
||||
Validate Fires before writing changes. Return false to cancel.
|
||||
.endtable
|
||||
65
widgets/dbGrid/dbGrid.dhs
Normal file
65
widgets/dbGrid/dbGrid.dhs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
.topic widget.dbgrid
|
||||
.title DbGrid
|
||||
.toc 1 DbGrid
|
||||
.index DbGrid
|
||||
.index wgtDbGrid
|
||||
.index wgtDbGridSetDataWidget
|
||||
.index Database Grid
|
||||
|
||||
.h2 DbGrid
|
||||
|
||||
A database grid widget that displays all records from a Data control in a scrollable, sortable table. Columns auto-populate from the Data control's column names and can be hidden, resized, and renamed by the application. Clicking a column header sorts the display. Selecting a row syncs the Data control's cursor position. The grid reads directly from the Data control's cached rows, so there is no separate copy of the data.
|
||||
|
||||
Header: widgets/widgetDbGrid.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *grid = wgtDbGrid(parent);
|
||||
wgtDbGridSetDataWidget(grid, dataCtrl);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtDbGridRefresh
|
||||
.index wgtDbGridSetColumnVisible
|
||||
.index wgtDbGridSetColumnHeader
|
||||
.index wgtDbGridSetColumnWidth
|
||||
.index wgtDbGridGetSelectedRow
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtDbGrid(parent) Create a database grid widget.
|
||||
wgtDbGridSetDataWidget(w, dataWidget) Bind the grid to a Data control. The grid reads rows from this widget.
|
||||
wgtDbGridRefresh(w) Re-read the Data control's state and repaint the grid.
|
||||
wgtDbGridSetColumnVisible(w, fieldName, visible) Show or hide a column by field name.
|
||||
wgtDbGridSetColumnHeader(w, fieldName, header) Set a display header for a column (overrides the field name).
|
||||
wgtDbGridSetColumnWidth(w, fieldName, width) Set the width of a column by field name (tagged size, 0 = auto).
|
||||
wgtDbGridGetSelectedRow(w) Get the index of the currently selected data row (-1 if none).
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
GridLines Boolean Read/Write Whether to draw grid lines between cells.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
Refresh Re-read the Data control and repaint.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Event Description
|
||||
----- -----------
|
||||
Click Fires when a row is clicked.
|
||||
DblClick Fires when a row is double-clicked. Default event.
|
||||
.endtable
|
||||
49
widgets/dropdown/dropdown.dhs
Normal file
49
widgets/dropdown/dropdown.dhs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
.topic widget.dropdown
|
||||
.title Dropdown
|
||||
.toc 1 Dropdown
|
||||
.index Dropdown
|
||||
.index wgtDropdown
|
||||
.index wgtDropdownSetItems
|
||||
.index wgtDropdownGetSelected
|
||||
.index wgtDropdownSetSelected
|
||||
|
||||
.h2 Dropdown
|
||||
|
||||
A drop-down list that displays a single selected item and expands to show all options when clicked. Read-only selection (the user cannot type into it).
|
||||
|
||||
Header: widgets/widgetDropdown.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *dd = wgtDropdown(parent);
|
||||
const char *items[] = { "Red", "Green", "Blue" };
|
||||
wgtDropdownSetItems(dd, items, 3);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtDropdown(parent) Create a dropdown list.
|
||||
wgtDropdownSetItems(w, items, count) Set the list of items. items is a const char ** array.
|
||||
wgtDropdownGetSelected(w) Get the index of the selected item (-1 if none).
|
||||
wgtDropdownSetSelected(w, idx) Set the selected item by index.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the selected item changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
ListIndex Integer Read/Write Index of the currently selected item.
|
||||
.endtable
|
||||
51
widgets/image/image.dhs
Normal file
51
widgets/image/image.dhs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.topic widget.image
|
||||
.title Image
|
||||
.toc 1 Display Widgets
|
||||
.toc 1 Image
|
||||
.index Image
|
||||
.index wgtImage
|
||||
.index wgtImageFromFile
|
||||
.index wgtImageSetData
|
||||
.index wgtImageLoadFile
|
||||
|
||||
.h2 Image
|
||||
|
||||
Displays a bitmap image. Can be created from raw pixel data or loaded from a BMP file on disk. The image is rendered at its natural size within the widget bounds.
|
||||
|
||||
Header: widgets/widgetImage.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtImage(parent, data, w, h, pitch) Create an image widget from raw pixel data. data is a uint8_t * pixel buffer, w/h are dimensions, pitch is bytes per row.
|
||||
wgtImageFromFile(parent, path) Create an image widget by loading a BMP file from disk.
|
||||
.endtable
|
||||
|
||||
.h3 Methods
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtImageSetData(w, data, imgW, imgH, pitch) Replace the displayed image with new raw pixel data.
|
||||
wgtImageLoadFile(w, path) Replace the displayed image by loading a new file.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when the image is clicked.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Picture String Write-only Load an image from a file path.
|
||||
ImageWidth Integer Read-only Width of the currently loaded image in pixels.
|
||||
ImageHeight Integer Read-only Height of the currently loaded image in pixels.
|
||||
.endtable
|
||||
52
widgets/imageButton/imgbtn.dhs
Normal file
52
widgets/imageButton/imgbtn.dhs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
.topic widget.imagebutton
|
||||
.title ImageButton
|
||||
.toc 1 ImageButton
|
||||
.index ImageButton
|
||||
.index wgtImageButton
|
||||
.index wgtImageButtonFromFile
|
||||
.index wgtImageButtonSetData
|
||||
.index wgtImageButtonLoadFile
|
||||
|
||||
.h2 ImageButton
|
||||
|
||||
A clickable button that displays an image instead of text. Has press/release visual feedback like a regular button. Can be created from raw pixel data or a BMP file.
|
||||
|
||||
Header: widgets/widgetImageButton.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtImageButton(parent, data, w, h, pitch) Create an image button from raw pixel data.
|
||||
wgtImageButtonFromFile(parent, path) Create an image button by loading a BMP file.
|
||||
.endtable
|
||||
|
||||
.h3 Methods
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtImageButtonSetData(w, data, imgW, imgH, pitch) Replace the image with new raw pixel data.
|
||||
wgtImageButtonLoadFile(w, path) Replace the image by loading a new file.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when the image button is clicked (press + release).
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Picture String Write-only Load an image from a file path.
|
||||
ImageWidth Integer Read-only Width of the currently loaded image in pixels.
|
||||
ImageHeight Integer Read-only Height of the currently loaded image in pixels.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
45
widgets/label/label.dhs
Normal file
45
widgets/label/label.dhs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
.topic widget.label
|
||||
.title Label
|
||||
.toc 1 Label
|
||||
.index Label
|
||||
.index wgtLabel
|
||||
.index wgtLabelSetAlign
|
||||
|
||||
.h2 Label
|
||||
|
||||
A static text label. Does not accept keyboard focus. Typically used to describe other widgets. Supports text alignment and accelerator keys (with WCLASS_FOCUS_FORWARD, the accelerator moves focus to the next focusable sibling).
|
||||
|
||||
Header: widgets/widgetLabel.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *lbl = wgtLabel(parent, "Name:");
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtLabel(parent, text) Create a text label.
|
||||
wgtLabelSetAlign(w, align) Set the text alignment (AlignStartE, AlignCenterE, AlignEndE).
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
Use wgtSetText() / wgtGetText() to change the text. Set accelKey for accelerator support (focus forwards to next focusable widget).
|
||||
|
||||
.h3 Events
|
||||
|
||||
Labels use the common events only. Typically no callbacks are set on labels.
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Alignment Enum (Left, Center, Right) Read/Write Text alignment within the label.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
78
widgets/listBox/listBox.dhs
Normal file
78
widgets/listBox/listBox.dhs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
.topic widget.listbox
|
||||
.title ListBox
|
||||
.toc 1 ListBox
|
||||
.index ListBox
|
||||
.index wgtListBox
|
||||
.index wgtListBoxSetItems
|
||||
.index wgtListBoxGetSelected
|
||||
|
||||
.h2 ListBox
|
||||
|
||||
A scrollable list of text items. Supports single and multi-selection modes and drag-to-reorder.
|
||||
|
||||
Header: widgets/widgetListBox.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *lb = wgtListBox(parent);
|
||||
const char *items[] = { "Alpha", "Beta", "Gamma" };
|
||||
wgtListBoxSetItems(lb, items, 3);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtListBoxSetSelected
|
||||
.index wgtListBoxSetMultiSelect
|
||||
.index wgtListBoxIsItemSelected
|
||||
.index wgtListBoxSetReorderable
|
||||
.index wgtListBoxSelectAll
|
||||
.index wgtListBoxClearSelection
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtListBox(parent) Create a list box.
|
||||
wgtListBoxSetItems(w, items, count) Set the list items.
|
||||
wgtListBoxGetSelected(w) Get the index of the selected item (-1 if none).
|
||||
wgtListBoxSetSelected(w, idx) Set the selected item by index.
|
||||
wgtListBoxSetMultiSelect(w, multi) Enable or disable multi-selection mode.
|
||||
wgtListBoxIsItemSelected(w, idx) Check if a specific item is selected (multi-select mode).
|
||||
wgtListBoxSetItemSelected(w, idx, selected) Select or deselect a specific item.
|
||||
wgtListBoxSelectAll(w) Select all items (multi-select mode).
|
||||
wgtListBoxClearSelection(w) Deselect all items.
|
||||
wgtListBoxSetReorderable(w, reorderable) Enable drag-to-reorder.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when an item is clicked.
|
||||
onDblClick Fires when an item is double-clicked.
|
||||
onChange Fires when the selection changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
ListIndex Integer Read/Write Index of the currently selected item.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SelectAll Select all items.
|
||||
ClearSelection Deselect all items.
|
||||
SetMultiSelect Enable or disable multi-selection.
|
||||
SetReorderable Enable or disable drag-to-reorder.
|
||||
IsItemSelected Check if a specific item is selected by index.
|
||||
SetItemSelected Select or deselect a specific item by index.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
110
widgets/listView/listView.dhs
Normal file
110
widgets/listView/listView.dhs
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
.topic widget.listview
|
||||
.title ListView
|
||||
.toc 1 ListView
|
||||
.index ListView
|
||||
.index wgtListView
|
||||
.index wgtListViewSetColumns
|
||||
.index wgtListViewSetData
|
||||
.index ListViewColT
|
||||
.index ListViewSortE
|
||||
|
||||
.h2 ListView
|
||||
|
||||
A multi-column list with sortable headers. Supports single and multi-selection, column alignment, header click sorting, and drag-to-reorder. Data is provided as a flat array of strings (row-major order, one string per cell).
|
||||
|
||||
Header: widgets/widgetListView.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *lv = wgtListView(parent);
|
||||
ListViewColT cols[] = {
|
||||
{ "Name", wgtChars(20), ListViewAlignLeftE },
|
||||
{ "Size", wgtChars(10), ListViewAlignRightE }
|
||||
};
|
||||
wgtListViewSetColumns(lv, cols, 2);
|
||||
const char *cells[] = { "file.txt", "1234", "readme.md", "5678" };
|
||||
wgtListViewSetData(lv, cells, 2);
|
||||
.endcode
|
||||
|
||||
.h3 Column Definition
|
||||
|
||||
.code
|
||||
typedef struct {
|
||||
const char *title;
|
||||
int32_t width; // tagged size (wgtPixels/wgtChars/wgtPercent, 0 = auto)
|
||||
ListViewAlignE align; // ListViewAlignLeftE, ListViewAlignCenterE, ListViewAlignRightE
|
||||
} ListViewColT;
|
||||
.endcode
|
||||
|
||||
.h3 Sort Direction
|
||||
|
||||
.code
|
||||
typedef enum {
|
||||
ListViewSortNoneE,
|
||||
ListViewSortAscE,
|
||||
ListViewSortDescE
|
||||
} ListViewSortE;
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtListViewGetSelected
|
||||
.index wgtListViewSetSelected
|
||||
.index wgtListViewSetSort
|
||||
.index wgtListViewSetHeaderClickCallback
|
||||
.index wgtListViewSetMultiSelect
|
||||
.index wgtListViewSelectAll
|
||||
.index wgtListViewClearSelection
|
||||
.index wgtListViewSetReorderable
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtListView(parent) Create a list view.
|
||||
wgtListViewSetColumns(w, cols, count) Define columns from an array of ListViewColT.
|
||||
wgtListViewSetData(w, cellData, rowCount) Set row data. cellData is a flat const char ** array of size rowCount * colCount.
|
||||
wgtListViewGetSelected(w) Get the index of the selected row (-1 if none).
|
||||
wgtListViewSetSelected(w, idx) Set the selected row by index.
|
||||
wgtListViewSetSort(w, col, dir) Set the sort column and direction.
|
||||
wgtListViewSetHeaderClickCallback(w, cb) Set a callback for header clicks. Signature: void (*cb)(WidgetT *w, int32_t col, ListViewSortE dir).
|
||||
wgtListViewSetMultiSelect(w, multi) Enable or disable multi-selection.
|
||||
wgtListViewIsItemSelected(w, idx) Check if a specific row is selected.
|
||||
wgtListViewSetItemSelected(w, idx, selected) Select or deselect a specific row.
|
||||
wgtListViewSelectAll(w) Select all rows.
|
||||
wgtListViewClearSelection(w) Deselect all rows.
|
||||
wgtListViewSetReorderable(w, reorderable) Enable drag-to-reorder of rows.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when a row is clicked.
|
||||
onDblClick Fires when a row is double-clicked.
|
||||
onChange Fires when the selection changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
ListIndex Integer Read/Write Index of the currently selected row.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SelectAll Select all rows.
|
||||
ClearSelection Deselect all rows.
|
||||
SetMultiSelect Enable or disable multi-selection.
|
||||
SetReorderable Enable or disable drag-to-reorder.
|
||||
IsItemSelected Check if a specific row is selected by index.
|
||||
SetItemSelected Select or deselect a specific row by index.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
46
widgets/progressBar/progress.dhs
Normal file
46
widgets/progressBar/progress.dhs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
.topic widget.progressbar
|
||||
.title ProgressBar
|
||||
.toc 1 ProgressBar
|
||||
.index ProgressBar
|
||||
.index wgtProgressBar
|
||||
.index wgtProgressBarV
|
||||
.index wgtProgressBarSetValue
|
||||
.index wgtProgressBarGetValue
|
||||
|
||||
.h2 ProgressBar
|
||||
|
||||
A visual indicator of progress, displayed as a filled bar. Supports both horizontal and vertical orientations. Value ranges from 0 to 100.
|
||||
|
||||
Header: widgets/widgetProgressBar.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtProgressBar(parent) Create a horizontal progress bar.
|
||||
wgtProgressBarV(parent) Create a vertical progress bar.
|
||||
.endtable
|
||||
|
||||
.h3 Methods
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtProgressBarSetValue(w, value) Set the progress value (0-100).
|
||||
wgtProgressBarGetValue(w) Get the current progress value.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
ProgressBar is a display-only widget. Typically no callbacks are set.
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Value Integer Read/Write Current progress value (0-100).
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
61
widgets/radio/radio.dhs
Normal file
61
widgets/radio/radio.dhs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
.topic widget.radio
|
||||
.title Radio Button
|
||||
.toc 1 Radio Button
|
||||
.index Radio
|
||||
.index RadioGroup
|
||||
.index wgtRadio
|
||||
.index wgtRadioGroup
|
||||
.index wgtRadioGroupSetSelected
|
||||
.index wgtRadioGetIndex
|
||||
|
||||
.h2 Radio Button
|
||||
|
||||
A mutually exclusive selection control. Radio buttons must be placed inside a radio group container. Only one radio button within a group can be selected at a time.
|
||||
|
||||
Header: widgets/widgetRadio.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *grp = wgtRadioGroup(parent);
|
||||
WidgetT *r1 = wgtRadio(grp, "Option A");
|
||||
WidgetT *r2 = wgtRadio(grp, "Option B");
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtRadioGroup(parent) Create a radio group container.
|
||||
wgtRadio(parent, text) Create a radio button inside a group.
|
||||
wgtRadioGroupSetSelected(w, idx) Set the selected radio button by index within the group.
|
||||
wgtRadioGetIndex(w) Get the index of the currently selected radio button.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires on the radio button when clicked.
|
||||
onChange Fires when the selection changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Value Integer Read-only Index of the currently selected radio button in the group.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SetSelected Set the selected radio button by index.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
49
widgets/scrollPane/scrlpane.dhs
Normal file
49
widgets/scrollPane/scrlpane.dhs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
.topic widget.scrollpane
|
||||
.title ScrollPane
|
||||
.toc 1 ScrollPane
|
||||
.index ScrollPane
|
||||
.index wgtScrollPane
|
||||
.index wgtScrollPaneScrollToChild
|
||||
.index wgtScrollPaneSetNoBorder
|
||||
|
||||
.h2 ScrollPane
|
||||
|
||||
A scrollable container that provides vertical and/or horizontal scrollbars when its content exceeds the visible area. Place a single child (typically a VBox or HBox) inside the scroll pane.
|
||||
|
||||
Header: widgets/widgetScrollPane.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *sp = wgtScrollPane(parent);
|
||||
WidgetT *content = wgtVBox(sp);
|
||||
// add children to content...
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtScrollPane(parent) Create a scroll pane container.
|
||||
wgtScrollPaneScrollToChild(sp, child) Scroll so that the given child widget is visible.
|
||||
wgtScrollPaneSetNoBorder(w, noBorder) When true, removes the border around the scroll pane.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onScroll Fires when the scroll position changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
NoBorder Boolean Read/Write Whether the border around the scroll pane is hidden.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
|
|
@ -919,6 +919,14 @@ void wgtScrollPaneScrollToChild(WidgetT *w, const WidgetT *child) {
|
|||
}
|
||||
|
||||
|
||||
void wgtScrollPaneScrollToTop(WidgetT *w) {
|
||||
VALIDATE_WIDGET_VOID(w, sTypeId);
|
||||
ScrollPaneDataT *sp = (ScrollPaneDataT *)w->data;
|
||||
sp->scrollPosV = 0;
|
||||
sp->scrollPosH = 0;
|
||||
}
|
||||
|
||||
|
||||
// ============================================================
|
||||
// DXE registration
|
||||
// ============================================================
|
||||
|
|
@ -928,10 +936,12 @@ static const struct {
|
|||
WidgetT *(*create)(WidgetT *parent);
|
||||
void (*scrollToChild)(WidgetT *sp, const WidgetT *child);
|
||||
void (*setNoBorder)(WidgetT *w, bool noBorder);
|
||||
void (*scrollToTop)(WidgetT *w);
|
||||
} sApi = {
|
||||
.create = wgtScrollPane,
|
||||
.scrollToChild = wgtScrollPaneScrollToChild,
|
||||
.setNoBorder = wgtScrollPaneSetNoBorder
|
||||
.setNoBorder = wgtScrollPaneSetNoBorder,
|
||||
.scrollToTop = wgtScrollPaneScrollToTop
|
||||
};
|
||||
|
||||
static bool spGetNoBorder(const WidgetT *w) {
|
||||
|
|
|
|||
27
widgets/separatr/separatr.dhs
Normal file
27
widgets/separatr/separatr.dhs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
.topic widget.separator
|
||||
.title Separator
|
||||
.toc 1 Separator
|
||||
.index Separator
|
||||
.index wgtHSeparator
|
||||
.index wgtVSeparator
|
||||
|
||||
.h2 Separator
|
||||
|
||||
A visual dividing line used to separate groups of widgets. Available in horizontal and vertical orientations.
|
||||
|
||||
Header: widgets/widgetSeparator.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtHSeparator(parent) Create a horizontal separator line.
|
||||
wgtVSeparator(parent) Create a vertical separator line.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
Separator is a visual-only widget. No events.
|
||||
|
||||
.hr
|
||||
47
widgets/slider/slider.dhs
Normal file
47
widgets/slider/slider.dhs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
.topic widget.slider
|
||||
.title Slider
|
||||
.toc 1 Slider
|
||||
.index Slider
|
||||
.index wgtSlider
|
||||
.index wgtSliderSetValue
|
||||
.index wgtSliderGetValue
|
||||
|
||||
.h2 Slider
|
||||
|
||||
A horizontal slider (track bar) for selecting an integer value within a range. The user drags the thumb or clicks the track to change the value.
|
||||
|
||||
Header: widgets/widgetSlider.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *sl = wgtSlider(parent, 0, 100);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtSlider(parent, minVal, maxVal) Create a slider with the given integer range.
|
||||
wgtSliderSetValue(w, value) Set the slider value programmatically.
|
||||
wgtSliderGetValue(w) Get the current slider value.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the slider value changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Value Integer Read/Write Current slider value.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
34
widgets/spacer/spacer.dhs
Normal file
34
widgets/spacer/spacer.dhs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
.topic widget.spacer
|
||||
.title Spacer
|
||||
.toc 1 Spacer
|
||||
.index Spacer
|
||||
.index wgtSpacer
|
||||
|
||||
.h2 Spacer
|
||||
|
||||
An invisible widget used for layout purposes. By default it has weight=100, so it absorbs available extra space. Useful for pushing other widgets apart or aligning them to edges.
|
||||
|
||||
Header: widgets/widgetSpacer.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *row = wgtHBox(parent);
|
||||
wgtButton(row, "OK");
|
||||
wgtSpacer(row); // pushes Cancel to the right
|
||||
wgtButton(row, "Cancel");
|
||||
.endcode
|
||||
|
||||
.h3 Macro
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtSpacer(parent) Create an invisible spacer widget.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
Spacer is an invisible layout widget. No events.
|
||||
|
||||
.hr
|
||||
75
widgets/spinner/spinner.dhs
Normal file
75
widgets/spinner/spinner.dhs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
.topic widget.spinner
|
||||
.title Spinner
|
||||
.toc 1 Spinner
|
||||
.index Spinner
|
||||
.index wgtSpinner
|
||||
.index wgtSpinnerSetValue
|
||||
.index wgtSpinnerGetValue
|
||||
.index wgtSpinnerSetRealMode
|
||||
|
||||
.h2 Spinner
|
||||
|
||||
A numeric input with up/down buttons for incrementing and decrementing a value within a range. Supports both integer and floating-point (real) modes.
|
||||
|
||||
Header: widgets/widgetSpinner.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *sp = wgtSpinner(parent, 0, 100, 1);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtSpinnerSetRange
|
||||
.index wgtSpinnerSetStep
|
||||
.index wgtSpinnerGetRealValue
|
||||
.index wgtSpinnerSetRealValue
|
||||
.index wgtSpinnerSetRealRange
|
||||
.index wgtSpinnerSetRealStep
|
||||
.index wgtSpinnerSetDecimals
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtSpinner(parent, minVal, maxVal, step) Create a spinner with the given integer range and step size.
|
||||
wgtSpinnerSetValue(w, value) Set the integer value.
|
||||
wgtSpinnerGetValue(w) Get the current integer value.
|
||||
wgtSpinnerSetRange(w, minVal, maxVal) Set the integer range.
|
||||
wgtSpinnerSetStep(w, step) Set the integer step size.
|
||||
wgtSpinnerSetRealMode(w, enable) Switch to floating-point mode.
|
||||
wgtSpinnerGetRealValue(w) Get the current floating-point value.
|
||||
wgtSpinnerSetRealValue(w, value) Set the floating-point value.
|
||||
wgtSpinnerSetRealRange(w, minVal, maxVal) Set the floating-point range.
|
||||
wgtSpinnerSetRealStep(w, step) Set the floating-point step size.
|
||||
wgtSpinnerSetDecimals(w, decimals) Set the number of decimal places displayed in real mode.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the value changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Value Integer Read/Write Current integer value.
|
||||
RealMode Boolean Read/Write Whether floating-point mode is active.
|
||||
Decimals Integer Read/Write Number of decimal places displayed in real mode.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SetRange Set the integer range (min, max).
|
||||
SetStep Set the integer step size.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
49
widgets/splitter/splitter.dhs
Normal file
49
widgets/splitter/splitter.dhs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
.topic widget.splitter
|
||||
.title Splitter
|
||||
.toc 1 Splitter
|
||||
.index Splitter
|
||||
.index wgtSplitter
|
||||
.index wgtSplitterSetPos
|
||||
.index wgtSplitterGetPos
|
||||
|
||||
.h2 Splitter
|
||||
|
||||
A two-pane container with a draggable divider. The user drags the splitter bar to resize the two panes. Can be oriented vertically (left/right panes) or horizontally (top/bottom panes). Add exactly two children.
|
||||
|
||||
Header: widgets/widgetSplitter.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *sp = wgtSplitter(parent, true); // vertical = left|right
|
||||
WidgetT *left = wgtVBox(sp);
|
||||
WidgetT *right = wgtVBox(sp);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtSplitter(parent, vertical) Create a splitter. vertical=true for left/right panes, false for top/bottom.
|
||||
wgtSplitterSetPos(w, pos) Set the divider position in pixels.
|
||||
wgtSplitterGetPos(w) Get the current divider position in pixels.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the divider position changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Position Integer Read/Write Divider position in pixels.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
36
widgets/statbar/statbar.dhs
Normal file
36
widgets/statbar/statbar.dhs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
.topic widget.statusbar
|
||||
.title StatusBar
|
||||
.toc 1 StatusBar
|
||||
.index StatusBar
|
||||
.index wgtStatusBar
|
||||
|
||||
.h2 StatusBar
|
||||
|
||||
A horizontal bar typically placed at the bottom of a window for displaying status text and informational widgets. Children are laid out horizontally.
|
||||
|
||||
Header: widgets/widgetStatusBar.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *sb = wgtStatusBar(parent);
|
||||
wgtLabel(sb, "Ready");
|
||||
.endcode
|
||||
|
||||
.h3 Macro
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtStatusBar(parent) Create a status bar container.
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
Uses common container properties. Add child widgets (labels, progress bars, etc.) to populate.
|
||||
|
||||
.h3 Events
|
||||
|
||||
StatusBar itself has no widget-specific events. Events fire on the child widgets.
|
||||
|
||||
.hr
|
||||
61
widgets/tabControl/tabctrl.dhs
Normal file
61
widgets/tabControl/tabctrl.dhs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
.topic widget.tabcontrol
|
||||
.title TabControl
|
||||
.toc 1 TabControl
|
||||
.index TabControl
|
||||
.index TabPage
|
||||
.index wgtTabControl
|
||||
.index wgtTabPage
|
||||
.index wgtTabControlSetActive
|
||||
.index wgtTabControlGetActive
|
||||
|
||||
.h2 TabControl
|
||||
|
||||
A tabbed container that displays one page at a time with clickable tabs along the top. Each tab page is a container that holds its own child widgets.
|
||||
|
||||
Header: widgets/widgetTabControl.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *tabs = wgtTabControl(parent);
|
||||
WidgetT *page1 = wgtTabPage(tabs, "General");
|
||||
WidgetT *page2 = wgtTabPage(tabs, "Advanced");
|
||||
// add children to page1, page2...
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtTabControl(parent) Create a tab control.
|
||||
wgtTabPage(parent, title) Add a tab page with the given title. Returns the page container widget.
|
||||
wgtTabControlSetActive(w, idx) Set the active tab by index (0-based).
|
||||
wgtTabControlGetActive(w) Get the index of the active tab.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the active tab changes.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
TabIndex Integer Read/Write Index of the currently active tab (0-based).
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SetActive Set the active tab by index.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
65
widgets/textInput/textinpt.dhs
Normal file
65
widgets/textInput/textinpt.dhs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
.topic widget.textinput
|
||||
.title TextInput / TextArea
|
||||
.toc 1 Input Widgets
|
||||
.toc 1 TextInput / TextArea
|
||||
.index TextInput
|
||||
.index TextArea
|
||||
.index wgtTextInput
|
||||
.index wgtTextArea
|
||||
.index wgtPasswordInput
|
||||
.index wgtMaskedInput
|
||||
|
||||
.h2 TextInput / TextArea
|
||||
|
||||
Single-line text input, password input, masked input, and multi-line text area with optional syntax colorization, line numbers, find/replace, and gutter decorators.
|
||||
|
||||
Header: widgets/widgetTextInput.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtTextInput(parent, maxLen) Create a single-line text input. maxLen is the maximum number of characters.
|
||||
wgtPasswordInput(parent, maxLen) Create a password input (characters displayed as bullets).
|
||||
wgtMaskedInput(parent, mask) Create a masked input field. The mask string defines the input format.
|
||||
wgtTextArea(parent, maxLen) Create a multi-line text area.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (TextArea-specific)
|
||||
|
||||
.index wgtTextAreaSetColorize
|
||||
.index wgtTextAreaGoToLine
|
||||
.index wgtTextAreaSetAutoIndent
|
||||
.index wgtTextAreaSetShowLineNumbers
|
||||
.index wgtTextAreaFindNext
|
||||
.index wgtTextAreaReplaceAll
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtTextAreaSetColorize(w, fn, ctx) Set a syntax colorization callback. The callback receives each line and fills a color index array. Color indices: 0=default, 1=keyword, 2=string, 3=comment, 4=number, 5=operator, 6=type/builtin, 7=reserved.
|
||||
wgtTextAreaGoToLine(w, line) Scroll to and place the cursor on the given line number.
|
||||
wgtTextAreaSetAutoIndent(w, enable) Enable or disable automatic indentation on newline.
|
||||
wgtTextAreaSetShowLineNumbers(w, show) Show or hide line numbers in the gutter.
|
||||
wgtTextAreaSetCaptureTabs(w, capture) When true, Tab key inserts a tab/spaces instead of moving focus.
|
||||
wgtTextAreaSetTabWidth(w, width) Set the tab stop width in characters.
|
||||
wgtTextAreaSetUseTabChar(w, useChar) When true, insert literal tab characters; when false, insert spaces.
|
||||
wgtTextAreaFindNext(w, needle, caseSens, fwd) Search for the next occurrence. Returns true if found.
|
||||
wgtTextAreaReplaceAll(w, needle, repl, caseSens) Replace all occurrences. Returns the number of replacements made.
|
||||
wgtTextAreaSetLineDecorator(w, fn, ctx) Set a gutter line decorator callback. The callback returns a color and receives the line number, a color output pointer, and the user context.
|
||||
wgtTextAreaGetCursorLine(w) Get the current cursor line number.
|
||||
wgtTextAreaSetGutterClick(w, fn) Set a callback for gutter clicks (e.g. for breakpoint toggling). Callback receives the widget and line number.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onChange Fires when the text content changes.
|
||||
onKeyPress Fires on each key press (ASCII value).
|
||||
onValidate Called before committing a change. Return false to cancel.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
74
widgets/timer/timer.dhs
Normal file
74
widgets/timer/timer.dhs
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
.topic widget.timer
|
||||
.title Timer
|
||||
.toc 1 Non-Visual Widgets
|
||||
.toc 1 Timer
|
||||
.index Timer
|
||||
.index wgtTimer
|
||||
.index wgtTimerStart
|
||||
.index wgtTimerStop
|
||||
.index wgtTimerSetInterval
|
||||
.index wgtTimerIsRunning
|
||||
.index wgtUpdateTimers
|
||||
|
||||
.h2 Timer
|
||||
|
||||
A non-visual widget that fires its onClick callback at a regular interval. Useful for animations, polling, and periodic updates. Must be explicitly started after creation.
|
||||
|
||||
Header: widgets/widgetTimer.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *tmr = wgtTimer(parent, 1000, true); // 1 second, repeating
|
||||
tmr->onClick = onTimerTick;
|
||||
wgtTimerStart(tmr);
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtTimer(parent, intervalMs, repeat) Create a timer. intervalMs is the interval in milliseconds. repeat: true for repeating, false for one-shot.
|
||||
wgtTimerStart(w) Start the timer.
|
||||
wgtTimerStop(w) Stop the timer.
|
||||
wgtTimerSetInterval(w, intervalMs) Change the timer interval.
|
||||
wgtTimerIsRunning(w) Returns true if the timer is currently running.
|
||||
wgtUpdateTimers() Global tick function. Called by the event loop to advance all active timers.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires each time the timer elapses.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Enabled Boolean Read/Write Whether the timer is running. Reading returns the running state; writing starts or stops it.
|
||||
Interval Integer Write-only Timer interval in milliseconds.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
Start Start the timer.
|
||||
Stop Stop the timer.
|
||||
.endtable
|
||||
|
||||
.h3 Extra Events (BASIC Interface)
|
||||
|
||||
.table
|
||||
Event Description
|
||||
----- -----------
|
||||
Timer Fires each time the timer elapses. Default event.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
38
widgets/toolbar/toolbar.dhs
Normal file
38
widgets/toolbar/toolbar.dhs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
.topic widget.toolbar
|
||||
.title Toolbar
|
||||
.toc 1 Container Widgets
|
||||
.toc 1 Toolbar
|
||||
.index Toolbar
|
||||
.index wgtToolbar
|
||||
|
||||
.h2 Toolbar
|
||||
|
||||
A horizontal container for toolbar buttons and controls. Typically placed at the top of a window. Children (usually ImageButtons or Buttons) are laid out horizontally with toolbar-appropriate spacing.
|
||||
|
||||
Header: widgets/widgetToolbar.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *tb = wgtToolbar(parent);
|
||||
wgtImageButtonFromFile(tb, "icons/save.bmp");
|
||||
wgtImageButtonFromFile(tb, "icons/open.bmp");
|
||||
.endcode
|
||||
|
||||
.h3 Macro
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtToolbar(parent) Create a toolbar container.
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
Uses common container properties. Add children (buttons, separators, etc.) to populate the toolbar.
|
||||
|
||||
.h3 Events
|
||||
|
||||
Toolbar itself has no widget-specific events. Events fire on the child widgets.
|
||||
|
||||
.hr
|
||||
68
widgets/treeView/treeView.dhs
Normal file
68
widgets/treeView/treeView.dhs
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
.topic widget.treeview
|
||||
.title TreeView
|
||||
.toc 1 TreeView
|
||||
.index TreeView
|
||||
.index TreeItem
|
||||
.index wgtTreeView
|
||||
.index wgtTreeItem
|
||||
.index wgtTreeViewGetSelected
|
||||
|
||||
.h2 TreeView
|
||||
|
||||
A hierarchical tree control with expandable/collapsible nodes. Supports single and multi-selection and drag-to-reorder. Tree items are added as children of the TreeView or of other tree items to create nested hierarchies.
|
||||
|
||||
Header: widgets/widgetTreeView.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *tv = wgtTreeView(parent);
|
||||
WidgetT *root = wgtTreeItem(tv, "Root");
|
||||
WidgetT *child = wgtTreeItem(root, "Child");
|
||||
.endcode
|
||||
|
||||
.h3 Macros
|
||||
|
||||
.index wgtTreeViewSetSelected
|
||||
.index wgtTreeViewSetMultiSelect
|
||||
.index wgtTreeViewSetReorderable
|
||||
.index wgtTreeItemSetExpanded
|
||||
.index wgtTreeItemIsExpanded
|
||||
.index wgtTreeItemIsSelected
|
||||
.index wgtTreeItemSetSelected
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtTreeView(parent) Create a tree view control.
|
||||
wgtTreeItem(parent, text) Add a tree item as a child of the tree view or another tree item.
|
||||
wgtTreeViewGetSelected(w) Get the currently selected tree item (returns WidgetT *, NULL if none).
|
||||
wgtTreeViewSetSelected(w, item) Set the selected tree item.
|
||||
wgtTreeViewSetMultiSelect(w, multi) Enable or disable multi-selection.
|
||||
wgtTreeViewSetReorderable(w, reorderable) Enable drag-to-reorder of items.
|
||||
wgtTreeItemSetExpanded(w, expanded) Expand or collapse a tree item.
|
||||
wgtTreeItemIsExpanded(w) Check if a tree item is expanded.
|
||||
wgtTreeItemIsSelected(w) Check if a tree item is selected (multi-select mode).
|
||||
wgtTreeItemSetSelected(w, selected) Select or deselect a tree item.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
.table
|
||||
Callback Description
|
||||
-------- -----------
|
||||
onClick Fires when a tree item is clicked.
|
||||
onDblClick Fires when a tree item is double-clicked.
|
||||
onChange Fires when the selection changes.
|
||||
.endtable
|
||||
|
||||
.h3 Methods (BASIC Interface)
|
||||
|
||||
.table
|
||||
Method Description
|
||||
------ -----------
|
||||
SetMultiSelect Enable or disable multi-selection.
|
||||
SetReorderable Enable or disable drag-to-reorder.
|
||||
.endtable
|
||||
|
||||
.hr
|
||||
|
|
@ -1746,6 +1746,20 @@ void wgtTreeViewSetSelected(WidgetT *w, WidgetT *item) {
|
|||
VALIDATE_WIDGET_VOID(w, sTreeViewTypeId);
|
||||
|
||||
TreeViewDataT *tv = (TreeViewDataT *)w->data;
|
||||
|
||||
// Expand all ancestors so the item is visible in the tree
|
||||
if (item) {
|
||||
for (WidgetT *p = item->parent; p && p != w; p = p->parent) {
|
||||
if (p->type == sTreeItemTypeId) {
|
||||
TreeItemDataT *pti = (TreeItemDataT *)p->data;
|
||||
|
||||
if (pti && !pti->expanded) {
|
||||
pti->expanded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setSelectedItem(w, item);
|
||||
|
||||
if (tv->multiSelect && item) {
|
||||
|
|
|
|||
119
widgets/wgtsys.dhs
Normal file
119
widgets/wgtsys.dhs
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
.topic widget.base
|
||||
.title Base WidgetT (Common Properties, Events, and Operations)
|
||||
.toc 0 Widget System
|
||||
.default
|
||||
.index WidgetT
|
||||
.index Widget Base
|
||||
.index Common Properties
|
||||
.index Common Events
|
||||
|
||||
.h1 DVX Widget System
|
||||
|
||||
Complete reference for the DVX GUI widget toolkit. All widgets are implemented as dynamically loaded DXE modules. They are created via convenience macros that wrap the per-widget API function tables. The base WidgetT structure is defined in core/dvxWidget.h; individual widget headers live in widgets/.
|
||||
|
||||
Individual widgets are documented in their own sections. See the table of contents for the full list.
|
||||
|
||||
.h2 Base WidgetT (Common Properties, Events, and Operations)
|
||||
|
||||
Every widget inherits from the WidgetT structure defined in core/dvxWidget.h. The fields and callbacks listed here are available on all widget types.
|
||||
|
||||
.h3 Common Properties
|
||||
|
||||
.table
|
||||
Field Type Description
|
||||
----- ---- -----------
|
||||
name char[32] Widget name for lookup via wgtFind().
|
||||
x, y, w, h int32_t Computed geometry relative to the window content area (set by layout).
|
||||
minW, minH int32_t (tagged) Minimum size hints. Use wgtPixels(), wgtChars(), or wgtPercent(). 0 = auto.
|
||||
maxW, maxH int32_t (tagged) Maximum size constraints. 0 = no limit.
|
||||
prefW, prefH int32_t (tagged) Preferred size. 0 = auto.
|
||||
weight int32_t Extra-space distribution weight. 0 = fixed, 100 = normal. A widget with weight=200 gets twice the extra space of one with weight=100.
|
||||
align WidgetAlignE Main-axis alignment for children: AlignStartE, AlignCenterE, AlignEndE.
|
||||
spacing int32_t (tagged) Spacing between children (containers only). 0 = default.
|
||||
padding int32_t (tagged) Internal padding (containers only). 0 = default.
|
||||
fgColor uint32_t Foreground color override. 0 = use color scheme default.
|
||||
bgColor uint32_t Background color override. 0 = use color scheme default.
|
||||
visible bool Visibility state.
|
||||
enabled bool Enabled state. Disabled widgets are grayed out and ignore input.
|
||||
readOnly bool Read-only mode: allows scrolling/selection but blocks editing.
|
||||
swallowTab bool When true, Tab key goes to the widget instead of navigating focus.
|
||||
accelKey char Lowercase accelerator character. 0 if none.
|
||||
tooltip const char * Tooltip text. NULL = none. Caller owns the string.
|
||||
contextMenu MenuT * Right-click context menu. NULL = none. Caller owns.
|
||||
userData void * Application-defined user data pointer.
|
||||
.endtable
|
||||
|
||||
.h3 Size Specification Macros
|
||||
|
||||
.index wgtPixels
|
||||
.index wgtChars
|
||||
.index wgtPercent
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtPixels(v) Size in pixels.
|
||||
wgtChars(v) Size in character widths (multiplied by font charWidth).
|
||||
wgtPercent(v) Size as a percentage of parent dimension.
|
||||
.endtable
|
||||
|
||||
.h3 Common Events (Callbacks)
|
||||
|
||||
These callback function pointers are available on every WidgetT. Set them directly on the widget struct.
|
||||
|
||||
.index onClick
|
||||
.index onChange
|
||||
.index onKeyPress
|
||||
.index onKeyDown
|
||||
.index onMouseDown
|
||||
|
||||
.table
|
||||
Callback Signature Description
|
||||
-------- --------- -----------
|
||||
onClick void (*)(WidgetT *w) Fires on mouse click / activation.
|
||||
onDblClick void (*)(WidgetT *w) Fires on double-click.
|
||||
onChange void (*)(WidgetT *w) Fires when the widget's value changes (text, selection, check state, etc.).
|
||||
onFocus void (*)(WidgetT *w) Fires when the widget receives keyboard focus.
|
||||
onBlur void (*)(WidgetT *w) Fires when the widget loses keyboard focus.
|
||||
onKeyPress void (*)(WidgetT *w, int32_t keyAscii) Fires on a printable key press (ASCII value).
|
||||
onKeyDown void (*)(WidgetT *w, int32_t keyCode, int32_t shift) Fires on key down (scan code + shift state).
|
||||
onKeyUp void (*)(WidgetT *w, int32_t keyCode, int32_t shift) Fires on key up.
|
||||
onMouseDown void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse button press.
|
||||
onMouseUp void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse button release.
|
||||
onMouseMove void (*)(WidgetT *w, int32_t button, int32_t x, int32_t y) Fires on mouse movement over the widget.
|
||||
onScroll void (*)(WidgetT *w, int32_t delta) Fires on mouse wheel scroll.
|
||||
onValidate bool (*)(WidgetT *w) Validation callback. Return false to cancel a pending write.
|
||||
.endtable
|
||||
|
||||
.h3 Common Operations
|
||||
|
||||
.index wgtInitWindow
|
||||
.index wgtGetContext
|
||||
.index wgtInvalidate
|
||||
.index wgtSetText
|
||||
.index wgtGetText
|
||||
.index wgtSetEnabled
|
||||
.index wgtSetFocused
|
||||
.index wgtSetVisible
|
||||
.index wgtFind
|
||||
.index wgtDestroy
|
||||
|
||||
.table
|
||||
Function Description
|
||||
-------- -----------
|
||||
WidgetT *wgtInitWindow(AppContextT *ctx, WindowT *win) Initialize widgets for a window. Returns the root VBox container.
|
||||
AppContextT *wgtGetContext(const WidgetT *w) Walk up from any widget to retrieve the AppContextT.
|
||||
void wgtInvalidate(WidgetT *w) Mark widget for re-layout and repaint. Propagates to ancestors.
|
||||
void wgtInvalidatePaint(WidgetT *w) Mark widget for repaint only (no layout recalculation).
|
||||
void wgtSetText(WidgetT *w, const char *text) Set widget text (label, button, textinput, etc.).
|
||||
const char *wgtGetText(const WidgetT *w) Get widget text.
|
||||
void wgtSetEnabled(WidgetT *w, bool enabled) Enable or disable a widget.
|
||||
void wgtSetReadOnly(WidgetT *w, bool readOnly) Set read-only mode.
|
||||
void wgtSetFocused(WidgetT *w) Set keyboard focus to a widget.
|
||||
WidgetT *wgtGetFocused(void) Get the currently focused widget.
|
||||
void wgtSetVisible(WidgetT *w, bool visible) Show or hide a widget.
|
||||
void wgtSetName(WidgetT *w, const char *name) Set widget name for lookup.
|
||||
WidgetT *wgtFind(WidgetT *root, const char *name) Find a widget by name in the subtree.
|
||||
void wgtDestroy(WidgetT *w) Destroy a widget and all its children.
|
||||
void wgtSetTooltip(WidgetT *w, const char *text) Set tooltip text. Pass NULL to remove.
|
||||
.endtable
|
||||
|
|
@ -8,6 +8,7 @@ typedef struct {
|
|||
WidgetT *(*create)(WidgetT *parent);
|
||||
void (*scrollToChild)(WidgetT *sp, const WidgetT *child);
|
||||
void (*setNoBorder)(WidgetT *w, bool noBorder);
|
||||
void (*scrollToTop)(WidgetT *w);
|
||||
} ScrollPaneApiT;
|
||||
|
||||
static inline const ScrollPaneApiT *dvxScrollPaneApi(void) {
|
||||
|
|
@ -19,5 +20,6 @@ static inline const ScrollPaneApiT *dvxScrollPaneApi(void) {
|
|||
#define wgtScrollPane(parent) dvxScrollPaneApi()->create(parent)
|
||||
#define wgtScrollPaneScrollToChild(sp, child) dvxScrollPaneApi()->scrollToChild((sp), (child))
|
||||
#define wgtScrollPaneSetNoBorder(w, noBorder) dvxScrollPaneApi()->setNoBorder((w), (noBorder))
|
||||
#define wgtScrollPaneScrollToTop(w) dvxScrollPaneApi()->scrollToTop(w)
|
||||
|
||||
#endif // WIDGET_SCROLLPANE_H
|
||||
|
|
|
|||
51
widgets/wrapBox/wrapBox.dhs
Normal file
51
widgets/wrapBox/wrapBox.dhs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
.topic widget.wrapbox
|
||||
.title WrapBox
|
||||
.toc 1 WrapBox
|
||||
.index WrapBox
|
||||
.index wgtWrapBox
|
||||
|
||||
.h2 WrapBox
|
||||
|
||||
A flow/wrap layout container that arranges children left-to-right, wrapping to the next row when the available width is exceeded. Each row's height is the maximum child height in that row. Supports configurable spacing between items and rows, and per-row alignment for short rows.
|
||||
|
||||
Header: widgets/widgetWrapBox.h
|
||||
|
||||
.h3 Creation
|
||||
|
||||
.code
|
||||
WidgetT *wrap = wgtWrapBox(parent);
|
||||
wgtButton(wrap, "Tag 1");
|
||||
wgtButton(wrap, "Tag 2");
|
||||
wgtButton(wrap, "Tag 3");
|
||||
.endcode
|
||||
|
||||
.h3 Macro
|
||||
|
||||
.table
|
||||
Macro Description
|
||||
----- -----------
|
||||
wgtWrapBox(parent) Create a wrap box container.
|
||||
.endtable
|
||||
|
||||
.h3 Properties
|
||||
|
||||
WrapBox uses the common WidgetT container fields for layout control:
|
||||
|
||||
.table
|
||||
Property Description
|
||||
-------- -----------
|
||||
spacing Gap between children in both the horizontal and vertical directions (tagged size). Default is 4 pixels.
|
||||
padding Internal padding around children (tagged size). Default is 2 pixels.
|
||||
.endtable
|
||||
|
||||
.h3 Properties (BASIC Interface)
|
||||
|
||||
.table
|
||||
Property Type Access Description
|
||||
-------- ---- ------ -----------
|
||||
Alignment Enum (Left, Center, Right) Read/Write Row alignment for rows that do not fill the full width.
|
||||
.endtable
|
||||
|
||||
.h3 Events
|
||||
|
||||
WrapBox is a container widget. It uses the common events only. No widget-specific events are defined.
|
||||
Loading…
Add table
Reference in a new issue