projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test cvs commit
[wxWidgets.git]
/
src
/
qt
/
bmpbuttn.cpp
diff --git
a/src/qt/bmpbuttn.cpp
b/src/qt/bmpbuttn.cpp
index b70436648066d99418be6160975608af438d3f8c..03c4ceeb636be11c3cba4f63e5391d4e6ec79cdd 100644
(file)
--- a/
src/qt/bmpbuttn.cpp
+++ b/
src/qt/bmpbuttn.cpp
@@
-1,10
+1,11
@@
/////////////////////////////////////////////////////////////////////////////
// Name: bmpbuttn.cpp
/////////////////////////////////////////////////////////////////////////////
// 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
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@
-14,65
+15,49
@@
#include "wx/bmpbuttn.h"
#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::Set
Label( const wxString &label
)
+void wxBitmapButton::Set
BitmapLabel(const wxBitmap& bitmap
)
{
{
-
wxControl::SetLabel( label )
;
-}
;
+
m_buttonBitmap = bitmap
;
+}
-wxString wxBitmapButton::GetLabel(void) const
-{
- return wxControl::GetLabel();
-};