Big color update with the newest information

from the GTK+ hot-line, eh mail-list. The news
  is that they don't know what they do.

  Conversion from 12pt, wxSWISS, wxNORMAL, wxNORMAL to
  GTK+ system font

  Probably some other things


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1998-10-29 18:03:18 +00:00
parent 3ebf240158
commit 58614078c4
114 changed files with 631 additions and 780 deletions

4
configure vendored
View File

@ -5977,7 +5977,7 @@ else
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=""
@ -6041,7 +6041,7 @@ fi
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

View File

@ -1000,10 +1000,10 @@ GUI_TK_LINK=
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

View File

@ -35,38 +35,50 @@ for newest information.
-----------------------
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.
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:
Thread 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.
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.
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
-----------------------------

View File

@ -16,12 +16,6 @@ wxHelpController
Fix printing of bitmaps
-> No idea.
Add support SetForegroundColour in GTK widgets
-> On the way.
wxBitmapCheckBox
-> Interface same as checkbox?
wxImage
-> 24-bit support

View File

@ -64,7 +64,7 @@ public:
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);

View File

@ -63,6 +63,10 @@ class wxBitmapButton: public wxControl
virtual void SetBitmapLabel( const wxBitmap& bitmap );
wxBitmap& GetBitmapLabel(void) const { return (wxBitmap&) m_bitmap; }
// implementation
void ApplyWidgetStyle();
public:
wxBitmap m_bitmap;

View File

@ -59,9 +59,11 @@ class wxButton: public wxControl
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__

View File

@ -60,9 +60,12 @@ class wxCheckBox: public wxControl
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__

View File

@ -73,9 +73,9 @@ class wxChoice: public wxControl
void SetSelection( int n );
void SetStringSelection( const wxString &string );
void SetFont( const wxFont &font );
void SetBackgroundColour( const wxColour &colour );
// implementation
void ApplyWidgetStyle();
};
#endif // __GTKCHOICEH__

View File

@ -93,20 +93,16 @@ class wxComboBox: public wxControl
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()
};

View File

@ -3,8 +3,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,7 +2,7 @@
// 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
///////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,8 +2,7 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -99,7 +98,10 @@ public:
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:

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -72,9 +71,11 @@ class wxGauge: public wxControl
// 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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -83,18 +82,15 @@ class wxListBox: public wxControl
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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -80,7 +79,7 @@ class wxMDIParentFrame: public wxFrame
void OnActivate( wxActivateEvent& event );
void OnSysColourChanged( wxSysColourChangedEvent& event );
//private:
// implementation
wxMDIChildFrame *m_currentChild;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -138,13 +138,12 @@ public:
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

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -80,13 +79,12 @@ class wxRadioBox: public wxControl
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;

View File

@ -60,9 +60,11 @@ class wxRadioButton: public wxControl
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__

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -67,7 +66,8 @@ class wxScrollBar: public wxControl
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;
@ -80,6 +80,7 @@ class wxScrollBar: public wxControl
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,8 +2,7 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -63,9 +62,6 @@ class wxSlider: public wxControl
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;
@ -87,6 +83,7 @@ class wxSlider: public wxControl
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -51,7 +50,7 @@ class wxStaticBitmap: public wxControl
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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -51,6 +50,10 @@ class wxStaticBox: public wxControl
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__

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -52,6 +51,10 @@ class wxStaticText: public wxControl
long style = 0, const wxString &name = wxStaticTextNameStr );
wxString GetLabel(void) const;
void SetLabel( const wxString &label );
// implementation
void ApplyWidgetStyle();
};
#endif // __GTKSTATICTEXTH__

View File

@ -2,8 +2,6 @@
// 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

View File

@ -101,12 +101,14 @@ class wxTextCtrl: public wxControl, public streambuf
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:

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////// */

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -243,7 +242,9 @@ public:
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
GtkStyle *GetWidgetStyle();
GtkStyle *GetWidgetStyle();
void SetWidgetStyle();
virtual void ApplyWidgetStyle();
wxWindow *m_parent;
wxList m_children;

View File

@ -63,6 +63,10 @@ class wxBitmapButton: public wxControl
virtual void SetBitmapLabel( const wxBitmap& bitmap );
wxBitmap& GetBitmapLabel(void) const { return (wxBitmap&) m_bitmap; }
// implementation
void ApplyWidgetStyle();
public:
wxBitmap m_bitmap;

View File

@ -59,9 +59,11 @@ class wxButton: public wxControl
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__

View File

@ -60,9 +60,12 @@ class wxCheckBox: public wxControl
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__

View File

@ -73,9 +73,9 @@ class wxChoice: public wxControl
void SetSelection( int n );
void SetStringSelection( const wxString &string );
void SetFont( const wxFont &font );
void SetBackgroundColour( const wxColour &colour );
// implementation
void ApplyWidgetStyle();
};
#endif // __GTKCHOICEH__

View File

@ -93,20 +93,16 @@ class wxComboBox: public wxControl
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()
};

View File

