Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RTF -- a PITA or what?
Message
 
À
01/05/1998 17:36:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00096430
Message ID:
00097148
Vues:
23
Hi Mark,

When are you attempting this??? I bascially do the same thing.

I subclasses the RTF control. Here is the code:

Notice that I created a few custom properties to hold the bound field - and a custom method that takes care of writing data back to the bound field.

HTH,

< JVP >



**************************************************
*-- Class: olertf (c:\winnt\profiles\john\personal\code\oleclasses.vcx)
*-- ParentClass: olecontrol
*-- BaseClass: olecontrol
*-- OLEObject = C:\WINNT\System32\richtx32.ocx
*
DEFINE CLASS olertf AS olecontrol


Height = 193
Width = 289
*-- This property holds the file name of the contained document.
cfilename = (Space(0))
Name = "olertf"

*-- If .T., various user notifcations will be displayed.
lnotify = .F.

*-- This property tracks when unsaved changes exist.
lchanged = .F.

*-- This property holds the field to which the RTF Control is bound
boundfield = .F.
errorcode = .F.


*-- This method will refresh the display based on contents in the boundfield
PROCEDURE refreshdisplayfromboundfield
This.TextRtf = Eval(This.BoundField)

Return
ENDPROC


*-- This method will update the contents of the memo with the RTFTEXT Property of the RTF Control.
PROCEDURE updateboundfield
Replace (This.BoundField) With This.TextRtf

Return
ENDPROC


PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
Local Array aErrors[1]
Aerror(aErrors)
This.ErrorCode = aErrors[1,6]

Return
ENDPROC


PROCEDURE KeyPress
*** OLE Control Event ***
LPARAMETERS keyascii
This.lChanged = .T.
ENDPROC


*-- This method will print RTF document to printer.
PROCEDURE printdocument
ENDPROC




PROCEDURE errorhandler
ENDPROC


ENDDEFINE
*
*-- EndDefine: olertf
**************************************************
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform