OS/2, eCS & ArcaOS - Technical > Programming

Anyone used the EPM - eToolKit to make an MLE for VAC 3.0?

(1/3) > >>

Doug Clark:
Has anyone successfully used the EPM Etoolkit  to create an EPM based MLE in a VisualAge C++ v 3.0 IOC application?

Sample 2 from the etoolkit shows an E-MLE inside of an EFrame inside of an application window.  The E-MLE is the actual editor guts; the EFrame adds scroll bars, message line, title bar etc.  I lightly modified sample 2 from the etoolkit SDK, compiled with VAC 3.0 and it works - attached as epm_sample2.zip

But when I convert that into a "custom control" as a C++ class, to integrate with the user interface part of the IOC library, part of the E-MLE stops working.  It appears to be the part that sends messages, or receives messages related to editor commands.  What I THINK is happening is the dispatcher that the IOC uses to intercept and route window messages is somehow not sending the messages to the E-MLE window procedure.  Or rather some of the messages, because other messages clearly are getting through.

So has anyone converted a customized PM window/control into a IOC user interface object that can be inserted into various other IOC UI objects?

epm_sample2.zip is the lightly modified Sample 2 from the eToolkit sdk.   
testmain.zip contains my class EpmMle (descended from IControl) which is my attempt to integrate an EFrame/E-MLE into a custom control that can be used in IOC.  Run testmain.exe from testmain.zip and try issuing a command from the menu;  Command - Command Dlg and then type some EPM command, such as SAYERROR 'Hello'   You will need the VAC 3.0 runtime libraries to run testmain.exe





Andreas Schnellbacher:
I've never tried to compile the examples myself. I had problems with two of the four example's .exes, when another EPM was open. I've just tried it again and all four start now.

We discussed to create our own GUI app at NEPMD. I thought that this approach was too complex, but at that time I had not even a compiler. Looking back, that seems to be not completely wrong. But alone the ETK functions have so many bugs, that I would start there first if I had the ETK source. For most of them, I've added workarounds and have now the skills to fix at least just a few of them, if the sources would have been released. The GUI would be another story, but must flaws are in the ETK. It would be much better to start with a supported and well-spread toolkit, e.g. Scintilla. Also Kate looks very promising. Of course that requires to change the compiler, too.

Lars:

--- Quote from: Doug Clark on April 22, 2021, 05:18:18 am ---Has anyone successfully used the EPM Etoolkit  to create an EPM based MLE in a VisualAge C++ v 3.0 IOC application?

Sample 2 from the etoolkit shows an E-MLE inside of an EFrame inside of an application window.  The E-MLE is the actual editor guts; the EFrame adds scroll bars, message line, title bar etc.  I lightly modified sample 2 from the etoolkit SDK, compiled with VAC 3.0 and it works - attached as epm_sample2.zip

But when I convert that into a "custom control" as a C++ class, to integrate with the user interface part of the IOC library, part of the E-MLE stops working.  It appears to be the part that sends messages, or receives messages related to editor commands.  What I THINK is happening is the dispatcher that the IOC uses to intercept and route window messages is somehow not sending the messages to the E-MLE window procedure.  Or rather some of the messages, because other messages clearly are getting through.

So has anyone converted a customized PM window/control into a IOC user interface object that can be inserted into various other IOC UI objects?

epm_sample2.zip is the lightly modified Sample 2 from the eToolkit sdk.   
testmain.zip contains my class EpmMle (descended from IControl) which is my attempt to integrate an EFrame/E-MLE into a custom control that can be used in IOC.  Run testmain.exe from testmain.zip and try issuing a command from the menu;  Command - Command Dlg and then type some EPM command, such as SAYERROR 'Hello'   You will need the VAC 3.0 runtime libraries to run testmain.exe

--- End quote ---

I also played around with it and created a very simple editor. What I vaguely remember is that if you want to invoke a editor built-in command, you need to use the "post" window message otherwise EPM will get unsynchronized/run into concurrency issues if it runs on more than one thread (which it will do if you invoke a command that takes a longer time to process).

Andreas Schnellbacher:

--- Quote from: Lars on April 22, 2021, 08:29:13 pm ---What I vaguely remember is that if you want to invoke a editor built-in command, you need to use the "post" window message

--- End quote ---
Yes, that's true. almost all ETK messages are posted. From the EPM code (NEPMD macros), these are the few ones that are sent:

--- Code: ---Send_Config_Data
Set dialog title (ProofDlg)
Set current word being proofed (ProofDlg)
Disable buttons (ProofDlg)
Set default button (ProofDlg)
Set dialog prompt (ProofDlg)
Fill listbox (ProofDlg)
Set entry field (ProofDlg)
Disable everything (ProofDlg)
EPM_EDIT_LOGAPPEND
EPM_FRAME_STATUSLINE
EII_EDIT_REFRESHSTATUSLINE
EPM_FRAME_STATUSLINE
EPM_FRAME_MESSAGELINE
EPM_EDIT_LOGERROR
(SetMenuAttribute)
MM_SetItemText
MM_QueryItem
MM_SETDEFAULTITEMID
EPM_EDIT_KW_QUERYPARSE
EFRAMEM_ToggleControl
EPM_EDIT_CONTROLTOGGLE
EPM_Edit_Query_Help_Instance
HM_SET_HELP_LIBRARY_NAME
(RenderUndoInfo)

--- End code ---

Lars:
Not sure if we are talking about the same thing.
To clarify, I am talking about the EPM API equivalent of the /postme command line option.
For example, in another "project", I am using EPM to load a source file, scroll to a code line containing an error plus displaying the error message in the status line. I invoke EPM from a command line and use the /postme switch on all 3 actions: loading the source file, scrolling to code line and finally, displaying the error text in the status line.
If I do not use the /postme switch, scrolling to the code line will fail because the file is not loaded in time. Using the /postme switch properly serializes these actions.

Navigation

[0] Message Index

[#] Next page

Go to full version