@ -3,8 +3,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,7 +2,7 @@
// 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
///////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,8 +2,7 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -99,7 +98,10 @@ public:
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:

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -72,9 +71,11 @@ class wxGauge: public wxControl
// 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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -83,18 +82,15 @@ class wxListBox: public wxControl
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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -80,7 +79,7 @@ class wxMDIParentFrame: public wxFrame
void OnActivate( wxActivateEvent& event );
void OnSysColourChanged( wxSysColourChangedEvent& event );
//private:
// implementation
wxMDIChildFrame *m_currentChild;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -138,13 +138,12 @@ public:
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

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -80,13 +79,12 @@ class wxRadioBox: public wxControl
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;

View File

@ -60,9 +60,11 @@ class wxRadioButton: public wxControl
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__

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -67,7 +66,8 @@ class wxScrollBar: public wxControl
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;
@ -80,6 +80,7 @@ class wxScrollBar: public wxControl
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,8 +2,7 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -63,9 +62,6 @@ class wxSlider: public wxControl
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;
@ -87,6 +83,7 @@ class wxSlider: public wxControl
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
GtkAdjustment *m_adjust;
float m_oldPos;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -51,7 +50,7 @@ class wxStaticBitmap: public wxControl
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;

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -51,6 +50,10 @@ class wxStaticBox: public wxControl
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__

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -52,6 +51,10 @@ class wxStaticText: public wxControl
long style = 0, const wxString &name = wxStaticTextNameStr );
wxString GetLabel(void) const;
void SetLabel( const wxString &label );
// implementation
void ApplyWidgetStyle();
};
#endif // __GTKSTATICTEXTH__

View File

@ -2,8 +2,6 @@
// 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

View File

@ -101,12 +101,14 @@ class wxTextCtrl: public wxControl, public streambuf
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:

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////// */

View File

@ -2,9 +2,8 @@
// 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
/////////////////////////////////////////////////////////////////////////////
@ -243,7 +242,9 @@ public:
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
GtkStyle *GetWidgetStyle();
GtkStyle *GetWidgetStyle();
void SetWidgetStyle();
virtual void ApplyWidgetStyle();
wxWindow *m_parent;
wxList m_children;

View File

@ -33,7 +33,7 @@
#include "icons/list.xpm"
#include "icons/radio.xpm"
#include "icons/text.xpm"
#include "icons/stattext.xpm"
#include "icons/gauge.xpm"
#endif
//----------------------------------------------------------------------
@ -69,6 +69,8 @@ class MyPanel: public wxPanel
wxChoice *m_choice;
wxComboBox *m_combo;
wxRadioBox *m_radio;
wxGauge *m_gauge;
wxSlider *m_slider;
wxButton *m_fontButton;
wxTextCtrl *m_text;
@ -176,6 +178,10 @@ const ID_RADIOBOX_ENABLE = 164;
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)
@ -214,7 +220,7 @@ END_EVENT_TABLE()
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");
@ -233,14 +239,14 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
// 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
@ -260,7 +266,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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;
@ -268,8 +274,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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) );
@ -283,7 +291,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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) );
@ -296,9 +305,10 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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) );
@ -309,11 +319,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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[] =
@ -323,11 +334,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
};
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) );
@ -336,9 +348,14 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
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) )

View File

@ -173,3 +173,4 @@ bool wxPanel::SetFocusToNextChild(wxNode *node, bool bForward)
return TRUE;
}

View File

@ -129,8 +129,7 @@ LIB_CPP_SRC=\
generic/splitter.cpp \
generic/statusbr.cpp \
generic/tabg.cpp \
generic/textdlgg.cpp
generic/textdlgg.cpp
LIB_C_SRC=\
common/extended.c \

View File

@ -130,3 +130,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
gtk_pixmap_set( g_pixmap, m_bitmap.GetPixmap(), mask );
}
void wxBitmapButton::ApplyWidgetStyle()
{
}

View File

@ -74,6 +74,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -106,34 +107,10 @@ void wxButton::Enable( bool enable )
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 );
}

View File

@ -72,6 +72,7 @@ bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
SetLabel( label );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -113,23 +114,11 @@ void wxCheckBox::Enable( bool enable )
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 );
}

View File

@ -70,20 +70,22 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
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 );
@ -102,11 +104,7 @@ void wxChoice::Append( const wxString &item )
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 );
@ -259,34 +257,9 @@ void wxChoice::SetStringSelection( const wxString &string )
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) ) );
@ -297,9 +270,15 @@ void wxChoice::SetBackgroundColour( const wxColour &colour )
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;
}
}

View File

@ -104,6 +104,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
gtk_widget_realize( GTK_COMBO(m_widget)->button );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -135,11 +136,7 @@ void wxComboBox::Append( const wxString &item, char *clientData )
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 );
@ -438,21 +435,21 @@ void wxComboBox::OnSize( wxSizeEvent &event )
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;
@ -469,27 +466,3 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
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;
}
}

View File

@ -287,5 +287,3 @@ void wxDialog::SetIcon( const wxIcon &icon )
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}

View File

@ -361,8 +361,20 @@ GdkFont *wxFont::GetInternalFont(float scale) const
}
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)

