> Do you mean a modern desktop framework based on MWAPI for all current M implementations? Although MiniM has activex, libs and examples for a lot of modern languages, this week I was thinking talking to Mr.Eugene Karataev about it. Hey Mr.Eugene! Are you there? Anyway, please tell us more about your idea.
Main idea is to use Lazarus as component-oriented windowing base.
This tool allow to create form editors, get and save form definition where we want and to create this forma at runtime. Form definition is text like this:
object Form1: TMForm
Left = 581
Height = 426
Top = 194
OnCreate = FormCreate
OnDestroy = FormDestroy
OnClose = FormClose
object btnFile: TButton
Left = 248
Height = 25
Caption = '...'
OnClick = btnFileClick
TabOrder = 4
end
object edtRoutines: TMemo
Left = 75
Height = 60
Top = 151
Width = 169
TabOrder = 5
end
end
This definition can be imported by custom tool into global and read from there by form player.
Player can create form by this definition and on each event call like button pressed see the name
of event handler assosiated in form development and can know arguments passed from the Lazarus.
So just call the server and wait callback calls from the server.
Server can pass to player commands like set or get property values or command to call function.
Test code which I run to test was:
test ; place here default event handlers for the test MForm
; Self is passed variable, mean form reference
; Sender are references to event source objects
FormCreate(Sender)
s ^mftrace($i(^mftrace))="FormCreate("_Sender_"), Self="_Self
q
FormDestroy(Sender)
s ^mftrace($i(^mftrace))="FormDestroy("_Sender_"), Self="_Self
q
FormClose(Sender,CloseAction)
; CloseAction passed by reference
s ^mftrace($i(^mftrace))="FormClose("_Sender_"), Self="_Self_", CloseAction="_CloseAction
; to prevent window closing uncomment this line
; s CloseAction="caNone"
q
btnFileClick(Sender)
; get object reference to edit component
n edtName=$$CHILD^%MF(Self,"edtName")
; call function Clear
d PROC^%MF(edtName,"Clear")
; get object reference of child component
n edtReport=$$CHILD^%MF(Self,"edtReport")
; get object reference to property Lines of component
n Lines=$$GET^%MF(edtReport,"Lines")
; call function Add of Lines property of edtReport component
n tmp=$$FUNC^%MF(Lines,"Add",$h)
q
; s ^mftrace($i(^mftrace))="btnFileClick("_Sender_"), Self="_Self
n caption=$$GET^%MF(Self,"Caption")
n edtName=$$CHILD^%MF(Self,"edtName")
d SET^%MF(edtName,"Text",caption)
n edtReport=$$CHILD^%MF(Self,"edtReport")
n Lines=$$GET^%MF(edtReport,"Lines")
s ^mftrace($i(^mftrace))="btnFileClick("_Sender_"), Lines="_Lines
q
btnImportClick(Sender)
s ^mftrace($i(^mftrace))="btnImportClick("_Sender_"), Self="_Self
n edtName=$$CHILD^%MF(Self,"edtName")
d SET^%MF(edtName,"Text",$zv)
d SET^%MF(Self,"Caption","Hello, MUMPS Forms!")
q
Here $$CHILD^%MF gets reference to child component by name,
PROC^%MF calls procedure without returning value,
$$GET^%MF reads property value and SET^%MF sets the value.
so, the code
n edtReport=$$CHILD^%MF(Self,"edtReport")
n Lines=$$GET^%MF(edtReport,"Lines")
n tmp=$$FUNC^%MF(Lines,"Add",$h)
gets the reference to child component edrReport (Memo component),
gets reference to object property Lines and calls funtion of Lines Add and pass $h value.
And player in multiline editor shows one more line with $h.
New form can be created by
s child=$$NEW^%MF(“frmChild”)
I tests very simple stand wihich supports only some components and events for MiniM on Windows and
for GT.M on Linux, and this executes without any code changes. Of course, I cannot use
new var=expr in GT.M.
Full project development requires many and many time to implement each event type. and function.
And make tests, and use many usable components, and develop form designer, and import-export tools, documentation, examples, installers, user security model, secure network messages. And I does not see all problems now )))
This project is like Java or DotNET wrappers to objects of OS-specific GUI but with the M on the server which control the form player on the client computer. Like M server control the telnet on the client side.
I know that this can be done but know too that this gets many time.
Eugene Karataev.