// simple types
// ----------------------------------------------------------------------------
-#include <wx/filefn.h>
+#include "wx/string.h"
+#include "wx/filefn.h"
// define off_t
#include <sys/types.h>
// classes
//-----------------------------------------------------------------------------
-class wxDC;
-class wxPaintDC;
-class wxMemoryDC;
-class wxToolBarGTK;
-
class wxMask;
class wxBitmap;
wxMask( const wxBitmap& bitmap );
~wxMask(void);
- private:
+ public:
- friend wxBitmap;
- friend wxDC;
- friend wxPaintDC;
- friend wxToolBarGTK;
-
GdkBitmap *GetBitmap(void) const;
protected:
wxPalette *GetColourMap(void) const
{ return GetPalette(); };
- private:
-
- friend wxDC;
- friend wxPaintDC;
- friend wxMemoryDC;
- friend wxToolBarGTK;
+ public:
GdkPixmap *GetPixmap(void) const;
class wxBitmapButton;
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+extern const char *wxButtonNameStr;
+
//-----------------------------------------------------------------------------
// wxBitmapButton
//-----------------------------------------------------------------------------
+class wxBitmapButton: public wxControl
+{
+ DECLARE_DYNAMIC_CLASS(wxBitmapButton)
+
+ public:
+
+ wxBitmapButton(void);
+ wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ const long style = 0, const wxString &name = wxButtonNameStr );
+ bool Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ const long style = 0, const wxString &name = wxButtonNameStr );
+ void SetDefault(void);
+ void SetLabel( const wxString &label );
+ wxString GetLabel(void) const;
+
+ public:
+
+ wxBitmap m_bitmap;
+
+};
#endif // __BMPBUTTONH__
// classes
//-----------------------------------------------------------------------------
-class wxDC;
-class wxPaintDC;
-class wxMemoryDC;
-class wxToolBarGTK;
-
class wxMask;
class wxBitmap;
wxMask( const wxBitmap& bitmap );
~wxMask(void);
- private:
+ public:
- friend wxBitmap;
- friend wxDC;
- friend wxPaintDC;
- friend wxToolBarGTK;
-
GdkBitmap *GetBitmap(void) const;
protected:
wxPalette *GetColourMap(void) const
{ return GetPalette(); };
- private:
-
- friend wxDC;
- friend wxPaintDC;
- friend wxMemoryDC;
- friend wxToolBarGTK;
+ public:
GdkPixmap *GetPixmap(void) const;
class wxBitmapButton;
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+extern const char *wxButtonNameStr;
+
//-----------------------------------------------------------------------------
// wxBitmapButton
//-----------------------------------------------------------------------------
+class wxBitmapButton: public wxControl
+{
+ DECLARE_DYNAMIC_CLASS(wxBitmapButton)
+
+ public:
+
+ wxBitmapButton(void);
+ wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ const long style = 0, const wxString &name = wxButtonNameStr );
+ bool Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
+ const long style = 0, const wxString &name = wxButtonNameStr );
+ void SetDefault(void);
+ void SetLabel( const wxString &label );
+ wxString GetLabel(void) const;
+
+ public:
+
+ wxBitmap m_bitmap;
+
+};
#endif // __BMPBUTTONH__
DEFAULT_USE_ENHANCED_DIALOG=0
DEFAULT_USE_FORM=0
-DEFAULT_USE_PROLOGIO=0
+DEFAULT_USE_PROLOGIO=1
DEFAULT_USE_RPC=0
DEFAULT_USE_WX_RESOURCES=1
\
gtk/app.cpp \
gtk/bitmap.cpp \
+ gtk/bmpbuttn.cpp \
gtk/brush.cpp \
gtk/button.cpp \
gtk/checkbox.cpp \
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: bmpbuttn.cpp
+// Purpose:
+// Author: Robert Roebling
+// Created: 01/02/97
+// Id:
+// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "bmpbuttn.h"
+#endif
+
+#include "wx/bmpbuttn.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxBitmapButton;
+
+//-----------------------------------------------------------------------------
+// wxBitmapButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+
+void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), gpointer data )
+{
+ wxBitmapButton *button = (wxBitmapButton*)data;
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
+ event.SetEventObject(button);
+ button->ProcessEvent(event);
+};
+
+//-----------------------------------------------------------------------------
+
+wxBitmapButton::wxBitmapButton(void)
+{
+};
+
+wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos, const wxSize &size,
+ const long style, const wxString &name )
+{
+ Create( parent, id, bitmap, pos, size, style, name );
+};
+
+bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos, const wxSize &size,
+ const long style, const wxString &name )
+{
+ m_needParent = TRUE;
+
+ wxSize newSize = size;
+
+ PreCreation( parent, id, pos, newSize, style, name );
+
+ m_bitmap = bitmap;
+ m_label = "";
+
+ m_widget = gtk_button_new();
+
+ if (m_bitmap.Ok())
+ {
+ GdkBitmap *mask = NULL;
+ if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
+ GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
+
+ gtk_widget_show( pixmap );
+ gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
+ };
+
+
+
+ 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 );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+ GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this );
+
+ PostCreation();
+
+ Show( TRUE );
+
+ return TRUE;
+};
+
+void wxBitmapButton::SetDefault(void)
+{
+};
+
+void wxBitmapButton::SetLabel( const wxString &label )
+{
+ wxControl::SetLabel( label );
+};
+
+wxString wxBitmapButton::GetLabel(void) const
+{
+ return wxControl::GetLabel();
+};
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: bmpbuttn.cpp
+// Purpose:
+// Author: Robert Roebling
+// Created: 01/02/97
+// Id:
+// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifdef __GNUG__
+#pragma implementation "bmpbuttn.h"
+#endif
+
+#include "wx/bmpbuttn.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxBitmapButton;
+
+//-----------------------------------------------------------------------------
+// wxBitmapButton
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+
+void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), gpointer data )
+{
+ wxBitmapButton *button = (wxBitmapButton*)data;
+ wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
+ event.SetEventObject(button);
+ button->ProcessEvent(event);
+};
+
+//-----------------------------------------------------------------------------
+
+wxBitmapButton::wxBitmapButton(void)
+{
+};
+
+wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos, const wxSize &size,
+ const long style, const wxString &name )
+{
+ Create( parent, id, bitmap, pos, size, style, name );
+};
+
+bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
+ const wxPoint &pos, const wxSize &size,
+ const long style, const wxString &name )
+{
+ m_needParent = TRUE;
+
+ wxSize newSize = size;
+
+ PreCreation( parent, id, pos, newSize, style, name );
+
+ m_bitmap = bitmap;
+ m_label = "";
+
+ m_widget = gtk_button_new();
+
+ if (m_bitmap.Ok())
+ {
+ GdkBitmap *mask = NULL;
+ if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
+ GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
+
+ gtk_widget_show( pixmap );
+ gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
+ };
+
+
+
+ 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 );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "clicked",
+ GTK_SIGNAL_FUNC(gtk_button_clicked_callback), (gpointer*)this );
+
+ PostCreation();
+
+ Show( TRUE );
+
+ return TRUE;
+};
+
+void wxBitmapButton::SetDefault(void)
+{
+};
+
+void wxBitmapButton::SetLabel( const wxString &label )
+{
+ wxControl::SetLabel( label );
+};
+
+wxString wxBitmapButton::GetLabel(void) const
+{
+ return wxControl::GetLabel();
+};
BIN_TARGET=wxTest
# define library sources
BIN_SRC=\
-wxTest.cpp
+wxTest.cpp stream.cpp
#define library objects
BIN_OBJ=\
-wxTest.o
+wxTest.o stream.o
# additional things needed to link
BIN_LINK=