m_fontStyle = wxFONTSTYLE_NORMAL;
m_fontWeight = wxFONTWEIGHT_NORMAL;
m_fontUnderlined = false;
+ m_fontStrikethrough = false;
m_fontEncoding = wxFONTENCODING_DEFAULT;
m_fontFamily = wxFONTFAMILY_DEFAULT;
m_fontStyle = attr.m_fontStyle;
m_fontWeight = attr.m_fontWeight;
m_fontUnderlined = attr.m_fontUnderlined;
+ m_fontStrikethrough = attr.m_fontStrikethrough;
m_fontFaceName = attr.m_fontFaceName;
m_fontEncoding = attr.m_fontEncoding;
m_fontFamily = attr.m_fontFamily;
if (HasFontUnderlined())
underlined = GetFontUnderlined();
+ bool strikethrough = false;
+ if ( HasFontStrikethrough() )
+ strikethrough = GetFontStrikethrough();
+
wxString fontFaceName;
if (HasFontFaceName())
fontFaceName = GetFontFaceName();
fontFamily = GetFontFamily();
wxFont font(fontSize, fontFamily, fontStyle, fontWeight, underlined, fontFaceName, encoding);
+ if ( strikethrough )
+ font.SetStrikethrough( true );
return font;
}
if (flags & wxTEXT_ATTR_FONT_UNDERLINE)
m_fontUnderlined = font.GetUnderlined();
+ if (flags & wxTEXT_ATTR_FONT_STRIKETHROUGH)
+ m_fontStrikethrough = font.GetStrikethrough();
+
if (flags & wxTEXT_ATTR_FONT_FACE)
m_fontFaceName = font.GetFaceName();
destStyle.SetFontUnderlined(style.GetFontUnderlined());
}
+ if (style.HasFontStrikethrough())
+ {
+ if (!(compareWith && compareWith->HasFontStrikethrough() && compareWith->GetFontStrikethrough() == style.GetFontStrikethrough()))
+ destStyle.SetFontStrikethrough(style.GetFontStrikethrough());
+ }
+
if (style.HasFontFaceName())
{
if (!(compareWith && compareWith->HasFontFaceName() && compareWith->GetFontFaceName() == style.GetFontFaceName()))
{
int relevantBitsA = valueA & flags;
int relevantBitsB = valueB & flags;
- return (relevantBitsA != relevantBitsB);
+ return relevantBitsA == relevantBitsB;
}
/// Split into paragraph and character styles
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
{
+ bool handled = false;
// we have a native implementation for Win32 and so don't need this one
#ifndef __WIN32__
wxChar ch = 0;
int keycode = event.GetKeyCode();
+
+ long from, to;
+ GetSelection(&from,&to);
+ long insert = GetInsertionPoint();
+ long last = GetLastPosition();
+
+ // catch arrow left and right
+
switch ( keycode )
{
+ case WXK_LEFT:
+ if ( event.ShiftDown() )
+ SetSelection( (from > 0 ? from - 1 : 0) , to );
+ else
+ {
+ if ( from != to )
+ insert = from;
+ else if ( insert > 0 )
+ insert -= 1;
+ SetInsertionPoint( insert );
+ }
+ handled = true;
+ break;
+ case WXK_RIGHT:
+ if ( event.ShiftDown() )
+ SetSelection( from, (to < last ? to + 1 : last) );
+ else
+ {
+ if ( from != to )
+ insert = to;
+ else if ( insert < last )
+ insert += 1;
+ SetInsertionPoint( insert );
+ }
+ handled = true;
+ break;
case WXK_NUMPAD0:
case WXK_NUMPAD1:
case WXK_NUMPAD2:
const long pos = GetInsertionPoint();
if ( pos < GetLastPosition() )
Remove(pos, pos + 1);
+ handled = true;
}
break;
const long pos = GetInsertionPoint();
if ( pos > 0 )
Remove(pos - 1, pos);
+ handled = true;
}
break;
{
WriteText(ch);
- return true;
+ handled = true;
}
#else // __WIN32__
wxUnusedVar(event);
#endif // !__WIN32__/__WIN32__
- return false;
+ return handled;
}
// do the window-specific processing after processing the update event