added dummy Set/GetMargin
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,6 +74,10 @@ public:
|
|||||||
void SetBitmapLabel( const wxBitmap& bitmap );
|
void SetBitmapLabel( const wxBitmap& bitmap );
|
||||||
void SetBitmapSelected( const wxBitmap& bitmap );
|
void SetBitmapSelected( const wxBitmap& bitmap );
|
||||||
|
|
||||||
|
void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||||
|
int GetMarginX() const { return m_marginX; }
|
||||||
|
int GetMarginY() const { return m_marginY; }
|
||||||
|
|
||||||
virtual bool Enable(bool enable);
|
virtual bool Enable(bool enable);
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -93,6 +97,10 @@ public:
|
|||||||
wxBitmap m_focus;
|
wxBitmap m_focus;
|
||||||
wxBitmap m_selected;
|
wxBitmap m_selected;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_marginX;
|
||||||
|
int m_marginY;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||||
};
|
};
|
||||||
|
@@ -74,6 +74,10 @@ public:
|
|||||||
void SetBitmapLabel( const wxBitmap& bitmap );
|
void SetBitmapLabel( const wxBitmap& bitmap );
|
||||||
void SetBitmapSelected( const wxBitmap& bitmap );
|
void SetBitmapSelected( const wxBitmap& bitmap );
|
||||||
|
|
||||||
|
void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||||
|
int GetMarginX() const { return m_marginX; }
|
||||||
|
int GetMarginY() const { return m_marginY; }
|
||||||
|
|
||||||
virtual bool Enable(bool enable);
|
virtual bool Enable(bool enable);
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
@@ -93,6 +97,10 @@ public:
|
|||||||
wxBitmap m_focus;
|
wxBitmap m_focus;
|
||||||
wxBitmap m_selected;
|
wxBitmap m_selected;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_marginX;
|
||||||
|
int m_marginY;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||||
};
|
};
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bmpbuttn.cpp
|
// Name: gtk/bmpbuttn.cpp
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -119,11 +119,14 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
|
m_marginX =
|
||||||
|
m_marginY = 0;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
|
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bitmap = bitmap;
|
m_bitmap = bitmap;
|
||||||
@@ -131,8 +134,6 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
|||||||
m_focus = bitmap;
|
m_focus = bitmap;
|
||||||
m_selected = bitmap;
|
m_selected = bitmap;
|
||||||
|
|
||||||
m_label = "";
|
|
||||||
|
|
||||||
m_widget = gtk_button_new();
|
m_widget = gtk_button_new();
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if (GTK_MINOR_VERSION > 0)
|
||||||
@@ -218,15 +219,15 @@ void wxBitmapButton::SetBitmap()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_isSelected)
|
if (m_isSelected)
|
||||||
{
|
{
|
||||||
the_one = m_selected;
|
the_one = m_selected;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_hasFocus)
|
if (m_hasFocus)
|
||||||
the_one = m_focus;
|
the_one = m_focus;
|
||||||
else
|
else
|
||||||
the_one = m_bitmap;
|
the_one = m_bitmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,5 +316,6 @@ void wxBitmapButton::EndSelect()
|
|||||||
m_isSelected = FALSE;
|
m_isSelected = FALSE;
|
||||||
SetBitmap();
|
SetBitmap();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif // wxUSE_BMPBUTTON
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bmpbuttn.cpp
|
// Name: gtk/bmpbuttn.cpp
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Author: Robert Roebling
|
// Author: Robert Roebling
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling
|
// Copyright: (c) 1998 Robert Roebling
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -119,11 +119,14 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
|||||||
m_needParent = TRUE;
|
m_needParent = TRUE;
|
||||||
m_acceptsFocus = TRUE;
|
m_acceptsFocus = TRUE;
|
||||||
|
|
||||||
|
m_marginX =
|
||||||
|
m_marginY = 0;
|
||||||
|
|
||||||
if (!PreCreation( parent, pos, size ) ||
|
if (!PreCreation( parent, pos, size ) ||
|
||||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
|
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bitmap = bitmap;
|
m_bitmap = bitmap;
|
||||||
@@ -131,8 +134,6 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
|||||||
m_focus = bitmap;
|
m_focus = bitmap;
|
||||||
m_selected = bitmap;
|
m_selected = bitmap;
|
||||||
|
|
||||||
m_label = "";
|
|
||||||
|
|
||||||
m_widget = gtk_button_new();
|
m_widget = gtk_button_new();
|
||||||
|
|
||||||
#if (GTK_MINOR_VERSION > 0)
|
#if (GTK_MINOR_VERSION > 0)
|
||||||
@@ -218,15 +219,15 @@ void wxBitmapButton::SetBitmap()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_isSelected)
|
if (m_isSelected)
|
||||||
{
|
{
|
||||||
the_one = m_selected;
|
the_one = m_selected;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_hasFocus)
|
if (m_hasFocus)
|
||||||
the_one = m_focus;
|
the_one = m_focus;
|
||||||
else
|
else
|
||||||
the_one = m_bitmap;
|
the_one = m_bitmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,5 +316,6 @@ void wxBitmapButton::EndSelect()
|
|||||||
m_isSelected = FALSE;
|
m_isSelected = FALSE;
|
||||||
SetBitmap();
|
SetBitmap();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
#endif // wxUSE_BMPBUTTON
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user