Page 2 of 4

Posted: Wed Jun 08, 2005 1:49 pm
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??

Posted: Wed Jun 08, 2005 5:03 pm
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...

Posted: Wed Jun 08, 2005 5:47 pm
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.

Posted: Wed Jun 08, 2005 5:55 pm
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.

Posted: Wed Jun 08, 2005 8:35 pm
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:

Posted: Wed Jun 08, 2005 9:55 pm
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!

Posted: Fri Jul 22, 2005 5:49 pm
by Ginger
Any news here? How goes the battle?

Ginger

Posted: Fri Jul 22, 2005 11:28 pm
by GeoTrail
WOW, that looks so sweet.
You have no idea how times I've dreamed about that ;)

Posted: Sat Jul 23, 2005 12:14 am
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.

Posted: Sat Jul 23, 2005 6:32 pm
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

Posted: Sun Nov 13, 2005 12:32 am
by GeoTrail
What's the status for this project now?

Posted: Sun Nov 13, 2005 4:10 pm
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:

Posted: Sun Nov 13, 2005 5:56 pm
by GeoTrail
Hehehehe ok then, get back to work and stop reading :lol: :D

Posted: Sun Nov 13, 2005 9:42 pm
by Brice Manuel
Just what we need, turning PB into a VB clone. :cry:

Posted: Sun Nov 13, 2005 10:25 pm
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.