Simple RTF controll

This forum is for ideas and or code to be contributed for general use.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Simple RTF controll

#1 Post by jdsoft »

Hello,

Attached you find a simple RTF control.
Screenshot.jpg
Screenshot.jpg (55.38 KiB) Viewed 7038 times
This can easy be included in your Express application.
However, it can be inproved visualy (especialy the toolbar), re-size and drag-drop is not supported.
The code can be improved.

Code: Select all

/*
 Sample programm for a RTF edit control in express++

 If your application uses a ARC file, you might want to alter DcRtfEdit.ch.
 Change the values of the #define for the resources.

 */

#include "Common.ch"
#include "DcDialog.ch"
#include "DcRtfEdit.ch"
#define COLOR_ORANGE GraMakeRGBColor( { 253, 120,  41 } )

Procedure Main()
LOCAL GetList        := {}
LOCAL nLine          := 1
LOCAL nTab           := 22
LOCAL lOk            := FALSE
LOCAL lHide          := FALSE
LOCAL lWhen          := TRUE
LOCAL cRtf           := MemoRead("RtfSample.rtf")
LOCAL oRtf           := nil
@ nLine++, nTab   DCCHECKBOX  lWhen CAPTION "Rtf editor is active (WHEN {||TRUE})" ACTION Dc_GetRefresh(oRtf)
@ nLine++, nTab   DCCHECKBOX  lHide CAPTION "Rtf editor is hidden (HIDE {||TRUE})" ACTION Dc_GetRefresh(oRtf)
nLine++
@ nLine  , nTab   DCRTFEDIT cRtf OBJECT oRtf    ;
                  SIZE     120,18               ;
                  CAPTION  "A RTF text box"     ;
                  FONT  "9.Arial Bold"          ;
                  WHEN  {||lWhen}               ;
                  HIDE  {||lHide}               ;
                  COLOR COLOR_ORANGE

DCREAD GUI TO lOk FIT
if lOk
endif
oRtf:Destroy()                // <<<<<==== No not forget !!
oRtf                 := nil
Return

Procedure AppSys()
Return

Attached you find the sourcecode.
If you have improvements, please let me know.

Regards,
Jack Duijf
Attachments
DcRtfEdit.zip
(87.97 KiB) Downloaded 896 times
Regards,
Jack Duijf

Post Reply