PureGUI
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> If PB can be used in a visual way, PB become, maybe one of the most popular
> programming tool, imho.
Just a reminder: Visual Basic users, or those who don't mind installing the
free 7 MB version of Visual Basic, can design their PureBasic GUIs with VB's
nice drag-and-drop editor, and then use "vis2pure" to convert the GUI design
into PureBasic source code, ready-to-run instantly.
http://www.bowlay.com/vis2pure.htm
PB - Registered PureBasic Coder
Edited by - PB on 01 May 2002 19:04:36
> If PB can be used in a visual way, PB become, maybe one of the most popular
> programming tool, imho.
Just a reminder: Visual Basic users, or those who don't mind installing the
free 7 MB version of Visual Basic, can design their PureBasic GUIs with VB's
nice drag-and-drop editor, and then use "vis2pure" to convert the GUI design
into PureBasic source code, ready-to-run instantly.
http://www.bowlay.com/vis2pure.htm
PB - Registered PureBasic Coder
Edited by - PB on 01 May 2002 19:04:36
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", @MyProcedure(W,X,Y,Z) )
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", ?MyLabel )
BUT SORRY, when releasing PureGUI I have to think about further development (PureGUIDE) and I prefer Subroutines.
So if you call Procedures instead of Subroutines and PUREGUIDE will be released (one fine day...) you have to change your exsting code to use PUREGUIDE.
And like I said the Subroutine is only used to JUMP to the function related to the GUI event. The more modular you code at the beginning the less rework you will have in the future.
-------------------------------------------------------------------------------------
THIS WILL BE THE MAIN WAY TO CODE 'MODULAR' IN PUREGUIDE:
At the end of every PureGUI main code will be a IncludeFile command to store all the needed Subroutines in this file.
Every GUI event jumps to such a subroutine and in this subroutine is a 'XIncludeFile' command that jumps to another Include file, and finally in THIS file you can code WHATEVER YOU WANT.
What you code in this File - Procedures or whatever - is up to you.
At THIS POINT you are able to code YOUR WAY!
Dependencies from one Procedure to another can be solved with the new Declare command of PureBasic.
-------------------------------------------------------------------------------------
AND IN THE FUTURE:
In PureGUIDE you can press the right mouse button over your Gadget and the file called with 'XIncludeFile' will show up and you are able to write your code...
This is my intention - and with this style nobody will need a foldable editor.
And the documentation issue is a good point to think about.
The Syntax would be:
PG_Create("ButtonGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("CheckBoxGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("TextGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,"",0,0)
PG_Create("StringGadget",WindowNB,PosX,PosY,SizeX,SizeY,Content$,ToolTip$,LMB_Command,0)
PG_Create("ButtonImageGadget",WindowNB,PosX,PosY,SizeX,SizeY,Image$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("ImageGadget",WindowNB,PosX,PosY,SizeX,SizeY,Image$,"",0,0)
PG_Create("ProgressBarGadget",WindowNB,PosX,PosY,SizeX,SizeY,"","",Min,Max)
You see that there must be the same amount of parameters and the data type must be the same.
That's because PureBasic doesn't allow changing the number of parameters for the same procedure [for now]. (remember: PureGUI is coded in PureBasic...)
After PureGUI is released you are able to call procedures - BUT you have to change your code if you want to use PUREGUIDE one fine day.
If I would call your syntax I must call PG_CreateGadget twice to set first LMB and than RMB. ( and I would create 2 Buttons...)
I want be able to set 2 Actions at 1 time for LMB/RMB
Forgot to mention that there will be 2 commands to fill the syntax:
PG_NoFunctionNeeded() and PG_NoFunctionAssigned()
you code:
PG_Create("ButtonGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,@PG_NoFunctionAssigned(),@PG_NoFunctionNeeded())
In this way you can test the GUI code before you code the functions behind the events.
PG_NoFunctionNeeded() will do nothing (used if you don't need a function for RMB [in the example]) The action behind PG_NoFunctionAssigned is that you will get a little window with a reminder like "You have to code a function for this Gadget".
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 01 May 2002 19:36:33
Well The correct syntax would be:How about doing both:
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", MyProcedure(W,X,Y,Z) )
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", ?MyLabel )
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", @MyProcedure(W,X,Y,Z) )
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip", ?MyLabel )
BUT SORRY, when releasing PureGUI I have to think about further development (PureGUIDE) and I prefer Subroutines.
So if you call Procedures instead of Subroutines and PUREGUIDE will be released (one fine day...) you have to change your exsting code to use PUREGUIDE.
And like I said the Subroutine is only used to JUMP to the function related to the GUI event. The more modular you code at the beginning the less rework you will have in the future.
-------------------------------------------------------------------------------------
THIS WILL BE THE MAIN WAY TO CODE 'MODULAR' IN PUREGUIDE:
At the end of every PureGUI main code will be a IncludeFile command to store all the needed Subroutines in this file.
Every GUI event jumps to such a subroutine and in this subroutine is a 'XIncludeFile' command that jumps to another Include file, and finally in THIS file you can code WHATEVER YOU WANT.
What you code in this File - Procedures or whatever - is up to you.
At THIS POINT you are able to code YOUR WAY!
Dependencies from one Procedure to another can be solved with the new Declare command of PureBasic.
-------------------------------------------------------------------------------------
AND IN THE FUTURE:
In PureGUIDE you can press the right mouse button over your Gadget and the file called with 'XIncludeFile' will show up and you are able to write your code...
This is my intention - and with this style nobody will need a foldable editor.
Yes using CREATE... the overhead of an application would be smaller.The *CreateGadget*(1 / 3) method keeps the number of *new* commands introduced into PB to 1 whereas the PG_ButtonGadget(2) method requires at least a dozen new commands - a page of documentation for each command. I think *CreateGadget* would more readily encompass new GadgetTypes.
And the documentation issue is a good point to think about.
The Syntax would be:
PG_Create("ButtonGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("CheckBoxGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("TextGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,"",0,0)
PG_Create("StringGadget",WindowNB,PosX,PosY,SizeX,SizeY,Content$,ToolTip$,LMB_Command,0)
PG_Create("ButtonImageGadget",WindowNB,PosX,PosY,SizeX,SizeY,Image$,ToolTip$,LMB_Command,RMB_Command)
PG_Create("ImageGadget",WindowNB,PosX,PosY,SizeX,SizeY,Image$,"",0,0)
PG_Create("ProgressBarGadget",WindowNB,PosX,PosY,SizeX,SizeY,"","",Min,Max)
You see that there must be the same amount of parameters and the data type must be the same.
That's because PureBasic doesn't allow changing the number of parameters for the same procedure [for now]. (remember: PureGUI is coded in PureBasic...)
Sorry, please read THE MAIN WAY above...The Procedure approach(3) would be very readable and therefore easily maintained
After PureGUI is released you are able to call procedures - BUT you have to change your code if you want to use PUREGUIDE one fine day.
NOPE because you can only declare '1 action / 1 value / 1 index' at a time.I just think this syntax:
PG_CreateGadget(#Button,Window1,320,10,100,25,"Button","ToolTip",MyProcedure(PG_ButtonAction,PG_GadgetValue$,PG_GadgetIndex))
would allow you to incorporate it in syntactically one day (perhaps) more easily.
If I would call your syntax I must call PG_CreateGadget twice to set first LMB and than RMB. ( and I would create 2 Buttons...)
I want be able to set 2 Actions at 1 time for LMB/RMB
Forgot to mention that there will be 2 commands to fill the syntax:
PG_NoFunctionNeeded() and PG_NoFunctionAssigned()
you code:
PG_Create("ButtonGadget",WindowNB,PosX,PosY,SizeX,SizeY,Text$,ToolTip$,@PG_NoFunctionAssigned(),@PG_NoFunctionNeeded())
In this way you can test the GUI code before you code the functions behind the events.
PG_NoFunctionNeeded() will do nothing (used if you don't need a function for RMB [in the example]) The action behind PG_NoFunctionAssigned is that you will get a little window with a reminder like "You have to code a function for this Gadget".
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 01 May 2002 19:36:33
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fred.
The events won't be changed to much for v3.10. Anyway all have been internally redone, so everything should work ok. Please keep in mind than starting v3.10 amost all events can be catched easely (ex for a listicongadget: left click, right click, left double click, right double clik etc...). So you need to link several procedure/label for each action..
Fred - AlphaSND
The events won't be changed to much for v3.10. Anyway all have been internally redone, so everything should work ok. Please keep in mind than starting v3.10 amost all events can be catched easely (ex for a listicongadget: left click, right click, left double click, right double clik etc...). So you need to link several procedure/label for each action..
Fred - AlphaSND
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
I tried years ago the free Visual Basic IDE and it was not bad.
And with PB's excellent vis2pure you can write a GUI for PureBasic with this IDE
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
YES, this is a very good solution!Just a reminder: Visual Basic users, or those who don't mind installing the
free 7 MB version of Visual Basic, can design their PureBasic GUIs with VB's
nice drag-and-drop editor, and then use "vis2pure" to convert the GUI design
into PureBasic source code, ready-to-run instantly.
http://www.bowlay.com/vis2pure.htm
PB - Registered PureBasic Coder
I tried years ago the free Visual Basic IDE and it was not bad.
And with PB's excellent vis2pure you can write a GUI for PureBasic with this IDE
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
GREAT! If this works I don't need a WindowCallback routine anymore...The events won't be changed to much for v3.10. Anyway all have been internally redone, so everything should work ok. Please keep in mind than starting v3.10 amost all events can be catched easely (ex for a listicongadget: left click, right click, left double click, right double clik etc...). So you need to link several procedure/label for each action..
Fred - AlphaSND
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
BTW FRED, what is with the possibility to write PureBasic libs with PureBasic?
If I'm not able to alter PureBasic generated asm code by hand I have to create the library as DLL - and I don't like this way (than you need a header file etc...)
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
BTW FRED, what is with the possibility to write PureBasic libs with PureBasic?
If I'm not able to alter PureBasic generated asm code by hand I have to create the library as DLL - and I don't like this way (than you need a header file etc...)
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by marlo.
Well, Naw i say if you HATE any MS visual IDE, really, you must change de OS.Windows which is visual by excellence.I remember when i start on computers, i purchase AMIGA, because i dislike de bad OLD DOS style.Only characters,blank screens, really a bad stuff, AMIGA on the other hand offer us images,sounds, and even the first 3D images!. Now its important the design item on any program, and work only on an editor with ice code its not better than the visual thing.I like PB because is small and fast, but to see what i want on design i must run and run my code, and if exists any visual way to design on PB its better for all specially who loves the design.Or im wrong?
south south america
Well, Naw i say if you HATE any MS visual IDE, really, you must change de OS.Windows which is visual by excellence.I remember when i start on computers, i purchase AMIGA, because i dislike de bad OLD DOS style.Only characters,blank screens, really a bad stuff, AMIGA on the other hand offer us images,sounds, and even the first 3D images!. Now its important the design item on any program, and work only on an editor with ice code its not better than the visual thing.I like PB because is small and fast, but to see what i want on design i must run and run my code, and if exists any visual way to design on PB its better for all specially who loves the design.Or im wrong?
south south america
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by naw.
Hi Franco,
Ok - didnt notice the "PureGUI is coded in PB" comment before, so I appreciate the problem with number of params which kind of kills the whole argument for procedures anyway I still look forward to seeing the results real soon...
PureGUIDE sounds interesting (I'm trying to visualise it) - similar to a foldable editor but each Gadget has its own code pop-up window. The modularity bit sounds a bit FORTH'like.
Ta - N
Hi Franco,
Ok - didnt notice the "PureGUI is coded in PB" comment before, so I appreciate the problem with number of params which kind of kills the whole argument for procedures anyway I still look forward to seeing the results real soon...
PureGUIDE sounds interesting (I'm trying to visualise it) - similar to a foldable editor but each Gadget has its own code pop-up window. The modularity bit sounds a bit FORTH'like.
Ta - N
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by naw.
Nope you're right - I just prefer text editors for coding in
Well, Naw i say if you HATE any MS visual IDE, really, you must change de OS.Windows which is visual by excellence.I remember when i start on computers, i purchase AMIGA, because i dislike de bad OLD DOS style.Only characters,blank screens, really a bad stuff, AMIGA on the other hand offer us images,sounds, and even the first 3D images!. Now its important the design item on any program, and work only on an editor with ice code its not better than the visual thing.I like PB because is small and fast, but to see what i want on design i must run and run my code, and if exists any visual way to design on PB its better for all specially who loves the design.Or im wrong?
south south america
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Wanted to keep you posted:
1st public version of PureGUI finished, have to work on the documentation though.
Release will be this weekend. (hopefully... please don't pray for bad weather on the Westcoast)
Stay tuned
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Wanted to keep you posted:
1st public version of PureGUI finished, have to work on the documentation though.
Release will be this weekend. (hopefully... please don't pray for bad weather on the Westcoast)
Stay tuned
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
Hi all,
PureGUI is released!
http://fsw.home.attbi.com
under section PureGUI you will find 'Download'.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Hi all,
PureGUI is released!
http://fsw.home.attbi.com
under section PureGUI you will find 'Download'.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
There is a little bug in the 'OnFunction.pbi' file.
Just change under Subroutine FunctionGadget4:
this line:
to:
or download the version 1.1 from http://fsw.home.attbi.com
I missed this line. Sorry.
If you have any questions or suggestions let me know.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 06 June 2002 16:26:01
There is a little bug in the 'OnFunction.pbi' file.
Just change under Subroutine FunctionGadget4:
this line:
Code: Select all
  String$ = GetGadgetText(Gadget4)Â
Code: Select all
  String$ = GetGadgetText(MyComboBox)Â
I missed this line. Sorry.
If you have any questions or suggestions let me know.
Have a nice day...
Franco
Sometimes you have to go a lonely way to accomplish genius things.
Edited by - franco on 06 June 2002 16:26:01