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)