Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri Dec 30, 2005 5:40 pm Post subject: VDSOBJ: 'Object Format' Fonts |
|
|
I figured out how to change fonts on selected text. However, I can't figure out how to set the font for new text starting at the current carrot position.
If the user has typed some text then decides to change the the font from where they left off, the font dosen't change. I don't have a problem when appending text programmically, only when the enduser is inputing text.
| Code: | :FontMenu
%%Bold = off
%%Italic = off
%%Unline = off
OPTION FONTDLG,EXTENDED
%%tFont = @FONTDLG(%%Font,%%FontSize,%%FontStyle,%%FontColor)
If @ok()
parse "%%Font;%%FontSize;%%FontStyle;%%FontColor", %%tFont
If @unequal(@pos(B,%%FontStyle),0)
%%Bold = on
End
If @unequal(@pos(I,%%FontStyle),0)
%%Italic = on
End
If @unequal(@pos(U,%%FontStyle),0)
%%Unline = on
End
End
# Note: If no text is selected the current carrot position is returned
%%sel = @OBJECT(SELPOS,RICHEDIT2,SE)
info %%sel
parse "%%selS;%%selE", %%sel
OBJECT FORMAT,RICHEDIT2,CLIPBOARD,SELECT,%%selS,%%selE
OBJECT FORMAT,RICHEDIT2,BOLD,%%Bold
OBJECT FORMAT,RICHEDIT2,ITALIC,%%Italic
OBJECT FORMAT,RICHEDIT2,UNDERLINE,%%Unline
OBJECT FORMAT,RICHEDIT2,SETFONT,%%Font,%%FontSize,%%FontColor
OBJECT FOCUS,RICHEDIT2
goto evloop |
Thanks in advance,
Aslan |
|