Subclassing Rich Edit Boxes [message #483556] |
Wed, 02 September 2009 05:38 |
Eclipse User |
|
|
|
Originally posted by: siegfried.heintze.com
When programming Windows brand windows (i.e., user32.dll and gdi32.dll) with
C there is a funny concept of subclassing an edit box (or any window) where
one injects your own custom thread-proc to intercept messages before the
default microsoft threadproc can respond. This is entirely independent of
the inheritance feature in C++.
This allows one to avoid reinventing 99% of the logic of rich edit box
should you want to implement your own custom word processor.
I want to implement a custom and fancy word processor with special rules for
indentation. Can I subclass a rich edit box in SWT? Would it be portable to
linux and Mac?
Thanks,
Siegfried
|
|
|
Re: Subclassing Rich Edit Boxes [message #483972 is a reply to message #483556] |
Thu, 03 September 2009 19:14 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Siegfried,
SWT's rich editor control is StyledText. Clients of StyledText don't
subclass it or intercept its events, but influence it by calling API and/or
adding listeners. Anything involving StyledText should be portable across
all platforms. For info about StyledText see:
http://www.eclipse.org/articles/StyledText%201/article1.html
http://www.eclipse.org/articles/StyledText%202/article2.html
http://www.eclipse.org/swt/snippets#styledtext
In case you were asking about win32's native rich editor control, swt
doesn't make use of it, so you would be implementing this from scratch. If
you want to see what's involved in creating a custom control see
http://www.eclipse.org/articles/Article-Writing%20Your%20Own %20Widget/Writing%20Your%20Own%20Widget.htm .
And, of course, this wouldn't be portable to other platforms.
HTH,
Grant
"Siegfried Heintze" <siegfried@heintze.com> wrote in message
news:h7l0d6$rne$1@build.eclipse.org...
> When programming Windows brand windows (i.e., user32.dll and gdi32.dll)
with
> C there is a funny concept of subclassing an edit box (or any window)
where
> one injects your own custom thread-proc to intercept messages before the
> default microsoft threadproc can respond. This is entirely independent of
> the inheritance feature in C++.
>
> This allows one to avoid reinventing 99% of the logic of rich edit box
> should you want to implement your own custom word processor.
>
> I want to implement a custom and fancy word processor with special rules
for
> indentation. Can I subclass a rich edit box in SWT? Would it be portable
to
> linux and Mac?
>
> Thanks,
> Siegfried
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02252 seconds