RAD EventDesigner V3 (All OS)

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

RAD EventDesigner V3 (All OS)

Post by mk-soft »

Rapid Application Development - Event Designer V3

Cloud: OneDrive Public -> projects
Link: FTP - EventDesigner V3
Info MacOS. With Safari you can't open FTP folders anymore. Switch to another browser.
Creating of an executable program from one or several form files with complete event-handling for windows, menus and gadgets.

Features:
- Extension of the IDs for menus and gadgets with WindowID as prefix
- Afterwards changing of the original form files
- First window as parend window
- Set Windowposition Auto (#PB_Ignore)
- Include images
- Translate in MenuItem(...) '\t' to '+ #TAB$ +' for using shortcuts
- Saving of last preferences in project file

Process:
Create several Forms.pbf with the PureBasic FormDesigner without PB_Any and without event procedures and add them to the EventDesigner.
After successful creation of the event codes, the following files are ready.

- GuiCommonFile.pb
- GuiMainFile.pb
- GuiEventMainFile.pb
- GuiEvent[Form].pb

After changing of the original form files new events will be added
and is changing constants the code is updated.

Info:
- PB_Any is not supported
- Deactivate main and event procedure on FormDesigner

* The Copy Images option copies the files to the [ProjectPath]/Resources folder.
* Under macOS copied to the folder [ProjectPath]/MyAppData/Resources

! macOS:
! So that the resources are available in the APP at runtime, you need the MacOS IDE tool MyAppData.
! The required code for the tool can be saved under Menu Tools.
Structure of the form files without the FormDesigner

Code: Select all

;-TOP

; Enumeration not used

LoadFont(#Constant, ...)

Use[XY]ImageDecoder()

LoadImage(#Constant, ...)

; ----

;{ Begin : This always in the same form file

Procedure Open[Window_Constant]()
  If OpenWindow(#Window_Constant, ...)
    ; ...
  EndIf
EndProcedure

; ----

Procedure ResizeGadgets[Window_Constant]()
  ; ...
EndProcedure

;} End

; ----

Procedure InitPopupMenu()
  If CreatePopupImageMenu(#Popup_Constant[, ...]) 
    ; ...
  EndIf
EndProcedure : InitPopupMenu() ; On same line

; ----

Procedure [Others]()
  UseGadgetList(WindowID(#Window_Constant))
  ; ...
EndProcedure

[/size]
Last edited by mk-soft on Tue Sep 21, 2021 12:40 pm, edited 16 times in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (Beta)

Post by mk-soft »

Update v3.01 (Beta 2)
- Bug fixes
- Evaluation of external procedures revised

Example:
- Adding PopupMenus to Event Management.

The code is automatically adjusted and added to GuiCommonFile.pb

Code: Select all

;-TOP

; File: FormPopupMenus.pb

Procedure InitPopupMenu1()
 If CreatePopupImageMenu(#Popup1, #PB_Menu_ModernLook) 
    MenuItem(#Open, "Open")
    MenuItem(#Save, "Save")
    MenuItem(#SaveAs, "Save as")
    MenuItem(#Quit, "Quit")
    MenuBar()
    OpenSubMenu("Recent files")
    MenuItem(#SubMenu1, "PureBasic.exe")
    MenuItem(#SubMenu2, "Info.txt")
    CloseSubMenu()
  EndIf
EndProcedure : InitPopupMenu1()

Procedure InitPopupMenu2()
 If CreatePopupImageMenu(#Popup2, #PB_Menu_ModernLook) 
    MenuItem(#Open, "Open")
    MenuItem(#Save, "Save")
    MenuItem(#SaveAs, "Save as")
    MenuItem(#Quit, "Quit")
  EndIf
EndProcedure : InitPopupMenu2()
[/size]
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (Beta)

Post by mk-soft »

Update v3.04
- Bugfixes

The PB editor sometimes doesn't notice that the files have changed... ?!
Looking for a long time for the error, why the change of the file was not translated correctly :|
So better close the files before.

:wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Bitblazer
Enthusiast
Enthusiast
Posts: 730
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: RAD EventDesigner V3 (Beta)

Post by Bitblazer »

mk-soft wrote:The PB editor sometimes doesn't notice that the files have changed... ?!
Some IDE functions only notice changes after they where written to external memory / harddisk. Thats what i noticed.
webpage - discord chat links -> purebasic GPT4All
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (Beta)

Post by mk-soft »

During the test I opened all files. These are rewritten in the background (CreateFile).
The editor only recognizes two changed files, but sometimes all files have changed. :cry:

Update v3.05
- Added information
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3

Post by mk-soft »

Update v3.07
- Bugfix Macro ResizeGadget
- Bugfix write BOM
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3

Post by mk-soft »

Update v3.08
- Bugfix
- Restart Purebasic-IDE

Under Linux the tool "wmctrl" is needed to automatically terminate the Purebasic IDE.
sudo apt-get install wmctrl
:wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD EventDesigner V3

Post by Kwai chang caine »

Hello MkSoft :D

Excuse me to not try to help you before, but i have problems with SYMANTEC on my enterprise machine, and it's not the moment to load EXE of PB :cry:
Now i'm in my home, and i want to help you with my little means, for test your new toy, if that can help you a little bit :wink:

But like usually i have not all understand :oops:
I have create a form "essai.pbf" with the actual designer of the 5.70, without #PB_ANY and events

Code: Select all

; Form Designer for Purebasic - 5.70
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.

;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;

Enumeration FormWindow
  #Window_0
EndEnumeration

Enumeration FormGadget
  #Button_0
  #String_0
EndEnumeration


Procedure OpenWindow_0(x = 0, y = 0, width = 490, height = 140)
  OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
  ButtonGadget(#Button_0, 50, 60, 410, 50, "")
  StringGadget(#String_0, 50, 20, 420, 30, "")
EndProcedure
I have load "essai.pbf" in your program, and launch start process ...and nothing with happening with W10 X64 / v5.70 X86 :shock:
I'm really a "Ham butter" :oops:
ImageThe happiness is a road...
Not a destination
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3

Post by mk-soft »

I tried your form-file under Win 10 with PB-X86.
After saving the project.xml I quit Purebasic-IDE and created the code. After that the Purebasic-IDE was started again with the file GuiMainFile.pb.

What did the output show you?

- Close Purebasic IDE ...
- Start ...
- ?

The Purebasic IDE must be closed. If the IDE is not terminated, the process will not start.

After the process the following files must be present
- GuiCommonFile.pb, GuiMainFile.pb, GuiEventMainFile.pb, GuiEvent[Formfiles].pb

The original [Form].pbf is not changed, so that it can be adapted again and again by the FormDesigner.

If the constants of the original Form file are changed, the dialog windows for assigning the old constants to the constants appear.

P.S.
Saving the project.xml is important, as it is used to evaluate the changes made to the FormFile.pbf.
It also defines the target path for the Gui-Files.

Translated with http://www.DeepL.com/Translator


I haven't read correctly again...
Virus protection times again.
Add the program to the exceptions of the virus scanner!

Actually a normal program with the libraries XML (expat) and lib for PNG.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (All OS)

Post by mk-soft »

Update descriptions :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: RAD EventDesigner V3 (All OS)

Post by Kwai chang caine »

Aaaah ok !!!
This time that works

I have that in GuiEventMainFile :wink:

Code: Select all

;-TOP

; ***************************************************************************
; 
; Comment : EventDesigner - Common Event Main File
; Create  : 2019.09.08 17.32.26
; 
; Info    : Do not edit this file. This file always overwrite.
; 
; ***************************************************************************

; - Include Event Files
IncludeFile "D:\Temp\GuiEventessai.pb"

; ----

Prototype _MyPrototypeInvoke()

Structure _MyInvokeEvent
  Invoke._MyPrototypeInvoke[0]
EndStructure

Global *vTableEventSizeWindow._MyInvokeEvent = ?vTableEventSizeWindow
Global *vTableEventCloseWindow._MyInvokeEvent = ?vTableEventCloseWindow
Global *vTableEventMenu._MyInvokeEvent = ?vTableEventMenu
Global *vTableEventGadget._MyInvokeEvent = ?vTableEventGadget

#_CountEventWindow = 1
#_CountEventMenu = 0
#_CountEventGadget = 2

; ----

Procedure _MyEventSizeWindow()
  Protected WindowID = EventWindow()
  Select WindowID
    Case 0 To #_CountEventWindow - 1
      *vTableEventSizeWindow\Invoke[WindowID]()
  EndSelect
EndProcedure

; ----

Procedure _MyEventCloseWindow()
  Protected WindowID = EventWindow()
  Select WindowID
    Case 0 To #_CountEventWindow - 1
      *vTableEventCloseWindow\Invoke[WindowID]()
  EndSelect
EndProcedure

; ----

Procedure _MyEventMenu()
  Protected MenuID = EventMenu()
  Select MenuID
    Case 0 To #_CountEventMenu - 1
      *vTableEventMenu\Invoke[MenuID]()
  EndSelect
EndProcedure

; ----

Procedure _MyEventGadget()
  Protected GadgetID = EventGadget()
  Select GadgetID
    Case 0 To #_CountEventGadget - 1
      *vTableEventGadget\Invoke[GadgetID]()
  EndSelect
EndProcedure

; ----

; - Bind Events
BindEvent(#PB_Event_Menu, @_MyEventMenu())
BindEvent(#PB_Event_Gadget, @_MyEventGadget())
BindEvent(#PB_Event_SizeWindow, @_MyEventSizeWindow())
BindEvent(#PB_Event_CloseWindow, @_MyEventCloseWindow())
    
; ----

DataSection
  vTableEventSizeWindow:
  Data.i @MyEventSizeWindow_Window_0()
  
  vTableEventCloseWindow:
  Data.i @MyEventCloseWindow_Window_0()
  
  vTableEventMenu:
  
  vTableEventGadget:
  Data.i @MyEventGadget_Window_0_Button_0()
  Data.i @MyEventGadget_Window_0_String_0()
  
EndDataSection

; ----
Thanks for sharing and your explanation 8)
ImageThe happiness is a road...
Not a destination
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (All OS)

Post by mk-soft »

Fine :wink:

Update v3.09
- Exiting the Purebasic IDE optional
- Windows: SetForeGroundWindow for Purebasic IDE removed

Now the PB-IDE doesn't crowd in :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (All OS)

Post by mk-soft »

Update v3.10
- Added ToolbarButton "Stop Process"
- Optimize GuiEventMainFile.pb

I am now using the new EventDesigner myself for the development of the EventDesigner :wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: RAD EventDesigner V3 (All OS)

Post by mk-soft »

Update v3.10r2
- Bugfix Add Gadgets

:wink:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Bitblazer
Enthusiast
Enthusiast
Posts: 730
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: RAD EventDesigner V3 (All OS)

Post by Bitblazer »

mk-soft wrote:I am now using the new EventDesigner myself for the development of the EventDesigner :wink:
Thats the best way to find bugs, glitches and improve software imho :wink:
webpage - discord chat links -> purebasic GPT4All
Post Reply