[Done] 5.11-B1 Form Designer: File with event procedures ?
[Done] 5.11-B1 Form Designer: File with event procedures ?
I don't know if it happens only in windows version, but I cannot find a way to include a file with event procedures in Form Designer.
If I manually add in code an "Xinclude" it will be removed, maybe there is some input somewhere but I did not find it.
Using XP sp3 32 bit
If I manually add in code an "Xinclude" it will be removed, maybe there is some input somewhere but I did not find it.
Using XP sp3 32 bit
Re: 5.11-B1 Form Designer: File with event procedures ?
You need to do the other way around: you include your form and put your event procedure where you want (but not in the form file). Take a look here: http://www.purebasic.com/documentation/ ... _form.html
Re: 5.11-B1 Form Designer: File with event procedures ?
I did a simplified form and main file to check
TEST_Main.pb:
and the form
MainWindow.pbf
But the combo at EventProcedure is still empty and the procedure name has to be inserted manually even if there are 2 procedures declared in the .pbf file
edit: added picture:

TEST_Main.pb:
Code: Select all
XIncludeFile "MainWindow.pbf" ; Include the second window definition
OpenMainWindow() ; This procedure name is always 'Open' followed by the window name
; The event procedures, as specified in the 'event procedure' property of each gadget
Procedure OkButtonEvent(EventType)
Debug "OkButton event"
EndProcedure
Procedure CancelButtonEvent(EventType)
Debug "CancelButton event"
EndProcedure
Procedure TrainCalendarEvent(EventType)
Debug "TrainCalendar event"
EndProcedure
; The main event loop as usual, the only change is to call the automatically
; generated event procedure for each window.
Repeat
Event = WaitWindowEvent(10)
;Select EventWindow()
; Case MainWindow
MainWindow_Events(Event) ; This procedure name is always window name followed by '_Events'
; Case DateWindow
; DateWindow_Events(Event)
;EndSelect
Until Event = #PB_Event_CloseWindow ; Quit on any window close
MainWindow.pbf
Code: Select all
Global MainWindow
Enumeration #PB_Compiler_EnumerationValue
#Button_0
#Button_1
EndEnumeration
Declare CancelButtonEvent(EventType)
Declare OkButtonEvent(EventType)
Procedure OpenMainWindow()
MainWindow = OpenWindow(#PB_Any, 0, 0, 330, 280, "MainWindow", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
ButtonGadget(#Button_0, 80, 45, 155, 65, "Cancel")
ButtonGadget(#Button_1, 80, 130, 155, 65, "Ok")
EndProcedure
Procedure MainWindow_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #Button_0
CancelButtonEvent(EventType())
Case #Button_1
OkButtonEvent(EventType())
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
edit: added picture:

Re: 5.11-B1 Form Designer: File with event procedures ?
I think it shouldn't be a combobox anymore, you have to enter your procedure name (you hardly reuse twice the same procedure anyway).
Re: 5.11-B1 Form Designer: File with event procedures ?
Thank you for your prompt reply, I admit that seeing the combo, I thought that I was missing some setting.
Now that we know that, after all we can copy and paste the procedure names from the main file directly to Form Designer.
You are right that in practice we hardly ever reuse the same procedure twice, but choosing from an automatically populated combobox was more ...ehm.. "visual".
Keep on the good work and thanks for the continuos updates to you and the team.
Now that we know that, after all we can copy and paste the procedure names from the main file directly to Form Designer.
You are right that in practice we hardly ever reuse the same procedure twice, but choosing from an automatically populated combobox was more ...ehm.. "visual".
Keep on the good work and thanks for the continuos updates to you and the team.
Re: 5.11-B1 Form Designer: File with event procedures ?
If you need to enter the procedure-name.
Wouldn't it be more comfortable to select
one of the existing procedures?
The IDE knows all existing procedures, so
the FormDesigner should be able to get this
information, too? Would be really handy.
MFG PMV
Wouldn't it be more comfortable to select
one of the existing procedures?
The IDE knows all existing procedures, so
the FormDesigner should be able to get this
information, too? Would be really handy.
MFG PMV
Re: 5.11-B1 Form Designer: File with event procedures ?
I'll see what I can do, I move the topic to the designer forum so I don't forget!
Re: 5.11-B1 Form Designer: File with event procedures ?
Ok, it should now display all procedures from opened files in the IDE.
Let me know if that works fine when next beta is released!
Let me know if that works fine when next beta is released!
Re: [Done] 5.11-B1 Form Designer: File with event procedures
Thank you, I will test it surely.
I have a quick question in the meantime, I had to paste Turkish text (unicode) as caption, is there a way to accept unicode?
I have a quick question in the meantime, I had to paste Turkish text (unicode) as caption, is there a way to accept unicode?
Re: [Done] 5.11-B1 Form Designer: File with event procedures
Everything should be ready to support unicode on the form designer side, but some procedures in the IDE are not compatible with unicode so for now it is not supported!
Re: [Done] 5.11-B1 Form Designer: File with event procedures
It's really nice what you've been able to do with the designer 

Re: 5.11-B1 Form Designer: File with event procedures ?
nice!Polo wrote:Ok, it should now display all procedures from opened files in the IDE.
Let me know if that works fine when next beta is released!
Is it a big thing or can we hope for that support in one of the next release?Polo wrote:Everything should be ready to support unicode on the form designer side, but some procedures in the IDE are not compatible with unicode so for now it is not supported!
I speak about hope, not a final date.

MFG PMV
Re: [Done] 5.11-B1 Form Designer: File with event procedures
It works nicely, thank you.Polo wrote:Ok, it should now display all procedures from opened files in the IDE.
Let me know if that works fine when next beta is released!