View File

@ -575,4 +575,3 @@ void wxFrame::SetIcon( const wxIcon &icon )
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}

View File

@ -68,3 +68,9 @@ int wxGauge::GetValue(void) const
return m_gaugePos;
}
void wxGauge::ApplyWidgetStyle()
{
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}

View File

@ -126,6 +126,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
gtk_widget_realize( GTK_WIDGET(m_list) );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -143,11 +144,7 @@ void wxListBox::Append( const wxString &item, char *clientData )
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 );
@ -466,27 +463,9 @@ bool wxListBox::IsOwnGtkWindow( GdkWindow *window )
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 ) );
@ -496,8 +475,8 @@ void wxListBox::SetBackgroundColour( const wxColour &colour )
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;
}
}

View File

@ -456,23 +456,9 @@ bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
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 );
}

View File

@ -164,6 +164,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
SetLabel( title );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -460,46 +461,25 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
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)
{
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;

View File

@ -62,6 +62,9 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
return TRUE;
@ -100,23 +103,11 @@ void wxRadioButton::Enable( bool enable )
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 );
}

View File

@ -261,3 +261,10 @@ bool wxScrollBar::IsOwnGtkWindow( GdkWindow *window )
(window == range->step_forw) ||
(window == range->step_back) );
}
void wxScrollBar::ApplyWidgetStyle()
{
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}

View File

@ -166,7 +166,7 @@ wxFont wxSystemSettings::GetSystemFont( int index )
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;
}
}

View File

@ -90,6 +90,8 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
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",
@ -100,6 +102,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -187,23 +190,6 @@ int wxSlider::GetLineSize(void) const
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) )
{
}
@ -249,4 +235,8 @@ bool wxSlider::IsOwnGtkWindow( GdkWindow *window )
(window == range->step_back) );
}
void wxSlider::ApplyWidgetStyle()
{
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}

View File

@ -21,14 +21,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap,wxControl)
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,
@ -62,7 +62,7 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
Show( TRUE );
return TRUE;
};
}
void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
{
@ -74,5 +74,4 @@ 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 );
}
};
}

View File

@ -44,6 +44,9 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
SetLabel(label);
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
return TRUE;
@ -55,3 +58,10 @@ void wxStaticBox::SetLabel( const wxString &label )
GtkFrame *frame = GTK_FRAME( m_widget );
gtk_frame_set_label( frame, GetLabel() );
}
void wxStaticBox::ApplyWidgetStyle()
{
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}

View File

@ -91,6 +91,9 @@ bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &labe
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
return TRUE;
@ -110,3 +113,10 @@ void wxStaticText::SetLabel( const wxString &label )
gtk_label_set( GTK_LABEL(m_widget), m_label );
}
void wxStaticText::ApplyWidgetStyle()
{
SetWidgetStyle();
gtk_widget_set_style( m_widget, m_widgetStyle );
}

View File

@ -150,6 +150,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
Show( TRUE );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
return TRUE;
}
@ -617,11 +618,16 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
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
}
@ -641,8 +647,16 @@ void wxTextCtrl::SetBackgroundColour( const wxColour &colour )
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 );
}
}

View File

@ -1102,7 +1102,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
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;
@ -1965,19 +1965,8 @@ void wxWindow::SetBackgroundColour( const wxColour &colour )
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
@ -1992,23 +1981,51 @@ void wxWindow::SetForegroundColour( const wxColour &colour )
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()
@ -2172,10 +2189,8 @@ void wxWindow::SetFont( const wxFont &font )
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()

View File

@ -130,3 +130,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
gtk_pixmap_set( g_pixmap, m_bitmap.GetPixmap(), mask );
}
void wxBitmapButton::ApplyWidgetStyle()
{
}

View File

@ -74,6 +74,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
PostCreation();
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -106,34 +107,10 @@ void wxButton::Enable( bool enable )
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 );
}

View File

@ -72,6 +72,7 @@ bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
SetLabel( label );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -113,23 +114,11 @@ void wxCheckBox::Enable( bool enable )
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 );
}

View File

@ -70,20 +70,22 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
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 );
@ -102,11 +104,7 @@ void wxChoice::Append( const wxString &item )
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 );
@ -259,34 +257,9 @@ void wxChoice::SetStringSelection( const wxString &string )
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) ) );
@ -297,9 +270,15 @@ void wxChoice::SetBackgroundColour( const wxColour &colour )
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;
}
}

View File

@ -104,6 +104,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
gtk_widget_realize( GTK_COMBO(m_widget)->button );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
@ -135,11 +136,7 @@ void wxComboBox::Append( const wxString &item, char *clientData )
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 );
@ -438,21 +435,21 @@ void wxComboBox::OnSize( wxSizeEvent &event )
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;
@ -469,27 +466,3 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
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;
}
}

View File

@ -287,5 +287,3 @@ void wxDialog::SetIcon( const wxIcon &icon )
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}

View File

@ -361,8 +361,20 @@ GdkFont *wxFont::GetInternalFont(float scale) const
}
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)

Some files were not shown because too many files have changed in this diff Show More