Skip to content

Commit 420c5f0

Browse files
Merge pull request #26 from FellippeHeitor/development
Beta 6
2 parents d9adeb8 + b2906a5 commit 420c5f0

14 files changed

+549
-296
lines changed

InForm/InForm.ui

Lines changed: 107 additions & 18 deletions
Large diffs are not rendered by default.

InForm/InFormVersion.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CONST __UI_Version = "Beta version 5"
1+
CONST __UI_Version = "Beta version 6"

InForm/UiEditor.bas

Lines changed: 156 additions & 106 deletions
Large diffs are not rendered by default.

InForm/UiEditor.frm

Lines changed: 85 additions & 85 deletions
Large diffs are not rendered by default.

InForm/UiEditorPreview.bas

Lines changed: 140 additions & 60 deletions
Large diffs are not rendered by default.

InForm/UiEditorPreview.exe

19.5 KB
Binary file not shown.

InForm/UiEditorPreview.frm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
'InForm - GUI system for QB64 - Beta version 4
2-
'Fellippe Heitor, 2016/2017 - fellippe@qb64.org - @fellippeheitor
2+
'Fellippe Heitor, 2016/2018 - fellippe@qb64.org - @fellippeheitor
33
'-----------------------------------------------------------
44
SUB __UI_LoadForm
55
DIM __UI_NewID AS LONG
66
77
$RESIZE:ON
8-
_RESIZE OFF
98
109
__UI_NewID = __UI_NewControl(__UI_Type_Form, "Form1", 300, 300, 0, 0,0)
11-
Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?cour.ttf", 12, "")
10+
Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?/Library/Fonts/Arial.ttf?InForm/resources/NotoMono-Regular.ttf?cour.ttf", 12, "")
1211
END SUB
1312
1413
SUB __UI_AssignIDs
2.45 KB
Loading

InForm/resources/Application-icon.png

7.02 KB
Loading

InForm/vbdos2inform.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ END IF
3535
FormName$ = MID$(a$, 12)
3636

3737
o$ = "'InForm - GUI system for QB64 - " + __UI_Version
38-
o$ = o$ + lf + "'Fellippe Heitor, 2016/2017 - fellippe@qb64.org - @FellippeHeitor"
38+
o$ = o$ + lf + "'Fellippe Heitor, 2016/2018 - fellippe@qb64.org - @FellippeHeitor"
3939
o$ = o$ + lf + "'-----------------------------------------------------------"
4040
o$ = o$ + lf + "SUB __UI_LoadForm"
4141
o$ = o$ + lf
@@ -181,7 +181,7 @@ newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
181181
OPEN newTextFile$ FOR OUTPUT AS #TextFileNum
182182
PRINT #TextFileNum, "': This program was generated by"
183183
PRINT #TextFileNum, "': InForm - GUI system for QB64 - "; __UI_Version
184-
PRINT #TextFileNum, "': Fellippe Heitor, 2016/2017 - fellippe@qb64.org - @fellippeheitor"
184+
PRINT #TextFileNum, "': Fellippe Heitor, 2016/2018 - fellippe@qb64.org - @fellippeheitor"
185185
PRINT #TextFileNum, "'-----------------------------------------------------------"
186186
PRINT #TextFileNum,
187187
PRINT #TextFileNum, "': Controls' IDs: ------------------------------------------------------------------";

InForm/xp.uitheme

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
6767
END IF
6868
END IF
6969

70-
IF This.ControlState <> TempControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
70+
IF This.Redraw OR This.ControlState <> TempControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
7171
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
72+
This.Redraw = False
7273
This.ControlState = TempControlState
7374
This.FocusState = __UI_Focus = This.ID
7475
__UI_TempCaptions(This.ID) = Caption(This.ID)
@@ -100,9 +101,14 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
100101
_PUTIMAGE ((This.Width \ 2 - __UI_PrintWidth&(TempCaption$) \ 2) - ((IconWidth / 2) + 5), This.Height / 2 - ((This.Height - 4) / 2) + 1)-STEP(IconWidth - 1, IconHeight - 1), This.HelperCanvas
101102
ELSE
102103
'Icon will be centered
104+
DIM PictureOffsetX AS INTEGER, PictureOffsetY AS INTEGER
105+
IF This.ControlState = 3 THEN
106+
PictureOffsetX = 1
107+
PictureOffsetY = 1
108+
END IF
103109
IconHeight = This.Height - 6
104110
IconWidth = _WIDTH(This.HelperCanvas) * (IconHeight / _HEIGHT(This.HelperCanvas))
105-
_PUTIMAGE (This.Width \ 2 - ((IconWidth \ 2)), This.Height / 2 - ((This.Height - 4) / 2) + 1)-STEP(IconWidth - 1, IconHeight - 1), This.HelperCanvas
111+
_PUTIMAGE (This.Width \ 2 - ((IconWidth \ 2)) + PictureOffsetX, This.Height / 2 - ((This.Height - 4) / 2) + 1 + PictureOffsetY)-STEP(IconWidth - 1, IconHeight - 1), This.HelperCanvas
106112
END IF
107113
END IF
108114

@@ -150,8 +156,9 @@ SUB __UI_DrawLabel (This AS __UI_ControlTYPE, ControlState AS _BYTE)
150156
DIM PrevDest AS LONG, Temp&
151157
DIM CaptionIndent AS INTEGER, TempCaption$, TempLine$
152158

153-
IF This.ControlState <> ControlState OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
159+
IF This.Redraw OR This.ControlState <> ControlState OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
154160
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
161+
This.Redraw = False
155162
This.ControlState = ControlState
156163
__UI_TempCaptions(This.ID) = Caption(This.ID)
157164
IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True
@@ -288,8 +295,9 @@ SUB __UI_DrawToggleSwitch (This AS __UI_ControlTYPE, ControlState AS _BYTE)
288295

289296
'IF ControlImage = 0 THEN ControlImage = __UI_LoadThemeImage("radiobutton.png")
290297

291-
IF This.ControlState <> ControlState OR TIMER - This.LastChange < .5 OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
298+
IF This.Redraw OR This.ControlState <> ControlState OR TIMER - This.LastChange < .5 OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
292299
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
300+
This.Redraw = False
293301
This.ControlState = ControlState
294302
This.FocusState = __UI_Focus = This.ID
295303
This.PreviousValue = This.Value
@@ -345,7 +353,7 @@ SUB __UI_DrawToggleSwitch (This AS __UI_ControlTYPE, ControlState AS _BYTE)
345353

346354
'Focus outline
347355
IF __UI_Focus = This.ID AND __UI_KeyboardFocus THEN
348-
LINE (CaptionIndent - 1, 0)-STEP(This.Width - CaptionIndent - 1, This.Height - 1), _RGB32(0, 0, 0), B , 21845
356+
LINE (1, 1)-STEP(This.Width - 2, This.Height - 2), _RGB32(0, 0, 0), B , 21845
349357
END IF
350358
'------
351359

@@ -367,8 +375,9 @@ SUB __UI_DrawRadioButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
367375

368376
IF ControlImage = 0 THEN ControlImage = __UI_LoadThemeImage("radiobutton.png")
369377

370-
IF This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
378+
IF This.Redraw OR This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
371379
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
380+
This.Redraw = False
372381
This.ControlState = ControlState
373382
This.FocusState = __UI_Focus = This.ID
374383
This.PreviousValue = This.Value
@@ -445,8 +454,9 @@ SUB __UI_DrawCheckBox (This AS __UI_ControlTYPE, ControlState AS _BYTE)
445454

446455
IF ControlImage = 0 THEN ControlImage = __UI_LoadThemeImage("checkbox.png")
447456

448-
IF This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
457+
IF This.Redraw OR This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
449458
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
459+
This.Redraw = False
450460
This.ControlState = ControlState
451461
This.FocusState = __UI_Focus = This.ID
452462
This.PreviousValue = This.Value
@@ -518,8 +528,9 @@ SUB __UI_DrawProgressBar (This AS __UI_ControlTYPE, ControlState)
518528
IF ControlImage_Chunk = 0 THEN ControlImage_Chunk = __UI_LoadThemeImage("progresschunk.png")
519529
IF ControlImage_Track = 0 THEN ControlImage_Track = __UI_LoadThemeImage("progresstrack.png")
520530

521-
IF This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
531+
IF This.Redraw OR This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
522532
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
533+
This.Redraw = False
523534
This.ControlState = ControlState
524535
This.FocusState = __UI_Focus = This.ID
525536
This.PreviousValue = This.Value
@@ -613,8 +624,9 @@ SUB __UI_DrawTrackBar (This AS __UI_ControlTYPE, ControlState)
613624
TempControlState = ControlState
614625
IF This.Disabled THEN TempControlState = 5
615626

616-
IF This.ControlState <> TempControlState OR This.FocusState <> (__UI_Focus = This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
627+
IF This.Redraw OR This.ControlState <> TempControlState OR This.FocusState <> (__UI_Focus = This.ID) OR This.Value <> This.PreviousValue OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
617628
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
629+
This.Redraw = False
618630
This.ControlState = TempControlState
619631
This.FocusState = __UI_Focus = This.ID
620632
IF This.PreviousValue <> This.Value THEN
@@ -676,7 +688,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
676688

677689
__UI_CursorAdjustments This.ID
678690

679-
IF This.ControlState <> ControlState OR _
691+
IF This.Redraw OR This.ControlState <> ControlState OR _
680692
This.FocusState <> (__UI_Focus = This.ID) OR _
681693
Caption(This.ID) <> __UI_TempCaptions(This.ID) OR _
682694
Text(This.ID) <> __UI_TempTexts(This.ID) OR _
@@ -690,6 +702,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A
690702
__UI_ForceRedraw THEN
691703

692704
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
705+
This.Redraw = False
693706
This.ControlState = ControlState
694707
This.FocusState = __UI_Focus = This.ID
695708
__UI_TempCaptions(This.ID) = Caption(This.ID)
@@ -909,8 +922,9 @@ SUB __UI_DrawListBox (This AS __UI_ControlTYPE, ControlState)
909922
DIM PrevDest AS LONG, Temp&
910923
DIM CaptionIndent AS INTEGER, TempCaption$
911924

912-
IF This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR This.PreviousValue <> This.Value OR Text(This.ID) <> __UI_TempTexts(This.ID) OR This.PreviousInputViewStart <> This.InputViewStart OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
925+
IF This.Redraw OR This.ControlState <> ControlState OR This.FocusState <> (__UI_Focus = This.ID) OR This.PreviousValue <> This.Value OR Text(This.ID) <> __UI_TempTexts(This.ID) OR This.PreviousInputViewStart <> This.InputViewStart OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
913926
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
927+
This.Redraw = False
914928
This.ControlState = ControlState
915929
This.FocusState = __UI_Focus = This.ID
916930
This.PreviousValue = This.Value
@@ -1140,14 +1154,15 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState)
11401154
__UI_ClearColor ControlImage_Arrow, 0, 0
11411155
END IF
11421156

1143-
IF This.ControlState <> ControlState OR _
1157+
IF This.Redraw OR This.ControlState <> ControlState OR _
11441158
This.FocusState <> (__UI_Focus = This.ID) OR _
11451159
This.PreviousValue <> This.Value OR _
11461160
Text(This.ID) <> __UI_TempTexts(This.ID) OR _
11471161
This.PreviousInputViewStart <> This.InputViewStart OR _
11481162
This.PreviousParentID <> This.ParentID OR _
11491163
__UI_ForceRedraw THEN
11501164
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
1165+
This.Redraw = False
11511166
This.ControlState = ControlState
11521167
This.FocusState = __UI_Focus = This.ID
11531168
This.PreviousValue = This.Value
@@ -1275,8 +1290,9 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE)
12751290
__UI_ClearColor ControlImage, 0, 0
12761291
END IF
12771292

1278-
IF This.PreviouslyHidden <> This.Hidden OR This.ChildrenRedrawn OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.HelperCanvas = 0 OR (__UI_IsDragging AND Control(__UI_DraggingID).ParentID = This.ID) OR This.Value <> This.PreviousValue OR __UI_ForceRedraw OR __UI_DesignMode THEN
1293+
IF This.Redraw OR This.PreviouslyHidden <> This.Hidden OR This.ChildrenRedrawn OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR This.HelperCanvas = 0 OR (__UI_IsDragging AND Control(__UI_DraggingID).ParentID = This.ID) OR This.Value <> This.PreviousValue OR __UI_ForceRedraw OR __UI_DesignMode THEN
12791294
'Last time we drew this frame its children had different images
1295+
This.Redraw = False
12801296
This.ChildrenRedrawn = False
12811297
This.PreviousValue = This.Value
12821298
This.PreviouslyHidden = This.Hidden
@@ -1367,8 +1383,9 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE)
13671383
DIM PrevDest AS LONG, CaptionIndent AS INTEGER, TempCaption$
13681384
DIM Temp&
13691385

1370-
IF This.FocusState <> (__UI_Focus = This.ID) OR This.Value <> This.PreviousValue OR This.ControlState <> ControlState OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR __UI_ForceRedraw THEN
1386+
IF This.Redraw OR This.FocusState <> (__UI_Focus = This.ID) OR This.Value <> This.PreviousValue OR This.ControlState <> ControlState OR Caption(This.ID) <> __UI_TempCaptions(This.ID) OR __UI_ForceRedraw THEN
13711387
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
1388+
This.Redraw = False
13721389
This.ControlState = ControlState
13731390
This.PreviousValue = This.Value
13741391

@@ -1447,8 +1464,9 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE)
14471464
__UI_ClearColor ControlImage, 0, 0
14481465
END IF
14491466

1450-
IF This.Value <> This.PreviousValue OR This.FocusState <> (__UI_Focus = This.ID) OR This.ControlState <> ControlState OR __UI_ForceRedraw THEN
1467+
IF This.Redraw OR This.Value <> This.PreviousValue OR This.FocusState <> (__UI_Focus = This.ID) OR This.ControlState <> ControlState OR __UI_ForceRedraw THEN
14511468
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
1469+
This.Redraw = False
14521470
This.FocusState = (__UI_Focus = This.ID)
14531471
This.ControlState = ControlState
14541472
This.PreviousValue = This.Value
@@ -1543,8 +1561,9 @@ SUB __UI_DrawPictureBox (This AS __UI_ControlTYPE, ControlState AS _BYTE)
15431561
DIM PrevDest AS LONG, TheX AS INTEGER, TheY AS INTEGER
15441562
DIM CaptionIndent AS INTEGER, TempCaption$
15451563

1546-
IF This.Stretch <> This.PreviousStretch OR This.PreviousValue <> This.HelperCanvas OR This.ControlState <> ControlState OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
1564+
IF This.Redraw OR This.Stretch <> This.PreviousStretch OR This.PreviousValue <> This.HelperCanvas OR This.ControlState <> ControlState OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
15471565
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
1566+
This.Redraw = False
15481567
This.ControlState = ControlState
15491568
IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True
15501569
This.PreviousParentID = This.ParentID

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1+
![InForm logo](InForm/resources/Application-icon-128.png)
2+
13
# InForm
24
A GUI engine and WYSIWYG interface designer for QB64
35

46
Wiki: https://github.com/FellippeHeitor/InForm/wiki
57

8+
Official page: https://www.qb64.org/inform
9+
610
## Event-driven QB64 programs
711
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.
812

913
## Workflow
10-
After your form looks the way you want it to, click File -> Save to export its contents and generate a .bas source file. Three files are output:
11-
* **.frmbin**
12-
the binary form that can be later edited.
13-
14+
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:
1415
* **.frm**
15-
a representation of the generated form in QB64 code. This can be edited in QB64 or any text editor later, if you want to adjust fine details.
16+
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.
1617

1718
* **.bas**
1819
the actual program you will add your code to.
@@ -31,3 +32,4 @@ the actual program you will add your code to.
3132
* *OnLoad*, triggered right after the form is first shown.
3233
* *BeforeUpdateDisplay*, triggered everytime the form is about to be repainted.
3334
* *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).
35+
* *FormResized*, triggered when a form with the CanResize property is resized at runtime.

UiEditor.exe

3 KB
Binary file not shown.

build.bat

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@echo off
2+
echo Deleting old InForm folder...
3+
del /S /Q ..\qb64\InForm\*.* > nul
4+
del /S /Q ..\qb64\UiEditor.exe > nul
5+
6+
rd ..\qb64\InForm\resources\ > nul
7+
rd ..\qb64\InForm > nul
8+
9+
xcopy InForm\*.* ..\qb64\InForm\*.* /S /Q
10+
11+
..\qb64\qb64 -x "C:\Documents and Settings\Administrator\Desktop\InForm\InForm\UiEditor.bas" -o "C:\Documents and Settings\Administrator\Desktop\qb64\UiEditor.exe"
12+
..\qb64\qb64 -x "C:\Documents and Settings\Administrator\Desktop\InForm\InForm\UiEditorPreview.bas" -o "C:\Documents and Settings\Administrator\Desktop\qb64\InForm\UiEditorPreview.exe"
13+
14+
pause

0 commit comments

Comments
 (0)