This is my Visual Designer , GUI code maker for FBGUI 2 - Window9.bi library . ( 600 and + instructions , mainly for GUI code ) .
ReForm is not made by a professional of programming , but it works ... not so bad .
It produces the code in 1 file . See Test1.bas .
Produces code with all the Gadgets , Menu , PopMenu , Colors , Font .
To find FBGUI 2 -Window9 : Forum/Board Index / Libraries , or on SoundForge .
----------------------------------------------------------------------------------------------------------------------------
Update 2017/03 : discontinued .
Update 2016/08
Links on Hotmail.fr ( personal one drive ) :
ReForm v10-21 :
MD5 :
Size : 463 KB (474 112 bytes)
This is the help file :
Code: Select all
Hello,
This txt was written with FbEdit , and read with Notepad , the result is very ugly .
ReForm v10 is a visual designer for window9 , in a beta version .
It can create 9 windows , all the gadgets + a menu ,a popmenu , with choices of Fonts and Colors , Subs Declare ,Subs ,
Do Loop with Events .
Running the compiler , then the Exe , is possible .
- a menu designer , i hope very easy to use , with pre-view in a separated form.
- and PopMenu , with a designer . No pre-view .
There is no project file , the bas file itself is the project : ReForm can reload it ...and always read after any modif , then
display again windows and gadgets .
- 1 main window with the code
- 1 ' Inspector Gadget ' with 4 tabs : Gadget , Flags , Win / Prj , Misc .
- 1 Settings form
- 1 mini editor : the main code is displayed in a listbox , easier to manage , so a few lines can be edited modified and re-pasted in the
lisbox/main code .
-----------------------------------------------------------------------------------------------------------
---- Additions for v10.21 -------------------------------------
Added a List / Find tool ( in Settings Form ) :
List : All the window9.bi instructions
Find : search tools among Window9.bi and/or window.bi
----------------------------------------------
popmenu : like MenuDesigner but script like :
Load
Reload
Save
Exit
very simple .
------------------------------------------------
contextual menu in the main listbox ( code ) :
-move_to_the_left or right : uses a Tab , 1 more or 1 less .
-copy_lines_to_the_clipboard
-copy_Gadget_nn_to_clipboard : Select a line that include 'Gadget_1001' (for ex)
-past_Gadget_nn_from_the_clipboard : Select a line and paste 'Gadget1001' (for ex)
--------End additions --------------------------------------
Commands in the main window :
- Load : a bas file with a correct GUI code ...
- Reload : only the last bas . Before i click Reload , i need to verify if the name of the last
bas is displayed in the mini editor 'Project' ( in 'Win / Prj').
- New prj : asks for a file name , but if i don't want and just click 'Ok' , a name by default is
given : Test1 if you leave the text box empty . Or just a name without '.bas' .
Lines of code are written , with the first window , named 'Win1' . It's easy to change its name : 'Caption' in 'Win / Prj'.
- Save.bas or Save
For the first 'save my bas' , 'Save As' is required .
- Copy code : all the code displayed is copied in to the Clipboard .
- Copy lines : the selected lines are copied in to the Clipboard .
- Cut : Delete lines ; a mini window is displayed with a Checkbox : 'While checked , Preview update is locked' :
while this window is displayed , i can delete all the lines i want without problems :
Unchecked out at the end : all is updated now . Remember the code is the project , if the code is not correct ,
one cannot say what the result will be ; BUT the tool is not an interpretor , it just needs the datas where they must be !
So, Delete lines in Enum ( Gadget_1 = 1001 ,...)only if you delete
the corresponding gadgets code in Functions ! !
- Paste : from the clipboard to the main code , after the selected line .
- Edit : Select a line , click Edit ; an Editor appears .
- Modifying , replacing lines in the main code:
The lines are selected , click 'Edit'
In the Editor , modify something , click 'Replace' .
- Import lines : if you have imported 1 line from the main code , you can now import more lines : click the SpinBox .
- old lines : Undo like .
- Sub --> Function : Replace Sub by Function ; do it line by line in the main code :
the concerned lines are : Declare , Sub , End Sub .
- you can import a 'Declare Sub ....' line , modify the Sub name and click 'Update Sub name' .
- Settings : (A Checkbox ) Shows all the settings in a new form .
1 - Settings :
Values for Toolbar size : width , height and TBcorr (20 by default) . Editable .
TBcorr is added to the vertical position of gadgets .
Find fbc.exe : a button ; its path will be stored in ini file .
xini , yini , wini , hini : x,y,size by default for the gadgets to create. ( values <--> ini )
Unlike other VDes the mouse doesn't pre-pos the Gadget : see 'Cloning' feature
active panel : 0 by default ; the code for panel is prebuilt with 3 tabs-panels ,
the code in bas depends of this nb .(Showwindow ..., HideGadget...)
Gadget mini : 0 by default ; with a 0 ,the first gadget will be Gadget_1 .
! ! ! : if i want to include a bas to a previous project , it is possible
to start with Gadget_101 , for ex , if 'Gadget mini' is 100 .
Gadget base id : 1000 by default ; same case .
Menu base id : 10000 by default ; same case .
- Quit : with a Messagebox Yes , No .
--------------------------------------------------------------------------------------------------------
Inspector Gadget : a window with lists , values , settings for gadgets , commands .
!!! 'Parents' and 'Gadgets' buttons are not real buttons ( no action ) , just here for the look ...
First column : list of parents : windows (Window_1 , Window_2, etc)
panels (panGadget10 ,panGadget20 ,panGadget30 ) .( $A )
groups (group5 : 5 if GroupGadget(Gadget_5 ,....)
containers (cont5 : 5 if ContainerGadget(Gadget_5,.... )
Very ! important to select a parent before you to add a Gadget inside .
( its title : Parents ; it's a button , but only for the fine XP style ! , not functional)
Second column : ( its title : Gadgets ; it's a button , but only for the fine XP style ! , not functional)
Ex for a button , a line like this : w1 : Button : Gadget_1 = 1001
--> w1 is the parent (Window_1) ; or p10 (panel10), g1 (group1) , c5 (container) ...
Third column : Create : A button , active , this time !
All the possible gadgets in a list ; + Window + PopMenu + Menu .
Here , Menu is a prebuilt code . Or see MenuDesigner below .
PopMenu uses an editor : - for each line you want , just enter in a Menuitem ( 'Load' , 'Help' , ... without '' )
and press Enter on the KeyBoard . ( no Titles , no 'i,Load' or 'i,Save' like in MenuDesigner , just a Menuitems alone )
- click 'Confirm' ; the code is added to the main code .
- you can use 'Load' , 'Save' buttons . But 'Save as' is not possible ( just for MenuDesigner ).
--------->>> First step , in the 'Parents' column , a window OR a parent must be selected ! (else , Window_0 by default)
A parent can be (examples ): cont1 , group5 , panGadget10 , Window_2 , ... . For a Menu , PopMenu , only a window ...
- Toolbar and StatusBar are made with a prebuilt code .( and displayed in the window in a 'mini-mode' :
just a text 'Toolbar' or 'StatusBar' is displayed )
4 tabs : - Gadgets : values with editors , spins
Changing values : manual or with a spin ; press Enter
Color : editor or 2 buttons : 'T' (text color) and Bk (background) --> Requesters .
Font : editor or a button : 'Font' --> Requester .
- Disable : a checkbox ; the state (see the bas code after )
- Hide : a checkbox ; the visibility (see the bas code after )
! ! ! unchecking after checking theses settings is not valid , see the main code ,
only Delete ( line of code ) can work ! Sorry .
- Clones : select a gadget source
select a gadget in the list 'Create' : yes , what you want ...
click 'Clones' , a small window appears ,
choose the nb , vertical or horizontal , space between , ok
if a (new) type of gadget is not selected , a Messagebox appears . select a gadget in the list 'Create' , click Ok .
- Flags : it is just a mono-line editor displaying the values if they exist ,
the feature doesn't really exist : using FbEdit , it's easy to add Flags with the popup menu
in the final bas . Sorry ... but it is not so easy !
- Win / Prj : values in editors for a window
editor 'Project' : the name without '.bas' . Don't press Enter , the main code is always updated .
text 'Last Project' : displayed at startup : if ok , this prj can be 'Reload'ed.
text 'Last Dir ' : displayed ( partially )for control
- Misc : Compile : if all is complete , ( Do Loop ...) , click ! , then click Run Exe
Compile CB ( with clipboard ) : shows a Messagebox with : "in cmd , right click ,
choose 'paste' , push 'Enter' ".
with this procedure , errors are showed .
Run Exe : if compiled , click ... Reform waits for the exe to be closed .
Clear Part2 : possibility to rebuilt the Part2 . Starts to clean-up at
#Include XXX.-a.bas ( after the GUI code ).
So , it is not an obligation to use 'Split in 2 bas' . Re-built with Part2 .
--------->>> All this part of code is deleted , even if it is 'your' code !!! Rename or Save it before .
Change Gad nb : The base nb (0 --> 100 , 200 , ... )can be changed :
normal example : with 0 , Gadget_1 is the first .
With a base 100 , will be changed to Gadget_101 .
Change base id : The base id (1000) can be changed : maxi 9900 ... menu begin at 10000 .
but menu base id can be changed with Settings : ultra maxi 58999 !.
Real humans : in order to be moved-resized , gadgets are not reals ! just colorized
rectangles . ( Except Panel-Tab ) . With 'Real humans' , they are shown
in their real appearence , if possible ! ( not all ! ; if not possible , the
type is showed , like 'ContainerGadget , ... ').
Menu Designer : Manual design in 2 windows : Menu Designer and Preview . A 3rd window
is displayed if you compile the code of the menu for a real test :
Cde 'Save as complete bas and run' .
--------->>> First , in the column : 'Windows' in Inspector Gadget , a window must be selected ! (Window_1 by default)
- 1 : Menu Designer : commands : spin 'id' , start at 10000 from ini , but editable ( for menu + popmenu).
button 'Confirm' --> Preview form
buttons 'Load' and 'Save' , a menu-project file ( *.txt ).
button 'Save bas' , as a bas file .
button 'color' of the final menu display
toolbar Undo,Redo ,Paste ( or Ctl-c , Ctl-v )
button 'Include into bas ' : the menu is correct ? send the
code to the main code .
main editor , multi-lines : it works with short commands :
t : a title --> t,File or t,Edition or ...
i : item --> i,Load or i,Save or ...
s : submenu --> s,Others ...
-i : item in a submenu --> example : -i,Delete ( - = shifted )
c : flag "MF_CHECKED"
d : flag "MF_DISABLED"
g : flag "MF_GRAYED"
a real example copied from the main editor :
t,File
i,Load
i,Save,c,d,g
s,Others
-i,del,c,d,g
-i,nodel
i,return
t,Edition
i,Undo
i,Redo
no spaces , push Enter at the end of line . You can copy theses 10 lines for a first test .
Even if it is a script ,I think it is easier than all the commands in the Menu Designer in FbEdit , PureForm , ... no ?
- 2 : Preview : a list , a complete bas code : Enum , End Enum , ...
button : ' Include into bas ' : transfered to the main bas .
button : ' Save as a complete bas and Run ' : Compiled and Runned , it's
a real preview . Don't change the name 'MenuExe.bas' , just save .
Uses the current dir , if it exists : save your bas project before ( for the good path ).
Tested with 2 windows in the project and the same menu 2 times (easier.... ): the final code is correct , good compil .
Just selected 'Window_2' in Inspector Gadget ( a parent ! ) the 2nd time , then clicked 'Confirm' .
------------------------------------------------------------------------------------------------------------------
Moving - resizing with the mouse : left side , right , top , down and right-down corner only .
- a window : managed by Windows , as usual with the mouse .
- a gadget : see the hand or double-arrows when the mouse is over a gadget . Left-click and move .
- Corners : Only the right-bottom corner can be moved (see diagonal double-arrow)
- key 'Shift' pressed : moving only in vertical
- key 'Control' pressed : moving only in horizontal
- right click or 'Space' : refresh the form ; left click for grid
- key 'Esc' or 'Z' : return to the original position , but no more left click before !
- key 'A' : long dotted lines as guides with 5 choices :
A + mouse click on left , top , right or bottom : 1 line
A + mouse click on center : 4 lines ; move the gadget now , or not .
- Ctrl + A or Shift + A is possible
Grid : visual 10 x 10 , but magnetic 5 x 5 or 10 x 10 if the key 'G' is pressed when moving the mouse .
-------------------------------------------------------------------------------------------------------------------
Bugs : Tell me ,please ... If i can update this long code ...
The end . Have fun !
Code: Select all
' Test2
#Include Once "window9.bi"
Enum
PopMenu_0_file = 10001
PopMenu_0_load = 10002
PopMenu_0_save = 10003
Gadget_1 = 1001 ' Button : HELLO !!
Gadget_2 = 1002 ' CheckBox :
Gadget_3 = 1003 ' CheckBox :
Gadget_4 = 1004 ' Container :
Gadget_5 = 1005 ' Editor :
Menu_0_mymenu1 = 11001
Menu_0_mymenu2 = 11002
Gadget_6 = 1006
Gadget_7 = 1007 ' Spin :
Gadget_8 = 1008 ' String :
Gadget_9 = 1009 ' Text :
Gadget_10 = 1010 ' Editor :
Gadget_11 = 1011 ' Editor :
Gadget_12 = 1012 ' Group :
Gadget_13 = 1013 ' CheckBox :
End Enum
Namespace G
Dim As Handle group12
Dim As HANDLE cont4
Dim As HWND hwndWindow_0
Dim As HMENU hPopMenu_0
Dim As Long ww0 , hw0 , wwold0 , hwold0 ' for resizing
Dim As HWND pan0Gadget_6
Dim As HWND pan1Gadget_6
Dim As HWND pan2Gadget_6
Dim As HWND pan3Gadget_6
Dim As HWND pan4Gadget_6
End Namespace
Sub MenuWindow0
Dim As HMENU hMenu_Window_0
hMenu_Window_0 = Create_Menu()
Dim As HMENU hLoad0
hLoad0 = MenuTitle(hMenu_Window_0,"Load")
MenuItem(Menu_0_mymenu1, hLoad0,"mymenu1")
MenuItem(Menu_0_mymenu2, hLoad0,"mymenu2")
MenuBackColor(hMenu_Window_0,&hDDDDDD, 1)
End Sub
Using G
Sub MenuDesigner
't,Load
'i,mymenu1
'i,mymenu2
End Sub
Sub GadgetStates
End Sub
Declare Function Sub_Gadget_1( ) As Long ' Button : HELLO !!
Declare Sub Sub_PopMenu_0_file( )
Declare Sub Sub_PopMenu_0_load( )
Declare Sub Sub_PopMenu_0_save( )
Declare Sub Sub_Menu_0_mymenu1( )
Declare Sub Sub_Menu_0_mymenu2( )
Function OpenWindow_Window_0( ) As HWND
hwndWindow_0 = OpenWindow("Win1000",334,3,818,411)
WindowColor(hwndWindow_0,BGR(149,215,104))
SetGadgetFont(,CInt(LoadFont("Courier new",8)))
UseGadgetList(hwndWindow_0)
MenuWindow0
hPopMenu_0 = CreatePopMenu()
MenuItem(PopMenu_0_file, hPopMenu_0,"file")
MenuItem(PopMenu_0_load, hPopMenu_0,"load")
MenuItem(PopMenu_0_save, hPopMenu_0,"save")
ButtonGadget(Gadget_1,20,15,135,50,"HELLO !!")
CheckBoxGadget(Gadget_2,20,83,135,50)
CheckBoxGadget(Gadget_3,20,154,135,50)
cont4 = ContainerGadget(Gadget_4,165,15,135,185)
UseGadgetList(cont4)
EditorGadget(Gadget_5,10,20,115,100)
UseGadgetList(hwndWindow_0)
SetGadgetColor(Gadget_5,&hE4EFA9,&h292929,3)
SetGadgetFont(Gadget_3,Cint(LoadFont("Cambria" , 12 , 0 , , 1 , , )))
PanelGadget(Gadget_6,314,12,300,225)
pan0Gadget_6 = AddPanelGadgetItem(Gadget_6,0,"Tab0")
WindowColor(pan0Gadget_6,BGR(240,240,240))
ShowWindow(pan0Gadget_6,1)
PanelGadgetSetCursel(Gadget_6,0)
UseGadgetList(pan0Gadget_6)
StringGadget(Gadget_8,15,15,150,40)
pan1Gadget_6 = AddPanelGadgetItem(Gadget_6,1,"Tab1")
WindowColor(pan1Gadget_6,BGR(240,240,240))
UseGadgetList(pan1Gadget_6)
SpinGadget(Gadget_7,40,15,60,40,100,0,50)
pan2Gadget_6 = AddPanelGadgetItem(Gadget_6,2,"Tab2")
WindowColor(pan2Gadget_6,BGR(240,240,240))
UseGadgetList(pan2Gadget_6)
TextGadget(Gadget_9,10,10,150,30)
pan3Gadget_6 = AddPanelGadgetItem(Gadget_6,3,"Tab3")
WindowColor(pan3Gadget_6,BGR(240,240,240))
UseGadgetList(pan3Gadget_6)
EditorGadget(Gadget_11,180,150,110,45)
group12 = GroupGadget(Gadget_12,10,10,230,95)
UseGadgetList(group12)
CheckBoxGadget(Gadget_13,20,25,85,25)
UseGadgetList(hwndWindow_0)
pan4Gadget_6 = AddPanelGadgetItem(Gadget_6,4,"Tab4")
WindowColor(pan4Gadget_6,BGR(240,240,240))
UseGadgetList(pan4Gadget_6)
EditorGadget(Gadget_10,15,105,120,60)
UseGadgetList(hwndWindow_0)
SetGadgetFont(Gadget_2,Cint(LoadFont("Arial" , 11 , 0 , 1 , 1 , , )))
Return hwndWindow_0
End Function
hwndWindow_0 = OpenWindow_Window_0()
Sub resize
Dim As RECT re
ww0 = WindowWidth(hwndWindow_0) : hw0 = WindowHeight(hwndWindow_0)
If ww0 <> wwold0 Or hw0 <> hwold0 Then
'ResizeGadget(Gadget_panel,,,ww0 -30,hw0 -200) ' is a panel
'Var gwpan = GadgetWidth(Gadget_panel) : Var ghpan = GadgetHeight(Gadget_panel)
'ResizeWindow(pan0Gadget_panel,1,1,gwpan,ghpan) ' resize tab itself
'ResizeWindow(pan1Gadget_panel,1,1,gwpan,ghpan)
'ResizeWindow(pan2Gadget_panel,1,1,gwpan,ghpan)
'ResizeGadget(Gadget_xx,0,0, ww0 -350,hw0 -200)
'ResizeGadget(Gadget_xx,0,0, ww0 -350,hw0 -200)
'ResizeGadget(Gadget_xx,0,0, ww0 -350,hw0 -200)
'ResizeGadget(Gadget_xx,,,,ghpan)
'ResizeGadget(Gadget_xx,,,gwpan,)
wwold0 = ww0 : hwold0 = hw0
EndIf
End Sub
Function Sub_Gadget_1( ) As Long ' Button : HELLO !!
' Static As
End Function
Sub Sub_PopMenu_0_file( )
' Static As
End Sub
Sub Sub_PopMenu_0_load( )
' Static As
End Sub
Sub Sub_PopMenu_0_save( )
' Static As
End Sub
Sub Sub_Menu_0_mymenu1( )
' Static As
End Sub
Sub Sub_Menu_0_mymenu2( )
' Static As
End Sub
' code MAIN
' endcode MAIN
Do
Var event = WaitEvent
Select Case event
Case WM_SIZE
' resize
Case EventClose
Exit Do ' End
Case WM_RBUTTONDOWN
DisplayPopupMenu(hPopMenu_0,GlobalMouseX,GlobalMouseY)
Case EventMenu
Select Case EventNumber
Case Menu_0_mymenu1
Sub_Menu_0_mymenu1
Case Menu_0_mymenu2
Sub_Menu_0_mymenu2
Case PopMenu_0_file
Sub_PopMenu_0_file
Case PopMenu_0_load
Sub_PopMenu_0_load
Case PopMenu_0_save
Sub_PopMenu_0_save
End Select
Case EventGadget
Select Case EventNumber
Case 0
Case Gadget_1 ' Button : HELLO !!
Sub_Gadget_1( )
End Select
Select Case EventNumberToolBar
Case 9999
End Select
End Select
Loop
'