Page 1 of 1

looking for Richedit enhancement

PostPosted: Fri Jun 15, 2007 9:27 am
by StefanHaupt
Hi all,

for a new project i need some additional functions for the richedit class. These are to subscript / superscript a char and to to insert numbers and bullets.

I don´t speak C, so i can´t code them myself.

I would be happy, if anyone wants to share these functions.

Many thanks

kind regards
Stefan

PostPosted: Fri Jun 15, 2007 2:58 pm
by StefanHaupt
I tried the following method, but it does not work

Code: Select all  Expand view
#define CFE_SUBSCRIPT      0x00010000     /* Superscript and subscript are */
#define CFE_SUPERSCRIPT    0x00020000     /*  mutually exclusive         */

#define CFM_SUBSCRIPT      CFE_SUBSCRIPT + CFE_SUPERSCRIPT
#define CFM_SUPERSCRIPT    CFM_SUBSCRIPT

//----------------------------------------------------------------------------//

METHOD SetAttribute2( lBold, lItalic, lUnderline, lStrikeOut, lSub, lSup, lOnOff ) CLASS TRichEdit

   local nMask, nEffects

   DEFAULT lBold      := .f., ;
           lItalic    := .f., ;
           lUnderline := .f., ;
           lStrikeOut := .f., ;
           lSub       := .f.,;
           lSup       := .f.,;
           lOnOff     := .t.

   nMask := nOR( If( lBold, CFM_BOLD, 0 ), If( lItalic, CFM_ITALIC, 0 ), ;
                 If( lUnderline, CFM_UNDERLINE, 0 ), ;
                 If( lStrikeOut, CFM_STRIKEOUT, 0 ),;
                 If( lSub, CFM_SUBSCRIPT,0),;
                 If( lSup, CFM_SUPERSCRIPT,0) )

   nEffects := nOR( If( lBold, CFE_BOLD, 0 ), If( lItalic, CFE_ITALIC, 0 ), ;
                    If( lUnderline, CFE_UNDERLINE, 0 ), ;
                    If( lStrikeOut, CFE_STRIKEOUT, 0 ),;
                    If( lSub, CFE_SUBSCRIPT,0),;
                    If( lSup, CFE_SUPERSCRIPT,0) )

   RESetAttribute( ::hWnd, nMask, nEffects, lOnOff )

   ::Change()

return nil


Any hints ?

Stefan

PostPosted: Wed Jun 27, 2007 8:41 pm
by StefanHaupt
Nobody ? :(