projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proper const-ness for GetLine() and operator[]()
[wxWidgets.git]
/
src
/
univ
/
button.cpp
diff --git
a/src/univ/button.cpp
b/src/univ/button.cpp
index f04966be286c83a4632741964eeb9bf3938f5b55..788196ca61d13bbb3fb6b720e445d644e943907e 100644
(file)
--- a/
src/univ/button.cpp
+++ b/
src/univ/button.cpp
@@
-79,8
+79,6
@@
static const wxCoord DEFAULT_BTN_MARGIN_Y = 0;
// implementation
// ============================================================================
// implementation
// ============================================================================
-IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
-
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// creation
// ----------------------------------------------------------------------------
@@
-128,9
+126,9
@@
bool wxButton::Create(wxWindow *parent,
SetLabel(label);
if (bitmap.Ok())
SetLabel(label);
if (bitmap.Ok())
- Set
ImageLabel(bitmap); // SetBestSize called by SetImageLabel
()
+ Set
Bitmap(bitmap); // SetInitialSize called by SetBitmap
()
else
else
- Set
Best
Size(size);
+ Set
Initial
Size(size);
CreateInputHandler(wxINP_HANDLER_BUTTON);
CreateInputHandler(wxINP_HANDLER_BUTTON);
@@
-213,7
+211,7
@@
void wxButton::DoDraw(wxControlRenderer *renderer)
renderer->DrawButtonBorder();
}
renderer->DrawButtonBorder();
}
- renderer->DrawLabel(m_bitmap, m_marginBmpX, m_marginBmpY);
+ renderer->Draw
Button
Label(m_bitmap, m_marginBmpX, m_marginBmpY);
}
bool wxButton::DoDrawBackground(wxDC& dc)
}
bool wxButton::DoDrawBackground(wxDC& dc)
@@
-315,24
+313,29
@@
wxInputHandler *wxButton::GetStdInputHandler(wxInputHandler *handlerDef)
// misc
// ----------------------------------------------------------------------------
// misc
// ----------------------------------------------------------------------------
-void wxButton::
SetImageLabel(const wxBitmap& bitmap
)
+void wxButton::
DoSetBitmap(const wxBitmap& bitmap, State which
)
{
{
- m_bitmap = bitmap;
+ // we support only one bitmap right now, although this wouldn't be
+ // difficult to change
+ if ( which == State_Normal )
+ m_bitmap = bitmap;
- Set
Image
Margins(DEFAULT_BTN_MARGIN_X, DEFAULT_BTN_MARGIN_Y);
+ Set
Bitmap
Margins(DEFAULT_BTN_MARGIN_X, DEFAULT_BTN_MARGIN_Y);
}
}
-void wxButton::
SetImage
Margins(wxCoord x, wxCoord y)
+void wxButton::
DoSetBitmap
Margins(wxCoord x, wxCoord y)
{
m_marginBmpX = x + 2;
m_marginBmpY = y + 2;
{
m_marginBmpX = x + 2;
m_marginBmpY = y + 2;
- Set
Best
Size(wxDefaultSize);
+ Set
Initial
Size(wxDefaultSize);
}
}
-
void
wxButton::SetDefault()
+
wxWindow *
wxButton::SetDefault()
{
m_isDefault = true;
{
m_isDefault = true;
+
+ return wxButtonBase::SetDefault();
}
// ============================================================================
}
// ============================================================================