1
1
Fork 0
mirror of https://github.com/FellippeHeitor/InForm.git synced 2024-05-06 20:10:12 +00:00

Initial cleanup

This commit is contained in:
Samuel Gomes 2023-05-09 02:23:53 +05:30
parent fb177d6abf
commit a3ba9a6feb
22 changed files with 6908 additions and 17574 deletions

View file

@ -1,166 +0,0 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 160
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementAttributeLikeMacros:
- Q_EMIT
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

File diff suppressed because it is too large Load diff

View file

@ -1,253 +1,235 @@
'InForm - GUI library for QB64
'Fellippe Heitor, 2016-2019 - fellippe@qb64.org - @fellippeheitor
'
DECLARE CUSTOMTYPE LIBRARY
FUNCTION __UI_GetPID ALIAS getpid ()
SUB __UI_MemCopy ALIAS memcpy (BYVAL dest AS _OFFSET, BYVAL source AS _OFFSET, BYVAL bytes AS LONG)
END DECLARE
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
Declare Library "./InForm/falcon"
Sub uprint_extra (ByVal x&, Byval y&, Byval chars%&, Byval length%&, Byval kern&, Byval do_render&, txt_width&, Byval charpos%&, charcount&, Byval colour~&, Byval max_width&)
Function uprint (ByVal x&, Byval y&, chars$, Byval txt_len&, Byval colour~&, Byval max_width&)
Function uprintwidth (chars$, Byval txt_len&, Byval max_width&)
Function uheight& ()
Function falcon_uspacing& Alias uspacing ()
Function uascension& ()
End Declare
$If WIN Then
Declare Library
Function __UI_MB& Alias MessageBox (ByVal ignore&, message$, title$, Byval type&)
Function GetSystemMetrics& (ByVal WhichMetric&)
End Declare
Const __UI_SM_SWAPBUTTON = 23
$Else
DECLARE LIBRARY ""
FUNCTION __UI_MB& ALIAS MessageBox (BYVAL ignore&, message$, title$, BYVAL type&)
$IF WIN THEN
DECLARE LIBRARY
FUNCTION GetSystemMetrics& (BYVAL WhichMetric&)
END DECLARE
$End If
$ScreenHide
_ControlChr Off
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
$SCREENHIDE
_CONTROLCHR OFF
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_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_ThemeImagesType
FileName As String * 32
Handle 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_ThemeImagesType
FileName AS STRING * 32
Handle AS LONG
END TYPE
Type __UI_KeyCombos
Combo As String * 14 ' "CTRL+SHIFT+F12"
FriendlyCombo As String * 14 ' "Ctrl+Shift+F12"
ControlID As Long
End Type
TYPE __UI_WordWrapHistoryType
StringSlot AS LONG
Width AS INTEGER
LongestLine AS INTEGER
Font AS LONG
TotalLines AS INTEGER
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 Shared __UI_ThemeImages(0 To 100) As __UI_ThemeImagesType
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
TYPE __UI_KeyCombos
Combo AS STRING * 14 ' "CTRL+SHIFT+F12"
FriendlyCombo AS STRING * 14 ' "Ctrl+Shift+F12"
ControlID AS LONG
END TYPE
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_LastRenderedLineWidth As Long, __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
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 SHARED __UI_ThemeImages(0 TO 100) AS __UI_ThemeImagesType
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
'Control types: -----------------------------------------------
Dim Shared __UI_Type(0 To 18) As __UI_Types
DIM SHARED __UI_Type(0 TO 18) AS __UI_Types
__UI_Type(__UI_Type_Form).Name = "Form"
__UI_Type(__UI_Type_Frame).Name = "Frame"
@ -325,7 +307,8 @@ __UI_Type(__UI_Type_ToggleSwitch).RestrictResize = __UI_CantResize
__UI_RestoreFKeys
CONST True = -1, False = 0
CONST False = 0, True = Not False
'$INCLUDE:'InFormVersion.bas'
__UI_SubMenuDelay = .4
__UI_SnapDistance = 5
@ -347,6 +330,7 @@ DO
LOOP
SYSTEM
__UI_ErrorHandler:
RESUME NEXT

View file

