[Implemented] New Visual Designer

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Is a lib really necessary? Can't you just make your own procedures which administers a linked lists with the gadget id's and associated procedures??
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post by naw »

There are people on this thread who are better qualified than me to discuss this, but it seems to me that the easiest way would be for VD to just separate the major sections of the source (even more than it does now):

A spearate file where all the includes are kept for MyProject_Constants.pbi / MyProject_GadgetCreate.pbi / MyProject_EventLoop.pbi / MyProject_GadgetActions.pbi:
MyProject.pb

A file for all enumerations, Globals & Constants:
MyProject_Constants.pbi

All the Gadget / Menu Procedures could be stored in a file called:
MyProject_GadgetActions.pbi

The Repeat...Until event event loop should use Select..Case..EndSelect statements and instead of using Debug could perhaps call a Procedure using the same name as the Gadged IDs #Constant name:
MyProject_EventLoop.pbi

Another one to create all the Window, Menus, Gadgets GUI objects called:
MyProject_GadgetCreate.pbi


- I dunno - just seems like a neat way for the VD to split the code up into sections that will be more easily maintained...
Ta - N
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Berikco wrote: It's just a standard event loop, with if/endif or Select/Case
I only see disadvantages in using a closed lib, sounds more like VB blackbox to me
Berikco,
It's funny that you mention a closed lib... VD is closed source too :wink:
I wrote: I don't mean that you have to use my lib, but why not use the same approach to make things easier (hope you get my point).
You don't have to use my lib!
My lib is not written in pb because pb doesn't have "redim preserve" and I used arrays for that.

But the point here is not my lib, it's the technique used.
The pb approach is soo old-style it reminds me of "Profan2" when I used to use it back in the old days, when was it ... I think 10 or 12 years ago, or even longer.

Look at wxWidgets or QT or GTK - regarding gui they all do the same.
An event driven approach.
Maybe you think you loose control over the events but this is not the case.

It's just a matter to understand how it works.
And in fact I'm not that bright and I consider myself as a normal guy (not too stupid and not too intelligent) :wink:
So if I can get it - you can too.

But hey, Vd is your baby PB is a commercial endevour so ... good luck.

As a sidenote:
I've never used vd for anything serious - only for testing.
This said: who am I to tell you what to do...
:P

PS: ... only feel sorry for vd users.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Trond wrote:Is a lib really necessary? Can't you just make your own procedures which administers a linked lists with the gadget id's and associated procedures??
yep, but I used arrays instead - never trusted PB's LL's.
(they have been buggy back then and didn't have indexing... don't know about today though)
Also it's a matter of speed.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Berikco wrote:Is (was) the same under GFA Basic 32
It would be very easy for me if Purebasic had this functionality. :)
So Fred wil have to write this kind of lib for all versions ;)
Here a little gift from me (as you will see there is not much to it - really...).

Code: Select all

; Event Driven Coding can be so easy.
; PureBasic only code... no external lib necessary.
; (c) 2005 - by Franco (aka fsw)
; done from scratch in a few minutes
;- Start Main

Declare Button_1_Function()

;MaxObjects(0) is used to store the actual used number
;you could do it with linked lists too...
MaxObjects.l = 10 ; because there is no 'redim preserve' in pb - bummer...
Dim ObjectID.l(MaxObjects)

Procedure GetNewObjectID()
  ObjectID(0) = ObjectID(0) + 1
  ProcedureReturn ObjectID(0)
EndProcedure

Procedure ConnectTheGadgetToFunction(EventID, Function)
  ObjectID(EventID) = Function
EndProcedure

Procedure CallStoredEventFunction(EventID.l)
  CallFunctionFast(ObjectID(EventID))
EndProcedure

If OpenWindow(1,100,200,320,240,#PB_Window_SystemMenu,"Test") = 0 : End : EndIf

CreateGadgetList(WindowID(1))

PB_Button_0 = GetNewObjectID()
ButtonGadget(PB_Button_0,100,50,100,50,"Button ")
ConnectTheGadgetToFunction(PB_Button_0, ?Button_0_Function) ; it works with labels

PB_Button_1 = GetNewObjectID()
ButtonGadget(PB_Button_1,100,150,100,50,"Button ")
ConnectTheGadgetToFunction(PB_Button_1, @Button_1_Function()) ; it works with procedures

Repeat
  Event.l = WaitWindowEvent()
  
  Select Event
    Case #PB_Event_Gadget
      CallStoredEventFunction(EventGadgetID())
      
  EndSelect
Until Event = #PB_Event_CloseWindow

End

;- User Functions

Button_0_Function:
  MessageRequester("Test Button_0", "It works...",0)
Return

Procedure Button_1_Function()
  MessageRequester("Test Button_1", "It works too...",0)
EndProcedure
It's so easy - even with pb :shock:

ps: my first pb code after a few month and it works :lol:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Now this is what I call a REAL IDE. A built in code editor w/ visual designer integrated, and not glued on like the old 3.93 PB/win Code editor (and current beta). This one actually works together. Now if this was finish, this would knock the socks off the the current PB CE and japbe :)

Ah finally, the killer PB development tool :) This is definately one to keep an eye out for!
Ginger
New User
New User
Posts: 8
Joined: Tue Jun 28, 2005 4:50 am
Location: Edmonton, Alberta, Canada eh!
Contact:

Post by Ginger »

Any news here? How goes the battle?

Ginger
Ginger

***********************************
So say... a man called Ginger. Yes, I'm a dude.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

WOW, that looks so sweet.
You have no idea how times I've dreamed about that ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Heh, basically a "visual studio" for pure basic :) This has been needed for a very long time :) Hopefully this project is still going :) I'd pay $50 or more for something like this.
Ginger
New User
New User
Posts: 8
Joined: Tue Jun 28, 2005 4:50 am
Location: Edmonton, Alberta, Canada eh!
Contact:

Post by Ginger »

Yes I would definitely pay some coin for that ide! I'm sure they are still working on it, by the looks of the screenshot they've come too far for it to have been a whim! :D

Ginger
Ginger

***********************************
So say... a man called Ginger. Yes, I'm a dude.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

What's the status for this project now?
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Working on it this moment i read your post :)
Well actuale was working, i can't read post's and code at the same time :mrgreen:
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Hehehehe ok then, get back to work and stop reading :lol: :D
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Brice Manuel

Post by Brice Manuel »

Just what we need, turning PB into a VB clone. :cry:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Haha, thats funny. That would require a runtime library, an server grade network library, and a fixed keyboard lib :roll:

In all seriousness ...

If you want a real IDE, there were only two created for PureBasic, one have been discontinued, and this one that is being worked on. For all those people who have been looking for an IDE, here it is. For those who complain, you can always go back to the official code editor and dialog designer that comes with the PB distribution.

From the looks of it. Beriko is working on an (one and only, now) IDE for PureBasic. You are NOT required to use it. If you dont want to use it, dont use it. Really simple ...

I applaud Beriko for creating an IDE (basically) to bring PB up to the level and ease of Visual Basic. This have been one of the things lacking (IMO) with PB for a very long time.
Post Reply