echo "$ac_t""no" 1>&6
fi
- min_gtk_version=0.99.7
+ min_gtk_version=1.0.6
echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
echo "configure:5983: checking for GTK - version >= $min_gtk_version" >&5
no_gtk=""
echo "$ac_t""no" 1>&6
GTK_CFLAGS=""
GTK_LIBS=""
- { echo "configure: error: Are gtk-config and the GTK in path and up-to-date?" 1>&2; exit 1; }
+ { echo "configure: error: Is gtk-config in path and GTK+ is version 1.0.6?" 1>&2; exit 1; }
fi
MAKEINCLUDE=
if test "$wxUSE_GTK" = 1; then
- AM_PATH_GTK(0.99.7, [
+ AM_PATH_GTK(1.0.6, [
GUI_TK_INCLUDE="$GTK_CFLAGS"
GUI_TK_LIBRARY="$GTK_LIBS"
- ], AC_MSG_ERROR(Are gtk-config and the GTK in path and up-to-date?))
+ ], AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.0.6?))
TOOLKIT=GTK
TOOLKIT_DEF=__WXGTK__
MAKEINCLUDE=../gtk.inc
-----------------------
wxWindows/GTK requires the GTK+ library to be installed on your system.
-It has to be a stable version, preferebly version 1.0.6.
+It has to be a stable version, preferebly version 1.0.6. When using
+a version previous to 1.0.6 you'll get crashes here and there. This
+is certain to happen with colors in native widgets.
You can get the newest version of the GTK+ from the GTK homepage
at
http://www.gtk.org
+We also mirror GTK+ 1.0.6 at our ftp site. You'll find information
+about downloading at my homepage.
+
* Additional libraries
-----------------------
-There will be a few more features of wxWindows, which will
-require further libraries (on some platforms). These
-features will be optional. I hope to teach configure
-to check that out automatically.
-
-Thread support:
-
- Requires pthreads under Linux with glibc 2. pthreads are
- always present on such systems, so just compile, unless
- you have RedHat 5.0, which has a broken combination of
- glibc 2 and X. In this case, you have to run configure
- with "--without-threads".
-
- Requires PCthreads under Linux with libc 5. If you
- haven't installed pcthreads, there will be no thread
- support in wxWindows, but the library will compile.
-
- Requires Posix threads on commercial Unix system,
- which are always present. Just compile.
-
- On SGI Irix we first look for sprocs, then pthreads and
- use the last one found.
+wxWindows/Gtk requires a thread library and X libraries
+known to work with threads. This is the case on all
+commercial Unix-Variants and all Linux-Versions that
+are based on glibc 2 except RedHat 5.0 which is broken
+in many aspects. As of writing this, these Linux
+distributions have correct glibc 2 support:
+
+ - RedHat 5.1
+ - Debian 2.0
+ - Stampede
+
+The next major version of SuSE will also support glibc 2,
+but version 5.X does not. Also Caldera and Slackware
+don't yet support glibc 2.
+
+On IRIX you can also use SGI threads if Posix-Threads
+are not present. The SGI threads will be detected by
+configure automatically.
+
+You can always disable thread support by running
+
+./configure "--without-threads"
+make clean
+make
+NB: I included thread support in wxWindows/Gtk, as this
+problem will disappear in the near future when all major
+Linux Variants have moved to glibc 2. Also, the Linux
+Base Standard will include glibc 2.
+
* Create your configuration
-----------------------------
Fix printing of bitmaps
-> No idea.
-Add support SetForegroundColour in GTK widgets
- -> On the way.
-
-wxBitmapCheckBox
- -> Interface same as checkbox?
-
wxImage
-> 24-bit support
void OnSysColourChanged(wxSysColourChangedEvent& event);
// Process a keyboard navigation message (Tab traversal)
void OnNavigationKey(wxNavigationKeyEvent& event);
-
+
protected:
bool SetFocusToNextChild(wxNode *nodeCurrent = (wxNode *) NULL, bool bForward = TRUE);
virtual void SetBitmapLabel( const wxBitmap& bitmap );
wxBitmap& GetBitmapLabel(void) const { return (wxBitmap&) m_bitmap; }
+ // implementation
+
+ void ApplyWidgetStyle();
+
public:
wxBitmap m_bitmap;
void SetDefault(void);
void SetLabel( const wxString &label );
void Enable( bool enable );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
- void SetForegroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
};
#endif // __GTKBUTTONH__
bool GetValue() const;
void SetLabel( const wxString& label );
- void SetFont( const wxFont &font );
void Enable( bool enable );
- void SetBackgroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
};
#endif // __GTKCHECKBOXH__
void SetSelection( int n );
void SetStringSelection( const wxString &string );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
-
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKCHOICEH__
void SetSelection(long from, long to);
void SetEditable(bool editable);
- void SetFont( const wxFont &font );
void OnSize( wxSizeEvent &event );
- void SetBackgroundColour( const wxColour &colour );
// implementation
-
- bool m_alreadySent;
- private:
-
+ bool m_alreadySent;
wxList m_clientData;
- GtkWidget* GetConnectWidget(void);
- bool IsOwnGtkWindow( GdkWindow *window );
+ GtkWidget* GetConnectWidget(void);
+ bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
DECLARE_EVENT_TABLE()
};
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: dnd.h
// Purpose: declaration of the wxDropTarget class
// Author: Robert Roebling
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: font.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: frame.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void OnCloseWindow( wxCloseEvent& event );
void OnIdle(wxIdleEvent& event);
- virtual void AddChild( wxWindow *child );
+ void AddChild( wxWindow *child );
+
+ // implementation
+
virtual void GtkOnSize( int x, int y, int width, int height );
private:
// Name: gauge.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Are we a Win95/GTK progress bar, or a normal gauge?
inline bool GetProgressBar(void) const { return m_useProgressBar; }
-
- protected:
-
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
int m_rangeMax;
int m_gaugePos;
bool m_useProgressBar;
// Name: gdiobj.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: listbox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void SetString( int n, const wxString &string );
void SetStringSelection( const wxString &string, bool select = TRUE );
- void SetFont( const wxFont &font );
void SetDropTarget( wxDropTarget *dropTarget );
- virtual void SetBackgroundColour(const wxColour &colour);
// implementation
int GetIndex( GtkWidget *item ) const;
GtkWidget *GetConnectWidget(void);
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
- private:
-
GtkList *m_list;
wxList m_clientData;
// Name: mdi.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void OnActivate( wxActivateEvent& event );
void OnSysColourChanged( wxSysColourChangedEvent& event );
- //private:
+ // implementation
wxMDIChildFrame *m_currentChild;
// Name: menu.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxWindow *GetPage(int nPage) const;
// implementation
- // --------------
- // base class virtuals
- virtual void AddChild(wxWindow *child);
- virtual void SetConstraintSizes(bool recurse);
- virtual bool DoPhase(int phase);
- virtual void SetFont( const wxFont &font );
- virtual void SetBackgroundColour( const wxColour &colour );
+
+ void AddChild(wxWindow *child);
+ void SetConstraintSizes(bool recurse);
+ bool DoPhase(int phase);
+ void ApplyWidgetStyle();
+
private:
// common part of all ctors
// Name: pen.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: radiobox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
int GetNumberOfRowsOrCols(void) const;
void SetNumberOfRowsOrCols( int n );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
void OnSize( wxSizeEvent &event );
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
bool m_alreadySent;
wxList m_boxes;
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
virtual bool GetValue(void) const;
- void SetFont( const wxFont &font );
void Enable( bool enable );
- void SetBackgroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKRADIOBUTTONH__
// Name: region.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: scrolbar.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
bool refresh = TRUE );
- // Backward compatibility
+ // Backward compatibility
+
int GetValue(void) const;
void SetValue( int viewStart );
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;
// Name: settings.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: slider.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxString& name = wxSliderNameStr );
virtual int GetValue(void) const;
virtual void SetValue( int );
- void GetSize( int *x, int *y ) const;
- void SetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
- void GetPosition( int *x, int *y ) const;
void SetRange( int minValue, int maxValue );
int GetMin(void) const;
int GetMax(void) const;
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;
// Name: statbmp.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
long style = 0, const wxString& name = wxStaticBitmapNameStr);
virtual void SetBitmap( const wxBitmap& bitmap );
wxBitmap& GetBitmap(void) const { return (wxBitmap&)m_bitmap; }
-
+
private:
wxBitmap m_bitmap;
// Name: stabox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
long style = 0, const wxString &name = wxStaticBoxNameStr );
void SetLabel( const wxString &label );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKSTATICBOXH__
// Name: stattext.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
long style = 0, const wxString &name = wxStaticTextNameStr );
wxString GetLabel(void) const;
void SetLabel( const wxString &label );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKSTATICTEXTH__
// Name: tbargtk.h
// Purpose: GTK toolbar
// Author: Robert Roebling
-// Modified by:
-// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
wxTextCtrl& operator<<(const char c);
void SetFont( const wxFont &font );
- virtual void SetBackgroundColour(const wxColour &colour);
+ void SetForegroundColour(const wxColour &colour);
+ void SetBackgroundColour(const wxColour &colour);
// implementation
GtkWidget* GetConnectWidget(void);
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
private:
// Name: timer.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: win_gtk.h
// Purpose: wxWindows's GTK base widget
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////// */
// Name: window.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
- GtkStyle *GetWidgetStyle();
+ GtkStyle *GetWidgetStyle();
+ void SetWidgetStyle();
+ virtual void ApplyWidgetStyle();
wxWindow *m_parent;
wxList m_children;
virtual void SetBitmapLabel( const wxBitmap& bitmap );
wxBitmap& GetBitmapLabel(void) const { return (wxBitmap&) m_bitmap; }
+ // implementation
+
+ void ApplyWidgetStyle();
+
public:
wxBitmap m_bitmap;
void SetDefault(void);
void SetLabel( const wxString &label );
void Enable( bool enable );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
- void SetForegroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
};
#endif // __GTKBUTTONH__
bool GetValue() const;
void SetLabel( const wxString& label );
- void SetFont( const wxFont &font );
void Enable( bool enable );
- void SetBackgroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
};
#endif // __GTKCHECKBOXH__
void SetSelection( int n );
void SetStringSelection( const wxString &string );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
-
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKCHOICEH__
void SetSelection(long from, long to);
void SetEditable(bool editable);
- void SetFont( const wxFont &font );
void OnSize( wxSizeEvent &event );
- void SetBackgroundColour( const wxColour &colour );
// implementation
-
- bool m_alreadySent;
- private:
-
+ bool m_alreadySent;
wxList m_clientData;
- GtkWidget* GetConnectWidget(void);
- bool IsOwnGtkWindow( GdkWindow *window );
+ GtkWidget* GetConnectWidget(void);
+ bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
DECLARE_EVENT_TABLE()
};
// Purpose:
// Author: Robert Roebling
// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: dnd.h
// Purpose: declaration of the wxDropTarget class
// Author: Robert Roebling
-// RCS-ID:
+// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// Name: filedlg.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: font.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: frame.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void OnCloseWindow( wxCloseEvent& event );
void OnIdle(wxIdleEvent& event);
- virtual void AddChild( wxWindow *child );
+ void AddChild( wxWindow *child );
+
+ // implementation
+
virtual void GtkOnSize( int x, int y, int width, int height );
private:
// Name: gauge.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Are we a Win95/GTK progress bar, or a normal gauge?
inline bool GetProgressBar(void) const { return m_useProgressBar; }
-
- protected:
-
+
+ // implementation
+
+ void ApplyWidgetStyle();
+
int m_rangeMax;
int m_gaugePos;
bool m_useProgressBar;
// Name: gdiobj.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: icon.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: listbox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void SetString( int n, const wxString &string );
void SetStringSelection( const wxString &string, bool select = TRUE );
- void SetFont( const wxFont &font );
void SetDropTarget( wxDropTarget *dropTarget );
- virtual void SetBackgroundColour(const wxColour &colour);
// implementation
int GetIndex( GtkWidget *item ) const;
GtkWidget *GetConnectWidget(void);
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
- private:
-
GtkList *m_list;
wxList m_clientData;
// Name: mdi.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void OnActivate( wxActivateEvent& event );
void OnSysColourChanged( wxSysColourChangedEvent& event );
- //private:
+ // implementation
wxMDIChildFrame *m_currentChild;
// Name: menu.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
wxWindow *GetPage(int nPage) const;
// implementation
- // --------------
- // base class virtuals
- virtual void AddChild(wxWindow *child);
- virtual void SetConstraintSizes(bool recurse);
- virtual bool DoPhase(int phase);
- virtual void SetFont( const wxFont &font );
- virtual void SetBackgroundColour( const wxColour &colour );
+
+ void AddChild(wxWindow *child);
+ void SetConstraintSizes(bool recurse);
+ bool DoPhase(int phase);
+ void ApplyWidgetStyle();
+
private:
// common part of all ctors
// Name: pen.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: radiobox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
int GetNumberOfRowsOrCols(void) const;
void SetNumberOfRowsOrCols( int n );
- void SetFont( const wxFont &font );
- void SetBackgroundColour( const wxColour &colour );
void OnSize( wxSizeEvent &event );
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
bool m_alreadySent;
wxList m_boxes;
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
virtual bool GetValue(void) const;
- void SetFont( const wxFont &font );
void Enable( bool enable );
- void SetBackgroundColour( const wxColour &colour );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKRADIOBUTTONH__
// Name: region.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: scrolbar.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
bool refresh = TRUE );
- // Backward compatibility
+ // Backward compatibility
+
int GetValue(void) const;
void SetValue( int viewStart );
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;
// Name: settings.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: slider.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
+// Id: $Id$
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxString& name = wxSliderNameStr );
virtual int GetValue(void) const;
virtual void SetValue( int );
- void GetSize( int *x, int *y ) const;
- void SetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
- void GetPosition( int *x, int *y ) const;
void SetRange( int minValue, int maxValue );
int GetMin(void) const;
int GetMax(void) const;
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;
// Name: statbmp.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
long style = 0, const wxString& name = wxStaticBitmapNameStr);
virtual void SetBitmap( const wxBitmap& bitmap );
wxBitmap& GetBitmap(void) const { return (wxBitmap&)m_bitmap; }
-
+
private:
wxBitmap m_bitmap;
// Name: stabox.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
long style = 0, const wxString &name = wxStaticBoxNameStr );
void SetLabel( const wxString &label );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKSTATICBOXH__
// Name: stattext.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
long style = 0, const wxString &name = wxStaticTextNameStr );
wxString GetLabel(void) const;
void SetLabel( const wxString &label );
+
+ // implementation
+
+ void ApplyWidgetStyle();
};
#endif // __GTKSTATICTEXTH__
// Name: tbargtk.h
// Purpose: GTK toolbar
// Author: Robert Roebling
-// Modified by:
-// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
wxTextCtrl& operator<<(const char c);
void SetFont( const wxFont &font );
- virtual void SetBackgroundColour(const wxColour &colour);
+ void SetForegroundColour(const wxColour &colour);
+ void SetBackgroundColour(const wxColour &colour);
// implementation
GtkWidget* GetConnectWidget(void);
bool IsOwnGtkWindow( GdkWindow *window );
+ void ApplyWidgetStyle();
private:
// Name: timer.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Name: win_gtk.h
// Purpose: wxWindows's GTK base widget
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////// */
// Name: window.h
// Purpose:
// Author: Robert Roebling
-// Created: 01/02/97
-// Id:
-// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id: $Id$
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
- GtkStyle *GetWidgetStyle();
+ GtkStyle *GetWidgetStyle();
+ void SetWidgetStyle();
+ virtual void ApplyWidgetStyle();
wxWindow *m_parent;
wxList m_children;
#include "icons/list.xpm"
#include "icons/radio.xpm"
#include "icons/text.xpm"
-#include "icons/stattext.xpm"
+#include "icons/gauge.xpm"
#endif
//----------------------------------------------------------------------
wxChoice *m_choice;
wxComboBox *m_combo;
wxRadioBox *m_radio;
+ wxGauge *m_gauge;
+ wxSlider *m_slider;
wxButton *m_fontButton;
wxTextCtrl *m_text;
const ID_SET_FONT = 170;
+const ID_GAUGE = 180;
+const ID_SLIDER = 181;
+
+
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
EVT_SIZE ( MyPanel::OnSize)
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, MyPanel::OnPageChanged)
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
{
- SetBackgroundColour("cadet blue");
+// SetBackgroundColour("cadet blue");
m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
m_text->SetBackgroundColour("wheat");
// image ids and names
enum
{
- Image_List, Image_Choice, Image_Combo, Image_Text, Image_Radio, Image_Static, Image_Max
+ Image_List, Image_Choice, Image_Combo, Image_Text, Image_Radio, Image_Gauge, Image_Max
};
// fill the image list
#ifdef __WXMSW__
const char *aIconNames[] =
{
- "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "stattext.xpm"
+ "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "gauge.txt"
};
wxASSERT( WXSIZEOF(aIconNames) == Image_Max ); // keep in sync
imagelist-> Add( wxBitmap( combo_xpm ));
imagelist-> Add( wxBitmap( text_xpm ));
imagelist-> Add( wxBitmap( radio_xpm ));
- imagelist-> Add( wxBitmap( stattext_xpm ));
+ imagelist-> Add( wxBitmap( gauge_xpm ));
#endif
wxButton *button = (wxButton*)NULL;
m_notebook->SetImageList(imagelist);
m_notebook->SetBackgroundColour("cadet blue");
- wxPanel *panel = new wxPanel(m_notebook);
+ wxPanel *panel = (wxPanel*) NULL;
+ panel = new wxPanel(m_notebook);
panel->SetBackgroundColour("cadet blue");
+ panel->SetForegroundColour("blue");
m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
m_listbox->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
m_notebook->AddPage(panel, "wxList", FALSE, Image_List);
panel = new wxPanel(m_notebook);
- panel->SetBackgroundColour("cadet blue");
+// panel->SetBackgroundColour("cadet blue");
+// panel->SetForegroundColour("blue");
m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
m_choice->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
panel = new wxPanel(m_notebook);
- panel->SetBackgroundColour("cadet blue");
+// panel->SetBackgroundColour("cadet blue");
+// panel->SetForegroundColour("blue");
m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
- m_combo->SetBackgroundColour("wheat");
+// m_combo->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
m_notebook->AddPage(panel, "wxComboBox", FALSE, Image_Combo);
panel = new wxPanel(m_notebook);
- panel->SetBackgroundColour("cadet blue");
+// panel->SetBackgroundColour("cadet blue");
+// panel->SetForegroundColour("blue");
wxTextCtrl *tc = new wxTextCtrl( panel, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(350,28));
- tc->SetBackgroundColour("wheat");
+// tc->SetBackgroundColour("wheat");
tc = new wxTextCtrl( panel, ID_TEXT, "And here.", wxPoint(10,50), wxSize(350,160), wxTE_MULTILINE );
- tc->SetBackgroundColour("wheat");
+// tc->SetBackgroundColour("wheat");
m_notebook->AddPage(panel, "wxTextCtrl" , FALSE, Image_Text);
wxString choices2[] =
};
panel = new wxPanel(m_notebook);
- panel->SetBackgroundColour("cadet blue");
+// panel->SetBackgroundColour("cadet blue");
+// panel->SetForegroundColour("blue");
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "That", wxPoint(10,160), wxSize(-1,-1), 2, choices2, 1, wxRA_HORIZONTAL );
- m_radio->SetBackgroundColour("wheat");
+// m_radio->SetBackgroundColour("wheat");
m_radio = new wxRadioBox( panel, ID_RADIOBOX, "This", wxPoint(10,10), wxSize(-1,-1), 5, choices, 1, wxRA_VERTICAL );
- m_radio->SetBackgroundColour("wheat");
+// m_radio->SetBackgroundColour("wheat");
(void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_RADIOBOX_SEL_STR, "Select 'This'", wxPoint(180,80), wxSize(140,30) );
(void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(180,130), wxSize(140,30) );
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
panel = new wxPanel(m_notebook);
- panel->SetBackgroundColour("cadet blue");
- (void)new wxStaticBox( panel, -1, "StaticBox", wxPoint(10,10), wxSize(160,130) );
- m_notebook->AddPage(panel, "wxStaticBox", FALSE, Image_Static);
+// panel->SetBackgroundColour("cadet blue");
+// panel->SetForegroundColour("blue");
+ (void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
+ m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155,-1) );
+// m_gauge->SetBackgroundColour("wheat");
+ m_slider = new wxSlider( panel, -1, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
+// m_slider->SetBackgroundColour("wheat");
+ m_notebook->AddPage(panel, "wxGauge", FALSE, Image_Gauge);
}
void MyPanel::OnSize( wxSizeEvent& WXUNUSED(event) )
generic/splitter.cpp \
generic/statusbr.cpp \
generic/tabg.cpp \
- generic/textdlgg.cpp
-
+ generic/textdlgg.cpp
LIB_C_SRC=\
common/extended.c \
gtk_pixmap_set( g_pixmap, m_bitmap.GetPixmap(), mask );
}
+void wxBitmapButton::ApplyWidgetStyle()
+{
+}
+
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxButton::SetFont( const wxFont &font )
+void wxButton::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetFont( font );
-
- gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
-}
-
-void wxButton::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
+ SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
-}
-
-void wxButton::SetForegroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetForegroundColour( colour );
-
- if (!m_foregroundColour.Ok()) return;
-
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
SetLabel( label );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxCheckBox::SetFont( const wxFont &font )
+void wxCheckBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid checkbox" );
-
- wxControl::SetFont( font );
-
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-void wxCheckBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid checkbox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
for (int i = 0; i < n; i++)
{
GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
- gtk_signal_connect( GTK_OBJECT( item ), "activate",
- GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
-
gtk_menu_append( GTK_MENU(menu), item );
- gtk_widget_show( item );
gtk_widget_realize( item );
gtk_widget_realize( GTK_BIN(item)->child );
+
+ gtk_widget_show( item );
+
+ gtk_signal_connect( GTK_OBJECT( item ), "activate",
+ GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
}
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_realize( menu_item );
gtk_widget_realize( GTK_BIN(menu_item)->child );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( menu_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN(menu_item)->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT( menu_item ), "activate",
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
if (n != -1) SetSelection( n );
}
-void wxChoice::SetFont( const wxFont &font )
+void wxChoice::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
-
- wxControl::SetFont( font );
-
- GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
- GList *child = menu_shell->children;
- while (child)
- {
- GtkBin *bin = GTK_BIN( child->data );
- GtkWidget *label = (GtkWidget *) NULL;
- if (bin->child) label = bin->child;
- if (!label) label = GTK_BUTTON(m_widget)->child;
-
- gtk_widget_set_style( label, GetWidgetStyle() );
-
- child = child->next;
- }
-}
-
-void wxChoice::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
+ SetWidgetStyle();
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
while (child)
{
gtk_widget_set_style( GTK_WIDGET( child->data ), m_widgetStyle );
+
+ GtkBin *bin = GTK_BIN( child->data );
+ GtkWidget *label = (GtkWidget *) NULL;
+ if (bin->child) label = bin->child;
+ if (!label) label = GTK_BUTTON(m_widget)->child;
+
+ gtk_widget_set_style( label, m_widgetStyle );
+
child = child->next;
}
}
-
-
gtk_widget_realize( GTK_COMBO(m_widget)->button );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
GtkWidget *list_item = gtk_list_item_new_with_label( item );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( list_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN( list_item )->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
gtk_widget_set_usize( GTK_COMBO(m_widget)->button, w, m_height );
}
-void wxComboBox::SetFont( const wxFont &font )
+void wxComboBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ SetWidgetStyle();
- wxWindow::SetFont( font );
-
+ gtk_widget_set_style( GTK_COMBO(m_widget)->button, m_widgetStyle );
gtk_widget_set_style( GTK_COMBO(m_widget)->entry, m_widgetStyle );
+ gtk_widget_set_style( GTK_COMBO(m_widget)->list, m_widgetStyle );
GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
-
GList *child = list->children;
while (child)
{
- GtkBin *bin = (GtkBin*) child->data;
-
+ gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
+
+ GtkBin *bin = GTK_BIN(child->data);
gtk_widget_set_style( bin->child, m_widgetStyle );
child = child->next;
return ( (window == GTK_ENTRY( GTK_COMBO(m_widget)->entry )->text_area) ||
(window == GTK_COMBO(m_widget)->button->window ) );
}
-
-void wxComboBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
-// gtk_widget_set_style( m_widget, m_widgetStyle );
-
- gtk_widget_set_style( GTK_COMBO(m_widget)->button, m_widgetStyle );
- gtk_widget_set_style( GTK_COMBO(m_widget)->entry, m_widgetStyle );
- gtk_widget_set_style( GTK_COMBO(m_widget)->list, m_widgetStyle );
-
- GList *child = GTK_LIST( GTK_COMBO(m_widget)->list )->children;
- while (child)
- {
- gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
-
- child = child->next;
- }
-}
-
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
-
-
}
else
{
- font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
- M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+ if ((int_scale == 100) &&
+ (M_FONTDATA->m_style == wxSWISS) &&
+ (M_FONTDATA->m_pointSize == 12) &&
+ (M_FONTDATA->m_weight == wxNORMAL) &&
+ (M_FONTDATA->m_underlined == FALSE) &&
+ (M_FONTDATA->m_style == wxNORMAL))
+ {
+ font = gdk_font_load( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
+ }
+ else
+ {
+ font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
+ M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+ }
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
}
if (!font)
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
-
return m_gaugePos;
}
+void wxGauge::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
gtk_widget_realize( GTK_WIDGET(m_list) );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
GtkWidget *list_item = gtk_list_item_new_with_label( item );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( list_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN( list_item )->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
return FALSE;
}
-void wxListBox::SetFont( const wxFont &font )
+void wxListBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
-
- wxControl::SetFont( font );
-
- GList *child = m_list->children;
- while (child)
- {
- gtk_widget_set_style( GTK_BIN(child->data)->child, m_widgetStyle );
- child = child->next;
- }
-}
-
-void wxListBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
+ SetWidgetStyle();
GdkWindow *window = GTK_WIDGET(m_list)->window;
m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
GList *child = m_list->children;
while (child)
{
+ gtk_widget_set_style( GTK_BIN(child->data)->child, m_widgetStyle );
gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
child = child->next;
}
}
-
return TRUE;
}
-void wxNotebook::SetFont( const wxFont &font )
+void wxNotebook::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
-
- wxControl::SetFont( font );
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
-
-void wxNotebook::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
+ SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
SetLabel( title );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
}
-void wxRadioBox::SetFont( const wxFont &font )
+void wxRadioBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ SetWidgetStyle();
- wxControl::SetFont( font );
-
gtk_widget_set_style( m_widget, m_widgetStyle );
wxNode *node = m_boxes.First();
while (node)
{
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkWidget *widget = GTK_WIDGET( node->Data() );
+ gtk_widget_set_style( widget, m_widgetStyle );
+ GtkButton *button = GTK_BUTTON( node->Data() );
gtk_widget_set_style( button->child, m_widgetStyle );
node = node->Next();
}
}
-void wxRadioBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-
- wxNode *node = m_boxes.First();
- while (node)
- {
- GtkWidget *button = GTK_WIDGET( node->Data() );
-
- gtk_widget_set_style( button, m_widgetStyle );
-
- node = node->Next();
- }
-}
-
bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
{
if (window == m_widget->window) return TRUE;
PostCreation();
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxRadioButton::SetFont( const wxFont &font )
+void wxRadioButton::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
-
- wxControl::SetFont( font );
-
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-void wxRadioButton::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
(window == range->step_forw) ||
(window == range->step_back) );
}
+
+void wxScrollBar::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
case wxSYS_DEFAULT_GUI_FONT:
{
if (!g_systemFont)
- g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
+ g_systemFont = new wxFont( 10, wxSWISS, wxNORMAL, wxNORMAL );
return *g_systemFont;
}
}
else
m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
+ gtk_scale_set_draw_value( GTK_SCALE( m_widget ), FALSE );
+
m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) );
gtk_signal_connect (GTK_OBJECT (m_adjust), "value_changed",
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
return 0;
}
-// not supported in wxGTK (and GTK)
-
-void wxSlider::GetSize( int *x, int *y ) const
-{
- wxWindow::GetSize( x, y );
-}
-
-void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
-{
- wxWindow::SetSize( x, y, width, height, sizeFlags );
-}
-
-void wxSlider::GetPosition( int *x, int *y ) const
-{
- wxWindow::GetPosition( x, y );
-}
-
void wxSlider::SetTick( int WXUNUSED(tickPos) )
{
}
(window == range->step_back) );
}
-
+void wxSlider::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
wxStaticBitmap::wxStaticBitmap(void)
{
-};
+}
wxStaticBitmap::wxStaticBitmap( 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 );
-};
+}
bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
-};
+}
void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
{
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
-};
-
+}
SetLabel(label);
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
GtkFrame *frame = GTK_FRAME( m_widget );
gtk_frame_set_label( frame, GetLabel() );
}
+
+void wxStaticBox::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
PostCreation();
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
gtk_label_set( GTK_LABEL(m_widget), m_label );
}
+
+void wxStaticText::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
Show( TRUE );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
return TRUE;
}
return (window == GTK_ENTRY(m_text)->text_area);
}
-void wxTextCtrl::SetFont( const wxFont &font )
+void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
- wxControl::SetFont( font );
+ // doesn't work
+}
+
+void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
+{
+ wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
// doesn't work
}
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
+}
+
+void wxTextCtrl::ApplyWidgetStyle()
+{
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ }
else
{
+ SetWidgetStyle();
gtk_widget_set_style( m_text, m_widgetStyle );
}
}
m_cursor = new wxCursor( wxCURSOR_ARROW );
m_font = *wxSWISS_FONT;
// m_backgroundColour = wxWHITE;
- m_foregroundColour = wxBLACK;
+// m_foregroundColour = wxBLACK;
m_windowStyle = style;
m_windowName = name;
m_constraints = (wxLayoutConstraints *) NULL;
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
- else
- {
- GtkStyle *style = GetWidgetStyle();
- m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
- style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
- }
+
+ ApplyWidgetStyle();
}
wxColour wxWindow::GetForegroundColour() const
m_foregroundColour = colour;
if (!m_foregroundColour.Ok()) return;
- if (!m_wxwindow)
+ ApplyWidgetStyle();
+}
+
+GtkStyle *wxWindow::GetWidgetStyle()
+{
+ if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
+
+ m_widgetStyle =
+ gtk_style_copy(
+ gtk_widget_get_style( m_widget ) );
+
+ return m_widgetStyle;
+}
+
+void wxWindow::SetWidgetStyle()
+{
+ GtkStyle *style = GetWidgetStyle();
+
+ gdk_font_unref( style->font );
+ style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+
+ if (m_foregroundColour.Ok())
{
- GtkStyle *style = GetWidgetStyle();
m_foregroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
style->fg[GTK_STATE_NORMAL] = *m_foregroundColour.GetColor();
style->fg[GTK_STATE_PRELIGHT] = *m_foregroundColour.GetColor();
style->fg[GTK_STATE_ACTIVE] = *m_foregroundColour.GetColor();
}
+
+ if (m_backgroundColour.Ok())
+ {
+ m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+ style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
+ }
}
-GtkStyle *wxWindow::GetWidgetStyle()
+void wxWindow::ApplyWidgetStyle()
{
- if (!m_widgetStyle)
- m_widgetStyle =
- gtk_style_copy(
- gtk_widget_get_style( m_widget ) );
- return m_widgetStyle;
}
bool wxWindow::Validate()
m_font = font;
else
m_font = *wxSWISS_FONT;
-
- GtkStyle *style = GetWidgetStyle();
- gdk_font_unref( style->font );
- style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+
+ ApplyWidgetStyle();
}
wxFont *wxWindow::GetFont()
gtk_pixmap_set( g_pixmap, m_bitmap.GetPixmap(), mask );
}
+void wxBitmapButton::ApplyWidgetStyle()
+{
+}
+
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxButton::SetFont( const wxFont &font )
+void wxButton::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetFont( font );
-
- gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
-}
-
-void wxButton::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
+ SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
-}
-
-void wxButton::SetForegroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
-
- wxControl::SetForegroundColour( colour );
-
- if (!m_foregroundColour.Ok()) return;
-
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
SetLabel( label );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxCheckBox::SetFont( const wxFont &font )
+void wxCheckBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid checkbox" );
-
- wxControl::SetFont( font );
-
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-void wxCheckBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid checkbox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
for (int i = 0; i < n; i++)
{
GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
- gtk_signal_connect( GTK_OBJECT( item ), "activate",
- GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
-
gtk_menu_append( GTK_MENU(menu), item );
- gtk_widget_show( item );
gtk_widget_realize( item );
gtk_widget_realize( GTK_BIN(item)->child );
+
+ gtk_widget_show( item );
+
+ gtk_signal_connect( GTK_OBJECT( item ), "activate",
+ GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
}
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
gtk_widget_realize( menu_item );
gtk_widget_realize( GTK_BIN(menu_item)->child );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( menu_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN(menu_item)->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT( menu_item ), "activate",
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
if (n != -1) SetSelection( n );
}
-void wxChoice::SetFont( const wxFont &font )
+void wxChoice::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
-
- wxControl::SetFont( font );
-
- GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
- GList *child = menu_shell->children;
- while (child)
- {
- GtkBin *bin = GTK_BIN( child->data );
- GtkWidget *label = (GtkWidget *) NULL;
- if (bin->child) label = bin->child;
- if (!label) label = GTK_BUTTON(m_widget)->child;
-
- gtk_widget_set_style( label, GetWidgetStyle() );
-
- child = child->next;
- }
-}
-
-void wxChoice::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
+ SetWidgetStyle();
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
while (child)
{
gtk_widget_set_style( GTK_WIDGET( child->data ), m_widgetStyle );
+
+ GtkBin *bin = GTK_BIN( child->data );
+ GtkWidget *label = (GtkWidget *) NULL;
+ if (bin->child) label = bin->child;
+ if (!label) label = GTK_BUTTON(m_widget)->child;
+
+ gtk_widget_set_style( label, m_widgetStyle );
+
child = child->next;
}
}
-
-
gtk_widget_realize( GTK_COMBO(m_widget)->button );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
GtkWidget *list_item = gtk_list_item_new_with_label( item );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( list_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN( list_item )->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
gtk_widget_set_usize( GTK_COMBO(m_widget)->button, w, m_height );
}
-void wxComboBox::SetFont( const wxFont &font )
+void wxComboBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ SetWidgetStyle();
- wxWindow::SetFont( font );
-
+ gtk_widget_set_style( GTK_COMBO(m_widget)->button, m_widgetStyle );
gtk_widget_set_style( GTK_COMBO(m_widget)->entry, m_widgetStyle );
+ gtk_widget_set_style( GTK_COMBO(m_widget)->list, m_widgetStyle );
GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
-
GList *child = list->children;
while (child)
{
- GtkBin *bin = (GtkBin*) child->data;
-
+ gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
+
+ GtkBin *bin = GTK_BIN(child->data);
gtk_widget_set_style( bin->child, m_widgetStyle );
child = child->next;
return ( (window == GTK_ENTRY( GTK_COMBO(m_widget)->entry )->text_area) ||
(window == GTK_COMBO(m_widget)->button->window ) );
}
-
-void wxComboBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
-// gtk_widget_set_style( m_widget, m_widgetStyle );
-
- gtk_widget_set_style( GTK_COMBO(m_widget)->button, m_widgetStyle );
- gtk_widget_set_style( GTK_COMBO(m_widget)->entry, m_widgetStyle );
- gtk_widget_set_style( GTK_COMBO(m_widget)->list, m_widgetStyle );
-
- GList *child = GTK_LIST( GTK_COMBO(m_widget)->list )->children;
- while (child)
- {
- gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
-
- child = child->next;
- }
-}
-
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
-
-
}
else
{
- font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
- M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+ if ((int_scale == 100) &&
+ (M_FONTDATA->m_style == wxSWISS) &&
+ (M_FONTDATA->m_pointSize == 12) &&
+ (M_FONTDATA->m_weight == wxNORMAL) &&
+ (M_FONTDATA->m_underlined == FALSE) &&
+ (M_FONTDATA->m_style == wxNORMAL))
+ {
+ font = gdk_font_load( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
+ }
+ else
+ {
+ font = wxLoadQueryNearestFont( point_scale, M_FONTDATA->m_fontId, M_FONTDATA->m_style,
+ M_FONTDATA->m_weight, M_FONTDATA->m_underlined );
+ }
M_FONTDATA->m_scaled_xfonts.Append( int_scale, (wxObject*)font );
}
if (!font)
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
-
return m_gaugePos;
}
+void wxGauge::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
gtk_widget_realize( GTK_WIDGET(m_list) );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
GtkWidget *list_item = gtk_list_item_new_with_label( item );
- if (m_widgetStyle)
- {
- gtk_widget_set_style( list_item, m_widgetStyle );
- gtk_widget_set_style( GTK_BIN( list_item )->child, m_widgetStyle );
- }
+ if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
return FALSE;
}
-void wxListBox::SetFont( const wxFont &font )
+void wxListBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
-
- wxControl::SetFont( font );
-
- GList *child = m_list->children;
- while (child)
- {
- gtk_widget_set_style( GTK_BIN(child->data)->child, m_widgetStyle );
- child = child->next;
- }
-}
-
-void wxListBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
+ SetWidgetStyle();
GdkWindow *window = GTK_WIDGET(m_list)->window;
m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
GList *child = m_list->children;
while (child)
{
+ gtk_widget_set_style( GTK_BIN(child->data)->child, m_widgetStyle );
gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
child = child->next;
}
}
-
return TRUE;
}
-void wxNotebook::SetFont( const wxFont &font )
+void wxNotebook::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
-
- wxControl::SetFont( font );
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
-
-void wxNotebook::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid notebook" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
+ SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}
SetLabel( title );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
wxFAIL_MSG("wxRadioBox::SetNumberOfRowsOrCols not implemented.");
}
-void wxRadioBox::SetFont( const wxFont &font )
+void wxRadioBox::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
+ SetWidgetStyle();
- wxControl::SetFont( font );
-
gtk_widget_set_style( m_widget, m_widgetStyle );
wxNode *node = m_boxes.First();
while (node)
{
- GtkButton *button = GTK_BUTTON( node->Data() );
+ GtkWidget *widget = GTK_WIDGET( node->Data() );
+ gtk_widget_set_style( widget, m_widgetStyle );
+ GtkButton *button = GTK_BUTTON( node->Data() );
gtk_widget_set_style( button->child, m_widgetStyle );
node = node->Next();
}
}
-void wxRadioBox::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid radiobox" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-
- wxNode *node = m_boxes.First();
- while (node)
- {
- GtkWidget *button = GTK_WIDGET( node->Data() );
-
- gtk_widget_set_style( button, m_widgetStyle );
-
- node = node->Next();
- }
-}
-
bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
{
if (window == m_widget->window) return TRUE;
PostCreation();
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
gtk_widget_set_sensitive( GTK_BUTTON(m_widget)->child, enable );
}
-void wxRadioButton::SetFont( const wxFont &font )
+void wxRadioButton::ApplyWidgetStyle()
{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
-
- wxControl::SetFont( font );
-
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_BUTTON(m_widget)->child, m_widgetStyle );
}
-void wxRadioButton::SetBackgroundColour( const wxColour &colour )
-{
- wxCHECK_RET( m_widget != NULL, "invalid radiobutton" );
-
- wxControl::SetBackgroundColour( colour );
-
- if (!m_backgroundColour.Ok()) return;
-
- gtk_widget_set_style( m_widget, m_widgetStyle );
-}
(window == range->step_forw) ||
(window == range->step_back) );
}
+
+void wxScrollBar::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
case wxSYS_DEFAULT_GUI_FONT:
{
if (!g_systemFont)
- g_systemFont = new wxFont( "-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*" );
+ g_systemFont = new wxFont( 10, wxSWISS, wxNORMAL, wxNORMAL );
return *g_systemFont;
}
}
else
m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
+ gtk_scale_set_draw_value( GTK_SCALE( m_widget ), FALSE );
+
m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) );
gtk_signal_connect (GTK_OBJECT (m_adjust), "value_changed",
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
return 0;
}
-// not supported in wxGTK (and GTK)
-
-void wxSlider::GetSize( int *x, int *y ) const
-{
- wxWindow::GetSize( x, y );
-}
-
-void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
-{
- wxWindow::SetSize( x, y, width, height, sizeFlags );
-}
-
-void wxSlider::GetPosition( int *x, int *y ) const
-{
- wxWindow::GetPosition( x, y );
-}
-
void wxSlider::SetTick( int WXUNUSED(tickPos) )
{
}
(window == range->step_back) );
}
-
+void wxSlider::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
wxStaticBitmap::wxStaticBitmap(void)
{
-};
+}
wxStaticBitmap::wxStaticBitmap( 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 );
-};
+}
bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
-};
+}
void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
{
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
-};
-
+}
SetLabel(label);
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
GtkFrame *frame = GTK_FRAME( m_widget );
gtk_frame_set_label( frame, GetLabel() );
}
+
+void wxStaticBox::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
PostCreation();
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
+
Show( TRUE );
return TRUE;
gtk_label_set( GTK_LABEL(m_widget), m_label );
}
+
+void wxStaticText::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+}
+
Show( TRUE );
SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
return TRUE;
}
return (window == GTK_ENTRY(m_text)->text_area);
}
-void wxTextCtrl::SetFont( const wxFont &font )
+void wxTextCtrl::SetFont( const wxFont &WXUNUSED(font) )
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
- wxControl::SetFont( font );
+ // doesn't work
+}
+
+void wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
+{
+ wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
// doesn't work
}
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
+}
+
+void wxTextCtrl::ApplyWidgetStyle()
+{
+ if (m_windowStyle & wxTE_MULTILINE)
+ {
+ }
else
{
+ SetWidgetStyle();
gtk_widget_set_style( m_text, m_widgetStyle );
}
}
m_cursor = new wxCursor( wxCURSOR_ARROW );
m_font = *wxSWISS_FONT;
// m_backgroundColour = wxWHITE;
- m_foregroundColour = wxBLACK;
+// m_foregroundColour = wxBLACK;
m_windowStyle = style;
m_windowName = name;
m_constraints = (wxLayoutConstraints *) NULL;
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
- else
- {
- GtkStyle *style = GetWidgetStyle();
- m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
- style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
- style->bg[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
- style->base[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
- }
+
+ ApplyWidgetStyle();
}
wxColour wxWindow::GetForegroundColour() const
m_foregroundColour = colour;
if (!m_foregroundColour.Ok()) return;
- if (!m_wxwindow)
+ ApplyWidgetStyle();
+}
+
+GtkStyle *wxWindow::GetWidgetStyle()
+{
+ if (m_widgetStyle) gtk_style_unref( m_widgetStyle );
+
+ m_widgetStyle =
+ gtk_style_copy(
+ gtk_widget_get_style( m_widget ) );
+
+ return m_widgetStyle;
+}
+
+void wxWindow::SetWidgetStyle()
+{
+ GtkStyle *style = GetWidgetStyle();
+
+ gdk_font_unref( style->font );
+ style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+
+ if (m_foregroundColour.Ok())
{
- GtkStyle *style = GetWidgetStyle();
m_foregroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
style->fg[GTK_STATE_NORMAL] = *m_foregroundColour.GetColor();
style->fg[GTK_STATE_PRELIGHT] = *m_foregroundColour.GetColor();
style->fg[GTK_STATE_ACTIVE] = *m_foregroundColour.GetColor();
}
+
+ if (m_backgroundColour.Ok())
+ {
+ m_backgroundColour.CalcPixel( gdk_window_get_colormap( m_widget->window ) );
+ style->bg[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_NORMAL] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_PRELIGHT] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_ACTIVE] = *m_backgroundColour.GetColor();
+ style->bg[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
+ style->base[GTK_STATE_INSENSITIVE] = *m_backgroundColour.GetColor();
+ }
}
-GtkStyle *wxWindow::GetWidgetStyle()
+void wxWindow::ApplyWidgetStyle()
{
- if (!m_widgetStyle)
- m_widgetStyle =
- gtk_style_copy(
- gtk_widget_get_style( m_widget ) );
- return m_widgetStyle;
}
bool wxWindow::Validate()
m_font = font;
else
m_font = *wxSWISS_FONT;
-
- GtkStyle *style = GetWidgetStyle();
- gdk_font_unref( style->font );
- style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+
+ ApplyWidgetStyle();
}
wxFont *wxWindow::GetFont()