X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d6e8e45fe72afcb38d1da3b2b90c307ac052b0c..0738b901b17340f09766524b8d9d79e9ed1268e7:/src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 5e8b9ef8b3..f7145a78a5 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -35,6 +35,7 @@ #include "wx/statbmp.h" #include "wx/bitmap.h" #include "wx/utils.h" // for wxStripMenuCodes() + #include "wx/settings.h" #endif const char wxControlNameStr[] = "control"; @@ -173,7 +174,7 @@ int wxControlBase::FindAccelIndex(const wxString& label, wxString *labelOnly) // the character following MNEMONIC_PREFIX is the accelerator for this // control unless it is MNEMONIC_PREFIX too - this allows to insert // literal MNEMONIC_PREFIX chars into the label - static const wxChar MNEMONIC_PREFIX = _T('&'); + static const wxChar MNEMONIC_PREFIX = wxT('&'); if ( labelOnly ) { @@ -198,7 +199,7 @@ int wxControlBase::FindAccelIndex(const wxString& label, wxString *labelOnly) } else { - wxFAIL_MSG(_T("duplicate accel char in control label")); + wxFAIL_MSG(wxT("duplicate accel char in control label")); } } } @@ -217,6 +218,17 @@ wxBorder wxControlBase::GetDefaultBorder() const return wxBORDER_THEME; } +/* static */ wxVisualAttributes +wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + wxVisualAttributes attrs; + attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); + attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); + attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + + return attrs; +} + // ---------------------------------------------------------------------------- // wxControlBase - ellipsization code // ---------------------------------------------------------------------------- @@ -233,6 +245,8 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD wxASSERT_MSG(!curLine.Contains('\n'), "Use Ellipsize() instead!"); + wxASSERT_MSG( mode != wxELLIPSIZE_NONE, "shouldn't be called at all then" ); + // NOTE: this function assumes that any mnemonic/tab character has already // been handled if it was necessary to handle them (see Ellipsize()) @@ -336,6 +350,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD } break; + case wxELLIPSIZE_NONE: default: wxFAIL_MSG("invalid ellipsize mode"); return curLine; @@ -400,7 +415,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc, } } // we need to remove mnemonics from the label for correct calculations - else if ( *pc == wxS('&') && (flags & wxELLIPSIZE_PROCESS_MNEMONICS) != 0 ) + else if ( *pc == wxS('&') && (flags & wxELLIPSIZE_FLAGS_PROCESS_MNEMONICS) ) { // pc+1 is safe: at worst we'll be at end() wxString::const_iterator next = pc + 1; @@ -409,7 +424,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc, //else: remove this ampersand } // we need also to expand tabs to properly calc their size - else if ( *pc == wxS('\t') && (flags & wxELLIPSIZE_EXPAND_TAB) != 0 ) + else if ( *pc == wxS('\t') && (flags & wxELLIPSIZE_FLAGS_EXPAND_TABS) ) { // Windows natively expands the TABs to 6 spaces. Do the same: curLine += wxS(" ");