/////////////////////////////////////////////////////////////////////////////
// Name: bmpbuttn.cpp
-// Purpose:
-// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Purpose: wxBitmapButton
+// Author: AUTHOR
+// Modified by:
+// Created: ??/??/98
+// RCS-ID: $Id$
+// Copyright: (c) AUTHOR
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/bmpbuttn.h"
-//-----------------------------------------------------------------------------
-// classes
-//-----------------------------------------------------------------------------
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
-class wxBitmapButton;
+bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
+ const wxPoint& pos,
+ const wxSize& size, long style,
+ const wxValidator& validator,
+ const wxString& name)
+{
+ m_buttonBitmap = bitmap;
+ SetName(name);
+ SetValidator(validator);
+ parent->AddChild(this);
-//-----------------------------------------------------------------------------
-// wxBitmapButton
-//-----------------------------------------------------------------------------
+ m_backgroundColour = parent->GetDefaultBackgroundColour() ;
+ m_foregroundColour = parent->GetDefaultForegroundColour() ;
+ m_windowStyle = style;
+ m_marginX = 0;
+ m_marginY = 0;
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+ int x = pos.x;
+ int y = pos.y;
+ int width = size.x;
+ int height = size.y;
-wxBitmapButton::wxBitmapButton(void)
-{
-};
+ if (id == -1)
+ m_windowId = NewControlId();
+ else
+ m_windowId = id;
-wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- Create( parent, id, bitmap, pos, size, style, name );
-};
+ if ( width == -1 && bitmap.Ok())
+ width = bitmap.GetWidth() + 2*m_marginX;
-bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
- const wxPoint &pos, const wxSize &size,
- long style, const wxString &name )
-{
- m_needParent = TRUE;
-
- wxSize newSize = size;
+ if ( height == -1 && bitmap.Ok())
+ height = bitmap.GetHeight() + 2*m_marginY;
- PreCreation( parent, id, pos, newSize, style, name );
-
- m_bitmap = bitmap;
- m_label = "";
-
-
- if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
- if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
- SetSize( newSize.x, newSize.y );
-
+ /* TODO: create bitmap button
+ */
- PostCreation();
-
- Show( TRUE );
-
- return TRUE;
-};
-
-void wxBitmapButton::SetDefault(void)
-{
-};
+ return FALSE;
+}
-void wxBitmapButton::SetLabel( const wxString &label )
+void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
{
- wxControl::SetLabel( label );
-};
+ m_buttonBitmap = bitmap;
+}
-wxString wxBitmapButton::GetLabel(void) const
-{
- return wxControl::GetLabel();
-};