Page 1 of 1

A SQLWindows-like OO framework for SpiderBasic?

Posted: Thu May 07, 2020 12:47 am
by Charlie
In my quest to set myself up with a RAD SpiderBasic database application development, à la SQLWindows-like Object-Oriented programming and Event-Driven programming ...

I've just started putting together a framework that fits the type of programming I feel most comfortable with (being a career-long SQLWindows, aka OpenText Gupta Team Developer, programmer).

Aside: likely going to be using Kexi for rapid db design and form design.

If anybody else is interested in this kind of thing, let me know and I'll try to put together related documentation in a TiddlyWiki instance.

Here are some snippets of code I have so far:

Code: Select all

Prototype Proto_PreDestroyWindow()

Structure cStdGuiObject
  WndNum.u
  Xpos.u
  Ypos.u 
  Width.u
  Height.u
EndStructure

Structure cStdWindow      Extends cStdGuiObject
  Title.s
  PreDestroyWindow.Proto_PreDestroyWindow
EndStructure

Global NewList TopLevelWindows.cStdWindow()

Procedure.u CreateWindow(*pWnd.cStdWindow)
  hResult.u = OpenWindow(#PB_Any, *pWnd\Xpos, *pWnd\Ypos, *pWnd\Width, *pWnd\Height, *pWnd\Title)
  AddElement(TopLevelWindows())
  TopLevelWindows()\Title = *pWnd\Title
  TopLevelWindows()\PreDestroyWindow = *pWnd\PreDestroyWindow
  TopLevelWindows()\WndNum = hResult
  Debug TopLevelWindows()\Title
  ProcedureReturn hResult 
EndProcedure

Procedure DestroyWindow()
  ThisElement = FirstElement(TopLevelWindows())
  While ThisElement <> null
    If TopLevelWindows()\WndNum = EventWindow()
      TopLevelWindows()\PreDestroyWindow()
      Break
    EndIf
    ThisElement = NextElement(TopLevelWindows())
  Wend
  
  CloseWindow(EventWindow())
EndProcedure

BindEvent(#PB_Event_CloseWindow, @DestroyWindow() )

Global frmAlphabet.cStdFormWindow

Procedure frmAlphabet_PreDestroy()
  Debug "This is the opportunity to do window-specific things before closing the window (save data, disconnect from db, etc."
EndProcedure

With frmAlphabet
  \Title = "ASL Alphabet Browser"
  \Xpos = 10 : \Ypos = 40
  \Width = 200 : \Height = 100
  \PreDestroyWindow = @frmAlphabet_PreDestroy()
EndWith

CreateWindow(frmAlphabet)


Re: A SQLWindows-like OO framework for SpiderBasic?

Posted: Tue May 12, 2020 11:48 am
by SparrowhawkMMU
Interesting. Are you planning on having a project/code outliner like SQLWindows? That would be cool.

I have not used SQLWindows since the last 16-bit version (5.something, I forget) as I moved jobs around that time. A couple of years ago in a fit of nostalgia and with a tentative idea of adding Gupta to the list of products my clients can call on me for, I enquired as to the cost of a new developer license for the OpenText version and nearly fell off my chair when I was quoted £6000+ for a year PLUS support/updates at additional cost!

I still look out for a second hand copy of Centura's 32-bit release on eBay etc but no joy to date :)

My copy of 5 is installed on a Windows 2000 Pro VM on this Mac though, and occasionally I fire it up to marvel at how advanced it was for its time. :)

PS - I have very fond memories of my time in Canada, crossing from Vancouver to Nova Scotia and PEI, although I never made it to Newfoundland alas, as the ferry cost was too high. This was 32 years ago, and I was basically living off sliced bread and cheese by the time I got that far east! :D

Re: A SQLWindows-like OO framework for SpiderBasic?

Posted: Tue May 12, 2020 4:29 pm
by Charlie
SparrowhawkMMU wrote:Interesting. Are you planning on having a project/code outliner like SQLWindows? That would be cool.

I have not used SQLWindows since the last 16-bit version (5.something, I forget) as I moved jobs around that time. A couple of years ago in a fit of nostalgia and with a tentative idea of adding Gupta to the list of products my clients can call on me for, I enquired as to the cost of a new developer license for the OpenText version and nearly fell off my chair when I was quoted £6000+ for a year PLUS support/updates at additional cost!

I still look out for a second hand copy of Centura's 32-bit release on eBay etc but no joy to date :)

My copy of 5 is installed on a Windows 2000 Pro VM on this Mac though, and occasionally I fire it up to marvel at how advanced it was for its time. :)

PS - I have very fond memories of my time in Canada, crossing from Vancouver to Nova Scotia and PEI, although I never made it to Newfoundland alas, as the ferry cost was too high. This was 32 years ago, and I was basically living off sliced bread and cheese by the time I got that far east! :D
In reverse ...

I've never traveled my own country much. Was in BC 32 years ago, but that was for Basic (as in military) training. I didn't get to see much of BC other than way too much mud. I've been to the Magdalen Islands for a nice 4 day weekend back in 2012, and I loved it. Very beautiful place. I would love to go live in (and work remotely from) Newfoundland for a month or so and kiss the cod a few times.

Back to this framework ...

To me, the outliner in SQLWindows (and now OpenText's Gupta Team Developer) is the best in class. Coming up with a new editor for SpiderBasic that matches the SQLWindows outliner, that is way above my head.

So far, my little project (I'm calling it "RAD.sb") is about putting together a "rapid application development" framework that gives me the benefit of coding in a SQLWindows-like-ish way, but I'm finding it also has a bit of a Visual Basic (or Gambas) feel/organization to it. I rather like the results. The "framework" makes the coding very well organized in a way that fits this ADHD sponge o' mine.

For lack of a visual window/form designer in SpiderBasic, I've found myself using Kexi for rad/agile database design and data entry and for window/form design. In SpiderBasic, I'm setting up windows and gadgets with properties (via structures), and letting the framework handle creation of windows and gadgets via those properties (copy/pasted from Kexi).

By "RAD", I mean rapid application development of SpiderBasic database applications that are "object-oriented" (well, close enough via prototypes and structures) and "event-driven" (minimizing the number of "Bind Event" calls in the actual application code, letting the framework handle all of that.)

I'm treating the "desktop" in my SpiderBasic projects like a MDI Window, and groups of Windows (grouped by a domain of functionality) as an application. As I'm working on the RAD.sb framework, I'm also building an American Sign Language education tool that uses the framework. Say a group of windows to help with signing the alphabet are one application, and a group of windows to help signing numbers is another application.

I'll try to put an early build of my "ASL.sb" app on the web, and figure out a nice and easy way to share the source code, and at some point put together some RAD.sb documentation in a TiddlyWiki .

So much to do, so few hours in a day. More so: fun something silly. Cheers !

Re: A SQLWindows-like OO framework for SpiderBasic?

Posted: Tue May 12, 2020 6:26 pm
by Charlie
For anybody interested, here's a very-early demo of RAD.sb (what I have so far) used for ASL.sb, an eventual set of applications to help learn American Sign Language.

I'm building a first version of RAD.sb as I'm creating ASL.sb. These will keep my busy hobby-programming wise for a bit.

If you feel adventurous and have an early look at my intertwingled thinking, download this zip archive of related files (RAD.sb project and source code files and the "sample app" files that will eventually be a complete version of ASL.sb),