wxRichTextFormattingDialog and wxRichTextAttr
Jürgen
info at innova-studios.com
Fri Mar 7 05:32:01 PST 2008
Hi Julian,
worked great - thanks. Maybe a small suggestion for a interface design
rewrite: why havent you used same look&feel for each textattr function?
e.g.:
GetUnderlined() -> bool
GetWeight() = enum
GetStyle() = enum
GetTextEffects() = enum
GetFontFacename() = wxString
GetFontSize() = int
The names and functions are ok, but imho i would say that GetUnderlined()
should be part of GetTextEffects(). Same with GetStyle().
Underlining and making a text slant or italic is maybe not the same as a
strikethrough, but they would fit there very well. It was a little bit
confusing that there were so many functions that do nearly the same and
sometimes they even return true or false :)
Maybe there could be wrappers for the things most users use?
e.g.
GetUnderlined() -> bool
GetStrikethrough() -> bool
GetItalic() -> bool and so on.
kind regards, juergen
> Hi Jurgen,
>
> You should be able to check whether wxTextAttr::HasTextEffects() is true
> after having retrieved the style, and if so, check whether
> GetTextEffectsFlags() has wxTEXT_ATTR_EFFECT_CAPITALS or
> wxTEXT_ATTR_EFFECT_STRIKETHROUGH.
>
> For example:
>
> wxTextAttrEx attr;
> if (ctrl->GetStyle(pos, attr) && attr.HasTextEffects() &&
> (attr.GetTextEffectsFlags() & wxTEXT_ATTR_EFFECT_CAPITALS) &&
> (attr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
> {
> // We have capitals at this position.
> }
>
> If it doesn't work, maybe you could step into
> wxRichTextParagraphLayoutBox::DoGetStyle() and check the actual value of
> the attributes - also try using a fresh wxTextAttrEx each time you
> retrieve the style.
>
> Best regards,
>
> Julian
>
> Jürgen wrote:
>> hi there,
>>
>> currently using rtctrl and wxRichTextFormattingDialog to format my
>> output.
>> i need to grab the details of every single char and as stefan wrote i'm
>> using wxRichTextAttr.
>>
>> i can nearly get every single information i wanted, except of
>> "Strikethrough" and "Capitals".
>> How can i get those information?
>>
>> Thanks for your help,
>>
>> kind regards juergen
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
>> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>>
>>
>>
>>
>
>
> --
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
More information about the wx-users
mailing list