projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove extra '{' which broke docs compilation
[wxWidgets.git]
/
contrib
/
src
/
gizmos
/
ledctrl.cpp
diff --git
a/contrib/src/gizmos/ledctrl.cpp
b/contrib/src/gizmos/ledctrl.cpp
index 3f0d109a3c51d713ea520f67b96b15941ec47469..458af3f4cc35dee5bc1a0618543905e0e4ad8dfe 100644
(file)
--- a/
contrib/src/gizmos/ledctrl.cpp
+++ b/
contrib/src/gizmos/ledctrl.cpp
@@
-2,10
+2,6
@@
// headers
// ============================================================================
// headers
// ============================================================================
-#ifdef __GNUG__
- #pragma implementation "wxLEDNumberCtrl.h"
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
@@
-136,7
+132,7
@@
void wxLEDNumberCtrl::SetValue(wxString const &Value, bool Redraw)
if (Value != m_Value)
{
#ifdef __WXDEBUG__
if (Value != m_Value)
{
#ifdef __WXDEBUG__
- if (!Value.
IsE
mpty())
+ if (!Value.
e
mpty())
{
for(size_t i=0; i<Value.Length(); i++) {
wxChar ch = Value[i];
{
for(size_t i=0; i<Value.Length(); i++) {
wxChar ch = Value[i];
@@
-178,7
+174,6
@@
void wxLEDNumberCtrl::OnPaint(wxPaintEvent &WXUNUSED(event))
wxMemoryDC MemDc;
MemDc.SelectObject(*pMemoryBitmap);
wxMemoryDC MemDc;
MemDc.SelectObject(*pMemoryBitmap);
- MemDc.BeginDrawing();
// Draw background.
MemDc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));
// Draw background.
MemDc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));
@@
-189,54
+184,54
@@
void wxLEDNumberCtrl::OnPaint(wxPaintEvent &WXUNUSED(event))
const int DigitCount = m_Value.Len();
for (int offset=0, i = 0; offset < DigitCount; ++offset, ++i)
{
const int DigitCount = m_Value.Len();
for (int offset=0, i = 0; offset < DigitCount; ++offset, ++i)
{
-
c
har c = m_Value.GetChar(offset);
+
wxC
har c = m_Value.GetChar(offset);
// Draw faded lines if wanted.
// Draw faded lines if wanted.
- if (m_DrawFaded && (c !=
'.'
))
+ if (m_DrawFaded && (c !=
_T('.')
))
DrawDigit(MemDc, DIGITALL, i);
// Draw the digits.
switch (c)
{
DrawDigit(MemDc, DIGITALL, i);
// Draw the digits.
switch (c)
{
- case
'0'
:
+ case
_T('0')
:
DrawDigit(MemDc, DIGIT0, i);
break;
DrawDigit(MemDc, DIGIT0, i);
break;
- case
'1'
:
+ case
_T('1')
:
DrawDigit(MemDc, DIGIT1, i);
break;
DrawDigit(MemDc, DIGIT1, i);
break;
- case
'2'
:
+ case
_T('2')
:
DrawDigit(MemDc, DIGIT2, i);
break;
DrawDigit(MemDc, DIGIT2, i);
break;
- case
'3'
:
+ case
_T('3')
:
DrawDigit(MemDc, DIGIT3, i);
break;
DrawDigit(MemDc, DIGIT3, i);
break;
- case
'4'
:
+ case
_T('4')
:
DrawDigit(MemDc, DIGIT4, i);
break;
DrawDigit(MemDc, DIGIT4, i);
break;
- case
'5'
:
+ case
_T('5')
:
DrawDigit(MemDc, DIGIT5, i);
break;
DrawDigit(MemDc, DIGIT5, i);
break;
- case
'6'
:
+ case
_T('6')
:
DrawDigit(MemDc, DIGIT6, i);
break;
DrawDigit(MemDc, DIGIT6, i);
break;
- case
'7'
:
+ case
_T('7')
:
DrawDigit(MemDc, DIGIT7, i);
break;
DrawDigit(MemDc, DIGIT7, i);
break;
- case
'8'
:
+ case
_T('8')
:
DrawDigit(MemDc, DIGIT8, i);
break;
DrawDigit(MemDc, DIGIT8, i);
break;
- case
'9'
:
+ case
_T('9')
:
DrawDigit(MemDc, DIGIT9, i);
break;
DrawDigit(MemDc, DIGIT9, i);
break;
- case
'-'
:
+ case
_T('-')
:
DrawDigit(MemDc, DASH, i);
break;
DrawDigit(MemDc, DASH, i);
break;
- case
'.'
:
+ case
_T('.')
:
// Display the decimal in the previous segment
i--;
DrawDigit(MemDc, DECIMALSIGN, i);
break;
// Display the decimal in the previous segment
i--;
DrawDigit(MemDc, DECIMALSIGN, i);
break;
- case
' '
:
+ case
_T(' ')
:
// just skip it
break;
default :
// just skip it
break;
default :
@@
-245,8
+240,6
@@
void wxLEDNumberCtrl::OnPaint(wxPaintEvent &WXUNUSED(event))
}
}
}
}
- MemDc.EndDrawing();
-
// Blit the memory dc to screen.
Dc.Blit(0, 0, Width, Height, &MemDc, 0, 0, wxCOPY);
delete pMemoryBitmap;
// Blit the memory dc to screen.
Dc.Blit(0, 0, Width, Height, &MemDc, 0, 0, wxCOPY);
delete pMemoryBitmap;
@@
-259,9
+252,9
@@
void wxLEDNumberCtrl::DrawDigit(wxDC &Dc, int Digit, int Column)
if (Digit == DIGITALL)
{
if (Digit == DIGITALL)
{
- const
int R = LineColor.Red() / 16
;
- const
int G = LineColor.Green() / 16
;
- const
int B = LineColor.Blue() / 16
;
+ const
unsigned char R = (unsigned char)(LineColor.Red() / 16)
;
+ const
unsigned char G = (unsigned char)(LineColor.Green() / 16)
;
+ const
unsigned char B = (unsigned char)(LineColor.Blue() / 16)
;
LineColor.Set(R, G, B);
}
LineColor.Set(R, G, B);
}