Should PureBasic become my main development system?
Re: Should PureBasic become my main development system?
For me, the best IDE (even better that VB6) was the Delphi one
- the.weavster
- Addict
- Posts: 1537
- Joined: Thu Jul 03, 2003 6:53 pm
- Location: England
Re: Should PureBasic become my main development system?
It's been a while since I did anything involving PB gadgets (recently I've tended to make application servers with an HTML ui) but this skeleton shows how I liked to layout code for apps with multiple windows:
Code: Select all
Enumeration windows
#frmMain
#frmChild
EndEnumeration
Enumeration gadgets
#frmMain_btnChild
#frmChild_btnOK
EndEnumeration
; child window - definition and handlers could be in separate file(s)
Procedure frmChild_Open()
If OpenWindow(#frmChild, 0, 0, 200, 150, "child", #PB_Window_SystemMenu|#PB_Window_WindowCentered)
ButtonGadget(#frmChild_btnOK, 10, 10, 150, 30, "Show Message")
EndIf
EndProcedure
; child window's gadget handlers
Procedure frmChild_onGadget(nGadget, nEventType, nX, nY)
Select nGadget
Case #frmChild_btnOK
MessageRequester("", "Hello, World!", 0)
EndSelect
EndProcedure
; app's main window
Procedure frmMain_Open()
If OpenWindow(#frmMain, 0, 0, 400, 300, "parent", #PB_Window_ScreenCentered)
ButtonGadget(#frmMain_btnChild, 10, 10, 150, 30, "Show Child")
EndIf
EndProcedure
; main window's gadget handlers
Procedure frmMain_onGadget(nGadget, nEventType, nX, nY)
Select nGadget
Case #frmMain_btnChild
frmChild_Open()
EndSelect
EndProcedure
; gadget events - routing to relevant window
Procedure Events_Gadget()
nGadget = EventGadget()
nEventType = EventType()
nX = 0 : nY = 0
Select GadgetType(nGadget)
Case #PB_GadgetType_Canvas
nX = GetGadgetAttribute(nGadget, #PB_Canvas_MouseX)
nY = GetGadgetAttribute(nGadget, #PB_Canvas_MouseY)
Case #PB_GadgetType_ListIcon
nY = GetGadgetState(nGadget)
; etc...
EndSelect
Select EventWindow()
Case #frmMain
frmMain_onGadget(nGadget, nEventType, nX, nY)
Case #frmChild
frmChild_onGadget(nGadget, nEventType, nX, nY)
EndSelect
EndProcedure
; windows' close events
Procedure Events_CloseWindow()
nWin = EventWindow()
Select nWin
Case #frmMain
End ; closing main window quits app
Default
CloseWindow(nWin)
EndSelect
EndProcedure
BindEvent(#PB_Event_Gadget, @Events_Gadget())
BindEvent(#PB_Event_CloseWindow, @Events_CloseWindow())
frmMain_Open()
Repeat
nWait = WaitWindowEvent()
ForEver
Re: Should PureBasic become my main development system?
Nice and clean, thaks for sharingthe.weavster wrote: ↑Thu Sep 22, 2022 6:58 pm It's been a while since I did anything involving PB gadgets (recently I've tended to make application servers with an HTML ui) but this skeleton shows how I liked to layout code for apps with multiple windows:
BTW: I'd love to see a simple example of how you use PB on the server side with an html front-end
Re: Should PureBasic become my main development system?
We just decided to use the react framework for our SIP software written in PB.
The website is started in kiosk mode and it communicates via websocket.
Works very well.
The website is started in kiosk mode and it communicates via websocket.
Works very well.
Re: Should PureBasic become my main development system?
Hi there Yogi Yang, I have looked at Twinbasic previously and it looks to have great potential but I wouldn't enter into the subscription model.
Thanks the.weavster for your skeleton code, it is very useful for me, thank you.
Caronte3D, I also enjoyed Delphi. I think from memory, I paid about US$112 for version 1 and the last I purchased was version 7. The price has increased a lot but we have Lazarus Pascal so we're okay.
Thanks the.weavster for your skeleton code, it is very useful for me, thank you.
Caronte3D, I also enjoyed Delphi. I think from memory, I paid about US$112 for version 1 and the last I purchased was version 7. The price has increased a lot but we have Lazarus Pascal so we're okay.
Re: Should PureBasic become my main development system?
Hi David. Thank you for saying so. I'm glad you found it helpful.
Since you mentioned that your focus would be on database applications, here's a quick guide for SQLite:
> PureBasic SQLite Database: A Quick Tutorial
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Re: Should PureBasic become my main development system?
Yes, Yogi. I played with it some. It appears well integrated with Visual Code. There's also RadBasic which is supposedly 100% compatible with VB6 projects. But it also unfortunately appears to have a subscription (Patreon) model as well.
Gary E Chike DMD MS
'Experience is what you get when you don't get what you want'
'Experience is what you get when you don't get what you want'
Re: Should PureBasic become my main development system?
Hello TI-994A and yes, I've already been using your excellent SQLite tutorial, thank you. It is another of your tutorials that made it possible for me to get going with PureBasic.
My ambitions with PureBasic have escalated much faster than my learning and I'm very pleased with my IceDesign purchase but coming back to reality, the way forward for me is to remain hand coding single-window applications for a while to better learn some of the terminology and then I'll be able to ask questions more intelligently.
David
My ambitions with PureBasic have escalated much faster than my learning and I'm very pleased with my IceDesign purchase but coming back to reality, the way forward for me is to remain hand coding single-window applications for a while to better learn some of the terminology and then I'll be able to ask questions more intelligently.
David