Rich Text Editor

79 views
Skip to first unread message

Gerald Brandt

unread,
Dec 7, 2007, 4:21:59 PM12/7/07
to wx-users
Hi,

Does anyone know if 3.0 (or the current SVN trunk) has a real rich text editor (i.e.:  rtf file support)

Gerald

chris elliott

unread,
Dec 8, 2007, 8:45:24 AM12/8/07
to wx-u...@lists.wxwidgets.org

Eirik Nesje

unread,
Dec 7, 2007, 6:42:59 PM12/7/07
to wx-u...@lists.wxwidgets.org
Hi

I have asked this question before but I have not seen any sollution. Looking through the source code makes me conclude with that this is hardcoded in the source in the src/common/filepickercmn.cpp file :

const wxChar wxFilePickerWidgetLabel[] = wxT("Browse");
const wxChar wxDirPickerWidgetLabel[] = wxT("Browse");

In the filepicker.h header file it is implemented as :

class WXDLLIMPEXP_CORE wxDirPickerCtrl : public wxFileDirPickerCtrlBase
..
..
..

protected:
    wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
                                            const wxString& path,
                                            const wxString& message,
                                            const wxString& WXUNUSED(wildcard))
    {
        return new wxDirPickerWidget(parent, wxID_ANY, wxDirPickerWidgetLabel,
                                     path, message,
                                     wxDefaultPosition, wxDefaultSize,
                                     GetPickerStyle(GetWindowStyle()));

...
...
...

Since I'm not always are using English labels in my programs, I would like to change this buttons label more dynamically. Any idea how to implement/use this without changing the "global" definitions in the filepickercmn.cpp file ?

Regards
Eirik

Gerald Brandt

unread,
Dec 8, 2007, 9:47:03 AM12/8/07
to wx-u...@lists.wxwidgets.org
That's what I'm currently using.  It doesn't do RTF files though, and before I roll my own I  wanted to see if 3.0 would handle it, since Julian Smart is/was working on a new one.
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Julian Smart

unread,
Dec 8, 2007, 11:45:40 AM12/8/07
to wx-u...@lists.wxwidgets.org
Gerald Brandt wrote:
> That's what I'm currently using. It doesn't do RTF files though, and
> before I roll my own I wanted to see if 3.0 would handle it, since
> Julian Smart is/was working on a new one.
Obviously one wouldn't write an entirely new editor just to add RTF
support :-) one would add an RTF handler to the existing control.
Unfortunately the contribution of a working RTF reader/writer has not
materialised as hoped, so this has stalled. RTF is becoming slightly
less relevant in the face of OpenDocument support by many packages.
There is an open document plugin for MS Word that opens ODF documents as
if natively.

Regards,

Julian

--
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD: www.anthemion.co.uk/dialogblocks


Vadim Zeitlin

unread,
Dec 8, 2007, 3:50:15 PM12/8/07
to wx-u...@lists.wxwidgets.org
On Sat, 08 Dec 2007 00:42:59 +0100 Eirik Nesje <ein...@online.no> wrote:

EN> I have asked this question before but I have not seen any sollution.
EN> Looking through the source code makes me conclude with that this is
EN> hardcoded in the source in the src/common/filepickercmn.cpp file :
EN>
EN> const wxChar wxFilePickerWidgetLabel[] = wxT("Browse");
EN> const wxChar wxDirPickerWidgetLabel[] = wxT("Browse");

I'm afraid there is indeed no solution except changing wx. I've just done
this in the trunk:

http://svn.wxwidgets.org/viewvc/wx?view=rev&revision=50585

and we probably can backport this to 2.8 too.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


Gerald Brandt

unread,
Dec 8, 2007, 4:24:26 PM12/8/07
to wx-u...@lists.wxwidgets.org
My mistake for being so general.  I did mean a new handler, of course.

So, will there be an OpenDocument handler in 3.0 then?

I've read somewhere that the Rich Text Control went through some changes.  Is there somewhere I could see the list of changes summarized, or should I just browse the SVN repo?

Gerald


