]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/ctrlcmn.cpp
Added 'HasAlpha' attribute for wxColourProperty. Setting it to true allows user to...
[wxWidgets.git] / src / common / ctrlcmn.cpp
index 851237fe56f4d9ad74ae2195b811292360c6e238..32f17b17a5479f2741df1901399a1d3ed9c2446e 100644 (file)
@@ -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<wxControlBase *>(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);