[comp.os.os2.programmer] Help with editing

jeff@cornea.mitre.org (Jeff Graber) (07/19/90)

I need help with a PM and C programming problem.  I am using OS/2 1.2 annd Microsoft C 6.0.

I am writing a program that needs to include simple editing (i.e. copy and paste) functionality.  I have Petzhold's book.  But it does this with vio calls and I need to use gpi calls.  I can't seem to get the mouse to select the exactly correct text.

	Has anyone out there in the vast reaches of the os2 world written this code with gpi calls?  Does anyone know if the IBM supplied editor uses gpi calls and if I can get a copy of that section of the source code?  I need to use gpi rather than vio calls because we need to display text in multiple colors.

	There must be someone out there that is using this PM junk.  Is there no one at Microsoft or IBM that reads this mail and wants to help?  I am a man and I have developed a real bad case of PMS (presentation manager syndrome) and I don't like it!!!!!  Please help!!!!

Sincerely Jeffrey Graber  703-883-5851

alistair@microsoft.UUCP (Alistair BANKS) (07/22/90)

OS/2 1.2 & beyond contains a new PM class called MLE, Multi-Line Edit.

This is the control class which the PM Editor in os/2 1.2 uses, with
style bits indicating scroll bars.

So the editor is really just a regular window, with a simple
menu and the main window is just an instance of MLE.

MLE allows for a choice of foreground and background colours,
but only on a per-window basis, not per-word.

MLE allows full cut and paste operations, with keyboard and
mouse.

Sadly, I cannot offer the sourc code to MLE as a working example
but would ask that if MLE is not sufficient for your purposes,
that you realise that a PM mouse message only returns the
position, and that you have to relate that position to any
text character using your own algorithms - there really cannot
be a general solution for all arbitary GPI based text output!

Alistair Banks
OS/2 Group
Microsoft