mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-14 11:39:33 +00:00
Major refactoring
This commit is contained in:
parent
4e6a167f15
commit
0918df0d11
21 changed files with 8385 additions and 8228 deletions
423
InForm/InForm.bi
423
InForm/InForm.bi
|
@ -1,365 +1,118 @@
|
|||
'InForm - GUI library for QB64
|
||||
'Fellippe Heitor, 2016-2019 - fellippe@qb64.org - @fellippeheitor
|
||||
'
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm-PE GUI engine for QB64-PE
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2023 George McGinn
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF VERSION < 3.9.1 THEN
|
||||
$Error This requires the latest version of QB64-PE from https://github.com/QB64-Phoenix-Edition/QB64pe/releases
|
||||
$END IF
|
||||
$IF INFORM_BI = UNDEFINED THEN
|
||||
$LET INFORM_BI = TRUE
|
||||
|
||||
' TODO: Re-factor this file to use include guards. For now, we will just set the preprocessor variable
|
||||
$LET INFORM_BI = TRUE
|
||||
'$INCLUDE:'InFormCommon.bi'
|
||||
|
||||
DECLARE LIBRARY
|
||||
FUNCTION __UI_GetPID ALIAS getpid
|
||||
END DECLARE
|
||||
'Control types: -----------------------------------------------
|
||||
__UI_Type(__UI_Type_Form).Name = "Form"
|
||||
|
||||
DECLARE CUSTOMTYPE LIBRARY
|
||||
SUB __UI_MemCopy ALIAS memcpy (BYVAL dest AS _OFFSET, BYVAL source AS _OFFSET, BYVAL bytes AS LONG)
|
||||
END DECLARE
|
||||
__UI_Type(__UI_Type_Frame).Name = "Frame"
|
||||
__UI_Type(__UI_Type_Frame).DefaultWidth = 230
|
||||
__UI_Type(__UI_Type_Frame).DefaultHeight = 150
|
||||
|
||||
$IF WIN THEN
|
||||
DECLARE LIBRARY
|
||||
FUNCTION GetSystemMetrics& (BYVAL WhichMetric&)
|
||||
END DECLARE
|
||||
__UI_Type(__UI_Type_Button).Name = "Button"
|
||||
__UI_Type(__UI_Type_Button).DefaultWidth = 80
|
||||
__UI_Type(__UI_Type_Button).DefaultHeight = 23
|
||||
|
||||
CONST __UI_SM_SWAPBUTTON = 23
|
||||
$END IF
|
||||
__UI_Type(__UI_Type_Label).Name = "Label"
|
||||
__UI_Type(__UI_Type_Label).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_Label).DefaultHeight = 23
|
||||
|
||||
' InForm theme image IDs
|
||||
CONST __INFORM_THEME_IMAGE_ARROWS~%% = 1~%%
|
||||
CONST __INFORM_THEME_IMAGE_BUTTON~%% = 2~%%
|
||||
CONST __INFORM_THEME_IMAGE_CHECKBOX~%% = 3~%%
|
||||
CONST __INFORM_THEME_IMAGE_FRAME~%% = 4~%%
|
||||
CONST __INFORM_THEME_IMAGE_MENUCHECKMARK~%% = 5~%%
|
||||
CONST __INFORM_THEME_IMAGE_NOTFOUND~%% = 6~%%
|
||||
CONST __INFORM_THEME_IMAGE_PROGRESSCHUNK~%% = 7~%%
|
||||
CONST __INFORM_THEME_IMAGE_PROGRESSTRACK~%% = 8~%%
|
||||
CONST __INFORM_THEME_IMAGE_RADIOBUTTON~%% = 9~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLBUTTONS~%% = 10~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHBUTTONS~%% = 11~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHTHUMB~%% = 12~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHTRACK~%% = 13~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLTHUMB~%% = 14~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLTRACK~%% = 15~%%
|
||||
CONST __INFORM_THEME_IMAGE_SLIDERDOWN~%% = 16~%%
|
||||
CONST __INFORM_THEME_IMAGE_SLIDERTRACK~%% = 17~%%
|
||||
__UI_Type(__UI_Type_CheckBox).Name = "CheckBox"
|
||||
__UI_Type(__UI_Type_CheckBox).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_CheckBox).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_CheckBox).TurnsInto = __UI_Type_ToggleSwitch
|
||||
|
||||
'$INCLUDE:'extensions/HashTable.bi'
|
||||
__UI_Type(__UI_Type_RadioButton).Name = "RadioButton"
|
||||
__UI_Type(__UI_Type_RadioButton).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_RadioButton).DefaultHeight = 23
|
||||
|
||||
$SCREENHIDE
|
||||
_CONTROLCHR OFF
|
||||
__UI_Type(__UI_Type_TextBox).Name = "TextBox"
|
||||
__UI_Type(__UI_Type_TextBox).DefaultWidth = 120
|
||||
__UI_Type(__UI_Type_TextBox).DefaultHeight = 23
|
||||
|
||||
TYPE __UI_ControlTYPE
|
||||
ID AS LONG
|
||||
ParentID AS LONG
|
||||
PreviousParentID AS LONG
|
||||
ContextMenuID AS LONG
|
||||
Type AS INTEGER
|
||||
Name AS STRING * 40
|
||||
ParentName AS STRING * 40
|
||||
SubMenu AS _BYTE
|
||||
MenuPanelID AS LONG
|
||||
SourceControl AS LONG
|
||||
Top AS INTEGER
|
||||
Left AS INTEGER
|
||||
Width AS INTEGER
|
||||
Height AS INTEGER
|
||||
Canvas AS LONG
|
||||
HelperCanvas AS LONG
|
||||
TransparentColor AS _UNSIGNED LONG
|
||||
Stretch AS _BYTE
|
||||
PreviousStretch AS _BYTE
|
||||
Font AS INTEGER
|
||||
PreviousFont AS INTEGER
|
||||
BackColor AS _UNSIGNED LONG
|
||||
ForeColor AS _UNSIGNED LONG
|
||||
SelectedForeColor AS _UNSIGNED LONG
|
||||
SelectedBackColor AS _UNSIGNED LONG
|
||||
BackStyle AS _BYTE
|
||||
HasBorder AS _BYTE
|
||||
BorderSize AS INTEGER
|
||||
Padding AS INTEGER
|
||||
Encoding AS LONG
|
||||
Align AS _BYTE
|
||||
PrevAlign AS _BYTE
|
||||
VAlign AS _BYTE
|
||||
PrevVAlign AS _BYTE
|
||||
BorderColor AS _UNSIGNED LONG
|
||||
Value AS _FLOAT
|
||||
PreviousValue AS _FLOAT
|
||||
Min AS _FLOAT
|
||||
PrevMin AS _FLOAT
|
||||
Max AS _FLOAT
|
||||
PrevMax AS _FLOAT
|
||||
Interval AS _FLOAT
|
||||
PrevInterval AS _FLOAT
|
||||
MinInterval AS _FLOAT
|
||||
PrevMinInterval AS _FLOAT
|
||||
HotKey AS INTEGER
|
||||
HotKeyOffset AS INTEGER
|
||||
HotKeyPosition AS INTEGER
|
||||
ShowPercentage AS _BYTE
|
||||
AutoScroll AS _BYTE
|
||||
AutoSize AS _BYTE
|
||||
InputViewStart AS LONG
|
||||
PreviousInputViewStart AS LONG
|
||||
LastVisibleItem AS INTEGER
|
||||
ItemHeight AS INTEGER
|
||||
HasVScrollbar AS _BYTE
|
||||
VScrollbarButton2Top AS INTEGER
|
||||
HoveringVScrollbarButton AS _BYTE
|
||||
ThumbHeight AS INTEGER
|
||||
ThumbTop AS INTEGER
|
||||
VScrollbarRatio AS SINGLE
|
||||
Cursor AS LONG
|
||||
PasswordField AS _BYTE
|
||||
PrevCursor AS LONG
|
||||
FieldArea AS LONG
|
||||
PreviousFieldArea AS LONG
|
||||
TextIsSelected AS _BYTE
|
||||
BypassSelectOnFocus AS _BYTE
|
||||
Multiline AS _BYTE
|
||||
NumericOnly AS _BYTE
|
||||
FirstVisibleLine AS LONG
|
||||
PrevFirstVisibleLine AS LONG
|
||||
CurrentLine AS LONG
|
||||
PrevCurrentLine AS LONG
|
||||
VisibleCursor AS LONG
|
||||
PrevVisibleCursor AS LONG
|
||||
ControlIsSelected AS _BYTE
|
||||
LeftOffsetFromFirstSelected AS INTEGER
|
||||
TopOffsetFromFirstSelected AS INTEGER
|
||||
SelectionLength AS LONG
|
||||
SelectionStart AS LONG
|
||||
WordWrap AS _BYTE
|
||||
CanResize AS _BYTE
|
||||
CanHaveFocus AS _BYTE
|
||||
Disabled AS _BYTE
|
||||
Hidden AS _BYTE
|
||||
PreviouslyHidden AS _BYTE
|
||||
CenteredWindow AS _BYTE
|
||||
ControlState AS _BYTE
|
||||
ChildrenRedrawn AS _BYTE
|
||||
FocusState AS LONG
|
||||
LastChange AS SINGLE
|
||||
Redraw AS _BYTE
|
||||
BulletStyle AS _BYTE
|
||||
MenuItemGroup AS INTEGER
|
||||
KeyCombo AS LONG
|
||||
BoundTo AS LONG
|
||||
BoundProperty AS LONG
|
||||
END TYPE
|
||||
__UI_Type(__UI_Type_ProgressBar).Name = "ProgressBar"
|
||||
__UI_Type(__UI_Type_ProgressBar).DefaultWidth = 300
|
||||
__UI_Type(__UI_Type_ProgressBar).DefaultHeight = 23
|
||||
|
||||
TYPE __UI_Types
|
||||
Name AS STRING * 16
|
||||
Count AS LONG
|
||||
TurnsInto AS INTEGER
|
||||
DefaultHeight AS INTEGER
|
||||
MinimumHeight AS INTEGER
|
||||
DefaultWidth AS INTEGER
|
||||
MinimumWidth AS INTEGER
|
||||
RestrictResize AS _BYTE
|
||||
END TYPE
|
||||
__UI_Type(__UI_Type_ListBox).Name = "ListBox"
|
||||
__UI_Type(__UI_Type_ListBox).DefaultWidth = 200
|
||||
__UI_Type(__UI_Type_ListBox).DefaultHeight = 200
|
||||
__UI_Type(__UI_Type_ListBox).TurnsInto = __UI_Type_DropdownList
|
||||
|
||||
TYPE __UI_WordWrapHistoryType
|
||||
StringSlot AS LONG
|
||||
Width AS INTEGER
|
||||
LongestLine AS INTEGER
|
||||
Font AS LONG
|
||||
TotalLines AS INTEGER
|
||||
END TYPE
|
||||
__UI_Type(__UI_Type_DropdownList).Name = "DropdownList"
|
||||
__UI_Type(__UI_Type_DropdownList).DefaultWidth = 200
|
||||
__UI_Type(__UI_Type_DropdownList).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_DropdownList).TurnsInto = __UI_Type_ListBox
|
||||
|
||||
TYPE __UI_KeyCombos
|
||||
Combo AS STRING * 14 ' "CTRL+SHIFT+F12"
|
||||
FriendlyCombo AS STRING * 14 ' "Ctrl+Shift+F12"
|
||||
ControlID AS LONG
|
||||
END TYPE
|
||||
__UI_Type(__UI_Type_MenuBar).Name = "MenuBar"
|
||||
__UI_Type(__UI_Type_MenuBar).TurnsInto = __UI_Type_ContextMenu
|
||||
__UI_Type(__UI_Type_MenuBar).RestrictResize = __UI_CantResizeV
|
||||
|
||||
REDIM SHARED Caption(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempCaptions(0 TO 100) AS STRING
|
||||
REDIM SHARED Text(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempTexts(0 TO 100) AS STRING
|
||||
REDIM SHARED Mask(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempMask(0 TO 100) AS STRING
|
||||
REDIM SHARED ToolTip(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempTips(0 TO 100) AS STRING
|
||||
REDIM SHARED Control(0 TO 100) AS __UI_ControlTYPE
|
||||
REDIM SHARED ControlDrawOrder(0) AS LONG
|
||||
REDIM __UI_ThemeImages(0 TO 0) AS HashTableType
|
||||
REDIM SHARED __UI_WordWrapHistoryTexts(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_WordWrapHistoryResults(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_WordWrapHistory(0 TO 100) AS __UI_WordWrapHistoryType
|
||||
REDIM SHARED __UI_ThisLineChars(0) AS LONG, __UI_FocusedTextBoxChars(0) AS LONG
|
||||
REDIM SHARED __UI_ActiveMenu(0 TO 100) AS LONG, __UI_ParentMenu(0 TO 100) AS LONG
|
||||
REDIM SHARED __UI_KeyCombo(0 TO 100) AS __UI_KeyCombos
|
||||
__UI_Type(__UI_Type_MenuItem).Name = "MenuItem"
|
||||
__UI_Type(__UI_Type_MenuItem).RestrictResize = __UI_CantResizeV
|
||||
|
||||
DIM SHARED __UI_TotalKeyCombos AS LONG, __UI_BypassKeyCombos AS _BYTE
|
||||
DIM SHARED table1252$(0 TO 255), table437$(0 TO 255)
|
||||
DIM SHARED __UI_MouseLeft AS INTEGER, __UI_MouseTop AS INTEGER
|
||||
DIM SHARED __UI_MouseWheel AS INTEGER, __UI_MouseButtonsSwap AS _BYTE
|
||||
DIM SHARED __UI_PrevMouseLeft AS INTEGER, __UI_PrevMouseTop AS INTEGER
|
||||
DIM SHARED __UI_MouseButton1 AS _BYTE, __UI_MouseButton2 AS _BYTE
|
||||
DIM SHARED __UI_MouseIsDown AS _BYTE, __UI_MouseDownOnID AS LONG
|
||||
DIM SHARED __UI_Mouse2IsDown AS _BYTE, __UI_Mouse2DownOnID AS LONG
|
||||
DIM SHARED __UI_PreviousMouseDownOnID AS LONG
|
||||
DIM SHARED __UI_KeyIsDown AS _BYTE, __UI_KeyDownOnID AS LONG
|
||||
DIM SHARED __UI_ShiftIsDown AS _BYTE, __UI_CtrlIsDown AS _BYTE
|
||||
DIM SHARED __UI_AltIsDown AS _BYTE, __UI_ShowHotKeys AS _BYTE, __UI_AltCombo$
|
||||
DIM SHARED __UI_LastMouseClick AS SINGLE, __UI_MouseDownOnScrollbar AS SINGLE
|
||||
DIM SHARED __UI_DragX AS INTEGER, __UI_DragY AS INTEGER
|
||||
DIM SHARED __UI_DefaultButtonID AS LONG
|
||||
DIM SHARED __UI_KeyHit AS LONG, __UI_KeepFocus AS _BYTE
|
||||
DIM SHARED __UI_Focus AS LONG, __UI_PreviousFocus AS LONG, __UI_KeyboardFocus AS _BYTE
|
||||
DIM SHARED __UI_HoveringID AS LONG, __UI_LastHoveringID AS LONG, __UI_BelowHoveringID AS LONG
|
||||
DIM SHARED __UI_IsDragging AS _BYTE, __UI_DraggingID AS LONG
|
||||
DIM SHARED __UI_IsResizing AS _BYTE, __UI_ResizingID AS LONG
|
||||
DIM SHARED __UI_ResizeHandleHover AS _BYTE
|
||||
DIM SHARED __UI_IsSelectingText AS _BYTE, __UI_IsSelectingTextOnID AS LONG
|
||||
DIM SHARED __UI_SelectedText AS STRING, __UI_SelectionLength AS LONG
|
||||
DIM SHARED __UI_StateHasChanged AS _BYTE
|
||||
DIM SHARED __UI_DraggingThumb AS _BYTE, __UI_ThumbDragTop AS INTEGER
|
||||
DIM SHARED __UI_DraggingThumbOnID AS LONG
|
||||
DIM SHARED __UI_HasInput AS _BYTE, __UI_ProcessInputTimer AS SINGLE
|
||||
DIM SHARED __UI_UnloadSignal AS _BYTE, __UI_HasResized AS _BYTE
|
||||
DIM SHARED __UI_ExitTriggered AS _BYTE
|
||||
DIM SHARED __UI_Loaded AS _BYTE
|
||||
DIM SHARED __UI_EventsTimer AS INTEGER, __UI_RefreshTimer AS INTEGER
|
||||
DIM SHARED __UI_ActiveDropdownList AS LONG, __UI_ParentDropdownList AS LONG
|
||||
DIM SHARED __UI_TotalActiveMenus AS LONG, __UI_ActiveMenuIsContextMenu AS _BYTE
|
||||
DIM SHARED __UI_SubMenuDelay AS SINGLE, __UI_HoveringSubMenu AS _BYTE
|
||||
DIM SHARED __UI_TopMenuBarItem AS LONG
|
||||
DIM SHARED __UI_ActiveTipID AS LONG, __UI_TipTimer AS SINGLE, __UI_PreviousTipID AS LONG
|
||||
DIM SHARED __UI_ActiveTipTop AS INTEGER, __UI_ActiveTipLeft AS INTEGER
|
||||
DIM SHARED __UI_FormID AS LONG, __UI_HasMenuBar AS LONG
|
||||
DIM SHARED __UI_ScrollbarWidth AS INTEGER, __UI_ScrollbarButtonHeight AS INTEGER
|
||||
DIM SHARED __UI_MenuBarOffset AS INTEGER, __UI_MenuItemOffset AS INTEGER
|
||||
DIM SHARED __UI_NewMenuBarTextLeft AS INTEGER, __UI_DefaultCaptionIndent AS INTEGER
|
||||
DIM SHARED __UI_ForceRedraw AS _BYTE, __UI_AutoRefresh AS _BYTE
|
||||
DIM SHARED __UI_CurrentTitle AS STRING
|
||||
DIM SHARED __UI_DesignMode AS _BYTE, __UI_FirstSelectedID AS LONG
|
||||
DIM SHARED __UI_WaitMessage AS STRING, __UI_TotalSelectedControls AS LONG
|
||||
DIM SHARED __UI_WaitMessageHandle AS LONG, __UI_EditorMode AS _BYTE
|
||||
DIM SHARED __UI_LastRenderedCharCount AS LONG
|
||||
DIM SHARED __UI_SelectionRectangleTop AS INTEGER, __UI_SelectionRectangleLeft AS INTEGER
|
||||
DIM SHARED __UI_SelectionRectangle AS _BYTE
|
||||
DIM SHARED __UI_CantShowContextMenu AS _BYTE, __UI_ShowPositionAndSize AS _BYTE
|
||||
DIM SHARED __UI_ShowInvisibleControls AS _BYTE, __UI_Snapped AS _BYTE
|
||||
DIM SHARED __UI_SnappedByProximityX AS _BYTE, __UI_SnappedByProximityY AS _BYTE
|
||||
DIM SHARED __UI_SnappedX AS INTEGER, __UI_SnappedY AS INTEGER
|
||||
DIM SHARED __UI_SnappedXID AS LONG, __UI_SnappedYID AS LONG
|
||||
DIM SHARED __UI_SnapLines AS _BYTE, __UI_SnapDistance AS INTEGER, __UI_SnapDistanceFromForm AS INTEGER
|
||||
DIM SHARED __UI_FrameRate AS SINGLE, __UI_Font8Offset AS INTEGER, __UI_Font16Offset AS INTEGER
|
||||
DIM SHARED __UI_ClipboardCheck$, __UI_MenuBarOffsetV AS INTEGER
|
||||
DIM SHARED __UI_KeepScreenHidden AS _BYTE, __UI_MaxBorderSize AS INTEGER
|
||||
DIM SHARED __UI_InternalContextMenus AS LONG, __UI_DidClick AS _BYTE
|
||||
DIM SHARED __UI_ContextMenuSourceID AS LONG
|
||||
DIM SHARED __UI_FKey(1 TO 12) AS LONG
|
||||
__UI_Type(__UI_Type_MenuPanel).Name = "MenuPanel"
|
||||
|
||||
'Control types: -----------------------------------------------
|
||||
DIM SHARED __UI_Type(0 TO 18) AS __UI_Types
|
||||
__UI_Type(__UI_Type_Form).Name = "Form"
|
||||
__UI_Type(__UI_Type_PictureBox).Name = "PictureBox"
|
||||
__UI_Type(__UI_Type_PictureBox).DefaultWidth = 230
|
||||
__UI_Type(__UI_Type_PictureBox).DefaultHeight = 150
|
||||
|
||||
__UI_Type(__UI_Type_Frame).Name = "Frame"
|
||||
__UI_Type(__UI_Type_Frame).DefaultWidth = 230
|
||||
__UI_Type(__UI_Type_Frame).DefaultHeight = 150
|
||||
__UI_Type(__UI_Type_TrackBar).Name = "TrackBar"
|
||||
__UI_Type(__UI_Type_TrackBar).DefaultWidth = 300
|
||||
__UI_Type(__UI_Type_TrackBar).DefaultHeight = 40
|
||||
__UI_Type(__UI_Type_TrackBar).MinimumHeight = 30
|
||||
__UI_Type(__UI_Type_TrackBar).RestrictResize = __UI_CantResizeV
|
||||
|
||||
__UI_Type(__UI_Type_Button).Name = "Button"
|
||||
__UI_Type(__UI_Type_Button).DefaultWidth = 80
|
||||
__UI_Type(__UI_Type_Button).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_ContextMenu).Name = "ContextMenu"
|
||||
__UI_Type(__UI_Type_ContextMenu).TurnsInto = __UI_Type_MenuBar
|
||||
__UI_Type(__UI_Type_ContextMenu).RestrictResize = __UI_CantResize
|
||||
__UI_Type(__UI_Type_ContextMenu).DefaultWidth = 22
|
||||
__UI_Type(__UI_Type_ContextMenu).DefaultHeight = 22
|
||||
|
||||
__UI_Type(__UI_Type_Label).Name = "Label"
|
||||
__UI_Type(__UI_Type_Label).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_Label).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_Font).Name = "Font"
|
||||
|
||||
__UI_Type(__UI_Type_CheckBox).Name = "CheckBox"
|
||||
__UI_Type(__UI_Type_CheckBox).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_CheckBox).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_CheckBox).TurnsInto = __UI_Type_ToggleSwitch
|
||||
__UI_Type(__UI_Type_ToggleSwitch).Name = "ToggleSwitch"
|
||||
__UI_Type(__UI_Type_ToggleSwitch).DefaultWidth = 40
|
||||
__UI_Type(__UI_Type_ToggleSwitch).DefaultHeight = 17
|
||||
__UI_Type(__UI_Type_ToggleSwitch).TurnsInto = __UI_Type_CheckBox
|
||||
__UI_Type(__UI_Type_ToggleSwitch).RestrictResize = __UI_CantResize
|
||||
'--------------------------------------------------------------
|
||||
|
||||
__UI_Type(__UI_Type_RadioButton).Name = "RadioButton"
|
||||
__UI_Type(__UI_Type_RadioButton).DefaultWidth = 150
|
||||
__UI_Type(__UI_Type_RadioButton).DefaultHeight = 23
|
||||
$SCREENHIDE
|
||||
_CONTROLCHR OFF
|
||||
|
||||
__UI_Type(__UI_Type_TextBox).Name = "TextBox"
|
||||
__UI_Type(__UI_Type_TextBox).DefaultWidth = 120
|
||||
__UI_Type(__UI_Type_TextBox).DefaultHeight = 23
|
||||
__UI_RestoreFKeys
|
||||
|
||||
__UI_Type(__UI_Type_ProgressBar).Name = "ProgressBar"
|
||||
__UI_Type(__UI_Type_ProgressBar).DefaultWidth = 300
|
||||
__UI_Type(__UI_Type_ProgressBar).DefaultHeight = 23
|
||||
__UI_SubMenuDelay = .4
|
||||
__UI_SnapDistance = 5
|
||||
__UI_SnapDistanceFromForm = 10
|
||||
__UI_MaxBorderSize = 10
|
||||
__UI_Font8Offset = 5
|
||||
__UI_Font16Offset = 3
|
||||
__UI_ClipboardCheck$ = "InForm" + STRING$(2, 10) + "BEGIN CONTROL DATA" + CHR$(10) + STRING$(60, 45) + CHR$(10)
|
||||
|
||||
__UI_Type(__UI_Type_ListBox).Name = "ListBox"
|
||||
__UI_Type(__UI_Type_ListBox).DefaultWidth = 200
|
||||
__UI_Type(__UI_Type_ListBox).DefaultHeight = 200
|
||||
__UI_Type(__UI_Type_ListBox).TurnsInto = __UI_Type_DropdownList
|
||||
__UI_ThemeSetup
|
||||
__UI_InternalMenus
|
||||
__UI_LoadForm
|
||||
|
||||
__UI_Type(__UI_Type_DropdownList).Name = "DropdownList"
|
||||
__UI_Type(__UI_Type_DropdownList).DefaultWidth = 200
|
||||
__UI_Type(__UI_Type_DropdownList).DefaultHeight = 23
|
||||
__UI_Type(__UI_Type_DropdownList).TurnsInto = __UI_Type_ListBox
|
||||
__UI_Init
|
||||
|
||||
__UI_Type(__UI_Type_MenuBar).Name = "MenuBar"
|
||||
__UI_Type(__UI_Type_MenuBar).TurnsInto = __UI_Type_ContextMenu
|
||||
__UI_Type(__UI_Type_MenuBar).RestrictResize = __UI_CantResizeV
|
||||
|
||||
__UI_Type(__UI_Type_MenuItem).Name = "MenuItem"
|
||||
__UI_Type(__UI_Type_MenuItem).RestrictResize = __UI_CantResizeV
|
||||
|
||||
__UI_Type(__UI_Type_MenuPanel).Name = "MenuPanel"
|
||||
|
||||
__UI_Type(__UI_Type_PictureBox).Name = "PictureBox"
|
||||
__UI_Type(__UI_Type_PictureBox).DefaultWidth = 230
|
||||
__UI_Type(__UI_Type_PictureBox).DefaultHeight = 150
|
||||
|
||||
__UI_Type(__UI_Type_TrackBar).Name = "TrackBar"
|
||||
__UI_Type(__UI_Type_TrackBar).DefaultWidth = 300
|
||||
__UI_Type(__UI_Type_TrackBar).DefaultHeight = 40
|
||||
__UI_Type(__UI_Type_TrackBar).MinimumHeight = 30
|
||||
__UI_Type(__UI_Type_TrackBar).RestrictResize = __UI_CantResizeV
|
||||
|
||||
__UI_Type(__UI_Type_ContextMenu).Name = "ContextMenu"
|
||||
__UI_Type(__UI_Type_ContextMenu).TurnsInto = __UI_Type_MenuBar
|
||||
__UI_Type(__UI_Type_ContextMenu).RestrictResize = __UI_CantResize
|
||||
__UI_Type(__UI_Type_ContextMenu).DefaultWidth = 22
|
||||
__UI_Type(__UI_Type_ContextMenu).DefaultHeight = 22
|
||||
|
||||
__UI_Type(__UI_Type_Font).Name = "Font"
|
||||
|
||||
__UI_Type(__UI_Type_ToggleSwitch).Name = "ToggleSwitch"
|
||||
__UI_Type(__UI_Type_ToggleSwitch).DefaultWidth = 40
|
||||
__UI_Type(__UI_Type_ToggleSwitch).DefaultHeight = 17
|
||||
__UI_Type(__UI_Type_ToggleSwitch).TurnsInto = __UI_Type_CheckBox
|
||||
__UI_Type(__UI_Type_ToggleSwitch).RestrictResize = __UI_CantResize
|
||||
'--------------------------------------------------------------
|
||||
|
||||
__UI_RestoreFKeys
|
||||
|
||||
CONST FALSE = 0, TRUE = Not FALSE
|
||||
|
||||
'$INCLUDE:'InFormVersion.bas'
|
||||
__UI_SubMenuDelay = .4
|
||||
__UI_SnapDistance = 5
|
||||
__UI_SnapDistanceFromForm = 10
|
||||
__UI_MaxBorderSize = 10
|
||||
__UI_Font8Offset = 5
|
||||
__UI_Font16Offset = 3
|
||||
__UI_ClipboardCheck$ = "InForm" + STRING$(2, 10) + "BEGIN CONTROL DATA" + CHR$(10) + STRING$(60, 45) + CHR$(10)
|
||||
|
||||
__UI_ThemeSetup
|
||||
__UI_InternalMenus
|
||||
__UI_LoadForm
|
||||
|
||||
__UI_Init
|
||||
|
||||
'Main loop
|
||||
DO
|
||||
'Main loop
|
||||
DO
|
||||
_LIMIT 1
|
||||
LOOP
|
||||
LOOP
|
||||
|
||||
SYSTEM
|
||||
SYSTEM
|
||||
|
||||
__UI_ErrorHandler:
|
||||
RESUME NEXT
|
||||
__UI_ErrorHandler:
|
||||
RESUME NEXT
|
||||
|
||||
'$INCLUDE:'extensions/Base64.bas'
|
||||
'$INCLUDE:'extensions/HashTable.bas'
|
||||
$END IF
|
||||
|
|
1823
InForm/InForm.ui
1823
InForm/InForm.ui
File diff suppressed because it is too large
Load diff
310
InForm/InFormCommon.bi
Normal file
310
InForm/InFormCommon.bi
Normal file
|
@ -0,0 +1,310 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' Common InForm header. This is included by the main InForm header file
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF INFORMCOMMON_BI = UNDEFINED THEN
|
||||
$LET INFORMCOMMON_BI = TRUE
|
||||
|
||||
' Do a complier check to ensure we have the minimum version needed
|
||||
$IF VERSION < 3.11.0 THEN
|
||||
$ERROR 'This requires the latest version of QB64-PE from https://github.com/QB64-Phoenix-Edition/QB64pe/releases'
|
||||
$END IF
|
||||
|
||||
'$INCLUDE:'InFormVersion.bi'
|
||||
'$INCLUDE:'extensions/HashTable.bi'
|
||||
'$INCLUDE:'extensions/MessageBox.bi'
|
||||
|
||||
CONST FALSE%% = 0%%, TRUE%% = NOT FALSE
|
||||
|
||||
' InForm theme image IDs
|
||||
CONST __INFORM_THEME_IMAGE_ARROWS~%% = 1~%%
|
||||
CONST __INFORM_THEME_IMAGE_BUTTON~%% = 2~%%
|
||||
CONST __INFORM_THEME_IMAGE_CHECKBOX~%% = 3~%%
|
||||
CONST __INFORM_THEME_IMAGE_FRAME~%% = 4~%%
|
||||
CONST __INFORM_THEME_IMAGE_MENUCHECKMARK~%% = 5~%%
|
||||
CONST __INFORM_THEME_IMAGE_NOTFOUND~%% = 6~%%
|
||||
CONST __INFORM_THEME_IMAGE_PROGRESSCHUNK~%% = 7~%%
|
||||
CONST __INFORM_THEME_IMAGE_PROGRESSTRACK~%% = 8~%%
|
||||
CONST __INFORM_THEME_IMAGE_RADIOBUTTON~%% = 9~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLBUTTONS~%% = 10~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHBUTTONS~%% = 11~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHTHUMB~%% = 12~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLHTRACK~%% = 13~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLTHUMB~%% = 14~%%
|
||||
CONST __INFORM_THEME_IMAGE_SCROLLTRACK~%% = 15~%%
|
||||
CONST __INFORM_THEME_IMAGE_SLIDERDOWN~%% = 16~%%
|
||||
CONST __INFORM_THEME_IMAGE_SLIDERTRACK~%% = 17~%%
|
||||
|
||||
'Control types:
|
||||
CONST __UI_Type_Form%% = 1%%
|
||||
CONST __UI_Type_Frame%% = 2%%
|
||||
CONST __UI_Type_Button%% = 3%%
|
||||
CONST __UI_Type_Label%% = 4%%
|
||||
CONST __UI_Type_CheckBox%% = 5%%
|
||||
CONST __UI_Type_RadioButton%% = 6%%
|
||||
CONST __UI_Type_TextBox%% = 7%%
|
||||
CONST __UI_Type_ProgressBar%% = 8%%
|
||||
CONST __UI_Type_ListBox%% = 9%%
|
||||
CONST __UI_Type_DropdownList%% = 10%%
|
||||
CONST __UI_Type_MenuBar%% = 11%%
|
||||
CONST __UI_Type_MenuItem%% = 12%%
|
||||
CONST __UI_Type_MenuPanel%% = 13%%
|
||||
CONST __UI_Type_PictureBox%% = 14%%
|
||||
CONST __UI_Type_TrackBar%% = 15%%
|
||||
CONST __UI_Type_ContextMenu%% = 16%%
|
||||
CONST __UI_Type_Font%% = 17%%
|
||||
CONST __UI_Type_ToggleSwitch%% = 18%%
|
||||
|
||||
'Back styles:
|
||||
CONST __UI_Opaque%% = 0%%
|
||||
CONST __UI_Transparent%% = -1%%
|
||||
|
||||
'Text alignment
|
||||
CONST __UI_Left%% = 0%%
|
||||
CONST __UI_Center%% = 1%%
|
||||
CONST __UI_Right%% = 2%%
|
||||
CONST __UI_Top%% = 0%%
|
||||
CONST __UI_Middle%% = 1%%
|
||||
CONST __UI_Bottom%% = 2%%
|
||||
|
||||
'Textbox controls
|
||||
CONST __UI_NumericWithoutBounds%% = -1%%
|
||||
CONST __UI_NumericWithBounds%% = 2%%
|
||||
|
||||
'BulletStyle
|
||||
CONST __UI_CheckMark%% = 0%%
|
||||
CONST __UI_Bullet%% = 1%%
|
||||
|
||||
'General constants
|
||||
CONST __UI_ToolTipTimeOut! = 0.8!
|
||||
CONST __UI_CantResizeV%% = 1%%
|
||||
CONST __UI_CantResizeH%% = 2%%
|
||||
CONST __UI_CantResize%% = 3%%
|
||||
|
||||
DECLARE LIBRARY
|
||||
FUNCTION __UI_GetPID ALIAS getpid
|
||||
END DECLARE
|
||||
|
||||
DECLARE CUSTOMTYPE LIBRARY
|
||||
SUB __UI_MemCopy ALIAS memcpy (BYVAL dest AS _OFFSET, BYVAL source AS _OFFSET, BYVAL bytes AS LONG)
|
||||
END DECLARE
|
||||
|
||||
$IF WIN THEN
|
||||
DECLARE LIBRARY
|
||||
FUNCTION GetSystemMetrics& (BYVAL WhichMetric&)
|
||||
END DECLARE
|
||||
|
||||
CONST __UI_SM_SWAPBUTTON = 23
|
||||
$END IF
|
||||
|
||||
TYPE __UI_ControlTYPE
|
||||
ID AS LONG
|
||||
ParentID AS LONG
|
||||
PreviousParentID AS LONG
|
||||
ContextMenuID AS LONG
|
||||
Type AS INTEGER
|
||||
Name AS STRING * 40
|
||||
ParentName AS STRING * 40
|
||||
SubMenu AS _BYTE
|
||||
MenuPanelID AS LONG
|
||||
SourceControl AS LONG
|
||||
Top AS INTEGER
|
||||
Left AS INTEGER
|
||||
Width AS INTEGER
|
||||
Height AS INTEGER
|
||||
Canvas AS LONG
|
||||
HelperCanvas AS LONG
|
||||
TransparentColor AS _UNSIGNED LONG
|
||||
Stretch AS _BYTE
|
||||
PreviousStretch AS _BYTE
|
||||
Font AS INTEGER
|
||||
PreviousFont AS INTEGER
|
||||
BackColor AS _UNSIGNED LONG
|
||||
ForeColor AS _UNSIGNED LONG
|
||||
SelectedForeColor AS _UNSIGNED LONG
|
||||
SelectedBackColor AS _UNSIGNED LONG
|
||||
BackStyle AS _BYTE
|
||||
HasBorder AS _BYTE
|
||||
BorderSize AS INTEGER
|
||||
Padding AS INTEGER
|
||||
Encoding AS LONG
|
||||
Align AS _BYTE
|
||||
PrevAlign AS _BYTE
|
||||
VAlign AS _BYTE
|
||||
PrevVAlign AS _BYTE
|
||||
BorderColor AS _UNSIGNED LONG
|
||||
Value AS _FLOAT
|
||||
PreviousValue AS _FLOAT
|
||||
Min AS _FLOAT
|
||||
PrevMin AS _FLOAT
|
||||
Max AS _FLOAT
|
||||
PrevMax AS _FLOAT
|
||||
Interval AS _FLOAT
|
||||
PrevInterval AS _FLOAT
|
||||
MinInterval AS _FLOAT
|
||||
PrevMinInterval AS _FLOAT
|
||||
HotKey AS INTEGER
|
||||
HotKeyOffset AS INTEGER
|
||||
HotKeyPosition AS INTEGER
|
||||
ShowPercentage AS _BYTE
|
||||
AutoScroll AS _BYTE
|
||||
AutoSize AS _BYTE
|
||||
InputViewStart AS LONG
|
||||
PreviousInputViewStart AS LONG
|
||||
LastVisibleItem AS INTEGER
|
||||
ItemHeight AS INTEGER
|
||||
HasVScrollbar AS _BYTE
|
||||
VScrollbarButton2Top AS INTEGER
|
||||
HoveringVScrollbarButton AS _BYTE
|
||||
ThumbHeight AS INTEGER
|
||||
ThumbTop AS INTEGER
|
||||
VScrollbarRatio AS SINGLE
|
||||
Cursor AS LONG
|
||||
PasswordField AS _BYTE
|
||||
PrevCursor AS LONG
|
||||
FieldArea AS LONG
|
||||
PreviousFieldArea AS LONG
|
||||
TextIsSelected AS _BYTE
|
||||
BypassSelectOnFocus AS _BYTE
|
||||
Multiline AS _BYTE
|
||||
NumericOnly AS _BYTE
|
||||
FirstVisibleLine AS LONG
|
||||
PrevFirstVisibleLine AS LONG
|
||||
CurrentLine AS LONG
|
||||
PrevCurrentLine AS LONG
|
||||
VisibleCursor AS LONG
|
||||
PrevVisibleCursor AS LONG
|
||||
ControlIsSelected AS _BYTE
|
||||
LeftOffsetFromFirstSelected AS INTEGER
|
||||
TopOffsetFromFirstSelected AS INTEGER
|
||||
SelectionLength AS LONG
|
||||
SelectionStart AS LONG
|
||||
WordWrap AS _BYTE
|
||||
CanResize AS _BYTE
|
||||
CanHaveFocus AS _BYTE
|
||||
Disabled AS _BYTE
|
||||
Hidden AS _BYTE
|
||||
PreviouslyHidden AS _BYTE
|
||||
CenteredWindow AS _BYTE
|
||||
ControlState AS _BYTE
|
||||
ChildrenRedrawn AS _BYTE
|
||||
FocusState AS LONG
|
||||
LastChange AS SINGLE
|
||||
Redraw AS _BYTE
|
||||
BulletStyle AS _BYTE
|
||||
MenuItemGroup AS INTEGER
|
||||
KeyCombo AS LONG
|
||||
BoundTo AS LONG
|
||||
BoundProperty AS LONG
|
||||
END TYPE
|
||||
|
||||
TYPE __UI_Types
|
||||
Name AS STRING * 16
|
||||
Count AS LONG
|
||||
TurnsInto AS INTEGER
|
||||
DefaultHeight AS INTEGER
|
||||
MinimumHeight AS INTEGER
|
||||
DefaultWidth AS INTEGER
|
||||
MinimumWidth AS INTEGER
|
||||
RestrictResize AS _BYTE
|
||||
END TYPE
|
||||
|
||||
TYPE __UI_WordWrapHistoryType
|
||||
StringSlot AS LONG
|
||||
Width AS INTEGER
|
||||
LongestLine AS INTEGER
|
||||
Font AS LONG
|
||||
TotalLines AS INTEGER
|
||||
END TYPE
|
||||
|
||||
TYPE __UI_KeyCombos
|
||||
Combo AS STRING * 14 ' "CTRL+SHIFT+F12"
|
||||
FriendlyCombo AS STRING * 14 ' "Ctrl+Shift+F12"
|
||||
ControlID AS LONG
|
||||
END TYPE
|
||||
|
||||
REDIM SHARED Caption(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempCaptions(0 TO 100) AS STRING
|
||||
REDIM SHARED Text(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempTexts(0 TO 100) AS STRING
|
||||
REDIM SHARED Mask(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempMask(0 TO 100) AS STRING
|
||||
REDIM SHARED ToolTip(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_TempTips(0 TO 100) AS STRING
|
||||
REDIM SHARED Control(0 TO 100) AS __UI_ControlTYPE
|
||||
REDIM SHARED ControlDrawOrder(0) AS LONG
|
||||
REDIM __UI_ThemeImages(0 TO 0) AS HashTableType
|
||||
REDIM SHARED __UI_WordWrapHistoryTexts(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_WordWrapHistoryResults(0 TO 100) AS STRING
|
||||
REDIM SHARED __UI_WordWrapHistory(0 TO 100) AS __UI_WordWrapHistoryType
|
||||
REDIM SHARED __UI_ThisLineChars(0) AS LONG, __UI_FocusedTextBoxChars(0) AS LONG
|
||||
REDIM SHARED __UI_ActiveMenu(0 TO 100) AS LONG, __UI_ParentMenu(0 TO 100) AS LONG
|
||||
REDIM SHARED __UI_KeyCombo(0 TO 100) AS __UI_KeyCombos
|
||||
|
||||
DIM SHARED __UI_TotalKeyCombos AS LONG, __UI_BypassKeyCombos AS _BYTE
|
||||
DIM SHARED table1252$(0 TO 255), table437$(0 TO 255)
|
||||
DIM SHARED __UI_MouseLeft AS INTEGER, __UI_MouseTop AS INTEGER
|
||||
DIM SHARED __UI_MouseWheel AS INTEGER, __UI_MouseButtonsSwap AS _BYTE
|
||||
DIM SHARED __UI_PrevMouseLeft AS INTEGER, __UI_PrevMouseTop AS INTEGER
|
||||
DIM SHARED __UI_MouseButton1 AS _BYTE, __UI_MouseButton2 AS _BYTE
|
||||
DIM SHARED __UI_MouseIsDown AS _BYTE, __UI_MouseDownOnID AS LONG
|
||||
DIM SHARED __UI_Mouse2IsDown AS _BYTE, __UI_Mouse2DownOnID AS LONG
|
||||
DIM SHARED __UI_PreviousMouseDownOnID AS LONG
|
||||
DIM SHARED __UI_KeyIsDown AS _BYTE, __UI_KeyDownOnID AS LONG
|
||||
DIM SHARED __UI_ShiftIsDown AS _BYTE, __UI_CtrlIsDown AS _BYTE
|
||||
DIM SHARED __UI_AltIsDown AS _BYTE, __UI_ShowHotKeys AS _BYTE, __UI_AltCombo$
|
||||
DIM SHARED __UI_LastMouseClick AS SINGLE, __UI_MouseDownOnScrollbar AS SINGLE
|
||||
DIM SHARED __UI_DragX AS INTEGER, __UI_DragY AS INTEGER
|
||||
DIM SHARED __UI_DefaultButtonID AS LONG
|
||||
DIM SHARED __UI_KeyHit AS LONG, __UI_KeepFocus AS _BYTE
|
||||
DIM SHARED __UI_Focus AS LONG, __UI_PreviousFocus AS LONG, __UI_KeyboardFocus AS _BYTE
|
||||
DIM SHARED __UI_HoveringID AS LONG, __UI_LastHoveringID AS LONG, __UI_BelowHoveringID AS LONG
|
||||
DIM SHARED __UI_IsDragging AS _BYTE, __UI_DraggingID AS LONG
|
||||
DIM SHARED __UI_IsResizing AS _BYTE, __UI_ResizingID AS LONG
|
||||
DIM SHARED __UI_ResizeHandleHover AS _BYTE
|
||||
DIM SHARED __UI_IsSelectingText AS _BYTE, __UI_IsSelectingTextOnID AS LONG
|
||||
DIM SHARED __UI_SelectedText AS STRING, __UI_SelectionLength AS LONG
|
||||
DIM SHARED __UI_StateHasChanged AS _BYTE
|
||||
DIM SHARED __UI_DraggingThumb AS _BYTE, __UI_ThumbDragTop AS INTEGER
|
||||
DIM SHARED __UI_DraggingThumbOnID AS LONG
|
||||
DIM SHARED __UI_HasInput AS _BYTE, __UI_ProcessInputTimer AS SINGLE
|
||||
DIM SHARED __UI_UnloadSignal AS _BYTE, __UI_HasResized AS _BYTE
|
||||
DIM SHARED __UI_ExitTriggered AS _BYTE
|
||||
DIM SHARED __UI_Loaded AS _BYTE
|
||||
DIM SHARED __UI_EventsTimer AS INTEGER, __UI_RefreshTimer AS INTEGER
|
||||
DIM SHARED __UI_ActiveDropdownList AS LONG, __UI_ParentDropdownList AS LONG
|
||||
DIM SHARED __UI_TotalActiveMenus AS LONG, __UI_ActiveMenuIsContextMenu AS _BYTE
|
||||
DIM SHARED __UI_SubMenuDelay AS SINGLE, __UI_HoveringSubMenu AS _BYTE
|
||||
DIM SHARED __UI_TopMenuBarItem AS LONG
|
||||
DIM SHARED __UI_ActiveTipID AS LONG, __UI_TipTimer AS SINGLE, __UI_PreviousTipID AS LONG
|
||||
DIM SHARED __UI_ActiveTipTop AS INTEGER, __UI_ActiveTipLeft AS INTEGER
|
||||
DIM SHARED __UI_FormID AS LONG, __UI_HasMenuBar AS LONG
|
||||
DIM SHARED __UI_ScrollbarWidth AS INTEGER, __UI_ScrollbarButtonHeight AS INTEGER
|
||||
DIM SHARED __UI_MenuBarOffset AS INTEGER, __UI_MenuItemOffset AS INTEGER
|
||||
DIM SHARED __UI_NewMenuBarTextLeft AS INTEGER, __UI_DefaultCaptionIndent AS INTEGER
|
||||
DIM SHARED __UI_ForceRedraw AS _BYTE, __UI_AutoRefresh AS _BYTE
|
||||
DIM SHARED __UI_CurrentTitle AS STRING
|
||||
DIM SHARED __UI_DesignMode AS _BYTE, __UI_FirstSelectedID AS LONG
|
||||
DIM SHARED __UI_WaitMessage AS STRING, __UI_TotalSelectedControls AS LONG
|
||||
DIM SHARED __UI_WaitMessageHandle AS LONG, __UI_EditorMode AS _BYTE
|
||||
DIM SHARED __UI_LastRenderedCharCount AS LONG
|
||||
DIM SHARED __UI_SelectionRectangleTop AS INTEGER, __UI_SelectionRectangleLeft AS INTEGER
|
||||
DIM SHARED __UI_SelectionRectangle AS _BYTE
|
||||
DIM SHARED __UI_CantShowContextMenu AS _BYTE, __UI_ShowPositionAndSize AS _BYTE
|
||||
DIM SHARED __UI_ShowInvisibleControls AS _BYTE, __UI_Snapped AS _BYTE
|
||||
DIM SHARED __UI_SnappedByProximityX AS _BYTE, __UI_SnappedByProximityY AS _BYTE
|
||||
DIM SHARED __UI_SnappedX AS INTEGER, __UI_SnappedY AS INTEGER
|
||||
DIM SHARED __UI_SnappedXID AS LONG, __UI_SnappedYID AS LONG
|
||||
DIM SHARED __UI_SnapLines AS _BYTE, __UI_SnapDistance AS INTEGER, __UI_SnapDistanceFromForm AS INTEGER
|
||||
DIM SHARED __UI_FrameRate AS SINGLE, __UI_Font8Offset AS INTEGER, __UI_Font16Offset AS INTEGER
|
||||
DIM SHARED __UI_ClipboardCheck$, __UI_MenuBarOffsetV AS INTEGER
|
||||
DIM SHARED __UI_KeepScreenHidden AS _BYTE, __UI_MaxBorderSize AS INTEGER
|
||||
DIM SHARED __UI_InternalContextMenus AS LONG, __UI_DidClick AS _BYTE
|
||||
DIM SHARED __UI_ContextMenuSourceID AS LONG
|
||||
DIM SHARED __UI_FKey(1 TO 12) AS LONG
|
||||
|
||||
DIM SHARED __UI_Type(0 TO 18) AS __UI_Types
|
||||
|
||||
$END IF
|
|
@ -1,3 +0,0 @@
|
|||
' SemVer (Major.Minor.Patch)
|
||||
|
||||
CONST __UI_Version = "1.5.3"
|
15
InForm/InFormVersion.bi
Normal file
15
InForm/InFormVersion.bi
Normal file
|
@ -0,0 +1,15 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm SemVer (Major.Minor.Patch). This is included by the common header file
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF INFORMVERSION_BI = UNDEFINED THEN
|
||||
$LET INFORMVERSION_BI = TRUE
|
||||
|
||||
CONST __UI_VersionMajor = "1"
|
||||
CONST __UI_VersionMinor = "5"
|
||||
CONST __UI_VersionPatch = "3"
|
||||
CONST __UI_Version = __UI_VersionMajor + "." + __UI_VersionMinor + "." + __UI_VersionPatch
|
||||
|
||||
$END IF
|
|
@ -1,8 +1,13 @@
|
|||
OPTION _EXPLICIT
|
||||
OPTION _EXPLICITARRAY
|
||||
$UNSTABLE:HTTP
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm-PE GUI engine for QB64-PE
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2023 George McGinn
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$EXEICON:'.\resources\InForm.ico'
|
||||
OPTION _EXPLICIT
|
||||
|
||||
$EXEICON:'./resources/InForm.ico'
|
||||
|
||||
'Controls: --------------------------------------------------------------------
|
||||
'Main form
|
||||
|
@ -332,13 +337,10 @@ $ELSE
|
|||
$END IF
|
||||
|
||||
'$INCLUDE:'extensions/Ini.bi'
|
||||
'$INCLUDE:'extensions/MessageBox.bi'
|
||||
'$INCLUDE:'InForm.bi'
|
||||
'$INCLUDE:'xp.uitheme'
|
||||
'$INCLUDE:'UiEditor.frm'
|
||||
'$INCLUDE:'InForm.ui'
|
||||
'$INCLUDE:'extensions/Ini.bas'
|
||||
'$INCLUDE:'extensions/MessageBox.bas'
|
||||
|
||||
'Event procedures: ---------------------------------------------------------------
|
||||
SUB __UI_Click (id AS LONG)
|
||||
|
@ -577,7 +579,7 @@ SUB __UI_Click (id AS LONG)
|
|||
SaveForm TRUE, Control(SaveFrmOnlyCB).Value
|
||||
END IF
|
||||
CASE HelpMenuAbout
|
||||
MessageBox "InForm GUI engine for QB64-PE" + CHR$(13) + "Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + chr$(13) + "George McGinn, 2023 - gbytes58@gmail.com"+ CHR$(13) + "Samuel Gomes, (2023 - 2024) - @a740g" + STRING$(2, 13) + UiEditorTitle$ + " v" + __UI_Version + STRING$(2, 13) + "https://github.com/a740g/InForm-PE", UiEditorTitle$ + " - About", MsgBox_Information
|
||||
MessageBox "InForm GUI engine for QB64-PE" + CHR$(13) + "Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + CHR$(13) + "George McGinn, 2023 - gbytes58@gmail.com" + CHR$(13) + "Samuel Gomes, (2023 - 2024) - @a740g" + STRING$(2, 13) + UiEditorTitle$ + " v" + __UI_Version + STRING$(2, 13) + "https://github.com/a740g/InForm-PE", UiEditorTitle$ + " - About", MsgBox_Information
|
||||
CASE HelpMenuHelp
|
||||
MessageBox "Design a form and export the resulting code to generate an event-driven QB64-PE program.", UiEditorTitle$ + " - What's all this?", MsgBox_Information
|
||||
CASE FileMenuExit
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm-PE GUI engine for QB64-PE
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2023 George McGinn
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
OPTION _EXPLICIT
|
||||
OPTION _EXPLICITARRAY
|
||||
$UNSTABLE:HTTP
|
||||
|
||||
DIM SHARED UiEditorPID AS LONG, ExeIcon AS LONG
|
||||
DIM SHARED AutoNameControls AS _BYTE
|
||||
|
@ -83,34 +88,52 @@ ContextMenuIcon = LoadEditorImage(EDITOR_IMAGE_CONTEXTMENU)
|
|||
__UI_ClearColor ContextMenuIcon, 0, 0
|
||||
|
||||
'$INCLUDE:'extensions/GIFPlay.bi'
|
||||
'$INCLUDE:'extensions/MessageBox.bi'
|
||||
'$INCLUDE:'InForm.bi'
|
||||
'$INCLUDE:'UiEditorPreview.frm'
|
||||
'$INCLUDE:'xp.uitheme'
|
||||
'$INCLUDE:'InForm.ui'
|
||||
'$INCLUDE:'extensions/GIFPlay.bas'
|
||||
'$INCLUDE:'extensions/MessageBox.bas'
|
||||
|
||||
'Event procedures: ---------------------------------------------------------------
|
||||
SUB __UI_Click (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_MouseEnter (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_MouseLeave (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_FocusIn (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_FocusOut (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_MouseDown (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_MouseUp (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
FUNCTION AddNewMenuBarControl&
|
||||
|
@ -2239,9 +2262,15 @@ SUB RefreshContextMenus
|
|||
END SUB
|
||||
|
||||
SUB __UI_TextChanged (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
SUB __UI_ValueChanged (id AS LONG)
|
||||
SELECT CASE id
|
||||
CASE ELSE
|
||||
END SELECT
|
||||
END SUB
|
||||
|
||||
FUNCTION ReadSequential$ (Txt$, Bytes%)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' Base64 Encoder and Decoder library
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' Base64 encoder, decoder & resource loading library
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF BASE64_BAS = UNDEFINED THEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' Animated GIF Player library
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF GIFPLAY_BAS = UNDEFINED THEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' Animated GIF Player library
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF GIFPLAY_BI = UNDEFINED THEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' A simple hash table for integers and QB64 handles
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' A simple hash table for integers and QB64-PE handles
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF HASHTABLE_BAS = UNDEFINED THEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' A simple hash table for integers and QB64 handles
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' A simple hash table for integers and QB64-PE handles
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF HASHTABLE_BI = UNDEFINED THEN
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' INI Manager
|
||||
' Fellippe Heitor, 2017-2021 - fellippe@qb64.org - @fellippeheitor
|
||||
' https://github.com/FellippeHeitor/INI-Manager
|
||||
'
|
||||
' Add include guards - @a740g
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF INI_BAS = UNDEFINED THEN
|
||||
$LET INI_BAS = TRUE
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' INI Manager
|
||||
' Fellippe Heitor, 2017-2021 - fellippe@qb64.org - @fellippeheitor
|
||||
' https://github.com/FellippeHeitor/INI-Manager
|
||||
'
|
||||
' Add include guards - @a740g
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF INI_BI = UNDEFINED THEN
|
||||
$LET INI_BI = TRUE
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
' MessageBox compatibility functions
|
||||
' These basically emulates the legacy InForm MessageBox routines
|
||||
' All it does is calls the new QB64-PE _MESSAGEBOX$ function
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm MessageBox compatibility functions. These basically emulates the legacy InForm MessageBox routines
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF MESSAGEBOX_BAS = UNDEFINED THEN
|
||||
$LET MESSAGEBOX_BAS = TRUE
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
' MessageBox compatibility functions
|
||||
' These basically emulates the legacy InForm MessageBox routines
|
||||
' All it does is calls the new QB64-PE _MESSAGEBOX$ function
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm MessageBox compatibility functions. These basically emulates the legacy InForm MessageBox routines
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF MESSAGEBOX_BI = UNDEFINED THEN
|
||||
$LET MESSAGEBOX_BI = TRUE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' File I/O like routines for memory loaded files
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF STRINGFILE_BAS = UNDEFINED THEN
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' File I/O like routines for memory loaded files
|
||||
' Copyright (c) 2023 Samuel Gomes
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$IF STRINGFILE_BI = UNDEFINED THEN
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
OPTION _EXPLICIT
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' VBDOS to InForm form conversion utility
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2023 George McGinn
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
$CONSOLE:ONLY
|
||||
OPTION _EXPLICIT
|
||||
|
||||
CONST FALSE = 0, TRUE = NOT FALSE
|
||||
CONST FALSE%% = 0%%, TRUE%% = NOT FALSE
|
||||
|
||||
'$INCLUDE:'InFormVersion.bas'
|
||||
'$INCLUDE:'InFormVersion.bi'
|
||||
|
||||
PRINT "InForm GUI engine for QB64-PE - v"; __UI_Version
|
||||
PRINT "VBDOS to InForm form conversion utility"
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
'---------------------------------------------------------------------------------
|
||||
' *** XP.UITHEME ***
|
||||
' UI theme mimicking Windows XP's controls style
|
||||
' Image data embedded into SUB __UI_ImageData$
|
||||
'---------------------------------------------------------------------------------
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
' InForm-PE GUI theme mimicking Windows XP's controls style
|
||||
' Copyright (c) 2024 Samuel Gomes
|
||||
' Copyright (c) 2022 Fellippe Heitor
|
||||
'-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
SUB __UI_ThemeSetup
|
||||
$IF XP_UITHEME = UNDEFINED THEN
|
||||
$LET XP_UITHEME = TRUE
|
||||
|
||||
'$INCLUDE:'InFormCommon.bi'
|
||||
|
||||
SUB __UI_ThemeSetup
|
||||
'Metrics
|
||||
__UI_ScrollbarWidth = 17
|
||||
__UI_ScrollbarButtonHeight = 17
|
||||
__UI_MenuBarOffset = 8
|
||||
__UI_MenuItemOffset = 22
|
||||
__UI_DefaultCaptionIndent = 5
|
||||
END SUB
|
||||
END SUB
|
||||
|
||||
'---------------------------------------------------------------------------------
|
||||
FUNCTION __UI_DefaultColor~& (ControlType AS _BYTE, Attribute AS _BYTE)
|
||||
'---------------------------------------------------------------------------------
|
||||
FUNCTION __UI_DefaultColor~& (ControlType AS _BYTE, Attribute AS _BYTE)
|
||||
DIM Colors(1 TO 6) AS _UNSIGNED LONG
|
||||
|
||||
'.ForeColor
|
||||
|
@ -47,10 +52,10 @@ FUNCTION __UI_DefaultColor~& (ControlType AS _BYTE, Attribute AS _BYTE)
|
|||
END SELECT
|
||||
|
||||
__UI_DefaultColor~& = Colors(Attribute)
|
||||
END FUNCTION
|
||||
END FUNCTION
|
||||
|
||||
'---------------------------------------------------------------------------------
|
||||
FUNCTION __UI_ImageData$ (id AS _UNSIGNED _BYTE)
|
||||
'---------------------------------------------------------------------------------
|
||||
FUNCTION __UI_ImageData$ (id AS _UNSIGNED _BYTE)
|
||||
SELECT CASE id
|
||||
CASE __INFORM_THEME_IMAGE_ARROWS
|
||||
CONST SIZE_ARROWS_BMP_5306~& = 5306~&
|
||||
|
@ -285,4 +290,8 @@ FUNCTION __UI_ImageData$ (id AS _UNSIGNED _BYTE)
|
|||
CASE ELSE
|
||||
ERROR 51
|
||||
END SELECT
|
||||
END FUNCTION
|
||||
END FUNCTION
|
||||
|
||||
'$INCLUDE:'extensions/Base64.bas'
|
||||
|
||||
$END IF
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2023-2024 Samuel Gomes
|
||||
Copyright (c) 2023, George McGinn
|
||||
Copyright (c) 2016-2022 Fellippe Heitor
|
||||
Copyright (c) 2024 Samuel Gomes
|
||||
Copyright (c) 2023 George McGinn
|
||||
Copyright (c) 2022 Fellippe Heitor
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
Loading…
Reference in a new issue