Page 2 of 2
Re: Assigning RTF (styled) text to EditorGadget directly
Posted: Sat Apr 10, 2010 10:17 pm
by ts-soft
Armoured wrote:
But why not to have a basic command to make this?
EditorGadget is not designed to work with RTF. It's only for plain text.
The code to convert is useless on macos or linux.
// edit
It's better not using of string to hold the ascii string. I think this one
should better in this case:
Code: Select all
Procedure SetASCIIText(Gadget, Text.s)
Protected *mem, result
If Text
*mem = AllocateMemory(StringByteLength(Text, #PB_Ascii) + 1)
If *mem
PokeS(*mem, Text, -1, #PB_Ascii)
result = SendMessage_(GadgetID(Gadget), #WM_SETTEXT, 0, *mem)
FreeMemory(*mem)
EndIf
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0, 200, 200, 400, 200,"Memory Put", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget)
EditorGadget(0, 0, 0, WindowWidth(0), WindowHeight(0), #PB_Editor_ReadOnly)
SendMessage_(GadgetID(0), #EM_LIMITTEXT, -1, 0)
a.s="{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue0;}"
a.s=a.s+"{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\f0\fs20 Hello, this is \cf1\b\fs32 RTF\cf2\b0\fs20 direct!\cf0\par}"
SetASCIIText(0, a)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Re: Assigning RTF (styled) text to EditorGadget directly
Posted: Sat Apr 10, 2010 10:40 pm
by Armoured
ts-soft wrote:EditorGadget is not designed to work with RTF. It's only for plain text.
If EditorGadget on Windows can read and display correctly RTF then the EditorGadget on Windows support RTF.
ts-soft wrote:The code to convert is useless on macos or linux.
The MDIGadget and other commands works only on Windows and are here...
Re: Assigning RTF (styled) text to EditorGadget directly
Posted: Sat Apr 10, 2010 10:48 pm
by ts-soft
Armoured wrote:
If EditorGadget on Windows can read and display correctly RTF then the EditorGadget on Windows support RTF.
RTF is not supported without API. No command implemented, only the used control is a RichText control.
Re: Assigning RTF (styled) text to EditorGadget directly
Posted: Sat Apr 10, 2010 11:19 pm
by Armoured
ts-soft wrote:
RTF is not supported without API.
If EditorGadget on
Windows can read and display correctly RTF then the EditorGadget on
Windows support RTF.
ts-soft wrote:No command implemented, only the used control is a RichText control.
RTF is like Latex, a scripting language, for the layouts of the pages.
EditorGadget on
Windows, in my opinion, must display RTF text without problems in unicode or not.
With the appropriate documentation is possible to create commands to edit RTF text in the EditorGadget else there is WordPad

Re: Assigning RTF (styled) text to EditorGadget directly
Posted: Sun Apr 11, 2010 3:30 am
by RASHAD
Hi Armoured
You had a long run with ts-soft
Editor Gadget is a very sophisticated gadget,the team was very tied with it for compatibility with Mac & Linux
If you want to deal with it with MS way search the forum you will get at least 30 snippets for Freak,srod,Falco
and others
You will love it for sure ( Under Windows )
Good Luck Mate