]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/gizmos/ledctrl.cpp
removed enum that was causing more problems than it was worth
[wxWidgets.git] / contrib / src / gizmos / ledctrl.cpp
index 5c93feb7fbf58090e75c5031d03c0ba996adccf4..ffcd8ad150d2fec73100b7d130c865543e2920b2 100644 (file)
@@ -66,7 +66,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl()
     m_DigitMargin(-1),
     m_LineLength(-1),
     m_LineWidth(-1),
-    m_DrawFaded(FALSE),
+    m_DrawFaded(false),
     m_LeftStartPos(-1)
 {
 }
@@ -80,7 +80,7 @@ wxLEDNumberCtrl::wxLEDNumberCtrl(wxWindow *parent, wxWindowID id,
     m_DigitMargin(-1),
     m_LineLength(-1),
     m_LineWidth(-1),
-    m_DrawFaded(FALSE),
+    m_DrawFaded(false),
     m_LeftStartPos(-1)
 {
     Create(parent, id, pos, size, style);
@@ -94,7 +94,7 @@ bool wxLEDNumberCtrl::Create(wxWindow *parent, wxWindowID id,
     bool RetVal = wxControl::Create(parent, id, pos, size, style);
 
     if ((style & wxLED_DRAW_FADED) != 0)
-        SetDrawFaded(TRUE);
+        SetDrawFaded(true);
     if ((style & wxLED_ALIGN_MASK) != 0)
         SetAlignment((wxLEDValueAlign)(style & wxLED_ALIGN_MASK));
 
@@ -113,7 +113,7 @@ void wxLEDNumberCtrl::SetAlignment(wxLEDValueAlign Alignment, bool Redraw)
         RecalcInternals(GetClientSize());
 
         if (Redraw)
-            Refresh(FALSE);
+            Refresh(false);
     }
 }
 
@@ -125,7 +125,7 @@ void wxLEDNumberCtrl::SetDrawFaded(bool DrawFaded, bool Redraw)
         m_DrawFaded = DrawFaded;
 
         if (Redraw)
-            Refresh(FALSE);
+            Refresh(false);
     }
 }
 
@@ -134,6 +134,7 @@ void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
 {
     if (Value != m_Value)
     {
+#ifdef __WXDEBUG__
         if (!Value.IsEmpty())
         {
             for(size_t i=0; i<Value.Length(); i++) {
@@ -142,12 +143,13 @@ void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
                              wxT("wxLEDNumberCtrl can only display numeric string values."));
             }
         }
+#endif
 
         m_Value = Value;
         RecalcInternals(GetClientSize());
 
         if (Redraw)
-            Refresh(FALSE);
+            Refresh(false);
     }
 }
 
@@ -159,12 +161,12 @@ BEGIN_EVENT_TABLE(wxLEDNumberCtrl, wxControl)
 END_EVENT_TABLE()
 
 
-void wxLEDNumberCtrl::OnEraseBackground(wxEraseEvent &Event)
+void wxLEDNumberCtrl::OnEraseBackground(wxEraseEvent &WXUNUSED(event))
 {
 }
 
 
-void wxLEDNumberCtrl::OnPaint(wxPaintEvent &Event)
+void wxLEDNumberCtrl::OnPaint(wxPaintEvent &WXUNUSED(event))
 {
     wxPaintDC Dc(this);
 
@@ -191,7 +193,7 @@ void wxLEDNumberCtrl::OnPaint(wxPaintEvent &Event)
             DrawDigit(MemDc, DIGITALL, i);
 
         // Draw the digits.
-        switch (m_Value[i])
+        switch (m_Value.GetChar(i))
         {
             case '0' :
                 DrawDigit(MemDc, DIGIT0, i);
@@ -230,7 +232,7 @@ void wxLEDNumberCtrl::OnPaint(wxPaintEvent &Event)
                 // just skip it
                 break;
             default :
-                wxFAIL_MSG(_("Unknown digit value"));
+                wxFAIL_MSG(wxT("Unknown digit value"));
                 break;
         }
     }
@@ -269,7 +271,7 @@ void wxLEDNumberCtrl::DrawDigit(wxDC &Dc, int Digit, int Column)
     {
         Dc.DrawLine(XPos + m_LineMargin*2, m_LineMargin,
             XPos + m_LineLength, m_LineMargin);
-       }
+    }
 
     if (Digit & LINE2)
     {
@@ -318,12 +320,12 @@ void wxLEDNumberCtrl::RecalcInternals(const wxSize &CurrentSize)
     if ((Height * 0.07) < 1)
         m_LineMargin = 1;
     else
-        m_LineMargin = Height * 0.07;
+        m_LineMargin = (int)(Height * 0.07);
 
     if ((Height * 0.35) < 1)
         m_LineLength = 1;
     else
-        m_LineLength = Height * 0.35;
+        m_LineLength = (int)(Height * 0.35);
 
     m_LineWidth = m_LineMargin;
 
@@ -344,7 +346,7 @@ void wxLEDNumberCtrl::RecalcInternals(const wxSize &CurrentSize)
             m_LeftStartPos = (ClientWidth - ValueWidth) / 2;
             break;
         default :
-            wxFAIL_MSG(_("Unknown alignent value for wxLEDNumberCtrl."));
+            wxFAIL_MSG(wxT("Unknown alignent value for wxLEDNumberCtrl."));
             break;
     }
 }