# This script is creates a dir tree in ~/wxgtk_dist which
# can then be packed into an archive
-echo This script will copy the wxGTK release files into ~/wxgtk_dist
+echo --------
+echo This script will copy the wxGTK release files into ~/wxgtk_dist
+echo --------
+echo
mkdir ~/wxgtk_dist
mkdir ~/wxgtk_dist/wxGTK
cp Makefile.in ~/wxgtk_dist/wxGTK/samples/wxsocket
cp *.cpp ~/wxgtk_dist/wxGTK/samples/wxsocket
cp *.xpm ~/wxgtk_dist/wxGTK/samples/wxsocket
-cd ..
+cd ../..
+echo LOCAL CORRECTCIONS
+cd distrib/gtk
+cp README.txt ~/wxgtk_dist/wxGTK/utils/wxPython
+cp Setup ~/wxgtk_dist/wxGTK/utils/wxPython/src
#if wxUSE_DRAG_AND_DROP
void SetDropTarget( wxDropTarget *dropTarget );
#endif
- void SetToolTip( wxToolTip *tip );
- void SetToolTip( const wxString &tip );
-
// implementation
GtkWidget *GetConnectWidget();
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
+ void ApplyToolTip( GtkTooltips *tips, const char *tip );
GtkList *m_list;
wxList m_clientDataList;
public:
wxToolTip( const wxString &tip );
- ~wxToolTip();
- wxString GetTip();
+ void SetTip( const wxString &tip );
+ wxString GetTip() const;
+ wxWindow *GetWindow() const;
+ bool Ok() const;
- void Enable( bool flag );
- void SetDelay( long msecs );
- bool Ok();
+ static void Enable( bool flag );
+ static void SetDelay( long msecs );
// implementation
wxString m_text;
+ wxWindow *m_window;
- GtkTooltips *m_tooltips;
- GdkColor *m_bg;
- GdkColor *m_fg;
-
- void Create( GtkWidget *tool );
+ void Apply( wxWindow *win );
};
#endif // __GTKTOOLTIPH__
virtual void SetToolTip( const wxString &tip );
virtual void SetToolTip( wxToolTip *tip );
- virtual wxToolTip& GetToolTip();
+ virtual wxToolTip* GetToolTip();
virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
virtual void Clear();
virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed(int x, int y) const;
- virtual bool IsExposed(int x, int y, int w, int h) const;
- virtual bool IsExposed(const wxPoint& pt) const;
- virtual bool IsExposed(const wxRect& rect) const;
+ virtual bool IsExposed( int x, int y ) const;
+ virtual bool IsExposed( int x, int y, int w, int h ) const;
+ virtual bool IsExposed( const wxPoint& pt ) const;
+ virtual bool IsExposed( const wxRect& rect ) const;
virtual wxColour GetBackgroundColour() const;
virtual void SetBackgroundColour( const wxColour &colour );
// implementation
+ virtual wxPoint GetClientAreaOrigin() const;
+ virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+
+ bool HasVMT();
+
+ virtual void OnInternalIdle();
+
+ /* used by all classes in the widget creation process */
+
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
const wxSize &size, long style, const wxString &name );
void PostCreation();
+ /* the methods below are required because many native widgets
+ are composed of several subwidgets and setting a style for
+ the widget means setting it for all subwidgets as well.
+ also, it is nor clear, which native widget is the top
+ widget where (most of) the input goes. even tooltips have
+ to be applied to all subwidgets. */
+
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
- bool HasVMT();
-
- virtual wxPoint GetClientAreaOrigin() const;
- virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
-
GtkStyle *GetWidgetStyle();
void SetWidgetStyle();
virtual void ApplyWidgetStyle();
- virtual void OnInternalIdle();
+ virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+
+ /* private member variables */
wxWindow *m_parent;
wxList m_children;
#if wxUSE_DRAG_AND_DROP
void SetDropTarget( wxDropTarget *dropTarget );
#endif
- void SetToolTip( wxToolTip *tip );
- void SetToolTip( const wxString &tip );
-
// implementation
GtkWidget *GetConnectWidget();
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
+ void ApplyToolTip( GtkTooltips *tips, const char *tip );
GtkList *m_list;
wxList m_clientDataList;
public:
wxToolTip( const wxString &tip );
- ~wxToolTip();
- wxString GetTip();
+ void SetTip( const wxString &tip );
+ wxString GetTip() const;
+ wxWindow *GetWindow() const;
+ bool Ok() const;
- void Enable( bool flag );
- void SetDelay( long msecs );
- bool Ok();
+ static void Enable( bool flag );
+ static void SetDelay( long msecs );
// implementation
wxString m_text;
+ wxWindow *m_window;
- GtkTooltips *m_tooltips;
- GdkColor *m_bg;
- GdkColor *m_fg;
-
- void Create( GtkWidget *tool );
+ void Apply( wxWindow *win );
};
#endif // __GTKTOOLTIPH__
virtual void SetToolTip( const wxString &tip );
virtual void SetToolTip( wxToolTip *tip );
- virtual wxToolTip& GetToolTip();
+ virtual wxToolTip* GetToolTip();
virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
virtual void Clear();
virtual wxRegion GetUpdateRegion() const;
- virtual bool IsExposed(int x, int y) const;
- virtual bool IsExposed(int x, int y, int w, int h) const;
- virtual bool IsExposed(const wxPoint& pt) const;
- virtual bool IsExposed(const wxRect& rect) const;
+ virtual bool IsExposed( int x, int y ) const;
+ virtual bool IsExposed( int x, int y, int w, int h ) const;
+ virtual bool IsExposed( const wxPoint& pt ) const;
+ virtual bool IsExposed( const wxRect& rect ) const;
virtual wxColour GetBackgroundColour() const;
virtual void SetBackgroundColour( const wxColour &colour );
// implementation
+ virtual wxPoint GetClientAreaOrigin() const;
+ virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+
+ bool HasVMT();
+
+ virtual void OnInternalIdle();
+
+ /* used by all classes in the widget creation process */
+
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
const wxSize &size, long style, const wxString &name );
void PostCreation();
+ /* the methods below are required because many native widgets
+ are composed of several subwidgets and setting a style for
+ the widget means setting it for all subwidgets as well.
+ also, it is nor clear, which native widget is the top
+ widget where (most of) the input goes. even tooltips have
+ to be applied to all subwidgets. */
+
virtual GtkWidget* GetConnectWidget();
virtual bool IsOwnGtkWindow( GdkWindow *window );
void ConnectWidget( GtkWidget *widget );
- bool HasVMT();
-
- virtual wxPoint GetClientAreaOrigin() const;
- virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
-
GtkStyle *GetWidgetStyle();
void SetWidgetStyle();
virtual void ApplyWidgetStyle();
- virtual void OnInternalIdle();
+ virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+
+ /* private member variables */
wxWindow *m_parent;
wxList m_children;
case ID_LISTBOX_ENABLE:
{
m_text->WriteText("Checkbox clicked.\n");
+#ifdef __WXGTK__
+ wxCheckBox *cb = (wxCheckBox*)event.GetEventObject();
+ if (event.GetInt())
+ cb->SetToolTip( "Click to enable listbox" );
+ else
+ cb->SetToolTip( "Click to disable listbox" );
+#endif
m_listbox->Enable( event.GetInt() == 0 );
break;
}
#endif
#endif
- if (m_toolTip) m_toolTip->Create( list_item );
+ if (m_toolTip) m_toolTip->Apply( this );
}
void wxListBox::Append( const wxString &item )
return -1;
}
-void wxListBox::SetToolTip( const wxString &tip )
+void wxListBox::ApplyToolTip( GtkTooltips *tips, const char *tip )
{
- SetToolTip( new wxToolTip( tip ) );
-}
-
-void wxListBox::SetToolTip( wxToolTip *tip )
-{
- if (m_toolTip) delete m_toolTip;
-
- m_toolTip = tip;
-
- if (!tip) return;
-
- m_toolTip->Create( GTK_WIDGET(m_list) ); /* this has no effect */
-
GList *child = m_list->children;
while (child)
{
- m_toolTip->Create( GTK_WIDGET( child->data ) );
+ gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL );
child = child->next;
}
}
#include "gtk/gtk.h"
#include "gdk/gdk.h"
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+static GtkTooltips *ss_tooltips = (GtkTooltips*) NULL;
+static GdkColor ss_bg;
+static GdkColor ss_fg;
+
//-----------------------------------------------------------------------------
// wxToolTip
//-----------------------------------------------------------------------------
wxToolTip::wxToolTip( const wxString &tip )
{
m_text = tip;
-
- m_tooltips = (GtkTooltips*) NULL;
-
- m_fg = new GdkColor;
- m_fg->red = 0;
- m_fg->green = 0;
- m_fg->blue = 0;
-
- m_bg = new GdkColor;
- m_bg->red = 65535;
- m_bg->green = 65535;
- m_bg->blue = 50000;
+ m_window = (wxWindow*) NULL;
}
-wxToolTip::~wxToolTip()
+bool wxToolTip::Ok() const
{
- gtk_object_unref( GTK_OBJECT(m_tooltips) );
-
- delete m_fg;
- delete m_bg;
+ return (m_window);
}
-bool wxToolTip::Ok()
+wxString wxToolTip::GetTip() const
{
- return (m_tooltips);
+ return m_text;
}
-void wxToolTip::Create( GtkWidget *tool )
+void wxToolTip::SetTip( const wxString &tip )
{
- if (!m_tooltips)
+ m_text = tip;
+ Apply( m_window );
+}
+
+void wxToolTip::Apply( wxWindow *win )
+{
+ if (!win) return;
+
+ if (!ss_tooltips)
{
- m_tooltips = gtk_tooltips_new();
+ ss_tooltips = gtk_tooltips_new();
+
+ ss_fg.red = 0;
+ ss_fg.green = 0;
+ ss_fg.blue = 0;
+ gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_fg );
- gdk_color_alloc( gtk_widget_get_colormap( tool ), m_fg );
- gdk_color_alloc( gtk_widget_get_colormap( tool ), m_bg );
+ ss_bg.red = 65535;
+ ss_bg.green = 65535;
+ ss_bg.blue = 50000;
+ gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_bg );
- gtk_tooltips_set_colors( m_tooltips, m_bg, m_fg );
+ gtk_tooltips_set_colors( ss_tooltips, &ss_bg, &ss_fg );
}
- gtk_tooltips_set_tip( m_tooltips, tool, m_text, (gchar*) NULL );
+ m_window = win;
+
+ if (m_text.IsEmpty())
+ m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
+ else
+ m_window->ApplyToolTip( ss_tooltips, m_text );
}
void wxToolTip::Enable( bool flag )
{
- if (!Ok()) return;
+ if (!ss_tooltips) return;
if (flag)
- gtk_tooltips_enable( m_tooltips );
+ gtk_tooltips_enable( ss_tooltips );
else
- gtk_tooltips_disable( m_tooltips );
+ gtk_tooltips_disable( ss_tooltips );
}
void wxToolTip::SetDelay( long msecs )
{
- if (!Ok()) return;
+ if (!ss_tooltips) return;
- gtk_tooltips_set_delay( m_tooltips, msecs );
+ gtk_tooltips_set_delay( ss_tooltips, msecs );
}
void wxWindow::SetToolTip( const wxString &tip )
{
- SetToolTip( new wxToolTip( tip ) );
+ if (m_toolTip)
+ {
+ m_toolTip->SetTip( tip );
+ }
+ else
+ {
+ m_toolTip = new wxToolTip( tip );
+ m_toolTip->Apply( this );
+ }
+
+ if (tip.IsEmpty())
+ {
+ delete m_toolTip;
+ m_toolTip = (wxToolTip*) NULL;
+ }
}
void wxWindow::SetToolTip( wxToolTip *tip )
{
- if (m_toolTip) delete m_toolTip;
+ if (m_toolTip)
+ {
+ m_toolTip->SetTip( (char*) NULL );
+ delete m_toolTip;
+ }
m_toolTip = tip;
- if (m_toolTip) m_toolTip->Create( GetConnectWidget() );
+ if (m_toolTip) m_toolTip->Apply( this );
}
-wxToolTip& wxWindow::GetToolTip()
+void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
{
- if (!m_toolTip)
- wxLogError( "No tooltip set." );
-
- return *m_toolTip;
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+wxToolTip* wxWindow::GetToolTip()
+{
+ return m_toolTip;
}
wxColour wxWindow::GetBackgroundColour() const
#endif
#endif
- if (m_toolTip) m_toolTip->Create( list_item );
+ if (m_toolTip) m_toolTip->Apply( this );
}
void wxListBox::Append( const wxString &item )
return -1;
}
-void wxListBox::SetToolTip( const wxString &tip )
+void wxListBox::ApplyToolTip( GtkTooltips *tips, const char *tip )
{
- SetToolTip( new wxToolTip( tip ) );
-}
-
-void wxListBox::SetToolTip( wxToolTip *tip )
-{
- if (m_toolTip) delete m_toolTip;
-
- m_toolTip = tip;
-
- if (!tip) return;
-
- m_toolTip->Create( GTK_WIDGET(m_list) ); /* this has no effect */
-
GList *child = m_list->children;
while (child)
{
- m_toolTip->Create( GTK_WIDGET( child->data ) );
+ gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL );
child = child->next;
}
}
#include "gtk/gtk.h"
#include "gdk/gdk.h"
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+static GtkTooltips *ss_tooltips = (GtkTooltips*) NULL;
+static GdkColor ss_bg;
+static GdkColor ss_fg;
+
//-----------------------------------------------------------------------------
// wxToolTip
//-----------------------------------------------------------------------------
wxToolTip::wxToolTip( const wxString &tip )
{
m_text = tip;
-
- m_tooltips = (GtkTooltips*) NULL;
-
- m_fg = new GdkColor;
- m_fg->red = 0;
- m_fg->green = 0;
- m_fg->blue = 0;
-
- m_bg = new GdkColor;
- m_bg->red = 65535;
- m_bg->green = 65535;
- m_bg->blue = 50000;
+ m_window = (wxWindow*) NULL;
}
-wxToolTip::~wxToolTip()
+bool wxToolTip::Ok() const
{
- gtk_object_unref( GTK_OBJECT(m_tooltips) );
-
- delete m_fg;
- delete m_bg;
+ return (m_window);
}
-bool wxToolTip::Ok()
+wxString wxToolTip::GetTip() const
{
- return (m_tooltips);
+ return m_text;
}
-void wxToolTip::Create( GtkWidget *tool )
+void wxToolTip::SetTip( const wxString &tip )
{
- if (!m_tooltips)
+ m_text = tip;
+ Apply( m_window );
+}
+
+void wxToolTip::Apply( wxWindow *win )
+{
+ if (!win) return;
+
+ if (!ss_tooltips)
{
- m_tooltips = gtk_tooltips_new();
+ ss_tooltips = gtk_tooltips_new();
+
+ ss_fg.red = 0;
+ ss_fg.green = 0;
+ ss_fg.blue = 0;
+ gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_fg );
- gdk_color_alloc( gtk_widget_get_colormap( tool ), m_fg );
- gdk_color_alloc( gtk_widget_get_colormap( tool ), m_bg );
+ ss_bg.red = 65535;
+ ss_bg.green = 65535;
+ ss_bg.blue = 50000;
+ gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_bg );
- gtk_tooltips_set_colors( m_tooltips, m_bg, m_fg );
+ gtk_tooltips_set_colors( ss_tooltips, &ss_bg, &ss_fg );
}
- gtk_tooltips_set_tip( m_tooltips, tool, m_text, (gchar*) NULL );
+ m_window = win;
+
+ if (m_text.IsEmpty())
+ m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
+ else
+ m_window->ApplyToolTip( ss_tooltips, m_text );
}
void wxToolTip::Enable( bool flag )
{
- if (!Ok()) return;
+ if (!ss_tooltips) return;
if (flag)
- gtk_tooltips_enable( m_tooltips );
+ gtk_tooltips_enable( ss_tooltips );
else
- gtk_tooltips_disable( m_tooltips );
+ gtk_tooltips_disable( ss_tooltips );
}
void wxToolTip::SetDelay( long msecs )
{
- if (!Ok()) return;
+ if (!ss_tooltips) return;
- gtk_tooltips_set_delay( m_tooltips, msecs );
+ gtk_tooltips_set_delay( ss_tooltips, msecs );
}
void wxWindow::SetToolTip( const wxString &tip )
{
- SetToolTip( new wxToolTip( tip ) );
+ if (m_toolTip)
+ {
+ m_toolTip->SetTip( tip );
+ }
+ else
+ {
+ m_toolTip = new wxToolTip( tip );
+ m_toolTip->Apply( this );
+ }
+
+ if (tip.IsEmpty())
+ {
+ delete m_toolTip;
+ m_toolTip = (wxToolTip*) NULL;
+ }
}
void wxWindow::SetToolTip( wxToolTip *tip )
{
- if (m_toolTip) delete m_toolTip;
+ if (m_toolTip)
+ {
+ m_toolTip->SetTip( (char*) NULL );
+ delete m_toolTip;
+ }
m_toolTip = tip;
- if (m_toolTip) m_toolTip->Create( GetConnectWidget() );
+ if (m_toolTip) m_toolTip->Apply( this );
}
-wxToolTip& wxWindow::GetToolTip()
+void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
{
- if (!m_toolTip)
- wxLogError( "No tooltip set." );
-
- return *m_toolTip;
+ gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+wxToolTip* wxWindow::GetToolTip()
+{
+ return m_toolTip;
}
wxColour wxWindow::GetBackgroundColour() const