----- Original Message -----
From: "Julian Smart" <jul...@anthemion.co.uk>
To: wx-u...@lists.wxwidgets.org
Sent: Saturday, December 8, 2007 10:45:40 AM (GMT-0600) America/Chicago
Subject: Re: Rich Text Editor

Julian Smart

unread,
Dec 8, 2007, 5:54:05 PM12/8/07
to wx-u...@lists.wxwidgets.org
Hi Gerald,

Gerald Brandt wrote:
> My mistake for being so general. I did mean a new handler, of course.
>
> So, will there be an OpenDocument handler in 3.0 then?

Maybe if there's some demand for it, I could tidy up my code and add it
to SVN, but due to the way ODF requires named styles for all formatting,
my own implementation overrides a lot of the wxRTC style handling. So
(perhaps contrary to the tone of my previous mail!) it's not quite as
simple as adding a handler. Probably wxRTC itself should use auto-styles
as an option, but I don't want to bloat the basic implementation with
code that most may not need.

>
> I've read somewhere that the Rich Text Control went through some
> changes. Is there somewhere I could see the list of changes
> summarized, or should I just browse the SVN repo?

Most relevant changes are mentioned in docs/changes.txt for 2.8.7, but
I've just improved wxRTC performance by a factor of 3 or so (maybe more)
and that'll be in 2.8.8. Or you can replace your richtextbuffer.cpp with
the latest in SVN for WX_2_8_BRANCH.

Regards,

Julian

Robert Roebling

unread,
Dec 9, 2007, 7:18:29 AM12/9/07
to wx-u...@lists.wxwidgets.org

Julian Smart wrote:

> Hi Gerald,
>
> Gerald Brandt wrote:
> > My mistake for being so general. I did mean a new handler, of course.
> >
> > So, will there be an OpenDocument handler in 3.0 then?
> Maybe if there's some demand for it, I could tidy up my code and add it
> to SVN, but due to the way ODF requires named styles for all formatting,
> my own implementation overrides a lot of the wxRTC style handling. So
> (perhaps contrary to the tone of my previous mail!) it's not quite as
> simple as adding a handler. Probably wxRTC itself should use auto-styles
> as an option, but I don't want to bloat the basic implementation with
> code that most may not need.

I have no idea about the changes or enhancements required, but having
wxRichTextCtrl handle the OpenDocument would surely be great.

Robert

ashish

unread,
Dec 20, 2007, 11:20:56 AM12/20/07
to wx-u...@lists.wxwidgets.org

I agree, i Think that having ability to read and write opendocument
files would be very useful.

-ashish

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr...@lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h...@lists.wxwidgets.org


Bob

unread,
Jan 15, 2008, 10:23:17 AM1/15/08
to wx-u...@lists.wxwidgets.org

On 12/8/07, Vadim Zeitlin <va...@wxwidgets.org> wrote:
On Sat, 08 Dec 2007 00:42:59 +0100 Eirik Nesje <ein...@online.no> wrote:

I'm afraid there is indeed no solution except changing wx. I've just done
this in the trunk:

http://svn.wxwidgets.org/viewvc/wx?view=rev&revision=50585

and we probably can backport this to 2.8 too.


As FilePicker is derived from wxControl, is there some reason that
SetLabel() should not be usable, to change the button text?

I want to use the FilePicker to save a non-existing file,
and "Browse" doesn't really make sense to me for that,
in the context of my application.


Vadim Zeitlin

unread,
Jan 17, 2008, 12:41:50 PM1/17/08
to wx-u...@lists.wxwidgets.org
On Tue, 15 Jan 2008 10:23:17 -0500 Bob <wxwi...@gmail.com> wrote:

B> As FilePicker is derived from wxControl, is there some reason that
B> SetLabel() should not be usable, to change the button text?
B>
B> I want to use the FilePicker to save a non-existing file,
B> and "Browse" doesn't really make sense to me for that,
B> in the context of my application.

It seems like a good idea to use SetLabel() for this. At least I don't see
anything against it. If anybody feels like making a patch implementing this
(it should be really simple for the generic version but I don't know about
the native ones), it would be welcome.

Thanks,

Reply all
Reply to author
Forward
0 new messages