projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxStaticBitmap should have transparent background (fixes grey backgrounds
[wxWidgets.git]
/
src
/
univ
/
spinbutt.cpp
diff --git
a/src/univ/spinbutt.cpp
b/src/univ/spinbutt.cpp
index 9721e5062c46fd1595a4beadee98eb68e35ac56a..7df6ef7b8b70e3cbe88541ee9388ad12541ff2ec 100644
(file)
--- a/
src/univ/spinbutt.cpp
+++ b/
src/univ/spinbutt.cpp
@@
-17,8
+17,8
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if
def __GNUG__
- #pragma implementation "spinbut
base
.h"
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+ #pragma implementation "spinbut
t
.h"
#pragma implementation "univspinbutt.h"
#endif
#pragma implementation "univspinbutt.h"
#endif
@@
-101,13
+101,13
@@
bool wxSpinButton::Create(wxWindow *parent,
if ( !wxSpinButtonBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
if ( !wxSpinButtonBase::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
- return
FALSE
;
+ return
false
;
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_SPINBTN);
SetBestSize(size);
CreateInputHandler(wxINP_HANDLER_SPINBTN);
- return
TRUE
;
+ return
true
;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-144,14
+144,14
@@
int wxSpinButton::NormalizeValue(int value) const
if ( value > m_max )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
if ( value > m_max )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
- value = m_min + (value - m_max
) % (m_max - m_min
);
+ value = m_min + (value - m_max
- 1) % (m_max - m_min + 1
);
else
value = m_max;
}
else if ( value < m_min )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
else
value = m_max;
}
else if ( value < m_min )
{
if ( GetWindowStyleFlag() & wxSP_WRAP )
- value = m_max - (m_min - value
) % (m_max - m_min
);
+ value = m_max - (m_min - value
- 1) % (m_max - m_min + 1
);
else
value = m_min;
}
else
value = m_min;
}
@@
-167,7
+167,7
@@
bool wxSpinButton::ChangeValue(int inc)
{
// nothing changed - most likely because we are already at min/max
// value
{
// nothing changed - most likely because we are already at min/max
// value
- return
FALSE
;
+ return
false
;
}
wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN,
}
wxSpinEvent event(inc > 0 ? wxEVT_SCROLL_LINEUP : wxEVT_SCROLL_LINEDOWN,
@@
-178,7
+178,7
@@
bool wxSpinButton::ChangeValue(int inc)
if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
{
// programm has vetoed the event
if ( GetEventHandler()->ProcessEvent(event) && !event.IsAllowed() )
{
// programm has vetoed the event
- return
FALSE
;
+ return
false
;
}
m_value = valueNew;
}
m_value = valueNew;
@@
-187,7
+187,7
@@
bool wxSpinButton::ChangeValue(int inc)
event.SetEventType(wxEVT_SCROLL_THUMBTRACK);
(void)GetEventHandler()->ProcessEvent(event);
event.SetEventType(wxEVT_SCROLL_THUMBTRACK);
(void)GetEventHandler()->ProcessEvent(event);
- return
TRUE
;
+ return
true
;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-357,7
+357,7
@@
bool wxSpinButton::PerformAction(const wxControlAction& action,
else
return wxControl::PerformAction(action, numArg, strArg);
else
return wxControl::PerformAction(action, numArg, strArg);
- return
TRUE
;
+ return
true
;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-370,7
+370,7
@@
wxStdSpinButtonInputHandler(wxInputHandler *inphand)
{
}
{
}
-bool wxStdSpinButtonInputHandler::HandleKey(wx
Control *control
,
+bool wxStdSpinButtonInputHandler::HandleKey(wx
InputConsumer *consumer
,
const wxKeyEvent& event,
bool pressed)
{
const wxKeyEvent& event,
bool pressed)
{
@@
-390,43
+390,43
@@
bool wxStdSpinButtonInputHandler::HandleKey(wxControl *control,
break;
}
break;
}
- if ( !
!action
)
+ if ( !
action.IsEmpty()
)
{
{
- con
trol
->PerformAction(action);
+ con
sumer
->PerformAction(action);
- return
TRUE
;
+ return
true
;
}
}
}
}
- return wxStdInputHandler::HandleKey(con
trol
, event, pressed);
+ return wxStdInputHandler::HandleKey(con
sumer
, event, pressed);
}
}
-bool wxStdSpinButtonInputHandler::HandleMouse(wx
Control *control
,
+bool wxStdSpinButtonInputHandler::HandleMouse(wx
InputConsumer *consumer
,
const wxMouseEvent& event)
{
const wxMouseEvent& event)
{
- wxSpinButton *spinbtn = wxStaticCast(con
trol
, wxSpinButton);
+ wxSpinButton *spinbtn = wxStaticCast(con
sumer->GetInputWindow()
, wxSpinButton);
if ( spinbtn->GetArrows().HandleMouse(event) )
{
// don't refresh, everything is already done
if ( spinbtn->GetArrows().HandleMouse(event) )
{
// don't refresh, everything is already done
- return
FALSE
;
+ return
false
;
}
}
- return wxStdInputHandler::HandleMouse(con
trol
, event);
+ return wxStdInputHandler::HandleMouse(con
sumer
, event);
}
}
-bool wxStdSpinButtonInputHandler::HandleMouseMove(wx
Control *control
,
+bool wxStdSpinButtonInputHandler::HandleMouseMove(wx
InputConsumer *consumer
,
const wxMouseEvent& event)
{
const wxMouseEvent& event)
{
- wxSpinButton *spinbtn = wxStaticCast(con
trol
, wxSpinButton);
+ wxSpinButton *spinbtn = wxStaticCast(con
sumer->GetInputWindow()
, wxSpinButton);
if ( spinbtn->GetArrows().HandleMouseMove(event) )
{
// processed by the arrows
if ( spinbtn->GetArrows().HandleMouseMove(event) )
{
// processed by the arrows
- return
FALSE
;
+ return
false
;
}
}
- return wxStdInputHandler::HandleMouseMove(con
trol
, event);
+ return wxStdInputHandler::HandleMouseMove(con
sumer
, event);
}
}