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

Reduce number of $INCLUDEs needed in user code

This commit is contained in:
Samuel Gomes 2024-01-11 05:36:34 +05:30
parent 0918df0d11
commit 07a2b55433
31 changed files with 12 additions and 76 deletions

View file

@ -8,6 +8,9 @@
$IF INFORM_BI = UNDEFINED THEN
$LET INFORM_BI = TRUE
$SCREENHIDE
_CONTROLCHR OFF
'$INCLUDE:'InFormCommon.bi'
'Control types: -----------------------------------------------
@ -86,9 +89,6 @@ $IF INFORM_BI = UNDEFINED THEN
__UI_Type(__UI_Type_ToggleSwitch).RestrictResize = __UI_CantResize
'--------------------------------------------------------------
$SCREENHIDE
_CONTROLCHR OFF
__UI_RestoreFKeys
__UI_SubMenuDelay = .4

View file

@ -579,7 +579,7 @@ SUB __UI_Click (id AS LONG)
SaveForm TRUE, Control(SaveFrmOnlyCB).Value
END IF
CASE HelpMenuAbout
MessageBox "InForm GUI engine for QB64-PE" + CHR$(13) + "Fellippe Heitor, (2016 - 2022) - @FellippeHeitor" + CHR$(13) + "George McGinn, 2023 - gbytes58@gmail.com" + CHR$(13) + "Samuel Gomes, (2023 - 2024) - @a740g" + STRING$(2, 13) + UiEditorTitle$ + " v" + __UI_Version + STRING$(2, 13) + "https://github.com/a740g/InForm-PE", UiEditorTitle$ + " - About", MsgBox_Information
MessageBox "InForm GUI engine for QB64-PE" + CHR$(13) + "Copyright (c) 2024 Samuel Gomes - @a740g" + CHR$(13) + "Copyright (c) 2023 George McGinn - gbytes58@gmail.com" + CHR$(13) + "Copyright (c) 2022 Fellippe Heitor - @FellippeHeitor" + STRING$(2, 13) + UiEditorTitle$ + " v" + __UI_Version + STRING$(2, 13) + "https://github.com/a740g/InForm-PE", UiEditorTitle$ + " - About", MsgBox_Information
CASE HelpMenuHelp
MessageBox "Design a form and export the resulting code to generate an event-driven QB64-PE program.", UiEditorTitle$ + " - What's all this?", MsgBox_Information
CASE FileMenuExit

View file

