mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2025-01-14 19:49:33 +00:00
Initial cleanup
This commit is contained in:
parent
fb177d6abf
commit
a3ba9a6feb
22 changed files with 6908 additions and 17574 deletions
166
.clang-format
166
.clang-format
|
@ -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
|
|
||||||
...
|
|
||||||
|
|
10115
InForm/FreeTypeAmalgam.h
10115
InForm/FreeTypeAmalgam.h
File diff suppressed because it is too large
Load diff
456
InForm/InForm.bi
456
InForm/InForm.bi
|
@ -1,253 +1,235 @@
|
||||||
'InForm - GUI library for QB64
|
'InForm - GUI library for QB64
|
||||||
'Fellippe Heitor, 2016-2019 - fellippe@qb64.org - @fellippeheitor
|
'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
|
$IF WIN THEN
|
||||||
Function __UI_GetPID Alias getpid ()
|
DECLARE LIBRARY
|
||||||
End Declare
|
FUNCTION GetSystemMetrics& (BYVAL WhichMetric&)
|
||||||
|
|
||||||
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&)
|
|
||||||
END DECLARE
|
END DECLARE
|
||||||
$End If
|
|
||||||
|
|
||||||
$ScreenHide
|
CONST __UI_SM_SWAPBUTTON = 23
|
||||||
_ControlChr Off
|
$END IF
|
||||||
|
|
||||||
Type __UI_ControlTYPE
|
$SCREENHIDE
|
||||||
ID As Long
|
_CONTROLCHR OFF
|
||||||
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
|
TYPE __UI_ControlTYPE
|
||||||
Name As String * 16
|
ID AS LONG
|
||||||
Count As Long
|
ParentID AS LONG
|
||||||
TurnsInto As Integer
|
PreviousParentID AS LONG
|
||||||
DefaultHeight As Integer
|
ContextMenuID AS LONG
|
||||||
MinimumHeight As Integer
|
Type AS INTEGER
|
||||||
DefaultWidth As Integer
|
Name AS STRING * 40
|
||||||
MinimumWidth As Integer
|
ParentName AS STRING * 40
|
||||||
RestrictResize As _Byte
|
SubMenu AS _BYTE
|
||||||
End Type
|
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
|
TYPE __UI_Types
|
||||||
FileName As String * 32
|
Name AS STRING * 16
|
||||||
Handle As Long
|
Count AS LONG
|
||||||
End Type
|
TurnsInto AS INTEGER
|
||||||
|
DefaultHeight AS INTEGER
|
||||||
|
MinimumHeight AS INTEGER
|
||||||
|
DefaultWidth AS INTEGER
|
||||||
|
MinimumWidth AS INTEGER
|
||||||
|
RestrictResize AS _BYTE
|
||||||
|
END TYPE
|
||||||
|
|
||||||
Type __UI_WordWrapHistoryType
|
TYPE __UI_ThemeImagesType
|
||||||
StringSlot As Long
|
FileName AS STRING * 32
|
||||||
Width As Integer
|
Handle AS LONG
|
||||||
LongestLine As Integer
|
END TYPE
|
||||||
Font As Long
|
|
||||||
TotalLines As Integer
|
|
||||||
End Type
|
|
||||||
|
|
||||||
Type __UI_KeyCombos
|
TYPE __UI_WordWrapHistoryType
|
||||||
Combo As String * 14 ' "CTRL+SHIFT+F12"
|
StringSlot AS LONG
|
||||||
FriendlyCombo As String * 14 ' "Ctrl+Shift+F12"
|
Width AS INTEGER
|
||||||
ControlID As Long
|
LongestLine AS INTEGER
|
||||||
End Type
|
Font AS LONG
|
||||||
|
TotalLines AS INTEGER
|
||||||
|
END TYPE
|
||||||
|
|
||||||
ReDim Shared Caption(0 To 100) As String
|
TYPE __UI_KeyCombos
|
||||||
ReDim Shared __UI_TempCaptions(0 To 100) As String
|
Combo AS STRING * 14 ' "CTRL+SHIFT+F12"
|
||||||
ReDim Shared Text(0 To 100) As String
|
FriendlyCombo AS STRING * 14 ' "Ctrl+Shift+F12"
|
||||||
ReDim Shared __UI_TempTexts(0 To 100) As String
|
ControlID AS LONG
|
||||||
ReDim Shared Mask(0 To 100) As String
|
END TYPE
|
||||||
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
|
REDIM SHARED Caption(0 TO 100) AS STRING
|
||||||
Dim Shared table1252$(0 To 255), table437$(0 To 255)
|
REDIM SHARED __UI_TempCaptions(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_MouseLeft As Integer, __UI_MouseTop As Integer
|
REDIM SHARED Text(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_MouseWheel As Integer, __UI_MouseButtonsSwap As _Byte
|
REDIM SHARED __UI_TempTexts(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_PrevMouseLeft As Integer, __UI_PrevMouseTop As Integer
|
REDIM SHARED Mask(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_MouseButton1 As _Byte, __UI_MouseButton2 As _Byte
|
REDIM SHARED __UI_TempMask(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_MouseIsDown As _Byte, __UI_MouseDownOnID As Long
|
REDIM SHARED ToolTip(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_Mouse2IsDown As _Byte, __UI_Mouse2DownOnID As Long
|
REDIM SHARED __UI_TempTips(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_PreviousMouseDownOnID As Long
|
REDIM SHARED Control(0 TO 100) AS __UI_ControlTYPE
|
||||||
Dim Shared __UI_KeyIsDown As _Byte, __UI_KeyDownOnID As Long
|
REDIM SHARED ControlDrawOrder(0) AS LONG
|
||||||
Dim Shared __UI_ShiftIsDown As _Byte, __UI_CtrlIsDown As _Byte
|
REDIM SHARED __UI_ThemeImages(0 TO 100) AS __UI_ThemeImagesType
|
||||||
Dim Shared __UI_AltIsDown As _Byte, __UI_ShowHotKeys As _Byte, __UI_AltCombo$
|
REDIM SHARED __UI_WordWrapHistoryTexts(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_LastMouseClick As Single, __UI_MouseDownOnScrollbar As Single
|
REDIM SHARED __UI_WordWrapHistoryResults(0 TO 100) AS STRING
|
||||||
Dim Shared __UI_DragX As Integer, __UI_DragY As Integer
|
REDIM SHARED __UI_WordWrapHistory(0 TO 100) AS __UI_WordWrapHistoryType
|
||||||
Dim Shared __UI_DefaultButtonID As Long
|
REDIM SHARED __UI_ThisLineChars(0) AS LONG, __UI_FocusedTextBoxChars(0) AS LONG
|
||||||
Dim Shared __UI_KeyHit As Long, __UI_KeepFocus As _Byte
|
REDIM SHARED __UI_ActiveMenu(0 TO 100) AS LONG, __UI_ParentMenu(0 TO 100) AS LONG
|
||||||
Dim Shared __UI_Focus As Long, __UI_PreviousFocus As Long, __UI_KeyboardFocus As _Byte
|
REDIM SHARED __UI_KeyCombo(0 TO 100) AS __UI_KeyCombos
|
||||||
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_TotalKeyCombos AS LONG, __UI_BypassKeyCombos AS _BYTE
|
||||||
Dim Shared __UI_IsResizing As _Byte, __UI_ResizingID As Long
|
DIM SHARED table1252$(0 TO 255), table437$(0 TO 255)
|
||||||
Dim Shared __UI_ResizeHandleHover As _Byte
|
DIM SHARED __UI_MouseLeft AS INTEGER, __UI_MouseTop AS INTEGER
|
||||||
Dim Shared __UI_IsSelectingText As _Byte, __UI_IsSelectingTextOnID As Long
|
DIM SHARED __UI_MouseWheel AS INTEGER, __UI_MouseButtonsSwap AS _BYTE
|
||||||
Dim Shared __UI_SelectedText As String, __UI_SelectionLength As Long
|
DIM SHARED __UI_PrevMouseLeft AS INTEGER, __UI_PrevMouseTop AS INTEGER
|
||||||
Dim Shared __UI_StateHasChanged As _Byte
|
DIM SHARED __UI_MouseButton1 AS _BYTE, __UI_MouseButton2 AS _BYTE
|
||||||
Dim Shared __UI_DraggingThumb As _Byte, __UI_ThumbDragTop As Integer
|
DIM SHARED __UI_MouseIsDown AS _BYTE, __UI_MouseDownOnID AS LONG
|
||||||
Dim Shared __UI_DraggingThumbOnID As Long
|
DIM SHARED __UI_Mouse2IsDown AS _BYTE, __UI_Mouse2DownOnID AS LONG
|
||||||
Dim Shared __UI_HasInput As _Byte, __UI_ProcessInputTimer As Single
|
DIM SHARED __UI_PreviousMouseDownOnID AS LONG
|
||||||
Dim Shared __UI_UnloadSignal As _Byte, __UI_HasResized As _Byte
|
DIM SHARED __UI_KeyIsDown AS _BYTE, __UI_KeyDownOnID AS LONG
|
||||||
Dim Shared __UI_ExitTriggered As _Byte
|
DIM SHARED __UI_ShiftIsDown AS _BYTE, __UI_CtrlIsDown AS _BYTE
|
||||||
Dim Shared __UI_Loaded As _Byte
|
DIM SHARED __UI_AltIsDown AS _BYTE, __UI_ShowHotKeys AS _BYTE, __UI_AltCombo$
|
||||||
Dim Shared __UI_EventsTimer As Integer, __UI_RefreshTimer As Integer
|
DIM SHARED __UI_LastMouseClick AS SINGLE, __UI_MouseDownOnScrollbar AS SINGLE
|
||||||
Dim Shared __UI_ActiveDropdownList As Long, __UI_ParentDropdownList As Long
|
DIM SHARED __UI_DragX AS INTEGER, __UI_DragY AS INTEGER
|
||||||
Dim Shared __UI_TotalActiveMenus As Long, __UI_ActiveMenuIsContextMenu As _Byte
|
DIM SHARED __UI_DefaultButtonID AS LONG
|
||||||
Dim Shared __UI_SubMenuDelay As Single, __UI_HoveringSubMenu As _Byte
|
DIM SHARED __UI_KeyHit AS LONG, __UI_KeepFocus AS _BYTE
|
||||||
Dim Shared __UI_TopMenuBarItem As Long
|
DIM SHARED __UI_Focus AS LONG, __UI_PreviousFocus AS LONG, __UI_KeyboardFocus AS _BYTE
|
||||||
Dim Shared __UI_ActiveTipID As Long, __UI_TipTimer As Single, __UI_PreviousTipID As Long
|
DIM SHARED __UI_HoveringID AS LONG, __UI_LastHoveringID AS LONG, __UI_BelowHoveringID AS LONG
|
||||||
Dim Shared __UI_ActiveTipTop As Integer, __UI_ActiveTipLeft As Integer
|
DIM SHARED __UI_IsDragging AS _BYTE, __UI_DraggingID AS LONG
|
||||||
Dim Shared __UI_FormID As Long, __UI_HasMenuBar As Long
|
DIM SHARED __UI_IsResizing AS _BYTE, __UI_ResizingID AS LONG
|
||||||
Dim Shared __UI_ScrollbarWidth As Integer, __UI_ScrollbarButtonHeight As Integer
|
DIM SHARED __UI_ResizeHandleHover AS _BYTE
|
||||||
Dim Shared __UI_MenuBarOffset As Integer, __UI_MenuItemOffset As Integer
|
DIM SHARED __UI_IsSelectingText AS _BYTE, __UI_IsSelectingTextOnID AS LONG
|
||||||
Dim Shared __UI_NewMenuBarTextLeft As Integer, __UI_DefaultCaptionIndent As Integer
|
DIM SHARED __UI_SelectedText AS STRING, __UI_SelectionLength AS LONG
|
||||||
Dim Shared __UI_ForceRedraw As _Byte, __UI_AutoRefresh As _Byte
|
DIM SHARED __UI_StateHasChanged AS _BYTE
|
||||||
Dim Shared __UI_CurrentTitle As String
|
DIM SHARED __UI_DraggingThumb AS _BYTE, __UI_ThumbDragTop AS INTEGER
|
||||||
Dim Shared __UI_DesignMode As _Byte, __UI_FirstSelectedID As Long
|
DIM SHARED __UI_DraggingThumbOnID AS LONG
|
||||||
Dim Shared __UI_WaitMessage As String, __UI_TotalSelectedControls As Long
|
DIM SHARED __UI_HasInput AS _BYTE, __UI_ProcessInputTimer AS SINGLE
|
||||||
Dim Shared __UI_WaitMessageHandle As Long, __UI_EditorMode As _Byte
|
DIM SHARED __UI_UnloadSignal AS _BYTE, __UI_HasResized AS _BYTE
|
||||||
Dim Shared __UI_LastRenderedLineWidth As Long, __UI_LastRenderedCharCount As Long
|
DIM SHARED __UI_ExitTriggered AS _BYTE
|
||||||
Dim Shared __UI_SelectionRectangleTop As Integer, __UI_SelectionRectangleLeft As Integer
|
DIM SHARED __UI_Loaded AS _BYTE
|
||||||
Dim Shared __UI_SelectionRectangle As _Byte
|
DIM SHARED __UI_EventsTimer AS INTEGER, __UI_RefreshTimer AS INTEGER
|
||||||
Dim Shared __UI_CantShowContextMenu As _Byte, __UI_ShowPositionAndSize As _Byte
|
DIM SHARED __UI_ActiveDropdownList AS LONG, __UI_ParentDropdownList AS LONG
|
||||||
Dim Shared __UI_ShowInvisibleControls As _Byte, __UI_Snapped As _Byte
|
DIM SHARED __UI_TotalActiveMenus AS LONG, __UI_ActiveMenuIsContextMenu AS _BYTE
|
||||||
Dim Shared __UI_SnappedByProximityX As _Byte, __UI_SnappedByProximityY As _Byte
|
DIM SHARED __UI_SubMenuDelay AS SINGLE, __UI_HoveringSubMenu AS _BYTE
|
||||||
Dim Shared __UI_SnappedX As Integer, __UI_SnappedY As Integer
|
DIM SHARED __UI_TopMenuBarItem AS LONG
|
||||||
Dim Shared __UI_SnappedXID As Long, __UI_SnappedYID As Long
|
DIM SHARED __UI_ActiveTipID AS LONG, __UI_TipTimer AS SINGLE, __UI_PreviousTipID AS LONG
|
||||||
Dim Shared __UI_SnapLines As _Byte, __UI_SnapDistance As Integer, __UI_SnapDistanceFromForm As Integer
|
DIM SHARED __UI_ActiveTipTop AS INTEGER, __UI_ActiveTipLeft AS INTEGER
|
||||||
Dim Shared __UI_FrameRate As Single, __UI_Font8Offset As Integer, __UI_Font16Offset As Integer
|
DIM SHARED __UI_FormID AS LONG, __UI_HasMenuBar AS LONG
|
||||||
Dim Shared __UI_ClipboardCheck$, __UI_MenuBarOffsetV As Integer
|
DIM SHARED __UI_ScrollbarWidth AS INTEGER, __UI_ScrollbarButtonHeight AS INTEGER
|
||||||
Dim Shared __UI_KeepScreenHidden As _Byte, __UI_MaxBorderSize As Integer
|
DIM SHARED __UI_MenuBarOffset AS INTEGER, __UI_MenuItemOffset AS INTEGER
|
||||||
Dim Shared __UI_InternalContextMenus As Long, __UI_DidClick As _Byte
|
DIM SHARED __UI_NewMenuBarTextLeft AS INTEGER, __UI_DefaultCaptionIndent AS INTEGER
|
||||||
Dim Shared __UI_ContextMenuSourceID As Long
|
DIM SHARED __UI_ForceRedraw AS _BYTE, __UI_AutoRefresh AS _BYTE
|
||||||
Dim Shared __UI_FKey(1 To 12) As Long
|
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: -----------------------------------------------
|
'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_Form).Name = "Form"
|
||||||
|
|
||||||
__UI_Type(__UI_Type_Frame).Name = "Frame"
|
__UI_Type(__UI_Type_Frame).Name = "Frame"
|
||||||
|
@ -325,7 +307,8 @@ __UI_Type(__UI_Type_ToggleSwitch).RestrictResize = __UI_CantResize
|
||||||
|
|
||||||
__UI_RestoreFKeys
|
__UI_RestoreFKeys
|
||||||
|
|
||||||
CONST True = -1, False = 0
|
CONST False = 0, True = Not False
|
||||||
|
|
||||||
'$INCLUDE:'InFormVersion.bas'
|
'$INCLUDE:'InFormVersion.bas'
|
||||||
__UI_SubMenuDelay = .4
|
__UI_SubMenuDelay = .4
|
||||||
__UI_SnapDistance = 5
|
__UI_SnapDistance = 5
|
||||||
|
@ -347,6 +330,7 @@ DO
|
||||||
LOOP
|
LOOP
|
||||||
|
|
||||||
SYSTEM
|
SYSTEM
|
||||||
|
|
||||||
__UI_ErrorHandler:
|
__UI_ErrorHandler:
|
||||||
RESUME NEXT
|
RESUME NEXT
|
||||||
|
|
||||||
|
|
151
InForm/InForm.ui
151
InForm/InForm.ui
|
@ -42,40 +42,6 @@ FUNCTION __UI_NumericWithBounds%%: __UI_NumericWithBounds%% = 2: END FUNCTION
|
||||||
FUNCTION __UI_CheckMark%%: __UI_CheckMark%% = 0: END FUNCTION
|
FUNCTION __UI_CheckMark%%: __UI_CheckMark%% = 0: END FUNCTION
|
||||||
FUNCTION __UI_Bullet%%: __UI_Bullet%% = 1: 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
|
'General constants
|
||||||
FUNCTION __UI_ToolTipTimeOut!: __UI_ToolTipTimeOut! = .8: END FUNCTION
|
FUNCTION __UI_ToolTipTimeOut!: __UI_ToolTipTimeOut! = .8: END FUNCTION
|
||||||
FUNCTION __UI_CantResizeV%%: __UI_CantResizeV%% = 1: 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
|
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&
|
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
|
END FUNCTION
|
||||||
|
|
||||||
'---------------------------------------------------------------------------------
|
'---------------------------------------------------------------------------------
|
||||||
|
@ -717,7 +684,7 @@ SUB __UI_ProcessInput
|
||||||
IF __UI_HasMenuBar = True THEN
|
IF __UI_HasMenuBar = True THEN
|
||||||
'Add menubar div to main form's canvas
|
'Add menubar div to main form's canvas
|
||||||
_FONT Control(__UI_FormID).Font
|
_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 - 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)
|
LINE (0, __UI_MenuBarOffsetV)-STEP(Control(__UI_FormID).Width - 1, 0), Darken(Control(__UI_FormID).BackColor, 120)
|
||||||
__UI_RefreshMenuBar
|
__UI_RefreshMenuBar
|
||||||
|
@ -795,9 +762,9 @@ SUB __UI_UpdateDisplay
|
||||||
CLS
|
CLS
|
||||||
IF __UI_HasMenuBar THEN
|
IF __UI_HasMenuBar THEN
|
||||||
_FONT Control(__UI_FormID).Font
|
_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, 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, _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, 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)
|
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
|
ELSE
|
||||||
__UI_MenuBarOffsetV = 0
|
__UI_MenuBarOffsetV = 0
|
||||||
END IF
|
END IF
|
||||||
|
@ -834,7 +801,7 @@ SUB __UI_UpdateDisplay
|
||||||
_PRINTMODE _KEEPBACKGROUND
|
_PRINTMODE _KEEPBACKGROUND
|
||||||
COLOR _RGBA32(0, 0, 0, 150)
|
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), 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
|
GOTO BypassDisplay
|
||||||
ELSEIF Control(i).Hidden = True THEN
|
ELSEIF Control(i).Hidden = True THEN
|
||||||
GOTO BypassDisplay
|
GOTO BypassDisplay
|
||||||
|
@ -1282,7 +1249,7 @@ SUB __UI_UpdateDisplay
|
||||||
COLOR __UI_DefaultColor(__UI_Type_Form, 1)
|
COLOR __UI_DefaultColor(__UI_Type_Form, 1)
|
||||||
|
|
||||||
IF TotalLines = 1 THEN
|
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
|
ELSE
|
||||||
DO WHILE LEN(TempCaption$)
|
DO WHILE LEN(TempCaption$)
|
||||||
ThisLine% = ThisLine% + 1
|
ThisLine% = ThisLine% + 1
|
||||||
|
@ -1438,7 +1405,6 @@ SUB __UI_EventDispatcher
|
||||||
STATIC __UI_JustOpenedMenu AS _BYTE
|
STATIC __UI_JustOpenedMenu AS _BYTE
|
||||||
STATIC OriginalDragX AS INTEGER, OriginalDragY AS INTEGER
|
STATIC OriginalDragX AS INTEGER, OriginalDragY AS INTEGER
|
||||||
STATIC OriginalResizeRightSide AS INTEGER, OriginalResizeBottom 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 i AS LONG, j AS LONG, ThisItem%, TempParent AS LONG
|
||||||
DIM ContainerOffsetLeft AS INTEGER, ContainerOffsetTop AS INTEGER
|
DIM ContainerOffsetLeft AS INTEGER, ContainerOffsetTop AS INTEGER
|
||||||
|
|
||||||
|
@ -2097,7 +2063,7 @@ SUB __UI_EventDispatcher
|
||||||
ThisLineLen = LEN(ThisLine$)
|
ThisLineLen = LEN(ThisLine$)
|
||||||
|
|
||||||
'Print the text offscreen just to fill the right variables
|
'Print the text offscreen just to fill the right variables
|
||||||
__UI_PrintString _WIDTH + 10, _HEIGHT + 10, ThisLine$
|
__UI_CharPos ThisLine$
|
||||||
|
|
||||||
'New cursor position:
|
'New cursor position:
|
||||||
FOR i = 1 TO __UI_LastRenderedCharCount
|
FOR i = 1 TO __UI_LastRenderedCharCount
|
||||||
|
@ -2161,7 +2127,7 @@ SUB __UI_EventDispatcher
|
||||||
__UI_FillSelectedText 0, 0
|
__UI_FillSelectedText 0, 0
|
||||||
|
|
||||||
'Print the text offscreen just to fill the right variables
|
'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
|
'Single-line textbox click
|
||||||
FOR i = 1 TO __UI_LastRenderedCharCount
|
FOR i = 1 TO __UI_LastRenderedCharCount
|
||||||
|
@ -2261,7 +2227,7 @@ SUB __UI_EventDispatcher
|
||||||
_FONT (Control(__UI_IsSelectingTextOnID).Font)
|
_FONT (Control(__UI_IsSelectingTextOnID).Font)
|
||||||
IF NOT Control(__UI_IsSelectingTextOnID).Multiline THEN
|
IF NOT Control(__UI_IsSelectingTextOnID).Multiline THEN
|
||||||
'Print the text offscreen just to fill the right variables
|
'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
|
IF NOT WholeWordSelection THEN
|
||||||
'Single line selection, char by char
|
'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
|
IF Control(__UI_IsSelectingTextOnID).CurrentLine = 0 THEN Control(__UI_IsSelectingTextOnID).CurrentLine = 1
|
||||||
ThisLine$ = __UI_GetTextBoxLine(__UI_IsSelectingTextOnID, Control(__UI_IsSelectingTextOnID).CurrentLine, ThisLineStart)
|
ThisLine$ = __UI_GetTextBoxLine(__UI_IsSelectingTextOnID, Control(__UI_IsSelectingTextOnID).CurrentLine, ThisLineStart)
|
||||||
ThisLineLen = LEN(ThisLine$)
|
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:
|
'New cursor position:
|
||||||
FOR i = 1 TO __UI_LastRenderedCharCount
|
FOR i = 1 TO __UI_LastRenderedCharCount
|
||||||
|
@ -4761,7 +4727,7 @@ SUB __UI_AdjustNewMenuBarTopHeight (NextSlot AS LONG)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font
|
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
|
Control(NextSlot).Top = 0
|
||||||
|
|
||||||
IF TempCanvas <> 0 THEN
|
IF TempCanvas <> 0 THEN
|
||||||
|
@ -4778,9 +4744,9 @@ SUB __UI_AdjustNewMenuBarTopHeight (NextSlot AS LONG)
|
||||||
COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor
|
COLOR Control(__UI_FormID).ForeColor, Control(__UI_FormID).BackColor
|
||||||
CLS
|
CLS
|
||||||
IF Control(__UI_FormID).Font THEN _FONT Control(__UI_FormID).Font
|
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
|
__UI_MenuBarOffsetV = _ulinespacing + (((_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, _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, 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)
|
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
|
_DEST 0
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
@ -5699,6 +5665,7 @@ SUB __UI_ListBoxSearchItem (This AS __UI_ControlTYPE)
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
'---------------------------------------------------------------------------------
|
'---------------------------------------------------------------------------------
|
||||||
|
|
||||||
SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$)
|
SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$)
|
||||||
DIM Utf$
|
DIM Utf$
|
||||||
|
|
||||||
|
@ -5712,14 +5679,42 @@ SUB __UI_PrintString(Left AS INTEGER, Top AS INTEGER, Text$)
|
||||||
END IF
|
END IF
|
||||||
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
|
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
|
REDIM _PRESERVE __UI_ThisLineChars(__UI_LastRenderedCharCount) AS LONG
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
'---------------------------------------------------------------------------------
|
'---------------------------------------------------------------------------------
|
||||||
FUNCTION __UI_PrintWidth&(Text$)
|
FUNCTION __UI_PrintWidth&(Text$)
|
||||||
__UI_PrintWidth& = uprintwidth(Text$, LEN(Text$), 0)
|
__UI_PrintWidth& = _UPRINTWIDTH(Text$, 8)
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
'---------------------------------------------------------------------------------
|
'---------------------------------------------------------------------------------
|
||||||
|
@ -5868,23 +5863,6 @@ FUNCTION __UI_WordWrap$ (PassedText AS STRING, Width AS INTEGER, LongestLine AS
|
||||||
END IF
|
END IF
|
||||||
END FUNCTION
|
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!)
|
FUNCTION __UI_MAP! (value!, minRange!, maxRange!, newMinRange!, newMaxRange!)
|
||||||
__UI_MAP! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
|
__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
|
IF This.Type = __UI_Type_MenuBar THEN
|
||||||
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Left = This.Left
|
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
|
__UI_TopMenuBarItem = This.ID
|
||||||
ELSEIF This.Type = __UI_Type_MenuItem THEN
|
ELSEIF This.Type = __UI_Type_MenuItem THEN
|
||||||
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Left = Control(This.MenuPanelID).Left + Control(This.MenuPanelID).Width - __UI_MenuItemOffset / 4
|
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
|
END IF
|
||||||
|
|
||||||
'Calculate panel's width and position the menu items
|
'Calculate panel's width and position the menu items
|
||||||
ItemHeight = falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
|
ItemHeight = _ulinespacing + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset) + 3
|
||||||
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = (((_FONT = 8) * -1) * 3 + falcon_uspacing&) / 4
|
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Height = (((_FONT = 8) * -1) * 3 + _ulinespacing) / 4
|
||||||
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Width = 0
|
Control(__UI_ActiveMenu(__UI_TotalActiveMenus)).Width = 0
|
||||||
CurrentGroup = 1
|
CurrentGroup = 1
|
||||||
ComboSpacing = 0
|
ComboSpacing = 0
|
||||||
|
@ -6053,7 +6031,7 @@ SUB __UI_ActivateMenu (This AS __UI_ControlTYPE, SelectFirstItem AS _BYTE)
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
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
|
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
|
ELSE
|
||||||
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
||||||
END IF
|
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:
|
'Hot key:
|
||||||
IF (This.HotKey > 0 AND (__UI_ShowHotKeys AND NOT This.Disabled)) OR (This.HotKey > 0 AND __UI_DesignMode) THEN
|
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
|
END IF
|
||||||
|
|
||||||
'Focus outline:
|
'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 ((__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
|
IF LEN(Text(This.ID)) THEN
|
||||||
__UI_PrintString CaptionIndent - This.InputViewStart, ((This.Height \ 2) - uspacing& \ 2), ThisTempText$
|
__UI_PrintString CaptionIndent - This.InputViewStart, ((This.Height \ 2) - uspacing& \ 2), ThisTempText$
|
||||||
|
__UI_CharPos ThisTempText$
|
||||||
ELSE
|
ELSE
|
||||||
__UI_PrintString CaptionIndent, ((This.Height \ 2) - uspacing& \ 2), TempCaption$
|
__UI_PrintString CaptionIndent, ((This.Height \ 2) - uspacing& \ 2), TempCaption$
|
||||||
|
__UI_CharPos TempCaption$
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF This.TextIsSelected THEN
|
IF This.TextIsSelected THEN
|
||||||
|
@ -8350,7 +8330,7 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE)
|
||||||
'Hot key:
|
'Hot key:
|
||||||
IF (This.HotKey > 0 AND (__UI_ShowHotKeys AND NOT This.Disabled)) OR (This.HotKey > 0 AND __UI_DesignMode) THEN
|
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))
|
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
|
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)
|
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
||||||
END IF
|
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
|
IF This.HotKey > 0 AND (__UI_AltIsDown OR Control(__UI_Focus).Type = __UI_Type_MenuBar OR __UI_DesignMode) THEN
|
||||||
'Has "hot-key"
|
'Has "hot-key"
|
||||||
Temp& = __UI_PrintWidth(CHR$(This.HotKey))
|
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
|
END IF
|
||||||
|
|
||||||
IF __UI_DesignMode THEN
|
IF __UI_DesignMode THEN
|
||||||
|
@ -8427,8 +8407,8 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE)
|
||||||
_DEST Control(__UI_FormID).Canvas
|
_DEST Control(__UI_FormID).Canvas
|
||||||
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
||||||
_FONT (This.Font)
|
_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
|
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) - (falcon_uspacing& + (((_FONT = 8) * -1) * __UI_Font8Offset + ((_FONT = 16) * -1) * __UI_Font16Offset)) \ 2), "Add new"
|
__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
|
||||||
END IF
|
END IF
|
||||||
'---
|
'---
|
||||||
|
@ -8516,9 +8496,9 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, Parent AS LONG)
|
||||||
CheckMarkIndex = 3
|
CheckMarkIndex = 3
|
||||||
END IF
|
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
|
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
|
END IF
|
||||||
|
|
||||||
IF Control(i).SubMenu THEN
|
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
|
IF Control(i).HotKey > 0 THEN
|
||||||
'Has "hot-key"
|
'Has "hot-key"
|
||||||
Temp& = __UI_PrintWidth(CHR$(Control(i).HotKey))
|
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
|
END IF
|
||||||
|
|
||||||
IF Control(i).Value = True THEN
|
IF Control(i).Value = True THEN
|
||||||
'Checked menu item
|
'Checked menu item
|
||||||
IF Control(i).BulletStyle = __UI_Bullet%% THEN
|
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
|
ELSE
|
||||||
_PUTIMAGE (__UI_MenuItemOffset \ 2 - CheckMarkWidth \ 2, Control(i).Top + Control(i).Height \ 2 - CheckMarkHeight \ 2), ControlImage, , (0, CheckMarkIndex * CheckMarkHeight - CheckMarkHeight)-STEP(6, 6)
|
_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
|
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
|
IF __UI_DesignMode AND LEFT$(This.Name, 5) <> "__UI_" THEN
|
||||||
COLOR Darken(Control(__UI_FormID).BackColor, 80)
|
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
|
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
|
LINE (bX, bY)-STEP(bW, bH), C, BF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
'Starting with v1.0, __UI_VersionNumber is actually the current build.
|
'Starting with v1.0, __UI_VersionNumber is actually the current build.
|
||||||
Const __UI_Version = "v1.4"
|
|
||||||
Const __UI_VersionNumber = 21
|
$IF INFORMVERSION_BAS = UNDEFINED THEN
|
||||||
Const __UI_VersionIsBeta = 0
|
$LET INFORMVERSION_BAS = TRUE
|
||||||
Const __UI_CopyrightSpan = "2016-2021"
|
CONST __UI_Version = "v1.5"
|
||||||
|
CONST __UI_VersionNumber = 0
|
||||||
|
CONST __UI_VersionIsBeta = 1
|
||||||
|
CONST __UI_CopyrightSpan = "2016-2023"
|
||||||
|
$END IF
|
||||||
|
|
||||||
|
|
5972
InForm/UiEditor.bas
5972
InForm/UiEditor.bas
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,63 +1,67 @@
|
||||||
Function Download$ (url$, file$, timelimit) Static
|
$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
|
'as seen on http://www.qb64.org/wiki/Downloading_Files
|
||||||
'adapted for use with InForm
|
'adapted for use with InForm
|
||||||
|
|
||||||
Dim theClient As Long, l As Long
|
DIM theClient AS LONG, l AS LONG
|
||||||
Dim prevUrl$, prevUrl2$, url2$, x As Long
|
DIM prevUrl$, prevUrl2$, url2$, x AS LONG
|
||||||
Dim e$, url3$, x$, t!, a2$, a$, i As Long
|
DIM e$, url3$, x$, t!, a2$, a$, i AS LONG
|
||||||
Dim i2 As Long, i3 As Long, d$, fh As Long
|
DIM i2 AS LONG, i3 AS LONG, d$, fh AS LONG
|
||||||
|
|
||||||
If url$ <> prevUrl$ Or url$ = "" Then
|
IF url$ <> prevUrl$ OR url$ = "" THEN
|
||||||
prevUrl$ = url$
|
prevUrl$ = url$
|
||||||
If url$ = "" Then
|
IF url$ = "" THEN
|
||||||
If theClient Then Close theClient: theClient = 0
|
IF theClient THEN CLOSE theClient: theClient = 0
|
||||||
Exit Function
|
EXIT FUNCTION
|
||||||
End If
|
END IF
|
||||||
url2$ = url$
|
url2$ = url$
|
||||||
x = InStr(url2$, "/")
|
x = INSTR(url2$, "/")
|
||||||
If x Then url2$ = Left$(url$, x - 1)
|
IF x THEN url2$ = LEFT$(url$, x - 1)
|
||||||
If url2$ <> prevUrl2$ Then
|
IF url2$ <> prevUrl2$ THEN
|
||||||
prevUrl2$ = url2$
|
prevUrl2$ = url2$
|
||||||
If theClient Then Close theClient: theClient = 0
|
IF theClient THEN CLOSE theClient: theClient = 0
|
||||||
theClient = _OpenClient("TCP/IP:80:" + url2$)
|
theClient = _OPENCLIENT("TCP/IP:80:" + url2$)
|
||||||
If theClient = 0 Then Download = MKI$(2): prevUrl$ = "": Exit Function
|
IF theClient = 0 THEN Download = MKI$(2): prevUrl$ = "": EXIT FUNCTION
|
||||||
End If
|
END IF
|
||||||
e$ = Chr$(13) + Chr$(10) ' end of line characters
|
e$ = CHR$(13) + CHR$(10) ' end of line characters
|
||||||
url3$ = Right$(url$, Len(url$) - x + 1)
|
url3$ = RIGHT$(url$, LEN(url$) - x + 1)
|
||||||
x$ = "GET " + url3$ + " HTTP/1.1" + e$
|
x$ = "GET " + url3$ + " HTTP/1.1" + e$
|
||||||
x$ = x$ + "Host: " + url2$ + e$ + e$
|
x$ = x$ + "Host: " + url2$ + e$ + e$
|
||||||
Put #theClient, , x$
|
PUT #theClient, , x$
|
||||||
t! = Timer ' start time
|
t! = TIMER ' start time
|
||||||
End If
|
END IF
|
||||||
|
|
||||||
Get #theClient, , a2$
|
GET #theClient, , a2$
|
||||||
a$ = a$ + a2$
|
a$ = a$ + a2$
|
||||||
i = InStr(a$, "Content-Length:")
|
i = INSTR(a$, "Content-Length:")
|
||||||
If i Then
|
IF i THEN
|
||||||
i2 = InStr(i, a$, e$)
|
i2 = INSTR(i, a$, e$)
|
||||||
If i2 Then
|
IF i2 THEN
|
||||||
l = Val(Mid$(a$, i + 15, i2 - i - 14))
|
l = VAL(MID$(a$, i + 15, i2 - i - 14))
|
||||||
i3 = InStr(i2, a$, e$ + e$)
|
i3 = INSTR(i2, a$, e$ + e$)
|
||||||
If i3 Then
|
IF i3 THEN
|
||||||
i3 = i3 + 4 'move i3 to start of data
|
i3 = i3 + 4 'move i3 to start of data
|
||||||
If (Len(a$) - i3 + 1) = l Then
|
IF (LEN(a$) - i3 + 1) = l THEN
|
||||||
d$ = Mid$(a$, i3, l)
|
d$ = MID$(a$, i3, l)
|
||||||
fh = FreeFile
|
fh = FREEFILE
|
||||||
Open file$ For Output As #fh: Close #fh 'Warning! Clears data from existing file
|
OPEN file$ FOR OUTPUT AS #fh: CLOSE #fh 'Warning! Clears data from existing file
|
||||||
Open file$ For Binary As #fh
|
OPEN file$ FOR BINARY AS #fh
|
||||||
Put #fh, , d$
|
PUT #fh, , d$
|
||||||
Close #fh
|
CLOSE #fh
|
||||||
Download = MKI$(1) + MKL$(l) 'indicates download was successful
|
Download = MKI$(1) + MKL$(l) 'indicates download was successful
|
||||||
prevUrl$ = ""
|
prevUrl$ = ""
|
||||||
prevUrl2$ = ""
|
prevUrl2$ = ""
|
||||||
a$ = ""
|
a$ = ""
|
||||||
Close theClient
|
CLOSE theClient
|
||||||
theClient = 0
|
theClient = 0
|
||||||
Exit Function
|
EXIT FUNCTION
|
||||||
End If ' availabledata = l
|
END IF ' availabledata = l
|
||||||
End If ' i3
|
END IF ' i3
|
||||||
End If ' i2
|
END IF ' i2
|
||||||
End If ' i
|
END IF ' i
|
||||||
If Timer > t! + timelimit Then Close theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": Exit Function
|
IF TIMER > t! + timelimit THEN CLOSE theClient: theClient = 0: Download = MKI$(3): prevUrl$ = "": EXIT FUNCTION
|
||||||
Download = MKI$(0) 'still working
|
Download = MKI$(0) 'still working
|
||||||
End Function
|
END FUNCTION
|
||||||
|
$END IF
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
'#######################################################################################
|
'#######################################################################################
|
||||||
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
|
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
|
||||||
|
|
||||||
TYPE GIFDATA
|
$IF GIFPLAY_BI = UNDEFINED THEN
|
||||||
|
$LET GIFPLAY_BI = TRUE
|
||||||
|
|
||||||
|
TYPE GIFDATA
|
||||||
ID AS LONG
|
ID AS LONG
|
||||||
file AS INTEGER
|
file AS INTEGER
|
||||||
sigver AS STRING * 6
|
sigver AS STRING * 6
|
||||||
|
@ -30,9 +33,9 @@ TYPE GIFDATA
|
||||||
LastFrameUpdate AS SINGLE
|
LastFrameUpdate AS SINGLE
|
||||||
LastFrameDelay AS SINGLE
|
LastFrameDelay AS SINGLE
|
||||||
HideOverlay AS _BYTE
|
HideOverlay AS _BYTE
|
||||||
END TYPE
|
END TYPE
|
||||||
|
|
||||||
TYPE FRAMEDATA
|
TYPE FRAMEDATA
|
||||||
ID AS LONG
|
ID AS LONG
|
||||||
thisFrame AS LONG
|
thisFrame AS LONG
|
||||||
addr AS LONG
|
addr AS LONG
|
||||||
|
@ -50,8 +53,10 @@ TYPE FRAMEDATA
|
||||||
disposalMethod AS _UNSIGNED _BYTE
|
disposalMethod AS _UNSIGNED _BYTE
|
||||||
delay AS SINGLE
|
delay AS SINGLE
|
||||||
transColor AS _UNSIGNED _BYTE
|
transColor AS _UNSIGNED _BYTE
|
||||||
END TYPE
|
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
|
|
||||||
|
|
|
@ -6,7 +6,11 @@
|
||||||
'#######################################################################################
|
'#######################################################################################
|
||||||
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
|
'Adapted for use with InForm's PictureBox controls by @FellippeHeitor
|
||||||
|
|
||||||
SUB UpdateGif (ID AS LONG)
|
'$Include:'gifplay.bi'
|
||||||
|
|
||||||
|
$IF GIFPLAY_BM = UNDEFINED THEN
|
||||||
|
$LET GIFPLAY_BM = TRUE
|
||||||
|
SUB UpdateGif (ID AS LONG)
|
||||||
DIM i AS LONG, newFrame AS LONG
|
DIM i AS LONG, newFrame AS LONG
|
||||||
STATIC GifOverlay AS LONG
|
STATIC GifOverlay AS LONG
|
||||||
|
|
||||||
|
@ -879,3 +883,5 @@ FUNCTION gifUnpack$ (PackedData$)
|
||||||
gifUnpack$ = btemp$
|
gifUnpack$ = btemp$
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
'############################################################################################
|
'############################################################################################
|
||||||
|
$endif
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
'-----------------------------------------------------------
|
'-----------------------------------------------------------
|
||||||
|
|
||||||
': Controls' IDs: ------------------------------------------------------------------
|
': Controls' IDs: ------------------------------------------------------------------
|
||||||
Dim Shared gifplaySample As Long
|
DIM SHARED gifplaySample AS LONG
|
||||||
Dim Shared PictureBox1 As Long
|
DIM SHARED PictureBox1 AS LONG
|
||||||
Dim Shared LoadBT As Long
|
DIM SHARED LoadBT AS LONG
|
||||||
Dim Shared PlayBT As Long
|
DIM SHARED PlayBT AS LONG
|
||||||
|
|
||||||
': External modules: ---------------------------------------------------------------
|
': External modules: ---------------------------------------------------------------
|
||||||
'$INCLUDE:'gifplay.bi'
|
'$INCLUDE:'gifplay.bi'
|
||||||
|
@ -49,7 +49,7 @@ SUB __UI_Click (id AS LONG)
|
||||||
Caption(LoadBT) = "globe.gif loaded"
|
Caption(LoadBT) = "globe.gif loaded"
|
||||||
Control(LoadBT).Disabled = True
|
Control(LoadBT).Disabled = True
|
||||||
ELSE
|
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
|
END IF
|
||||||
CASE PlayBT
|
CASE PlayBT
|
||||||
IF GifIsPlaying(PictureBox1) THEN
|
IF GifIsPlaying(PictureBox1) THEN
|
||||||
|
|
|
@ -36,3 +36,4 @@ SUB __UI_AssignIDs
|
||||||
LoadBT = __UI_GetID("LoadBT")
|
LoadBT = __UI_GetID("LoadBT")
|
||||||
PlayBT = __UI_GetID("PlayBT")
|
PlayBT = __UI_GetID("PlayBT")
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
|
254
InForm/falcon.h
254
InForm/falcon.h
|
@ -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;
|
|
||||||
}
|
|
|
@ -4,18 +4,21 @@
|
||||||
'This file isn't required to be at the top of your programs,
|
'This file isn't required to be at the top of your programs,
|
||||||
'unless you intend to use OPTION _EXPLICIT
|
'unless you intend to use OPTION _EXPLICIT
|
||||||
|
|
||||||
'Global variables declaration
|
$IF INI_BI = UNDEFINED THEN
|
||||||
DIM currentIniFileName$
|
$LET INI_BI = TRUE
|
||||||
DIM currentIniFileLOF AS _UNSIGNED LONG
|
'Global variables declaration
|
||||||
DIM IniWholeFile$
|
DIM currentIniFileName$
|
||||||
DIM IniSectionData$
|
DIM currentIniFileLOF AS _UNSIGNED LONG
|
||||||
DIM IniPosition AS _UNSIGNED LONG
|
DIM IniWholeFile$
|
||||||
DIM IniNewFile$
|
DIM IniSectionData$
|
||||||
DIM IniLastSection$
|
DIM IniPosition AS _UNSIGNED LONG
|
||||||
DIM IniLastKey$
|
DIM IniNewFile$
|
||||||
DIM IniLF$
|
DIM IniLastSection$
|
||||||
DIM IniDisableAutoCommit
|
DIM IniLastKey$
|
||||||
DIM IniCODE
|
DIM IniLF$
|
||||||
DIM IniAllowBasicComments
|
DIM IniDisableAutoCommit
|
||||||
DIM IniForceReload
|
DIM IniCODE
|
||||||
|
DIM IniAllowBasicComments
|
||||||
|
DIM IniForceReload
|
||||||
|
$END IF
|
||||||
|
|
||||||
|
|
106
InForm/ini.bm
106
InForm/ini.bm
|
@ -1,7 +1,11 @@
|
||||||
'INI Manager - Beta 4
|
'INI Manager - Beta 4
|
||||||
'Fellippe Heitor, 2017 - fellippe@qb64.org - @fellippeheitor
|
'Fellippe Heitor, 2017 - fellippe@qb64.org - @fellippeheitor
|
||||||
|
|
||||||
SUB IniSortSection (file$, __section$)
|
'$Include:'ini.bi'
|
||||||
|
|
||||||
|
$IF INI_BM = UNDEFINED THEN
|
||||||
|
$LET INI_BM = TRUE
|
||||||
|
SUB IniSortSection (file$, __section$)
|
||||||
SHARED IniCODE, IniLastKey$, IniWholeFile$
|
SHARED IniCODE, IniLastKey$, IniWholeFile$
|
||||||
SHARED IniDisableAutoCommit
|
SHARED IniDisableAutoCommit
|
||||||
|
|
||||||
|
@ -52,9 +56,9 @@ SUB IniSortSection (file$, __section$)
|
||||||
IniCommit ' commit changes.
|
IniCommit ' commit changes.
|
||||||
|
|
||||||
IniCODE = 22
|
IniCODE = 22
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniDeleteSection (file$, __section$)
|
SUB IniDeleteSection (file$, __section$)
|
||||||
SHARED IniNewFile$, IniCODE, currentIniFileName$
|
SHARED IniNewFile$, IniCODE, currentIniFileName$
|
||||||
SHARED IniLF$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
SHARED IniLF$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
||||||
|
|
||||||
|
@ -71,15 +75,14 @@ SUB IniDeleteSection (file$, __section$)
|
||||||
|
|
||||||
IniCommit
|
IniCommit
|
||||||
IniCODE = 13
|
IniCODE = 13
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniDeleteKey (file$, __section$, __key$)
|
SUB IniDeleteKey (file$, __section$, __key$)
|
||||||
SHARED IniPosition AS _UNSIGNED LONG, IniCODE
|
SHARED IniPosition AS _UNSIGNED LONG, IniCODE
|
||||||
SHARED IniLF$, IniWholeFile$, IniSectionData$
|
SHARED IniLF$, IniWholeFile$, IniSectionData$
|
||||||
SHARED IniLastSection$, IniLastKey$, IniNewFile$
|
SHARED IniLastSection$, IniLastKey$, IniNewFile$
|
||||||
|
|
||||||
DIM tempValue$, fileNum AS INTEGER
|
DIM tempValue$, section$, key$
|
||||||
DIM section$, key$, thisLine$
|
|
||||||
DIM FoundLF AS _UNSIGNED LONG
|
DIM FoundLF AS _UNSIGNED LONG
|
||||||
|
|
||||||
IniCODE = 0
|
IniCODE = 0
|
||||||
|
@ -106,9 +109,9 @@ SUB IniDeleteKey (file$, __section$, __key$)
|
||||||
|
|
||||||
IniCommit
|
IniCommit
|
||||||
IniCODE = 19
|
IniCODE = 19
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniMoveKey (file$, __section$, __key$, __newsection$)
|
SUB IniMoveKey (file$, __section$, __key$, __newsection$)
|
||||||
'A move operation is a copy operation + a delete operation
|
'A move operation is a copy operation + a delete operation
|
||||||
|
|
||||||
SHARED IniCODE
|
SHARED IniCODE
|
||||||
|
@ -123,9 +126,9 @@ SUB IniMoveKey (file$, __section$, __key$, __newsection$)
|
||||||
|
|
||||||
IniDeleteKey file$, __section$, __key$
|
IniDeleteKey file$, __section$, __key$
|
||||||
IF IniCODE = 19 THEN IniCODE = 20
|
IF IniCODE = 19 THEN IniCODE = 20
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniCommit
|
SUB IniCommit
|
||||||
SHARED currentIniFileName$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
SHARED currentIniFileName$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
||||||
SHARED IniNewFile$, IniDisableAutoCommit, IniCODE
|
SHARED IniNewFile$, IniDisableAutoCommit, IniCODE
|
||||||
|
|
||||||
|
@ -149,9 +152,9 @@ SUB IniCommit
|
||||||
PUT #fileNum, 1, IniNewFile$
|
PUT #fileNum, 1, IniNewFile$
|
||||||
CLOSE #fileNum
|
CLOSE #fileNum
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION IniGetSection$ (__section$)
|
FUNCTION IniGetSection$ (__section$)
|
||||||
SHARED IniPosition AS _UNSIGNED LONG, IniCODE, currentIniFileName$
|
SHARED IniPosition AS _UNSIGNED LONG, IniCODE, currentIniFileName$
|
||||||
SHARED IniLF$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
SHARED IniLF$, IniWholeFile$, currentIniFileLOF AS _UNSIGNED LONG
|
||||||
|
|
||||||
|
@ -222,9 +225,9 @@ FUNCTION IniGetSection$ (__section$)
|
||||||
END IF
|
END IF
|
||||||
LOOP
|
LOOP
|
||||||
END IF
|
END IF
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION IniFormatSection$ (__section$)
|
FUNCTION IniFormatSection$ (__section$)
|
||||||
SHARED IniCODE
|
SHARED IniCODE
|
||||||
|
|
||||||
DIM section$
|
DIM section$
|
||||||
|
@ -241,16 +244,16 @@ FUNCTION IniFormatSection$ (__section$)
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IniFormatSection$ = section$
|
IniFormatSection$ = section$
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION ReadSetting$ (file$, __section$, __key$)
|
FUNCTION ReadSetting$ (file$, __section$, __key$)
|
||||||
SHARED IniLastSection$, IniLastKey$, IniWholeFile$, IniLF$
|
SHARED IniLastSection$, IniLastKey$, IniWholeFile$, IniLF$
|
||||||
SHARED IniPosition AS _UNSIGNED LONG, IniSectionData$
|
SHARED IniPosition AS _UNSIGNED LONG, IniSectionData$
|
||||||
SHARED IniCODE, IniAllowBasicComments
|
SHARED IniCODE, IniAllowBasicComments
|
||||||
SHARED currentIniFileLOF AS _UNSIGNED LONG
|
SHARED currentIniFileLOF AS _UNSIGNED LONG
|
||||||
|
|
||||||
IniLoad file$
|
IniLoad file$
|
||||||
IF IniCODE THEN EXIT SUB
|
IF IniCODE THEN EXIT FUNCTION
|
||||||
|
|
||||||
IF currentIniFileLOF = 0 OR LEN(LTRIM$(RTRIM$(IniWholeFile$))) = 0 THEN IniCODE = 17: EXIT FUNCTION
|
IF currentIniFileLOF = 0 OR LEN(LTRIM$(RTRIM$(IniWholeFile$))) = 0 THEN IniCODE = 17: EXIT FUNCTION
|
||||||
|
|
||||||
|
@ -259,13 +262,13 @@ FUNCTION ReadSetting$ (file$, __section$, __key$)
|
||||||
DIM i AS LONG, FoundLF AS _UNSIGNED LONG
|
DIM i AS LONG, FoundLF AS _UNSIGNED LONG
|
||||||
|
|
||||||
section$ = IniFormatSection(__section$)
|
section$ = IniFormatSection(__section$)
|
||||||
IF IniCODE THEN EXIT SUB
|
IF IniCODE THEN EXIT FUNCTION
|
||||||
|
|
||||||
'fetch the desired section$
|
'fetch the desired section$
|
||||||
IniSectionData$ = IniGetSection(section$)
|
IniSectionData$ = IniGetSection(section$)
|
||||||
IF IniCODE > 0 AND IniCODE <> 17 THEN EXIT SUB
|
IF IniCODE > 0 AND IniCODE <> 17 THEN EXIT FUNCTION
|
||||||
|
|
||||||
IF LEN(IniSectionData$) = 0 AND section$ <> "[]" THEN IniCODE = 14: EXIT SUB
|
IF LEN(IniSectionData$) = 0 AND section$ <> "[]" THEN IniCODE = 14: EXIT FUNCTION
|
||||||
|
|
||||||
IniLastSection$ = section$
|
IniLastSection$ = section$
|
||||||
|
|
||||||
|
@ -276,16 +279,16 @@ FUNCTION ReadSetting$ (file$, __section$, __key$)
|
||||||
IF key$ = "" THEN
|
IF key$ = "" THEN
|
||||||
IF section$ = "[]" THEN IniSectionData$ = IniWholeFile$
|
IF section$ = "[]" THEN IniSectionData$ = IniWholeFile$
|
||||||
key$ = IniNextKey
|
key$ = IniNextKey
|
||||||
IF IniCODE THEN EXIT SUB
|
IF IniCODE THEN EXIT FUNCTION
|
||||||
IF key$ = "" THEN
|
IF key$ = "" THEN
|
||||||
IniCODE = 10
|
IniCODE = 10
|
||||||
EXIT SUB
|
EXIT FUNCTION
|
||||||
END IF
|
END IF
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF LEFT$(key$, 1) = ";" OR LEFT$(key$, 1) = "'" OR INSTR(key$, "[") > 0 OR INSTR(key$, "]") > 0 OR INSTR(key$, "=") > 0 THEN
|
IF LEFT$(key$, 1) = ";" OR LEFT$(key$, 1) = "'" OR INSTR(key$, "[") > 0 OR INSTR(key$, "]") > 0 OR INSTR(key$, "=") > 0 THEN
|
||||||
IniCODE = 12
|
IniCODE = 12
|
||||||
EXIT SUB
|
EXIT FUNCTION
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IniLastKey$ = key$
|
IniLastKey$ = key$
|
||||||
|
@ -351,9 +354,9 @@ FUNCTION ReadSetting$ (file$, __section$, __key$)
|
||||||
|
|
||||||
ReadSetting$ = tempValue$
|
ReadSetting$ = tempValue$
|
||||||
IniLastSection$ = IniCurrentSection$
|
IniLastSection$ = IniCurrentSection$
|
||||||
END SUB
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION IniCurrentSection$
|
FUNCTION IniCurrentSection$
|
||||||
SHARED IniPosition AS _UNSIGNED LONG, IniSectionData$, IniWholeFile$
|
SHARED IniPosition AS _UNSIGNED LONG, IniSectionData$, IniWholeFile$
|
||||||
|
|
||||||
DIM GlobalPosition AS _UNSIGNED LONG, i AS _UNSIGNED LONG
|
DIM GlobalPosition AS _UNSIGNED LONG, i AS _UNSIGNED LONG
|
||||||
|
@ -383,14 +386,14 @@ FUNCTION IniCurrentSection$
|
||||||
IF ClosingBracket > 0 THEN
|
IF ClosingBracket > 0 THEN
|
||||||
IniCurrentSection$ = MID$(IniWholeFile$, GlobalPosition, ClosingBracket - GlobalPosition + 1)
|
IniCurrentSection$ = MID$(IniWholeFile$, GlobalPosition, ClosingBracket - GlobalPosition + 1)
|
||||||
END IF
|
END IF
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
SUB WriteSetting (file$, __section$, __key$, __value$)
|
SUB WriteSetting (file$, __section$, __key$, __value$)
|
||||||
SHARED IniPosition AS _UNSIGNED LONG, IniCODE, currentIniFileName$
|
SHARED IniPosition AS _UNSIGNED LONG, IniCODE, currentIniFileName$
|
||||||
SHARED IniLF$, IniWholeFile$, IniSectionData$
|
SHARED IniLF$, IniWholeFile$, IniSectionData$
|
||||||
SHARED IniLastSection$, IniLastKey$, IniNewFile$
|
SHARED IniLastSection$, IniLastKey$, IniNewFile$
|
||||||
|
|
||||||
DIM tempValue$, section$, key$, value$, thisLine$
|
DIM tempValue$, section$, key$, value$
|
||||||
|
|
||||||
IniCODE = 0
|
IniCODE = 0
|
||||||
|
|
||||||
|
@ -462,9 +465,9 @@ SUB WriteSetting (file$, __section$, __key$, __value$)
|
||||||
IniCODE = 0
|
IniCODE = 0
|
||||||
IF LCASE$(IniLastSection$) = LCASE$(section$) THEN
|
IF LCASE$(IniLastSection$) = LCASE$(section$) THEN
|
||||||
'find this section$ in the current ini file;
|
'find this section$ in the current ini file;
|
||||||
DIM Bracket1 AS _UNSIGNED LONG, Bracket2 AS _UNSIGNED LONG, foundSection$
|
DIM Bracket1 AS _UNSIGNED LONG
|
||||||
DIM beginSection AS _UNSIGNED LONG, endSection AS _UNSIGNED LONG
|
DIM beginSection AS _UNSIGNED LONG, endSection AS _UNSIGNED LONG
|
||||||
DIM currentPos AS _UNSIGNED LONG, i AS _UNSIGNED LONG
|
DIM i AS _UNSIGNED LONG
|
||||||
|
|
||||||
beginSection = 0
|
beginSection = 0
|
||||||
endSection = 0
|
endSection = 0
|
||||||
|
@ -541,27 +544,27 @@ SUB WriteSetting (file$, __section$, __key$, __value$)
|
||||||
|
|
||||||
IniCODE = 5
|
IniCODE = 5
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniSetForceReload (state AS _BYTE)
|
SUB IniSetForceReload (state AS _BYTE)
|
||||||
SHARED IniForceReload
|
SHARED IniForceReload
|
||||||
IF state THEN
|
IF state THEN
|
||||||
IniForceReload = -1
|
IniForceReload = -1
|
||||||
ELSE
|
ELSE
|
||||||
IniForceReload = 0
|
IniForceReload = 0
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniClose
|
SUB IniClose
|
||||||
SHARED IniDisableAutoCommit, currentIniFileName$
|
SHARED IniDisableAutoCommit, currentIniFileName$
|
||||||
|
|
||||||
IniDisableAutoCommit = 0
|
IniDisableAutoCommit = 0
|
||||||
IniCommit
|
IniCommit
|
||||||
|
|
||||||
currentIniFileName$ = ""
|
currentIniFileName$ = ""
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
SUB IniLoad (file$)
|
SUB IniLoad (file$)
|
||||||
SHARED IniCODE, currentIniFileName$, IniLF$, IniWholeFile$
|
SHARED IniCODE, currentIniFileName$, IniLF$, IniWholeFile$
|
||||||
SHARED currentIniFileLOF AS _UNSIGNED LONG
|
SHARED currentIniFileLOF AS _UNSIGNED LONG
|
||||||
SHARED IniForceReload
|
SHARED IniForceReload
|
||||||
|
@ -613,9 +616,9 @@ SUB IniLoad (file$)
|
||||||
currentIniFileName$ = ""
|
currentIniFileName$ = ""
|
||||||
GOTO IniFileNotFound
|
GOTO IniFileNotFound
|
||||||
END IF
|
END IF
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
FUNCTION IniNextKey$
|
FUNCTION IniNextKey$
|
||||||
SHARED IniCODE, IniLF$, currentIniFileName$, IniSectionData$
|
SHARED IniCODE, IniLF$, currentIniFileName$, IniSectionData$
|
||||||
SHARED IniPosition AS _UNSIGNED LONG
|
SHARED IniPosition AS _UNSIGNED LONG
|
||||||
STATIC lastDataBlock$, position AS _UNSIGNED LONG, tempLF$
|
STATIC lastDataBlock$, position AS _UNSIGNED LONG, tempLF$
|
||||||
|
@ -653,19 +656,19 @@ FUNCTION IniNextKey$
|
||||||
|
|
||||||
IniNextKey$ = tempKey$
|
IniNextKey$ = tempKey$
|
||||||
IniPosition = Equal
|
IniPosition = Equal
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION IniNextSection$ (file$)
|
FUNCTION IniNextSection$ (file$)
|
||||||
SHARED IniCODE, IniLF$, IniWholeFile$
|
SHARED IniCODE, IniLF$, IniWholeFile$
|
||||||
|
|
||||||
STATIC sectionStart AS _UNSIGNED LONG
|
STATIC sectionStart AS _UNSIGNED LONG
|
||||||
|
|
||||||
IniLoad file$
|
IniLoad file$
|
||||||
IF LEFT$(IniINFO$, 6) = "ERROR:" THEN EXIT SUB
|
IF LEFT$(IniINFO$, 6) = "ERROR:" THEN EXIT FUNCTION
|
||||||
|
|
||||||
IniCODE = 0
|
IniCODE = 0
|
||||||
|
|
||||||
DIM section$, foundSection AS _UNSIGNED LONG, endSection AS _UNSIGNED LONG
|
DIM foundSection AS _UNSIGNED LONG, endSection AS _UNSIGNED LONG
|
||||||
DIM i AS _UNSIGNED LONG, Bracket1 AS _UNSIGNED LONG, Bracket2 AS _UNSIGNED LONG
|
DIM i AS _UNSIGNED LONG, Bracket1 AS _UNSIGNED LONG, Bracket2 AS _UNSIGNED LONG
|
||||||
|
|
||||||
FindNext:
|
FindNext:
|
||||||
|
@ -701,9 +704,9 @@ FUNCTION IniNextSection$ (file$)
|
||||||
ELSE
|
ELSE
|
||||||
IniCODE = 24
|
IniCODE = 24
|
||||||
END IF
|
END IF
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION IniINFO$
|
FUNCTION IniINFO$
|
||||||
SHARED IniCODE
|
SHARED IniCODE
|
||||||
SELECT CASE IniCODE
|
SELECT CASE IniCODE
|
||||||
CASE 0: IniINFO$ = "Operation successful"
|
CASE 0: IniINFO$ = "Operation successful"
|
||||||
|
@ -732,12 +735,12 @@ FUNCTION IniINFO$
|
||||||
CASE 24: IniINFO$ = "No more sections"
|
CASE 24: IniINFO$ = "No more sections"
|
||||||
CASE ELSE: IniINFO$ = "ERROR: <invalid error code>"
|
CASE ELSE: IniINFO$ = "ERROR: <invalid error code>"
|
||||||
END SELECT
|
END SELECT
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
'Written in BASIC by Luke Ceddia for ide_methods.bas (QB64)
|
'Written in BASIC by Luke Ceddia for ide_methods.bas (QB64)
|
||||||
'After Cormen, Leiserson, Rivest & Stein "Introduction To Algoritms" via Wikipedia
|
'After Cormen, Leiserson, Rivest & Stein "Introduction To Algoritms" via Wikipedia
|
||||||
'Adapted for use in .INI Manager
|
'Adapted for use in .INI Manager
|
||||||
FUNCTION IniArraySort%% (arr() AS STRING)
|
FUNCTION IniArraySort%% (arr() AS STRING)
|
||||||
DIM i&, x$, j&, moves&
|
DIM i&, x$, j&, moves&
|
||||||
|
|
||||||
FOR i& = LBOUND(arr) + 1 TO UBOUND(arr)
|
FOR i& = LBOUND(arr) + 1 TO UBOUND(arr)
|
||||||
|
@ -754,5 +757,6 @@ FUNCTION IniArraySort%% (arr() AS STRING)
|
||||||
|
|
||||||
'Returns -1 (true) if any changes were made
|
'Returns -1 (true) if any changes were made
|
||||||
IniArraySort%% = moves& > 0
|
IniArraySort%% = moves& > 0
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
$END IF
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
OPTION _EXPLICIT
|
||||||
|
|
||||||
'$INCLUDE:'InFormVersion.bas'
|
'$INCLUDE:'InFormVersion.bas'
|
||||||
|
|
||||||
PRINT "InForm - GUI system for QB64 - "; __UI_Version
|
PRINT "InForm - GUI system for QB64 - "; __UI_Version
|
||||||
|
@ -5,8 +7,11 @@ PRINT "VBDOS to InForm form conversion utility"
|
||||||
PRINT "-------------------------------------------------"
|
PRINT "-------------------------------------------------"
|
||||||
|
|
||||||
DIM lf AS STRING * 1, q AS STRING * 1
|
DIM lf AS STRING * 1, q AS STRING * 1
|
||||||
|
DIM theFile$
|
||||||
|
|
||||||
lf = CHR$(10)
|
lf = CHR$(10)
|
||||||
q = CHR$(34)
|
q = CHR$(34)
|
||||||
|
|
||||||
IF LEN(COMMAND$) > 0 THEN
|
IF LEN(COMMAND$) > 0 THEN
|
||||||
IF _FILEEXISTS(COMMAND$) = 0 THEN PRINT "File not found.": END
|
IF _FILEEXISTS(COMMAND$) = 0 THEN PRINT "File not found.": END
|
||||||
theFile$ = COMMAND$
|
theFile$ = COMMAND$
|
||||||
|
@ -18,8 +23,11 @@ ELSE
|
||||||
IF _FILEEXISTS(theFile$) = 0 THEN PRINT "File "; theFile$; " not found." ELSE EXIT DO
|
IF _FILEEXISTS(theFile$) = 0 THEN PRINT "File "; theFile$; " not found." ELSE EXIT DO
|
||||||
LOOP
|
LOOP
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
OPEN theFile$ FOR BINARY AS #1
|
OPEN theFile$ FOR BINARY AS #1
|
||||||
|
|
||||||
|
DIM a$
|
||||||
|
|
||||||
LINE INPUT #1, a$
|
LINE INPUT #1, a$
|
||||||
IF a$ <> "Version 1.00" THEN
|
IF a$ <> "Version 1.00" THEN
|
||||||
PRINT "Expected VBDOS text form file. Exiting."
|
PRINT "Expected VBDOS text form file. Exiting."
|
||||||
|
@ -32,9 +40,9 @@ IF LEFT$(a$, 11) <> "BEGIN Form " THEN
|
||||||
END
|
END
|
||||||
END IF
|
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 + "'Fellippe Heitor, " + __UI_CopyrightSpan + " - fellippe@qb64.org - @FellippeHeitor"
|
||||||
o$ = o$ + lf + "'-----------------------------------------------------------"
|
o$ = o$ + lf + "'-----------------------------------------------------------"
|
||||||
o$ = o$ + lf + "SUB __UI_LoadForm"
|
o$ = o$ + lf + "SUB __UI_LoadForm"
|
||||||
|
@ -43,7 +51,13 @@ o$ = o$ + lf + " DIM __UI_NewID AS LONG"
|
||||||
o$ = o$ + lf
|
o$ = o$ + lf
|
||||||
o$ = o$ + lf + " __UI_NewID = __UI_NewControl(__UI_Type_Form, " + q + FormName$ + q + ", "
|
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
|
DO
|
||||||
IF EOF(1) THEN EXIT DO
|
IF EOF(1) THEN EXIT DO
|
||||||
|
@ -171,13 +185,13 @@ o$ = o$ + lf + "SUB __UI_AssignIDs"
|
||||||
o$ = o$ + assignIDs$
|
o$ = o$ + assignIDs$
|
||||||
o$ = o$ + lf + "END SUB"
|
o$ = o$ + lf + "END SUB"
|
||||||
|
|
||||||
newFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.frm"
|
DIM newFile$: newFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.frm"
|
||||||
CLOSE
|
CLOSE
|
||||||
OPEN newFile$ FOR BINARY AS #1
|
OPEN newFile$ FOR BINARY AS #1
|
||||||
PUT #1, , o$
|
PUT #1, , o$
|
||||||
CLOSE
|
CLOSE
|
||||||
TextFileNum = FREEFILE
|
DIM TextFileNum AS LONG: TextFileNum = FREEFILE
|
||||||
newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
|
DIM newTextFile$: newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
|
||||||
OPEN newTextFile$ FOR OUTPUT AS #TextFileNum
|
OPEN newTextFile$ FOR OUTPUT AS #TextFileNum
|
||||||
PRINT #TextFileNum, "': This program was generated by"
|
PRINT #TextFileNum, "': This program was generated by"
|
||||||
PRINT #TextFileNum, "': InForm - GUI system for QB64 - "; __UI_Version
|
PRINT #TextFileNum, "': InForm - GUI system for QB64 - "; __UI_Version
|
||||||
|
@ -248,6 +262,7 @@ END
|
||||||
|
|
||||||
AddProperties:
|
AddProperties:
|
||||||
IF LEN(caption$) THEN o$ = o$ + lf + " SetCaption __UI_NewID, " + caption$: caption$ = ""
|
IF LEN(caption$) THEN o$ = o$ + lf + " SetCaption __UI_NewID, " + caption$: caption$ = ""
|
||||||
|
DIM formBackColor$, formForeColor$
|
||||||
IF LEN(FormName$) = 0 THEN
|
IF LEN(FormName$) = 0 THEN
|
||||||
IF backColor$ = formBackColor$ THEN backColor$ = ""
|
IF backColor$ = formBackColor$ THEN backColor$ = ""
|
||||||
IF foreColor$ = formForeColor$ THEN foreColor$ = ""
|
IF foreColor$ = formForeColor$ THEN foreColor$ = ""
|
||||||
|
@ -263,3 +278,4 @@ RETURN
|
||||||
FUNCTION QBColor2QB64$ (index AS _BYTE)
|
FUNCTION QBColor2QB64$ (index AS _BYTE)
|
||||||
QBColor2QB64$ = "_RGB32(" + LTRIM$(STR$(_RED(index))) + ", " + LTRIM$(STR$(_GREEN(index))) + ", " + LTRIM$(STR$(_BLUE(index))) + ")"
|
QBColor2QB64$ = "_RGB32(" + LTRIM$(STR$(_RED(index))) + ", " + LTRIM$(STR$(_GREEN(index))) + ", " + LTRIM$(STR$(_BLUE(index))) + ")"
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Samuel Gomes
|
Copyright (c) 2023 Samuel Gomes
|
||||||
Copyright (c) 2016-2019 Fellippe Heitor
|
Copyright (c) 2016-2019 Fellippe Heitor
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# InForm
|
# InForm-PE
|
||||||
|
|
||||||
![InForm logo](InForm/resources/Application-icon-128.png)
|
![InForm logo](InForm/resources/Application-icon-128.png)
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ Wiki: <https://github.com/a740g/InForm/wiki>
|
||||||
|
|
||||||
## Event-driven QB64 programs
|
## 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
|
## 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**
|
* **.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**
|
* **.bas**
|
||||||
the actual program you will add your code to.
|
the actual program you will add your code to.
|
||||||
|
|
|
@ -1,68 +1,49 @@
|
||||||
|
|
||||||
# Makefile for InForm
|
# Makefile for InForm
|
||||||
# Copyright (c) 2022 Samuel Gomes
|
|
||||||
|
|
||||||
#MAKEFLAGS += --no-builtin-rules
|
|
||||||
|
|
||||||
ifndef OS
|
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
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),lnx)
|
ifeq ($(OS),lnx)
|
||||||
RM := rm -fr
|
RM := rm -fr
|
||||||
EXTENSION :=
|
EXTENSION :=
|
||||||
DIR_SLASH := /
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),win)
|
ifeq ($(OS),win)
|
||||||
RM := del /Q
|
RM := del /Q
|
||||||
EXTENSION := .exe
|
EXTENSION := .exe
|
||||||
DIR_SLASH := /
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),osx)
|
ifeq ($(OS),osx)
|
||||||
RM := rm -fr
|
RM := rm -fr
|
||||||
EXTENSION :=
|
EXTENSION :=
|
||||||
DIR_SLASH := \\
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# This should point to your QB64 installation
|
# This should point to your QB64 installation
|
||||||
FILE1 := qb64
|
QB64PE := qb64pe
|
||||||
FILE2 := qb64pe
|
QB64PE_FLAGS := -x -w -e
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
all: $(UiEditorEXE) $(UiEditorPreviewEXE)
|
all: UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
|
||||||
|
|
||||||
$(UiEditorEXE) : $(INFORM_PATH)$(UiEditorSRC)
|
UiEditor$(EXTENSION) : InForm/UiEditor.bas
|
||||||
$(ROOT_PATH)$(QB64)$(EXTENSION) $(QB64PE_FLAGS) -o $(INFORM_PATH)$(UiEditorEXE) $(INFORM_PATH)$(UiEditorSRC)
|
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
|
||||||
strip $(INFORM_PATH)$(UiEditorEXE)
|
|
||||||
|
|
||||||
$(UiEditorPreviewEXE): $(INFORM_PATH)$(UiEditorPreviewSRC)
|
InForm/UiEditorPreview$(EXTENSION) : InForm/UiEditorPreview.bas
|
||||||
$(ROOT_PATH)$(QB64)$(EXTENSION) $(QB64PE_FLAGS) -s:exewithsource=true -o $(INFORM_PATH)$(UiEditorPreviewEXE) $(INFORM_PATH)$(UiEditorPreviewSRC)
|
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
|
||||||
strip $(INFORM_PATH)$(UiEditorPreviewEXE)
|
|
||||||
|
InForm/vbdos2inform$(EXTENSION) : InForm/vbdos2inform.bas
|
||||||
|
$(QB64PE_PATH)$(QB64PE)$(EXTENSION) $(QB64PE_FLAGS) $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
ifeq ($(OS),win)
|
ifeq ($(OS),win)
|
||||||
$(RM) InForm\UiEditor$(EXTENSION) InForm\UiEditorPreview$(EXTENSION) InForm\vbdos2inform$(EXTENSION)
|
$(RM) UiEditor$(EXTENSION) InForm\UiEditorPreview$(EXTENSION) InForm\vbdos2inform$(EXTENSION)
|
||||||
else
|
else
|
||||||
$(RM) InForm/UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
|
$(RM) UiEditor$(EXTENSION) InForm/UiEditorPreview$(EXTENSION) InForm/vbdos2inform$(EXTENSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,28 +4,5 @@
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
echo "Compiling InForm..."
|
echo "Compiling InForm..."
|
||||||
make -f makefile.inform clean OS=lnx
|
make -f makefile.inform clean OS=lnx QB64PE_PATH=../QB64pe/
|
||||||
make -f makefile.inform OS=lnx
|
make -f makefile.inform OS=lnx QB64PE_PATH=../QB64pe/
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
|
@ -1,55 +1,7 @@
|
||||||
|
# InForm for QB64-PE Setup script
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
# InForm for QB64/QB64PE - Setup script
|
|
||||||
|
|
||||||
### Perform CLEAN function
|
echo "Compiling InForm..."
|
||||||
rm -fr InForm/UiEditor InForm/UiEditor_start.command InForm/UiEditorPreview InForm/UiEditorPreview_start.command
|
make -f makefile.inform clean OS=osx QB64PE_PATH=../QB64pe/
|
||||||
|
make -f makefile.inform OS=osx QB64PE_PATH=../QB64pe/
|
||||||
|
|
||||||
### 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
|
|
||||||
|
|
|
@ -4,27 +4,7 @@
|
||||||
%~d0
|
%~d0
|
||||||
cd %~dp0
|
cd %~dp0
|
||||||
|
|
||||||
rem Clean old .exe files from InForm
|
rem Adjust the path below to point to mingw32-make.exe in your QB64 installation
|
||||||
del /Q InForm\UiEditor.exe InForm\UiEditorPreview.exe
|
|
||||||
|
|
||||||
rem Check for which compiler for use in your QB64/QB64pe installation
|
|
||||||
echo Compiling InForm...
|
echo Compiling InForm...
|
||||||
|
..\QB64pe\internal\c\c_compiler\bin\mingw32-make.exe -f makefile.inform clean OS=win QB64PE_PATH=../QB64pe/
|
||||||
if exist qb64.exe (
|
..\QB64pe\internal\c\c_compiler\bin\mingw32-make.exe -f makefile.inform OS=win QB64PE_PATH=../QB64pe/
|
||||||
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
|
|
||||||
|
|
Loading…
Reference in a new issue