X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a37da0fa555e3399a36e0c7cbc4ea96a4bf4d4f0..6f3f38980f10a935f3b47dbf0d3b4643e96a4be2:/src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 851237fe56..32f17b17a5 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -88,13 +88,6 @@ bool wxControlBase::CreateControl(wxWindowBase *parent, return true; } -/* static */ -wxString wxControlBase::GetLabelText(const wxString& label) -{ - // we don't want strip the TABs here, just the mnemonics - return wxStripMenuCodes(label, wxStrip_Mnemonics); -} - void wxControlBase::Command(wxCommandEvent& event) { (void)GetEventHandler()->ProcessEvent(event); @@ -102,7 +95,7 @@ void wxControlBase::Command(wxCommandEvent& event) void wxControlBase::InitCommandEvent(wxCommandEvent& event) const { - event.SetEventObject((wxControlBase *)this); // const_cast + event.SetEventObject(const_cast(this)); // event.SetId(GetId()); -- this is usuall done in the event ctor @@ -154,9 +147,17 @@ void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) #endif // wxUSE_RADIOBTN } +/* static */ +wxString wxControlBase::GetLabelText(const wxString& label) +{ + // we don't want strip the TABs here, just the mnemonics + return wxStripMenuCodes(label, wxStrip_Mnemonics); +} + /* static */ wxString wxControlBase::RemoveMnemonics(const wxString& str) { + // we don't want strip the TABs here, just the mnemonics return wxStripMenuCodes(str, wxStrip_Mnemonics); } @@ -297,7 +298,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD // NOTE: the following piece of code works also when len == 1 // start the removal process from the middle of the string - // i.e. separe the string in three parts: + // i.e. separe the string in three parts: // - the first one to preserve, valid range [0;initialCharToRemove-1] or the empty range if initialCharToRemove==0 // - the second one to remove, valid range [initialCharToRemove;endCharToRemove] // - the third one to preserve, valid range [endCharToRemove+1;len-1] or the empty range if endCharToRemove==len-1 @@ -316,9 +317,9 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD if (initialCharToRemove >= 2) widthPx = charOffsetsPx[initialCharToRemove-1] - charOffsetsPx[initialCharToRemove-2]; else - widthPx = charOffsetsPx[initialCharToRemove-1]; + widthPx = charOffsetsPx[initialCharToRemove-1]; // the (initialCharToRemove-1)-th character is the first char of the string - + wxASSERT(widthPx >= 0); // widthPx is zero for e.g. tab characters // mark the (initialCharToRemove-1)-th character as removable @@ -371,7 +372,15 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD return curLine; } - wxASSERT(initialCharToRemove >= 0 && initialCharToRemove <= len-1); // see valid range for initialCharToRemove above +#ifdef __VMS +#pragma message disable unscomzer + // suppress warnings on comparison of unsigned numbers +#endif + wxASSERT(initialCharToRemove >= 0 && initialCharToRemove <= len-1); // see valid range for initialCharToRemove above +#ifdef __VMS +#pragma message enable unscomzer + // suppress warnings on comparison of unsigned numbers +#endif wxASSERT(nCharsToRemove >= 1 && nCharsToRemove <= len-initialCharToRemove); // see valid range for nCharsToRemove above // erase nCharsToRemove characters after initialCharToRemove (included); @@ -385,7 +394,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD int removedPx; if (initialCharToRemove >= 1) removedPx = charOffsetsPx[initialCharToRemove+nCharsToRemove-1] - charOffsetsPx[initialCharToRemove-1]; - else + else removedPx = charOffsetsPx[initialCharToRemove+nCharsToRemove-1]; wxASSERT(removedPx >= excessPx);