RTFGadget

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

RTFGadget

Post by garretthylltun »

Would love see a RTFGadget someday for all platforms PureBasic supports. :-)
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
· Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
· http://www.freewarehome.com/ <-- Freeware listings since 1996
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

How would you want it to differ from the editorgadget?

cheers
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

Does the editor gadget allow RTF? And if it does, do you need to use Windows Specific API calls to use it?

I didn't see any reference to the editor gadget being RTF capable.

All I'd like to see is your basic RTF editor gadget with the basic RTF functions, such as setting and getting Bold, Italic, Underline, Foreground color and Background color and that it work on at least Windows, Linux and Mac. I'm sure the Amiga users might use it too.
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
· Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
· http://www.freewarehome.com/ <-- Freeware listings since 1996
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Not sure about mac and linux since it requires the M$ rtf engine, but under windows, the editorgadget supports rtf just fine.

You can find plenty of examples in the forums.


cheers
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

Well that's great... :-) But darn it, I do really need cross platform support of the RTF. :-(

I'm making a cross platform portable(and not portable) Notes program for myself here. I use Windows ME, 2k, Vista, Linux and Mac and was hoping to be able to use RTF on all of these so that when I work on one or the other I can have my notes, website logons and such with me. As it is, I'll just have to stick with plain old text for now then. Not a major loss, but it sure would've been nice to have RTF support for this one.

Thanks for the reply you two :-)
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
· Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
· http://www.freewarehome.com/ <-- Freeware listings since 1996
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: RTFGadget

Post by PB »

The manual says the EditorGadget supports all OSes, and it does RTF,
so what's the problem here? I don't understand your concerns.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

I have no concerns.

I was unaware that the EditorGadget supported RTF at all since the help file made no mention of it at all:
Description

Creates an Editor gadget in the current GadgetList. If #PB_Any is used as '#Gadget' parameter, the new gadget number will be returned as 'Result'. #Gadget will be the number returned by the EventGadget() function.
So one could only assume that it only supported text since there is no mention of RTF support. I also did not see any mention of any formatting ability in the help file related to the EditorGadget.

So... with no information regarding RTF, I thought it might be a nice thing to have in PureBasic and thought I'd post a wish for it here.

Now of course I've been told that at least on Windows you can get RTF support, likely through the use of API calls.

Now you're saying that RTF support is available to the EditorGadget on all platforms.

So I guess there's no need for my wish of RTF support on all platforms since apparently it already exists. Now I only have to find out what functions/commands are needed to get the RTF support since I can't seem to find any documentation on RTF support at all.

Hey, maybe I should wish for documentation of the RTF support in PureBasic. :-)
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
· Necroprogramming FTW! - "Wait.. Is necroprogramming legal?"
· http://www.freewarehome.com/ <-- Freeware listings since 1996
Digital Wargames
Enthusiast
Enthusiast
Posts: 203
Joined: Sat May 23, 2009 4:39 am

Post by Digital Wargames »

FWIW, RTF has always been cross-platform. You had it on DOS apps and it actually started in MS Word 3 for Macintosh.

You might want to look at the code archive. There are 28 examples for the editor gadget, showing you how to do everything with it.

Don't forget you also have the lovely Scintilla gadget and EditorGadget3D that are both cross-platform and should handle RTF.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> maybe I should wish for documentation of the RTF support in PureBasic

True, the manual's example doesn't show any text coloring or style for the
EditorGadget. It should, to show that it's not just a plain text editor.

In the meantime, here's all you'll need to know to do RTF in an EditorGadget:

http://www.purebasic.fr/english/viewtopic.php?t=6666

Note: Freak's original post there doesn't work with v4.31, but I ported it, it's
in the second page of the thread now. Hope this helps!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Post Reply