@ -37,7 +37,7 @@ Assuming your setup is like the above, do the following:
- Open Terminal and change to the InForm-PE directory using an appropriate OS command
- Run `setup_inform_lnx.sh`, `setup_inform_osx.command` or `setup_inform_win.cmd` depending on the OS you are on. This will run make with the correct parameters. If the build fails, ensure QB64-PE is installed in the **QB64pe** directory (next to the InForm-PE directory). If QB64-PE is installed elsewhere, then edit the setup scripts to change the location
- Once InFrom-PE is compiled, you will find the UiEditor[.exe] executable in the InForm-PE directory
- Once InForm-PE is compiled, you will find the UiEditor[.exe] executable in the InForm-PE directory
- Run UiEditor[.exe] to start designing your forms
- 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 exported:
- **.frm** - 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
@ -61,29 +61,15 @@ Assuming your setup is like the above, do the following:
- *BeforeUnload*, triggered when the user tries to close the program, either via clicking the window's X button, right click in the task bar -> Close or with Alt+F4 (Windows only).
- *FormResized*, triggered when a form with the CanResize property is resized at runtime.
***The following files need to be copied to your project directory for it to compile.***
> Required
***IMPORTANT: The following files must be copied to your project directory for it to compile.***
```text
InForm/InFormVersion.bas
InForm/InForm.bi
InForm/InForm.ui
InForm/InFormCommon.bi
InForm/InFormVersion.bi
InForm/xp.uitheme
```
> Required only when GIF picturebox is used
```text
InForm/extensions/GIFPlay.bi
InForm/extensions/GIFPlay.bas
```
> Required only when using legacy InForm MessageBox routines (use [QB64-PE's native common dialog functions](https://qb64phoenix.com/qb64wiki/index.php/Keyword_Reference_-_By_usage#Window_and_Desktop) when writing new code)
```text
InForm/extensions/MessageBox.bi
InForm/extensions/MessageBox.bas
InForm/extensions/*.*
```
## EXAMPLES
@ -112,6 +98,7 @@ InForm/extensions/MessageBox.bas
| RockPaperScissorsSpockLizard | TempodiBasic |
| Stopwatch | Fellippe Heitor |
| TextFetch | B+ |
| ThemePreview | Fellippe Heitor |
| TicTacToe | Fellippe Heitor |
| TicTacToe2 | Fellippe Heitor |
| Trackword | Richard Notley |

View file

@ -33,12 +33,9 @@ DIM SHARED PIC2MEMRB AS LONG
DIM SHARED ResetBT AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'BIN2INCLUDE.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Custom procedures: --------------------------------------------------------------
FUNCTION checkExt%% (OFile$)

View file

@ -80,12 +80,9 @@ DIM SHARED memory AS DOUBLE ' value stored in memory
DIM SHARED nohistory AS INTEGER
': External modules: --------------------------------------------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Calculator.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Program procedures: ------------------------------------------------------------------------------------------------

View file

@ -18,7 +18,6 @@ DIM AS SINGLE CenterX, CenterY, Radius, MaxRadius
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'ClickTheVoid.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------
@ -166,6 +165,7 @@ END SUB
SUB __UI_TextChanged (id AS LONG)
SELECT CASE id
CASE ELSE
END SELECT
END SUB

View file

@ -22,7 +22,6 @@ REDIM SHARED Clock%%(12, 4, 2)
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Clock Patience.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -60,7 +60,6 @@ DIM SHARED SpiralAngle!, KeysList$, XF!, YF!, XN!, YN!, XGun!, YGun!
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Duck Shoot.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures & Functions: ---------------------------------------------------

View file

@ -32,7 +32,6 @@ CONST TT% = 38, TB% = 668, FL% = 82, FR% = 106, CL% = 321, CR% = 345
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Fahrenheit-Celsius.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Functions: ----------------------------------------------------------------------

View file

@ -55,7 +55,6 @@ DIM SHARED HappyNewYearLB AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Fireworks.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -17,12 +17,9 @@ DIM SHARED PlayButton AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/GIFPlay.bi'
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'GIFPlaySample.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
'$INCLUDE:'../../InForm/extensions/GIFPlay.bas'
': Event procedures: ---------------------------------------------------------------

View file

@ -196,12 +196,9 @@ DIM SHARED PlanetAnim%%, Trace%%, Wipe%%, UpArrow%%, DownArrow%%, EndArrow%%, Ar
CONST FrameRate% = 30, Persp& = -8000, Origin& = -16000, Uscreen% = 1400, Vscreen% = 830 'Uscreen%/Vscreen% same as PictureBox1
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'GravitationSimulation.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Event Procedures & Functions: ----------------------------------------------------

View file

@ -18,7 +18,6 @@ DIM SHARED Drawing AS _BYTE, Tool AS _UNSIGNED _BYTE
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'InFormPaint.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -36,7 +36,6 @@ DIM SHARED ClickCount%, Vertices%(3, 1), A#, B#, C#, XMouse%, YMouse%
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Inside-Outside Triangle.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Functions: ---------------------------------------------------------------------

View file

@ -48,7 +48,6 @@ DIM SHARED pbScene AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Lander1.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -65,7 +65,6 @@ DIM SHARED pbScene AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Lander2.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -33,7 +33,6 @@ CONST XOrigin% = 40, YOrigin% = 40, YHalfTile% = 30, XHalfTile% = 20, FrameRate%
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'QB64Mahjong.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures & Functions: ---------------------------------------------------

View file

@ -28,7 +28,6 @@ DIM SHARED ma&
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'MasterMindGuessTheSequence.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -32,7 +32,6 @@ REDIM SHARED Motion`(10, 6, 2), Choisi`(10, 6), Grid%%(10, 6)
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Pelmanism.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures & Functions: ---------------------------------------------------------------

View file

@ -22,7 +22,6 @@ DIM SHARED Horiz%%, Vert%%, InPlay`, Level%%, MoveIt%%, ValidSquare`
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'PictureGrid.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures & Functions: ---------------------------------------------------------------

View file

@ -49,7 +49,6 @@ DIM SHARED PlayBT AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'PlayFX.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Custom procedures: --------------------------------------------------------------

View file

@ -25,13 +25,10 @@ DIM SHARED assetsRPSLS_helpjpgPX AS LONG
DIM SHARED assetsspokpngPX AS LONG
DIM SHARED assetslizardpngPX AS LONG
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'RockHandScissor.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit

View file

@ -21,7 +21,6 @@ DIM SHARED elapsed AS SINGLE
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Stopwatch.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -9,10 +9,6 @@
OPTION _EXPLICIT
$IF VERSION < 3.11.0 THEN
$ERROR This requires the latest version of QB64-PE from https://github.com/QB64-Phoenix-Edition/QB64pe/releases
$END IF
': Controls' IDs: ------------------------------------------------------------------
DIM SHARED frmTextFetch AS LONG
DIM SHARED lbCWD AS LONG
@ -32,7 +28,6 @@ DIM SHARED lbEnd AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'TextFetch.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
SUB loadText

View file

@ -15,7 +15,6 @@ DIM SHARED ContextMenu1Copy AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'ThemePreview.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
FUNCTION GetThemeImageId~%% (fileName AS STRING)
@ -183,6 +182,7 @@ END SUB
SUB __UI_TextChanged (id AS LONG)
SELECT CASE id
CASE ELSE
END SELECT
END SUB

View file

@ -21,12 +21,9 @@ DIM SHARED Button8 AS LONG
DIM SHARED Button9 AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'TicTacToe.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit

View file

@ -21,12 +21,9 @@ DIM SHARED Button8 AS LONG
DIM SHARED Button9 AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'TicTacToe2.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit

View file

@ -48,13 +48,9 @@ DATA 254,36541,652,12587,23698741,98523,458,56974,685
FOR M%% = 1 TO noCells%%: READ TrackWord$(M%%): NEXT M%%
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'Trackword.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
FUNCTION snake2word$ (snakey$)
' Use the dim shared theWord$ to translate snake number string to letters

View file

@ -38,7 +38,6 @@ DIM SHARED Word(1 TO 22) AS LONG
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'WordClock.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
': Event procedures: ---------------------------------------------------------------

View file

@ -72,12 +72,9 @@ DIM SHARED AS STRING helpcontents, prt_text
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'ebacCalculator.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit

View file

@ -20,12 +20,9 @@ DIM SHARED AS STRING contents, originalcontents
': External modules: ---------------------------------------------------------------
'$INCLUDE:'../../InForm/extensions/MessageBox.bi'
'$INCLUDE:'../../InForm/InForm.bi'
'$INCLUDE:'wordSearch.frm'
'$INCLUDE:'../../InForm/xp.uitheme'
'$INCLUDE:'../../InForm/InForm.ui'
'$INCLUDE:'../../InForm/extensions/MessageBox.bas'
': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit