Skip to content

Commit

Permalink
Merge pull request #26 from FellippeHeitor/development
Browse files Browse the repository at this point in the history
Beta 6
  • Loading branch information
FellippeHeitor authored Mar 26, 2018
2 parents d9adeb8 + b2906a5 commit 420c5f0
Show file tree
Hide file tree
Showing 14 changed files with 549 additions and 296 deletions.
125 changes: 107 additions & 18 deletions InForm/InForm.ui

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion InForm/InFormVersion.bas
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CONST __UI_Version = "Beta version 5"
CONST __UI_Version = "Beta version 6"
262 changes: 156 additions & 106 deletions InForm/UiEditor.bas

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions InForm/UiEditor.frm

Large diffs are not rendered by default.

200 changes: 140 additions & 60 deletions InForm/UiEditorPreview.bas

Large diffs are not rendered by default.

Binary file modified InForm/UiEditorPreview.exe
Binary file not shown.
5 changes: 2 additions & 3 deletions InForm/UiEditorPreview.frm
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
'InForm - GUI system for QB64 - Beta version 4
'Fellippe Heitor, 2016/2017 - [email protected] - @fellippeheitor
'Fellippe Heitor, 2016/2018 - [email protected] - @fellippeheitor
'-----------------------------------------------------------
SUB __UI_LoadForm
DIM __UI_NewID AS LONG

$RESIZE:ON
_RESIZE OFF

__UI_NewID = __UI_NewControl(__UI_Type_Form, "Form1", 300, 300, 0, 0,0)
Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?cour.ttf", 12, "")
Control(__UI_NewID).Font = SetFont("segoeui.ttf?arial.ttf?/Library/Fonts/Arial.ttf?InForm/resources/NotoMono-Regular.ttf?cour.ttf", 12, "")
END SUB

SUB __UI_AssignIDs
Expand Down
Binary file added InForm/resources/Application-icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added InForm/resources/Application-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions InForm/vbdos2inform.bas
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ END IF
FormName$ = MID$(a$, 12)

o$ = "'InForm - GUI system for QB64 - " + __UI_Version
o$ = o$ + lf + "'Fellippe Heitor, 2016/2017 - [email protected] - @FellippeHeitor"
o$ = o$ + lf + "'Fellippe Heitor, 2016/2018 - [email protected] - @FellippeHeitor"
o$ = o$ + lf + "'-----------------------------------------------------------"
o$ = o$ + lf + "SUB __UI_LoadForm"
o$ = o$ + lf
Expand Down Expand Up @@ -181,7 +181,7 @@ newTextFile$ = LEFT$(theFile$, INSTR(theFile$, ".") - 1) + "_InForm.bas"
OPEN newTextFile$ FOR OUTPUT AS #TextFileNum
PRINT #TextFileNum, "': This program was generated by"
PRINT #TextFileNum, "': InForm - GUI system for QB64 - "; __UI_Version
PRINT #TextFileNum, "': Fellippe Heitor, 2016/2017 - [email protected] - @fellippeheitor"
PRINT #TextFileNum, "': Fellippe Heitor, 2016/2018 - [email protected] - @fellippeheitor"
PRINT #TextFileNum, "'-----------------------------------------------------------"
PRINT #TextFileNum,
PRINT #TextFileNum, "': Controls' IDs: ------------------------------------------------------------------";
Expand Down
51 changes: 35 additions & 16 deletions InForm/xp.uitheme
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
END IF
END IF

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = TempControlState
This.FocusState = __UI_Focus = This.ID
__UI_TempCaptions(This.ID) = Caption(This.ID)
Expand Down Expand Up @@ -100,9 +101,14 @@ SUB __UI_DrawButton (This AS __UI_ControlTYPE, ControlState AS _BYTE)
_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
ELSE
'Icon will be centered
DIM PictureOffsetX AS INTEGER, PictureOffsetY AS INTEGER
IF This.ControlState = 3 THEN
PictureOffsetX = 1
PictureOffsetY = 1
END IF
IconHeight = This.Height - 6
IconWidth = _WIDTH(This.HelperCanvas) * (IconHeight / _HEIGHT(This.HelperCanvas))
_PUTIMAGE (This.Width \ 2 - ((IconWidth \ 2)), This.Height / 2 - ((This.Height - 4) / 2) + 1)-STEP(IconWidth - 1, IconHeight - 1), This.HelperCanvas
_PUTIMAGE (This.Width \ 2 - ((IconWidth \ 2)) + PictureOffsetX, This.Height / 2 - ((This.Height - 4) / 2) + 1 + PictureOffsetY)-STEP(IconWidth - 1, IconHeight - 1), This.HelperCanvas
END IF
END IF

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

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

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

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -345,7 +353,7 @@ SUB __UI_DrawToggleSwitch (This AS __UI_ControlTYPE, ControlState AS _BYTE)

'Focus outline
IF __UI_Focus = This.ID AND __UI_KeyboardFocus THEN
LINE (CaptionIndent - 1, 0)-STEP(This.Width - CaptionIndent - 1, This.Height - 1), _RGB32(0, 0, 0), B , 21845
LINE (1, 1)-STEP(This.Width - 2, This.Height - 2), _RGB32(0, 0, 0), B , 21845
END IF
'------

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

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

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -445,8 +454,9 @@ SUB __UI_DrawCheckBox (This AS __UI_ControlTYPE, ControlState AS _BYTE)

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

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -518,8 +528,9 @@ SUB __UI_DrawProgressBar (This AS __UI_ControlTYPE, ControlState)
IF ControlImage_Chunk = 0 THEN ControlImage_Chunk = __UI_LoadThemeImage("progresschunk.png")
IF ControlImage_Track = 0 THEN ControlImage_Track = __UI_LoadThemeImage("progresstrack.png")

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -613,8 +624,9 @@ SUB __UI_DrawTrackBar (This AS __UI_ControlTYPE, ControlState)
TempControlState = ControlState
IF This.Disabled THEN TempControlState = 5

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = TempControlState
This.FocusState = __UI_Focus = This.ID
IF This.PreviousValue <> This.Value THEN
Expand Down Expand Up @@ -676,7 +688,7 @@ SUB __UI_DrawTextBox (This AS __UI_ControlTYPE, ControlState, ss1 AS LONG, ss2 A

__UI_CursorAdjustments This.ID

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

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

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -1140,14 +1154,15 @@ SUB __UI_DrawDropdownList (This AS __UI_ControlTYPE, ControlState)
__UI_ClearColor ControlImage_Arrow, 0, 0
END IF

IF This.ControlState <> ControlState OR _
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.FocusState = __UI_Focus = This.ID
This.PreviousValue = This.Value
Expand Down Expand Up @@ -1275,8 +1290,9 @@ SUB __UI_DrawFrame (This AS __UI_ControlTYPE)
__UI_ClearColor ControlImage, 0, 0
END IF

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
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
'Last time we drew this frame its children had different images
This.Redraw = False
This.ChildrenRedrawn = False
This.PreviousValue = This.Value
This.PreviouslyHidden = This.Hidden
Expand Down Expand Up @@ -1367,8 +1383,9 @@ SUB __UI_DrawMenuBar (This AS __UI_ControlTYPE, ControlState AS _BYTE)
DIM PrevDest AS LONG, CaptionIndent AS INTEGER, TempCaption$
DIM Temp&

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
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
This.PreviousValue = This.Value

Expand Down Expand Up @@ -1447,8 +1464,9 @@ SUB __UI_DrawMenuPanel (This AS __UI_ControlTYPE, ControlState AS _BYTE)
__UI_ClearColor ControlImage, 0, 0
END IF

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

IF This.Stretch <> This.PreviousStretch OR This.PreviousValue <> This.HelperCanvas OR This.ControlState <> ControlState OR This.PreviousParentID <> This.ParentID OR __UI_ForceRedraw THEN
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
'Last time this control was drawn it had a different state/caption, so it'll be redrawn
This.Redraw = False
This.ControlState = ControlState
IF This.ParentID THEN Control(This.ParentID).ChildrenRedrawn = True
This.PreviousParentID = This.ParentID
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
![InForm logo](InForm/resources/Application-icon-128.png)

# InForm
A GUI engine and WYSIWYG interface designer for QB64

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

Official page: https://www.qb64.org/inform

## 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.

## Workflow
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:
* **.frmbin**
the binary form that can be later edited.

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**
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.
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.

* **.bas**
the actual program you will add your code to.
Expand All @@ -31,3 +32,4 @@ the actual program you will add your code to.
* *OnLoad*, triggered right after the form is first shown.
* *BeforeUpdateDisplay*, triggered everytime the form is about to be repainted.
* *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.
Binary file modified UiEditor.exe
Binary file not shown.
14 changes: 14 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off
echo Deleting old InForm folder...
del /S /Q ..\qb64\InForm\*.* > nul
del /S /Q ..\qb64\UiEditor.exe > nul

rd ..\qb64\InForm\resources\ > nul
rd ..\qb64\InForm > nul

xcopy InForm\*.* ..\qb64\InForm\*.* /S /Q

..\qb64\qb64 -x "C:\Documents and Settings\Administrator\Desktop\InForm\InForm\UiEditor.bas" -o "C:\Documents and Settings\Administrator\Desktop\qb64\UiEditor.exe"
..\qb64\qb64 -x "C:\Documents and Settings\Administrator\Desktop\InForm\InForm\UiEditorPreview.bas" -o "C:\Documents and Settings\Administrator\Desktop\qb64\InForm\UiEditorPreview.exe"

pause

0 comments on commit 420c5f0

Please sign in to comment.