@ -42,40 +42,6 @@ FUNCTION __UI_NumericWithBounds%%: __UI_NumericWithBounds%% = 2: END FUNCTION
FUNCTION __UI_CheckMark%%: __UI_CheckMark%% = 0: END FUNCTION
FUNCTION __UI_Bullet%%: __UI_Bullet%% = 1: END FUNCTION
'Messagebox constants
FUNCTION MsgBox_OkOnly%%: MsgBox_OkOnly%% = 0: END FUNCTION
FUNCTION MsgBox_OkCancel%%: MsgBox_OkCancel%% = 1: END FUNCTION
FUNCTION MsgBox_AbortRetryIgnore%%: MsgBox_AbortRetryIgnore%% = 2: END FUNCTION
FUNCTION MsgBox_YesNoCancel%%: MsgBox_YesNoCancel%% = 3: END FUNCTION
FUNCTION MsgBox_YesNo%%: MsgBox_YesNo%% = 4: END FUNCTION
FUNCTION MsgBox_RetryCancel%%: MsgBox_RetryCancel%% = 5: END FUNCTION
FUNCTION MsgBox_CancelTryagainContinue%%: MsgBox_CancelTryagainContinue%% = 6: END FUNCTION
FUNCTION MsgBox_Critical%: MsgBox_Critical% = 16: END FUNCTION
FUNCTION MsgBox_Question%: MsgBox_Question% = 32: END FUNCTION
FUNCTION MsgBox_Exclamation%: MsgBox_Exclamation% = 48: END FUNCTION
FUNCTION MsgBox_Information%: MsgBox_Information% = 64: END FUNCTION
FUNCTION MsgBox_DefaultButton1%: MsgBox_DefaultButton1% = 0: END FUNCTION
FUNCTION MsgBox_DefaultButton2%: MsgBox_DefaultButton2% = 256: END FUNCTION
FUNCTION MsgBox_DefaultButton3%: MsgBox_DefaultButton3% = 512: END FUNCTION
FUNCTION MsgBox_Defaultbutton4%: MsgBox_Defaultbutton4% = 768: END FUNCTION
FUNCTION MsgBox_AppModal%%: MsgBox_AppModal%% = 0: END FUNCTION
FUNCTION MsgBox_SystemModal%: MsgBox_SystemModal% = 4096: END FUNCTION
FUNCTION MsgBox_SetForeground&: MsgBox_SetForeground& = 65536: END FUNCTION
FUNCTION MsgBox_Ok%%: MsgBox_Ok%% = 1: END FUNCTION
FUNCTION MsgBox_Cancel%%: MsgBox_Cancel%% = 2: END FUNCTION
FUNCTION MsgBox_Abort%%: MsgBox_Abort%% = 3: END FUNCTION
FUNCTION MsgBox_Retry%%: MsgBox_Retry%% = 4: END FUNCTION
FUNCTION MsgBox_Ignore%%: MsgBox_Ignore%% = 5: END FUNCTION
FUNCTION MsgBox_Yes%%: MsgBox_Yes%% = 6: END FUNCTION
FUNCTION MsgBox_No%%: MsgBox_No%% = 7: END FUNCTION
FUNCTION MsgBox_Tryagain%%: MsgBox_Tryagain%% = 10: END FUNCTION
FUNCTION MsgBox_Continue%%: MsgBox_Continue%% = 11: END FUNCTION
'General constants
FUNCTION __UI_ToolTipTimeOut!: __UI_ToolTipTimeOut! = .8: END FUNCTION
FUNCTION __UI_CantResizeV%%: __UI_CantResizeV%% = 1: END FUNCTION
@ -83,8 +49,9 @@ FUNCTION __UI_CantResizeH%%: __UI_CantResizeH%% = 2: END FUNCTION
FUNCTION __UI_CantResize%%: __UI_CantResize%% = 3: END FUNCTION
'---------------------------------------------------------------------------------
' a740g: Check if this has the expected behavior 'cause _UFONTHEIGHT actually returns the true font height for built-in fonts
FUNCTION uspacing&
uspacing& = uheight + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)
uspacing& = _UFONTHEIGHT + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)
END FUNCTION
'---------------------------------------------------------------------------------
@ -717,7 +684,7 @@ SUB __UI_ProcessInput
IF __UI_HasMenuBar = True THEN
'Add menubar div to main form's canvas
_FONT Control(__UI_FormID).Font
__UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
__UI_MenuBarOffsetV = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, __UI_MenuBarOffsetV - 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, __UI_MenuBarOffsetV)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
__UI_RefreshMenuBar
@ -795,9 +762,9 @@ SUB __UI_UpdateDisplay
CLS
IF __UI_HasMenuBar THEN
_FONT Control(__UI_FormID).Font
__UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
__UI_MenuBarOffsetV = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
ELSE
__UI_MenuBarOffsetV = 0
END IF
@ -834,7 +801,7 @@ SUB __UI_UpdateDisplay
_PRINTMODE _KEEPBACKGROUND
COLOR _RGBA32(0, 0, 0, 150)
_PRINTSTRING (Control(i).Left + 1, Control(i).Top + 1), RTRIM$(Control(i).Name)
_PRINTSTRING (Control(i).Left + 1, Control(i).Top + 1 + falcon_uspacing&), "(hidden)"
_PRINTSTRING (Control(i).Left + 1, Control(i).Top + 1 + _ulinespacing), "(hidden)"
GOTO BypassDisplay
ELSEIF Control(i).Hidden = True THEN
GOTO BypassDisplay
@ -1282,7 +1249,7 @@ SUB __UI_UpdateDisplay
COLOR __UI_DefaultColor(__UI_Type_Form, 1)
IF TotalLines = 1 THEN
__UI_PrintString _WIDTH \ 2 - __UI_PrintWidth(TempCaption$) \ 2 - 1.75, _HEIGHT \ 2 - uheight& \ 2 - 1.75, TempCaption$
__UI_PrintString _WIDTH \ 2 - __UI_PrintWidth(TempCaption$) \ 2 - 1.75, _HEIGHT \ 2 - _ufontheight \ 2 - 1.75, TempCaption$
ELSE
DO WHILE LEN(TempCaption$)
ThisLine% = ThisLine% + 1
@ -1438,7 +1405,6 @@ SUB __UI_EventDispatcher
STATIC __UI_JustOpenedMenu AS _BYTE
STATIC OriginalDragX AS INTEGER, OriginalDragY AS INTEGER
STATIC OriginalResizeRightSide AS INTEGER, OriginalResizeBottom AS INTEGER
STATIC PrevResizeSnapX AS INTEGER, PrevResizeSnapY AS INTEGER
DIM i AS LONG, j AS LONG, ThisItem%, TempParent AS LONG
DIM ContainerOffsetLeft AS INTEGER, ContainerOffsetTop AS INTEGER
@ -2097,7 +2063,7 @@ SUB __UI_EventDispatcher
ThisLineLen = LEN(ThisLine$)
'Print the text offscreen just to fill the right variables
__UI_PrintString _WIDTH + 10, _HEIGHT + 10, ThisLine$
__UI_CharPos ThisLine$
'New cursor position:
FOR i = 1 TO __UI_LastRenderedCharCount
@ -2161,7 +2127,7 @@ SUB __UI_EventDispatcher
__UI_FillSelectedText 0, 0
'Print the text offscreen just to fill the right variables
__UI_PrintString _WIDTH + 10, _HEIGHT + 10, Text(__UI_Focus)
__UI_CharPos Text(__UI_Focus)
'Single-line textbox click
FOR i = 1 TO __UI_LastRenderedCharCount
@ -2261,7 +2227,7 @@ SUB __UI_EventDispatcher
_FONT (Control(__UI_IsSelectingTextOnID).Font)
IF NOT Control(__UI_IsSelectingTextOnID).Multiline THEN
'Print the text offscreen just to fill the right variables
__UI_PrintString _WIDTH + 10, _HEIGHT + 10, Text(__UI_Focus)
__UI_CharPos Text(__UI_Focus)
IF NOT WholeWordSelection THEN
'Single line selection, char by char
@ -2318,7 +2284,7 @@ SUB __UI_EventDispatcher
IF Control(__UI_IsSelectingTextOnID).CurrentLine = 0 THEN Control(__UI_IsSelectingTextOnID).CurrentLine = 1
ThisLine$ = __UI_GetTextBoxLine(__UI_IsSelectingTextOnID, Control(__UI_IsSelectingTextOnID).CurrentLine, ThisLineStart)
ThisLineLen = LEN(ThisLine$)
__UI_PrintString _WIDTH + 10, _HEIGHT + 10, ThisLine$
__UI_CharPos ThisLine$ ' print the text offscreen just to fill the right variables
'New cursor position:
FOR i = 1 TO __UI_LastRenderedCharCount
@ -4761,7 +4727,7 @@ SUB __UI_AdjustNewMenuBarTopHeight (NextSlot AS LONG)
END IF
IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font
Control(NextSlot).Height = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5
Control(NextSlot).Height = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5
Control(NextSlot).Top = 0
IF TempCanvas <> 0 THEN
@ -4778,9 +4744,9 @@ SUB __UI_AdjustNewMenuBarTopHeight (NextSlot AS LONG)
COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor
CLS
IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font
__UI_MenuBarOffsetV = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
__UI_MenuBarOffsetV = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2
LINE (0, _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 1)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 80)
LINE (0, _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 5 + 2)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
_DEST 0
END IF
END SUB
@ -5699,6 +5665,7 @@ SUB __UI_ListBoxSearchItem (This AS __UI_ControlTYPE)
END SUB
'---------------------------------------------------------------------------------
SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$)
DIM Utf$
@ -5712,14 +5679,42 @@ SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$)
END IF
END IF
DIM PM AS LONG: PM = _PRINTMODE
_PRINTMODE _KEEPBACKGROUND
_UPRINTSTRING (Left, Top), Utf$, , 8
SELECT CASE PM
CASE 1
_PRINTMODE _KEEPBACKGROUND
CASE 2
_PRINTMODE _ONLYBACKGROUND
CASE 3
_PRINTMODE _FILLBACKGROUND
END SELECT
END SUB
SUB __UI_CharPos(Text$)
DIM Utf$
IF LEFT$(Text$, 1) = CHR$(7) AND (_FONT = 8 OR _FONT = 16) THEN
Utf$ = Text$
ELSE
IF Control(__UI_FormID).Encoding = 1252 THEN
Utf$ = FromCP1252$(Text$)
ELSE 'Default to 437
Utf$ = FromCP437$(Text$)
END IF
END IF
REDIM __UI_ThisLineChars(0 TO LEN(Utf$)) AS LONG
uprint_extra Left, Top, _OFFSET(Utf$), LEN(Utf$), True, True, __UI_LastRenderedLineWidth, _OFFSET(__UI_ThisLineChars()), __UI_LastRenderedCharCount, _DEFAULTCOLOR, 0
__UI_LastRenderedCharCount = _UCHARPOS(Utf$, __UI_ThisLineChars(), 8)
REDIM _PRESERVE __UI_ThisLineChars(__UI_LastRenderedCharCount) AS LONG
END SUB
'---------------------------------------------------------------------------------
FUNCTION __UI_PrintWidth&(Text$)
__UI_PrintWidth& = uprintwidth(Text$, LEN(Text$), 0)
__UI_PrintWidth& = _UPRINTWIDTH(Text$, 8)
END FUNCTION
'---------------------------------------------------------------------------------
@ -5868,23 +5863,6 @@ FUNCTION __UI_WordWrap$ (PassedText AS STRING, Width AS INTEGER, LongestLine AS
END IF
END FUNCTION
'---------------------------------------------------------------------------------
FUNCTION MessageBox& (Message$, Title$, Setup AS LONG)
_DELAY .1 'So the interface can redraw before the messagebox kicks in
IF Title$ = "" THEN Title$ = __UI_CurrentTitle
$IF WIN THEN
MessageBox& = __UI_MB(0, Replace(Message$, "\n", CHR$(10), False, 0) + CHR$(0), Title$ + CHR$(0), Setup + MsgBox_SystemModal + MsgBox_SetForeground)
$ELSE
IF (Setup AND 4) THEN
MessageBox& = __UI_MB(0, Replace(Message$, "\n", CHR$(10), False, 0) + CHR$(0), Title$ + CHR$(0), 4)
ELSE
MessageBox& = __UI_MB(0, Replace(Message$, "\n", CHR$(10), False, 0) + CHR$(0), Title$ + CHR$(0), 0)
END IF
$END IF
END FUNCTION
'---------------------------------------------------------------------------------
FUNCTION __UI_MAP! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
__UI_MAP! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
@ -5996,7 +5974,7 @@ SUB __UI_ActivateMenu (This AS __UI_ControlTYPE, SelectFirstItem AS _BYTE)
IF This.Type = __UI_Type_MenuBar THEN
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Left = This.Left
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Top = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Top = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
__UI_TopMenuBarItem = This.ID
ELSEIF This.Type = __UI_Type_MenuItem THEN
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Left = Control(This.MenuPanelID).Left + Control(This.MenuPanelID).Width - __UI_MenuItemOffset / 4
@ -6013,8 +5991,8 @@ SUB __UI_ActivateMenu (This AS __UI_ControlTYPE, SelectFirstItem AS _BYTE)
END IF
'Calculate panel's width and position the menu items
ItemHeight = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = (((_FONT = 8) * -1) * 3 + falcon_uspacing&) / 4
ItemHeight = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = (((_FONT = 8) * -1) * 3 + _ulinespacing) / 4
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Width = 0
CurrentGroup = 1
ComboSpacing = 0
@ -6053,7 +6031,7 @@ SUB __UI_ActivateMenu (This AS __UI_ControlTYPE, SelectFirstItem AS _BYTE)
END IF
NEXT
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height + (((((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + falcon_uspacing&) / 4)
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height + (((((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + _ulinespacing) / 4)
IF Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Width = 0 THEN Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Width = Control(__UI_FormID).Width / 4
@ -6956,11 +6934,11 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
ELSE
COLOR Darken(Control(__UI_FormID).BackColor, 80)
END IF
__UI_PrintString (IconWidth / 2) + (This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2), ((This.Height \ 2) - uheight& \ 2), TempCaption$
__UI_PrintString (IconWidth / 2) + (This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2), ((This.Height \ 2) - _ufontheight \ 2), TempCaption$
'Hot key:
IF (This.HotKey > 0 AND (__UI_ShowHotKeys AND NOT This.Disabled)) OR (This.HotKey > 0 AND __UI_DesignMode) THEN
LINE ((This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2) + This.HotKeyOffset, ((This.Height \ 2) + uheight& \ 2))-STEP(__UI_PrintWidth&(CHR$(This.HotKey)) - 1, 0), This.ForeColor
LINE ((This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2) + This.HotKeyOffset, ((This.Height \ 2) + _ufontheight \ 2))-STEP(__UI_PrintWidth&(CHR$(This.HotKey)) - 1, 0), This.ForeColor
END IF
'Focus outline:
@ -7689,8 +7667,10 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState)
IF ((__UI_Focus = This.ID) OR (This.ID = __UI_PreviousFocus AND __UI_ParentMenu(__UI_TotalActiveMenus) = This.ContextMenuID)) AND NOT This.Disabled THEN
IF LEN(Text(This.ID)) THEN
__UI_PrintString CaptionIndent - This.InputViewStart, ((This.Height \ 2) - uspacing& \ 2), ThisTempText$
__UI_CharPos ThisTempText$
ELSE
__UI_PrintString CaptionIndent, ((This.Height \ 2) - uspacing& \ 2), TempCaption$
__UI_CharPos TempCaption$
END IF
IF This.TextIsSelected THEN
@ -8350,7 +8330,7 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE)
'Hot key:
IF (This.HotKey > 0 AND (__UI_ShowHotKeys AND NOT This.Disabled)) OR (This.HotKey > 0 AND __UI_DesignMode) THEN
Temp& = __UI_PrintWidth(CHR$(This.HotKey))
LINE (CaptionLeft + Temp& + This.HotKeyOffset, uheight&)-STEP(Temp& - 1, 0), This.ForeColor
LINE (CaptionLeft + Temp& + This.HotKeyOffset, _ufontheight)-STEP(Temp& - 1, 0), This.ForeColor
END IF
END IF
END IF
@ -8414,11 +8394,11 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE)
COLOR Darken(Control(__UI_FormID).BackColor, 80)
END IF
__UI_PrintString __UI_MenuBarOffset, ((This.Height \ 2) - (falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2), TempCaption$
__UI_PrintString __UI_MenuBarOffset, ((This.Height \ 2) - (_ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2), TempCaption$
IF This.HotKey > 0 AND (__UI_AltIsDown OR Control(__UI_Focus).Type = __UI_Type_MenuBar OR __UI_DesignMode) THEN
'Has "hot-key"
Temp& = __UI_PrintWidth(CHR$(This.HotKey))
LINE (__UI_MenuBarOffset + This.HotKeyOffset, ((This.Height \ 2) + (falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2) - 1)-STEP(Temp& - 1, 0), _DEFAULTCOLOR
LINE (__UI_MenuBarOffset + This.HotKeyOffset, ((This.Height \ 2) + (_ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2) - 1)-STEP(Temp& - 1, 0), _DEFAULTCOLOR
END IF
IF __UI_DesignMode THEN
@ -8427,8 +8407,8 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE)
_DEST Control(__UI_FormID).Canvas
COLOR Darken(Control(__UI_FormID).BackColor, 80)
_FONT (This.Font)
LINE (__UI_NewMenuBarTextLeft + __UI_MenuBarOffset, ((This.Height \ 2) - (falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2))-STEP(__UI_PrintWidth("Add new"),(falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset))), Control(__UI_FormID).BackColor, BF
__UI_PrintString __UI_NewMenuBarTextLeft + __UI_MenuBarOffset, ((This.Height \ 2) - (falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2), "Add new"
LINE (__UI_NewMenuBarTextLeft + __UI_MenuBarOffset, ((This.Height \ 2) - (_ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2))-STEP(__UI_PrintWidth("Add new"),(_ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset))), Control(__UI_FormID).BackColor, BF
__UI_PrintString __UI_NewMenuBarTextLeft + __UI_MenuBarOffset, ((This.Height \ 2) - (_ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2), "Add new"
END IF
END IF
'---
@ -8516,9 +8496,9 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, Parent AS LONG)
CheckMarkIndex = 3
END IF
__UI_PrintString Control(i).Left + __UI_MenuItemOffset, Control(i).Top + Control(i).Height \ 2 - uheight& \ 2, TempCaption$
__UI_PrintString Control(i).Left + __UI_MenuItemOffset, Control(i).Top + Control(i).Height \ 2 - _ufontheight \ 2, TempCaption$
IF Control(i).KeyCombo > 0 THEN
__UI_PrintString Control(i).Left + This.Width - __UI_MenuItemOffset - __UI_PrintWidth(RTRIM$(__UI_KeyCombo(Control(i).KeyCombo).FriendlyCombo)), Control(i).Top + Control(i).Height \ 2 - uheight& \ 2, RTRIM$(__UI_KeyCombo(Control(i).KeyCombo).FriendlyCombo)
__UI_PrintString Control(i).Left + This.Width - __UI_MenuItemOffset - __UI_PrintWidth(RTRIM$(__UI_KeyCombo(Control(i).KeyCombo).FriendlyCombo)), Control(i).Top + Control(i).Height \ 2 - _ufontheight \ 2, RTRIM$(__UI_KeyCombo(Control(i).KeyCombo).FriendlyCombo)
END IF
IF Control(i).SubMenu THEN
@ -8528,13 +8508,13 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, Parent AS LONG)
IF Control(i).HotKey > 0 THEN
'Has "hot-key"
Temp& = __UI_PrintWidth(CHR$(Control(i).HotKey))
LINE (Control(i).Left + __UI_MenuItemOffset + Control(i).HotKeyOffset, Control(i).Top + Control(i).Height \ 2 + uheight& \ 2 - 1)-STEP(Temp& - 1, 0), _DEFAULTCOLOR
LINE (Control(i).Left + __UI_MenuItemOffset + Control(i).HotKeyOffset, Control(i).Top + Control(i).Height \ 2 + _ufontheight \ 2 - 1)-STEP(Temp& - 1, 0), _DEFAULTCOLOR
END IF
IF Control(i).Value = True THEN
'Checked menu item
IF Control(i).BulletStyle = __UI_Bullet%% THEN
__UI_PrintString __UI_MenuItemOffset \ 2 - __UI_PrintWidth(CHR$(7)) \ 2, Control(i).Top + Control(i).Height \ 2 - uheight \ 2, CHR$(7)
__UI_PrintString __UI_MenuItemOffset \ 2 - __UI_PrintWidth(CHR$(7)) \ 2, Control(i).Top + Control(i).Height \ 2 - _ufontheight \ 2, CHR$(7)
ELSE
_PUTIMAGE (__UI_MenuItemOffset \ 2 - CheckMarkWidth \ 2, Control(i).Top + Control(i).Height \ 2 - CheckMarkHeight \ 2), ControlImage, , (0, CheckMarkIndex * CheckMarkHeight - CheckMarkHeight)-STEP(6, 6)
END IF
@ -8578,7 +8558,7 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, Parent AS LONG)
IF __UI_DesignMode AND LEFT$(This.Name, 5) <> "__UI_" THEN
COLOR Darken(Control(__UI_FormID).BackColor, 80)
__UI_PrintString __UI_MenuItemOffset, This.Height - (uheight& + 6), "Add new"
__UI_PrintString __UI_MenuItemOffset, This.Height - (_ufontheight + 6), "Add new"
END IF
'---
@ -8714,3 +8694,4 @@ SUB __UI_ShadowBox (bX AS INTEGER, bY AS INTEGER, bW AS INTEGER, bH AS INTEGER,
LINE (bX, bY)-STEP(bW, bH), C, BF
END SUB

View file

@ -1,5 +1,10 @@
'Starting with v1.0, __UI_VersionNumber is actually the current build.
Const __UI_Version = "v1.4"
Const __UI_VersionNumber = 21
Const __UI_VersionIsBeta = 0
Const __UI_CopyrightSpan = "2016-2021"
$IF INFORMVERSION_BAS = UNDEFINED THEN
$LET INFORMVERSION_BAS = TRUE
CONST __UI_Version = "v1.5"
CONST __UI_VersionNumber = 0
CONST __UI_VersionIsBeta = 1
CONST __UI_CopyrightSpan = "2016-2023"
$END IF

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,63 +1,67 @@
Function Download$ (url$, file$, timelimit) Static
'as seen on http://www.qb64.org/wiki/Downloading_Files
'adapted for use with InForm
$IF DOWNLOAD_BAS = UNDEFINED THEN
$LET DOWNLOAD_BAS = TRUE
FUNCTION Download$ (url$, file$, timelimit) STATIC
'as seen on http://www.qb64.org/wiki/Downloading_Files
'adapted for use with InForm
Dim theClient As Long, l As Long
Dim prevUrl$, prevUrl2$, url2$, x As Long
Dim e$, url3$, x$, t!, a2$, a$, i As Long
Dim i2 As Long, i3 As Long, d$, fh As Long
DIM theClient AS LONG, l AS LONG
DIM prevUrl$, prevUrl2$, url2$, x AS LONG
DIM e$, url3$, x$, t!, a2$, a$, i AS LONG
DIM i2 AS LONG, i3 AS LONG, d$, fh AS LONG
If url$ <> prevUrl$ Or url$ = "" Then
prevUrl$ = url$
If url$ = "" Then
If theClient Then Close theClient: theClient = 0
Exit Function
End If
url2$ = url$
x = InStr(url2$, "/")
If x Then url2$ = Left$(url$, x - 1)
If url2$ <> prevUrl2$ Then
prevUrl2$ = url2$
If theClient Then Close theClient: theClient = 0
theClient = _OpenClient("TCP/IP:80:" + url2$)
If theClient = 0 Then Download = MKI$(2): prevUrl$ = "": Exit Function
End If
e$ = Chr$(13) + Chr$(10) ' end of line characters
url3$ = Right$(url$, Len(url$) - x + 1)
x$ = "GET " + url3$ + " HTTP/1.1" + e$
x$ = x$ + "Host: " + url2$ + e$ + e$
Put #theClient, , x$
t! = Timer ' start time
End If
IF url$ <> prevUrl$ OR url$ = "" THEN
prevUrl$ = url$
IF url$ = "" THEN
IF theClient THEN CLOSE theClient: theClient = 0
EXIT FUNCTION
END IF
url2$ = url$
x = INSTR(url2$, "/")
IF x THEN url2$ = LEFT$(url$, x - 1)
IF url2$ <> prevUrl2$ THEN
prevUrl2$ = url2$
IF theClient THEN CLOSE theClient: theClient = 0
theClient = _OPENCLIENT("TCP/IP:80:" + url2$)
IF theClient = 0 THEN Download = MKI$(2): prevUrl$ = "": EXIT FUNCTION
END IF
e$ = CHR$(13) + CHR$(10) ' end of line characters
url3$ = RIGHT$(url$, LEN(url$) - x + 1)
x$ = "GET " + url3$ + " HTTP/1.1" + e$
x$ = x$ + "Host: " + url2$ + e$ + e$
PUT #theClient, , x$
t! = TIMER ' start time
END IF
GET #theClient, , a2$
a$ = a$ + a2$
i = INSTR(a$, "Content-Length:")
IF i THEN
i2 = INSTR(i, a$, e$)
IF i2 THEN
l = VAL(MID$(a$, i + 15, i2 - i - 14))
i3 = INSTR(i2, a$, e$ + e$)
IF i3 THEN
i3 = i3 + 4 'move i3 to start of data
IF (LEN(a$) - i3 + 1) = l THEN
d$ = MID$(a$, i3, l)
fh = FREEFILE
OPEN file$ FOR OUTPUT AS #fh: CLOSE #fh 'Warning! Clears data from existing file
OPEN file$ FOR BINARY AS #fh
PUT #fh, , d$
CLOSE #fh
Download = MKI$(1) + MKL$(l) 'indicates download was successful
prevUrl$ = ""
prevUrl2$ = ""
a$ = ""
CLOSE theClient
theClient = 0
EXIT FUNCTION
END IF ' availabledata = l
END IF ' i3
END IF ' i2
END IF ' i
IF TIMER > t! + timelimit THEN CLOSE theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": EXIT FUNCTION
Download = MKI$(0) 'still working
END FUNCTION
$END IF
Get #theClient, , a2$
a$ = a$ + a2$
i = InStr(a$, "Content-Length:")
If i Then
i2 = InStr(i, a$, e$)
If i2 Then
l = Val(Mid$(a$, i + 15, i2 - i - 14))
i3 = InStr(i2, a$, e$ + e$)
If i3 Then
i3 = i3 + 4 'move i3 to start of data
If (Len(a$) - i3 + 1) = l Then
d$ = Mid$(a$, i3, l)
fh = FreeFile
Open file$ For Output As #fh: Close #fh 'Warning! Clears data from existing file
Open file$ For Binary As #fh
Put #fh, , d$
Close #fh
Download = MKI$(1) + MKL$(l) 'indicates download was successful
prevUrl$ = ""
prevUrl2$ = ""
a$ = ""
Close theClient
theClient = 0
Exit Function
End If ' availabledata = l
End If ' i3
End If ' i2
End If ' i
If Timer > t! + timelimit Then Close theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": Exit Function
Download = MKI$(0) 'still working
End Function

View file

@ -6,52 +6,57 @@
'#######################################################################################
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
TYPE GIFDATA
ID AS LONG
file AS INTEGER
sigver AS STRING * 6
width AS _UNSIGNED INTEGER
height AS _UNSIGNED INTEGER
bpp AS _UNSIGNED _BYTE
sortFlag AS _BYTE ' Unused
colorRes AS _UNSIGNED _BYTE
colorTableFlag AS _BYTE
bgColor AS _UNSIGNED _BYTE
aspect AS SINGLE ' Unused
numColors AS _UNSIGNED INTEGER
palette AS STRING * 768
firstFrame AS LONG
totalFrames AS LONG
IsPlaying AS _BYTE
Frame AS LONG
LoadedFrames AS LONG
GifLoadComplete AS _BYTE
LastFrameServed AS LONG
LastFrameUpdate AS SINGLE
LastFrameDelay AS SINGLE
HideOverlay AS _BYTE
END TYPE
$IF GIFPLAY_BI = UNDEFINED THEN
$LET GIFPLAY_BI = TRUE
TYPE FRAMEDATA
ID AS LONG
thisFrame AS LONG
addr AS LONG
left AS _UNSIGNED INTEGER
top AS _UNSIGNED INTEGER
width AS _UNSIGNED INTEGER
height AS _UNSIGNED INTEGER
localColorTableFlag AS _BYTE
interlacedFlag AS _BYTE
sortFlag AS _BYTE ' Unused
palBPP AS _UNSIGNED _BYTE
minimumCodeSize AS _UNSIGNED _BYTE
transparentFlag AS _BYTE 'GIF89a-specific (animation) values
userInput AS _BYTE ' Unused
disposalMethod AS _UNSIGNED _BYTE
delay AS SINGLE
transColor AS _UNSIGNED _BYTE
END TYPE
TYPE GIFDATA
ID AS LONG
file AS INTEGER
sigver AS STRING * 6
width AS _UNSIGNED INTEGER
height AS _UNSIGNED INTEGER
bpp AS _UNSIGNED _BYTE
sortFlag AS _BYTE ' Unused
colorRes AS _UNSIGNED _BYTE
colorTableFlag AS _BYTE
bgColor AS _UNSIGNED _BYTE
aspect AS SINGLE ' Unused
numColors AS _UNSIGNED INTEGER
palette AS STRING * 768
firstFrame AS LONG
totalFrames AS LONG
IsPlaying AS _BYTE
Frame AS LONG
LoadedFrames AS LONG
GifLoadComplete AS _BYTE
LastFrameServed AS LONG
LastFrameUpdate AS SINGLE
LastFrameDelay AS SINGLE
HideOverlay AS _BYTE
END TYPE
TYPE FRAMEDATA
ID AS LONG
thisFrame AS LONG
addr AS LONG
left AS _UNSIGNED INTEGER
top AS _UNSIGNED INTEGER
width AS _UNSIGNED INTEGER
height AS _UNSIGNED INTEGER
localColorTableFlag AS _BYTE
interlacedFlag AS _BYTE
sortFlag AS _BYTE ' Unused
palBPP AS _UNSIGNED _BYTE
minimumCodeSize AS _UNSIGNED _BYTE
transparentFlag AS _BYTE 'GIF89a-specific (animation) values
userInput AS _BYTE ' Unused
disposalMethod AS _UNSIGNED _BYTE
delay AS SINGLE
transColor AS _UNSIGNED _BYTE
END TYPE
REDIM SHARED GifData(0) AS GIFDATA
REDIM SHARED GifFrameData(0) AS FRAMEDATA
DIM SHARED TotalGIFLoaded AS LONG, TotalGIFFrames AS LONG
$END IF
REDIM SHARED GifData(0) AS GIFDATA
REDIM SHARED GifFrameData(0) AS FRAMEDATA
DIM SHARED TotalGIFLoaded AS LONG, TotalGIFFrames AS LONG

View file

@ -6,27 +6,31 @@
'#######################################################################################
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
SUB UpdateGif (ID AS LONG)
DIM i AS LONG, newFrame AS LONG
STATIC GifOverlay AS LONG
'$Include:'gifplay.bi'
i = GetGifIndex(ID)
$IF GIFPLAY_BM = UNDEFINED THEN
$LET GIFPLAY_BM = TRUE
SUB UpdateGif (ID AS LONG)
DIM i AS LONG, newFrame AS LONG
STATIC GifOverlay AS LONG
IF i = 0 THEN EXIT SUB
i = GetGifIndex(ID)
IF GifOverlay = 0 THEN
GifOverlay = LoadOverlayImage&
END IF
IF i = 0 THEN EXIT SUB
IF GifData(i).IsPlaying OR GifData(i).LastFrameServed = 0 THEN
IF GifData(i).LastFrameUpdate > 0 AND TIMER - GifData(i).LastFrameUpdate < GifData(i).LastFrameDelay THEN
'Wait for the GIF's frame delay
ELSE
GifData(i).Frame = GifData(i).Frame + 1
GifData(i).LastFrameServed = GifData(i).Frame
GifData(i).LastFrameUpdate = TIMER
IF GifOverlay = 0 THEN
GifOverlay = LoadOverlayImage&
END IF
IF GifData(i).IsPlaying OR GifData(i).LastFrameServed = 0 THEN
IF GifData(i).LastFrameUpdate > 0 AND TIMER - GifData(i).LastFrameUpdate < GifData(i).LastFrameDelay THEN
'Wait for the GIF's frame delay
ELSE
GifData(i).Frame = GifData(i).Frame + 1
GifData(i).LastFrameServed = GifData(i).Frame
GifData(i).LastFrameUpdate = TIMER
END IF
END IF
END IF
BeginDraw ID
newFrame = GetGifFrame&(i)
@ -879,3 +883,5 @@ FUNCTION gifUnpack$ (PackedData$)
gifUnpack$ = btemp$
END FUNCTION
'############################################################################################
$endif

View file

@ -5,10 +5,10 @@
'-----------------------------------------------------------
': Controls' IDs: ------------------------------------------------------------------
Dim Shared gifplaySample As Long
Dim Shared PictureBox1 As Long
Dim Shared LoadBT As Long
Dim Shared PlayBT As Long
DIM SHARED gifplaySample AS LONG
DIM SHARED PictureBox1 AS LONG
DIM SHARED LoadBT AS LONG
DIM SHARED PlayBT AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'gifplay.bi'
@ -49,7 +49,7 @@ SUB __UI_Click (id AS LONG)
Caption(LoadBT) = "globe.gif loaded"
Control(LoadBT).Disabled = True
ELSE
Answer = MessageBox("File 'globe.gif' could not be found.", "", MsgBox_Exclamation + MsgBox_OkOnly)
_MESSAGEBOX "GIFPlay Sample", "File 'globe.gif' could not be found.", "error"
END IF
CASE PlayBT
IF GifIsPlaying(PictureBox1) THEN

View file

@ -36,3 +36,4 @@ SUB __UI_AssignIDs
LoadBT = __UI_GetID("LoadBT")
PlayBT = __UI_GetID("PlayBT")
END SUB

View file

@ -1,254 +0,0 @@
#include "FreeTypeAmalgam.h"
// The following license applies to utf8decode() and associated data only
// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
/* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define UTF8_ACCEPT 0
#define UTF8_REJECT 1
static const uint8_t utf8d[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1f
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3f
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5f
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7f
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9f
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // a0..bf
8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // c0..df
0xa, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // e0..ef
0xb, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // f0..ff
0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2
1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4
1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6
1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // s7..s8
};
uint32_t inline utf8decode(uint32_t *state, uint32_t *codep, uint32_t byte) {
uint32_t type = utf8d[byte];
*codep = (*state != UTF8_ACCEPT) ? (byte & 0x3fu) | (*codep << 6) : (0xff >> type) & (byte);
*state = utf8d[256 + *state * 16 + type];
return *state;
}
/**************************************************************/
struct fonts_struct { // copied from parts/video/font/ttf/src.c
uint8 in_use;
uint8 *ttf_data;
int32 default_pixel_height;
uint8 bold;
uint8 italic;
uint8 underline;
uint8 monospace;
int32 monospace_width;
uint8 unicode;
//---------------------------------
FT_Face handle;
int32 baseline;
float default_pixel_height_scale;
};
extern img_struct *write_page;
extern int32 *font;
extern fonts_struct *fonts;
FT_Face get_fhandle() { return fonts[font[write_page->font]].handle; }
int get_defheight() { return fonts[font[write_page->font]].default_pixel_height; }
int gp2px(int gp) { return (float)gp / get_fhandle()->units_per_EM * get_defheight(); }
int uheight() {
switch (write_page->font) {
case 8:
return 9;
case 14:
return 15;
case 16:
return 17;
}
return gp2px(get_fhandle()->ascender - get_fhandle()->descender);
}
int uascension() {
switch (write_page->font) {
case 8:
return 9;
case 14:
return 13;
case 16:
return 14;
}
return gp2px(get_fhandle()->ascender);
}
int uspacing() {
if (write_page->font < 32)
return write_page->font;
return gp2px(get_fhandle()->height) + 2;
}
extern uint8 charset8x8[256][8][8];
extern uint8 charset8x16[256][16][8];
#ifdef QB64_64
void uprint_extra(int32 startx, int32 starty, int64 str_in, int64 bytelen, int32 kern_wanted, int32 do_render, int32 *txtwidth, int64 charpos, int32 *chars,
uint32 colour, int32 max_width) {
#else
void uprint_extra(int32 startx, int32 starty, int32 str_in, int64 bytelen, int32 kern_wanted, int32 do_render, int32 *txtwidth, int64 charpos, int32 *chars,
uint32 colour, int32 max_width) {
#endif
int builtin = 0;
if (write_page->font < 32) {
builtin = 1;
}
uint8 *str = (uint8 *)str_in;
uint32 cpindex, prev_state = 0, cur_state = 0, cp;
uint8 *builtin_start;
int cur_cpindex = 0;
FT_Face fhandle;
int prev_glyph = 0, glyph_index, error, kern;
FT_Vector kern_delta;
int pen_x, pen_y, draw_x, draw_y, pixmap_x, pixmap_y;
float alpha;
unsigned int rgb;
pen_x = startx;
pen_y = starty;
if (builtin) {
pen_y += 2;
} else {
fhandle = get_fhandle();
pen_y += uascension();
if (FT_HAS_KERNING(fhandle) && kern_wanted)
kern = 1;
else
kern = 0;
}
alpha = (colour >> 24) / 255.0;
rgb = colour & 0xffffff;
for (cpindex = 0; cpindex < bytelen; prev_state = cur_state, cpindex++) {
// if (pen_x > im->width || pen_y > im->height) break;
if (max_width && (pen_x > startx + max_width))
break;
if (charpos)
((int32 *)charpos)[cur_cpindex] = pen_x - startx;
switch (utf8decode(&cur_state, &cp, str[cpindex])) {
case UTF8_ACCEPT:
// good codepoint
cur_cpindex++;
break;
case UTF8_REJECT:
// codepoint would be U+FFFD (replacement character)
cp = 0xfffd;
cur_state = UTF8_ACCEPT;
if (prev_state != UTF8_ACCEPT)
cpindex--;
cur_cpindex++;
break;
default:
// need to read continuation bytes
continue;
break;
}
if (builtin) {
if (max_width && (pen_x + 8 > startx + max_width))
break;
if (cp > 255)
cp = 32;
switch (write_page->font) {
case 8:
builtin_start = &charset8x8[cp][0][0];
break;
case 14:
builtin_start = &charset8x16[cp][1][0];
break;
case 16:
builtin_start = &charset8x16[cp][0][0];
break;
}
if (do_render) {
for (draw_y = pen_y, pixmap_y = 0; pixmap_y < write_page->font; draw_y++, pixmap_y++) {
for (draw_x = pen_x, pixmap_x = 0; pixmap_x < 8; draw_x++, pixmap_x++) {
if (*builtin_start++)
pset_and_clip(draw_x, draw_y, colour);
}
}
}
pen_x += 8;
} else {
glyph_index = FT_Get_Char_Index(fhandle, cp);
if (kern && prev_glyph && glyph_index) {
FT_Get_Kerning(fhandle, prev_glyph, glyph_index, FT_KERNING_DEFAULT, &kern_delta);
pen_x += gp2px(kern_delta.x);
}
error = FT_Load_Glyph(fhandle, glyph_index, FT_LOAD_DEFAULT);
if (error)
continue;
error = FT_Render_Glyph(fhandle->glyph, FT_RENDER_MODE_NORMAL);
if (error)
continue;
if (max_width && (pen_x + fhandle->glyph->bitmap.width > startx + max_width))
break;
if (do_render) {
for (draw_y = pen_y - fhandle->glyph->bitmap_top, pixmap_y = 0; pixmap_y < fhandle->glyph->bitmap.rows; draw_y++, pixmap_y++) {
for (draw_x = pen_x + fhandle->glyph->bitmap_left, pixmap_x = 0; pixmap_x < fhandle->glyph->bitmap.width; draw_x++, pixmap_x++) {
if (write_page->compatible_mode == 32 && !write_page->alpha_disabled) {
pset_and_clip(draw_x, draw_y,
((int)(fhandle->glyph->bitmap.buffer[pixmap_y * fhandle->glyph->bitmap.width + pixmap_x] * alpha) << 24) | rgb);
} else {
if (fhandle->glyph->bitmap.buffer[pixmap_y * fhandle->glyph->bitmap.width + pixmap_x] > 102) {
pset_and_clip(draw_x, draw_y, colour);
}
}
}
}
}
pen_x += fhandle->glyph->advance.x / 64;
prev_glyph = glyph_index;
}
if (txtwidth)
*txtwidth = pen_x - startx;
if (chars)
*chars = cur_cpindex;
}
if (charpos)
((int32 *)charpos)[cur_cpindex] = pen_x - startx;
}
int32 uprint(int32 startx, int32 starty, char *str_in, int64 bytelen, uint32 colour, int32 max_width) {
int32 txtwidth;
#ifdef QB64_64
uprint_extra(startx, starty, (int64)str_in, bytelen, -1, 1, &txtwidth, 0, 0, colour, max_width);
#else
uprint_extra(startx, starty, (int32)str_in, bytelen, -1, 1, &txtwidth, 0, 0, colour, max_width);
#endif
return txtwidth;
}
int32 uprintwidth(char *str_in, int64 bytelen, int32 max_width) {
int32 txtwidth;
#ifdef QB64_64
uprint_extra(0, 0, (int64)str_in, bytelen, -1, 0, &txtwidth, 0, 0, 0, max_width);
#else
uprint_extra(0, 0, (int32)str_in, bytelen, -1, 0, &txtwidth, 0, 0, 0, max_width);
#endif
return txtwidth;
}

View file

@ -4,18 +4,21 @@
'This file isn't required to be at the top of your programs,
'unless you intend to use OPTION _EXPLICIT
'Global variables declaration
DIM currentIniFileName$
DIM currentIniFileLOF AS _UNSIGNED LONG
DIM IniWholeFile$
DIM IniSectionData$
DIM IniPosition AS _UNSIGNED LONG
DIM IniNewFile$
DIM IniLastSection$
DIM IniLastKey$
DIM IniLF$
DIM IniDisableAutoCommit
DIM IniCODE
DIM IniAllowBasicComments
DIM IniForceReload
$IF INI_BI = UNDEFINED THEN
$LET INI_BI = TRUE
'Global variables declaration
DIM currentIniFileName$
DIM currentIniFileLOF AS _UNSIGNED LONG
DIM IniWholeFile$
DIM IniSectionData$
DIM IniPosition AS _UNSIGNED LONG
DIM IniNewFile$
DIM IniLastSection$
DIM IniLastKey$
DIM IniLF$
DIM IniDisableAutoCommit
DIM IniCODE
DIM IniAllowBasicComments
DIM IniForceReload
$END IF

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,5 @@
OPTION _EXPLICIT
'$INCLUDE:'InFormVersion.bas'
PRINT "InForm - GUI system for QB64 - "; __UI_Version
@ -5,8 +7,11 @@ PRINT "VBDOS to InForm form conversion utility"
PRINT "-------------------------------------------------"
DIM lf AS STRING * 1, q AS STRING * 1
DIM theFile$
lf = CHR$(10)
q = CHR$(34)
IF LEN(COMMAND$) > 0 THEN
IF _FILEEXISTS(COMMAND$) = 0 THEN PRINT "File not found.": END
theFile$ = COMMAND$
@ -18,8 +23,11 @@ ELSE
IF _FILEEXISTS(theFile$) = 0 THEN PRINT "File "; theFile$; " not found." ELSE EXIT DO
LOOP
END IF
OPEN theFile$ FOR BINARY AS #1
DIM a$
LINE INPUT #1, a$
IF a$ <> "Version 1.00" THEN
PRINT "Expected VBDOS text form file. Exiting."
@ -32,9 +40,9 @@ IF LEFT$(a$, 11) <> "BEGIN Form " THEN
END
END IF
FormName$ = MID$(a$, 12)
DIM FormName$: FormName$ = MID$(a$, 12)
o$ = "'InForm - GUI system for QB64 - " + __UI_Version
DIM o$: o$ = "'InForm - GUI system for QB64 - " + __UI_Version
o$ = o$ + lf + "'Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @FellippeHeitor"
o$ = o$ + lf + "'-----------------------------------------------------------"
o$ = o$ + lf + "SUB __UI_LoadForm"
@ -43,7 +51,13 @@ o$ = o$ + lf + " DIM __UI_NewID AS LONG"
o$ = o$ + lf
o$ = o$ + lf + " __UI_NewID = __UI_NewControl(__UI_Type_Form, " + q + FormName$ + q + ", "
row = CSRLIN
DIM row AS LONG: row = CSRLIN
DIM percentage%, eq AS LONG, i AS LONG
DIM property$, value$, width$, height$, backColor$, foreColor$, caption$, text$
DIM leftSide$, top$, disabled$, hidden$, controlType$, control$, controlName$, i$
DIM controlList$, caseAll$, caseFocus$, caseList$, caseTextBox$, assignIDs$
DIM controlIDsDIM$, Frame$
DO
IF EOF(1) THEN EXIT DO
@ -171,13 +185,13 @@ o$ = o$ + lf + "SUB __UI_AssignIDs"
o$ = o$ + assignIDs$
o$ = o$ + lf + "END SUB"
newFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.frm"
DIM newFile$: newFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.frm"
CLOSE
OPEN newFile$ FOR BINARY AS #1
PUT #1, , o$
CLOSE
TextFileNum = FREEFILE
newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
DIM TextFileNum AS LONG: TextFileNum = FREEFILE
DIM newTextFile$: newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
OPEN newTextFile$ FOR OUTPUT AS #TextFileNum
PRINT #TextFileNum, "': This program was generated by"
PRINT #TextFileNum, "': InForm - GUI system for QB64 - "; __UI_Version
@ -248,6 +262,7 @@ END
AddProperties:
IF LEN(caption$) THEN o$ = o$ + lf + " SetCaption __UI_NewID, " + caption$: caption$ = ""
DIM formBackColor$, formForeColor$
IF LEN(FormName$) = 0 THEN
IF backColor$ = formBackColor$ THEN backColor$ = ""
IF foreColor$ = formForeColor$ THEN foreColor$ = ""
@ -263,3 +278,4 @@ RETURN
FUNCTION QBColor2QB64$ (index AS _BYTE)
QBColor2QB64$ = "_RGB32(" + LTRIM$(STR$(_RED(index))) + ", " + LTRIM$(STR$(_GREEN(index))) + ", " + LTRIM$(STR$(_BLUE(index))) + ")"
END FUNCTION

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022 Samuel Gomes
Copyright (c) 2023 Samuel Gomes
Copyright (c) 2016-2019 Fellippe Heitor
Permission is hereby granted, free of charge, to any person obtaining a copy

View file

@ -1,4 +1,4 @@
# InForm
# InForm-PE
![InForm logo](InForm/resources/Application-icon-128.png)
@ -8,14 +8,14 @@ Wiki: <https://github.com/a740g/InForm/wiki>
## Event-driven QB64 programs
InForm's main goal is to generate event-driven QB64 applications. This means that you design a graphical user interface with interactive controls and then write the code to respond to such controls once they are manipulated.
InForm-PE's main goal is to generate event-driven QB64-PE applications. This means that you design a graphical user interface with interactive controls and then write the code to respond to such controls once they are manipulated.
## Workflow
After your form looks the way you want it to, click File -> Save to export its contents and generate a .bas source file. Two files are output:
After your form looks the way you want it to, click **File > Save** to export its contents and generate a **.bas** source file. Two files are output:
* **.frm**
the generated form in QB64 code. This can be loaded back into InForm's designer or manually edited in QB64 or any text editor later, if you want to adjust fine details.
the generated form in QB64-PE code. This can be loaded back into InForm-PE's designer or manually edited in QB64-PE or any text editor later, if you want to adjust fine details.
* **.bas**
the actual program you will add your code to.

View file

@ -1,68 +1,49 @@
# Makefile for InForm
# Copyright (c) 2022 Samuel Gomes
#MAKEFLAGS += --no-builtin-rules
ifndef OS
$(error "OS must be set to 'lnx', 'win', or 'osx'")
$(error "OS must be set to 'lnx', 'win', or 'osx'")
endif
ifndef QB64PE_PATH
$(error "QB64PE_PATH must be path where QB64PE is installed")
endif
ifeq ($(OS),lnx)
RM := rm -fr
EXTENSION :=
DIR_SLASH := /
endif
ifeq ($(OS),win)
RM := del /Q
EXTENSION := .exe
DIR_SLASH := /
endif
ifeq ($(OS),osx)
RM := rm -fr
EXTENSION :=
DIR_SLASH := \\
endif
# This should point to your QB64 installation
FILE1 := qb64
FILE2 := qb64pe
ROOT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
ifeq (,$(wildcard $(FILE1)$(EXTENSION)))
QB64 := $(FILE2)
else ifeq (,$(wildcard $(FILE2)$(EXTENSION)))
QB64 := $(FILE1)
endif
QB64PE_FLAGS := -x -p
ROOT_PATH := $(ROOT_DIR)$(DIR_SLASH)
INFORM_PATH := InForm$(DIR_SLASH)
UiEditorSRC := UiEditor.bas
UiEditorEXE := UiEditor$(EXTENSION)
UiEditorPreviewSRC := UiEditorPreview.bas
UiEditorPreviewEXE := UiEditorPreview$(EXTENSION)
QB64PE := qb64pe
QB64PE_FLAGS := -x -w -e
.PHONY: all clean
all: $(UiEditorEXE) $(UiEditorPreviewEXE)
all: UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
$(UiEditorEXE) : $(INFORM_PATH)$(UiEditorSRC)
$(ROOT_PATH)$(QB64)$(EXTENSION) $(QB64PE_FLAGS) -o $(INFORM_PATH)$(UiEditorEXE) $(INFORM_PATH)$(UiEditorSRC)
strip $(INFORM_PATH)$(UiEditorEXE)
UiEditor$(EXTENSION) : InForm/UiEditor.bas
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
$(UiEditorPreviewEXE): $(INFORM_PATH)$(UiEditorPreviewSRC)
$(ROOT_PATH)$(QB64)$(EXTENSION) $(QB64PE_FLAGS) -s:exewithsource=true -o $(INFORM_PATH)$(UiEditorPreviewEXE) $(INFORM_PATH)$(UiEditorPreviewSRC)
strip $(INFORM_PATH)$(UiEditorPreviewEXE)
InForm/UiEditorPreview$(EXTENSION) : InForm/UiEditorPreview.bas
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
InForm/vbdos2inform$(EXTENSION) : InForm/vbdos2inform.bas
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
clean:
ifeq ($(OS),win)
$(RM) InForm\UiEditor$(EXTENSION) InForm\UiEditorPreview$(EXTENSION) InForm\vbdos2inform$(EXTENSION)
$(RM) UiEditor$(EXTENSION) InForm\UiEditorPreview$(EXTENSION) InForm\vbdos2inform$(EXTENSION)
else
$(RM) InForm/UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
$(RM) UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
endif

View file

@ -4,28 +4,5 @@
cd "$(dirname "$0")"
echo "Compiling InForm..."
make -f makefile.inform clean OS=lnx
make -f makefile.inform OS=lnx
if [ -e "./InForm/UiEditor" ]; then
echo "Adding InForm menu entry..."
cat > ~/.local/share/applications/qb64-inform.desktop <<EOF
[Desktop Entry]
Name=QB64 InForm GUI Designer
GenericName=QB64 InForm GUI Designer
Exec=$_pwd/InForm/UiEditor
Icon=$_pwd/InForm/resources/InForm.ico
Terminal=false
Type=Application
Categories=Development;IDE;GUI
Path=$_pwd
StartupNotify=false
EOF
echo "Running InForm Designer..."
cd InForm
./UiEditor &
else
echo "Compilation failed."
echo "Make sure you unpacked all files in QB64's folder, preserving the directory structure and also that you have the latest version of QB64 to use InForm."
fi
make -f makefile.inform clean OS=lnx QB64PE_PATH=../QB64pe/
make -f makefile.inform OS=lnx QB64PE_PATH=../QB64pe/

View file

@ -1,55 +1,7 @@
# InForm for QB64-PE Setup script
cd "$(dirname "$0")"
# InForm for QB64/QB64PE - Setup script
### Perform CLEAN function
rm -fr InForm/UiEditor InForm/UiEditor_start.command InForm/UiEditorPreview InForm/UiEditorPreview_start.command
### Install if QB64 is found
if [ -e "./qb64" ]; then
echo "Compiling InForm..."
./qb64 -x -p ./InForm/UiEditor.bas -o ./InForm/UiEditor
./qb64 -x -p ./InForm/UiEditorPreview.bas -s:exewithsource=true -o ./InForm/UiEditorPreview
cd InForm
if [ -e "./UiEditor" ]; then
echo "Running InForm Designer..."
./UiEditor &
echo
echo "Thank you for choosing InForm for QB64."
osascript -e 'tell application "Terminal" to close (every window whose name contains "UiEditor_start.command")' &
osascript -e 'if (count the windows of application "Terminal") is 0 then tell application "Terminal" to quit' &
exit 0
else
echo "Compilation failed."
echo "Make sure you unpacked all files in QB64's folder, preserving the directory structure, and also that you have QB64 to use InForm."
exit 1
fi
### Install if Q64PE is found
elif [ -e "./qb64pe" ]; then
echo "Compiling InForm..."
./qb64pe -x -p ./InForm/UiEditor.bas -o ./InForm/UiEditor
./qb64pe -x -p ./InForm/UiEditorPreview.bas -s:exewithsource=true -o ./InForm/UiEditorPreview
cd InForm
if [ -e "./UiEditor" ]; then
echo "Running InForm Designer..."
./UiEditor &
echo
echo "Thank you for choosing InForm for QB64PE."
osascript -e 'tell application "Terminal" to close (every window whose name contains "UiEditor_start.command")' &
osascript -e 'if (count the windows of application "Terminal") is 0 then tell application "Terminal" to quit' &
exit 0
else
echo "Compilation failed."
echo "Make sure you unpacked all files in QB64PE's folder, preserving the directory structure, and also that you have QB64PE to use InForm."
exit 1
fi
### If neither QB64 or QB64PE is found, message and error out.
else
echo "Compilation failed."
echo "Make sure you have either QB64 or QB64PE installed to use InForm."
exit 1
fi
exit 0
echo "Compiling InForm..."
make -f makefile.inform clean OS=osx QB64PE_PATH=../QB64pe/
make -f makefile.inform OS=osx QB64PE_PATH=../QB64pe/

View file

@ -4,27 +4,7 @@
%~d0
cd %~dp0
rem Clean old .exe files from InForm
del /Q InForm\UiEditor.exe InForm\UiEditorPreview.exe
rem Check for which compiler for use in your QB64/QB64pe installation
rem Adjust the path below to point to mingw32-make.exe in your QB64 installation
echo Compiling InForm...
if exist qb64.exe (
qb64 -x -p -o InForm/UiEditor.exe InForm/UiEditor.bas
qb64 -x -p -s:exewithsource=true -o InForm/UiEditorPreview.exe InForm/UiEditorPreview.bas
cd InForm
UiEditor
goto end)
if exist qb64pe.exe (
qb64pe -x -p -o InForm/UiEditor.exe InForm/UiEditor.bas
qb64pe -x -p -s:exewithsource=true -o InForm/UiEditorPreview.exe InForm/UiEditorPreview.bas
cd InForm
UiEditor
goto end)
echo qb64 or qb64pe not found. Setup Terminated.
:end
endlocal
..\QB64pe\internal\c\c_compiler\bin\mingw32-make.exe -f makefile.inform clean OS=win QB64PE_PATH=../QB64pe/
..\QB64pe\internal\c\c_compiler\bin\mingw32-make.exe -f makefile.inform OS=win QB64PE_PATH=../QB64pe/