cp *.h ~/wxgtk_dist/wxGTK/include/wx/generic
cd ..
+mkdir ~/wxgtk_dist/wxGTK/include/wx/unix
+cd unix
+cp *.h ~/wxgtk_dist/wxGTK/include/wx/unix
+cd ..
+
mkdir ~/wxgtk_dist/wxGTK/include/wx/gtk
cd gtk
cp *.h ~/wxgtk_dist/wxGTK/include/wx/gtk
cp *.cpp ~/wxgtk_dist/wxGTK/src/gtk
cd ..
+cd unix
+mkdir ~/wxgtk_dist/wxGTK/src/unix
+cp *.cpp ~/wxgtk_dist/wxGTK/src/unix
+cd ..
+
cd generic
mkdir ~/wxgtk_dist/wxGTK/src/generic
cp *.cpp ~/wxgtk_dist/wxGTK/src/generic
./configure
make
+su <type root password>
make install
+ldconfig
+exit
+
* The most simple errors
------------------------
-configure reports, that you don't have GTK 1.0.X installed
+configure reports, that you don't have GTK 1.X installed
although you are certainly sure you have. Well, you have
installed it, but you also have another version of the
GTK installed, which you may need to removed including
-----------------------
wxWindows/GTK requires the GTK+ library to be installed on your system.
-It has to be a stable version, preferebly version 1.0.6. When using
-a version previous to 1.0.6 you'll might get crashes here and there.
+It has to be a stable version, preferebly version 1.2.1. It might also
+work with the 1.0 series, but I didn't test that any longer.
-wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library
-and we will wait until the 1.2 version comes out and has stabilized
-until we'll work with that library.
+wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library.
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 my ftp site. You'll find information
+We also mirror GTK+ 1.2.1 at my ftp site. You'll find information
about downloading at my homepage.
* Additional libraries
./configure "--with-threads"
make clean
make
+su <type root password>
make install
+ldconfig
+exit
NB: I included thread support in wxWindows/Gtk, as this
problem will disappear in the near future when all major
- Welcome to wxWindows/Gtk 2.0.1,
+ Welcome to wxWindows/Gtk 2.1 beta 1,
-you have downloaded version 2.0.1 of the GTK+ 1.0 port of
-the wxWindows GUI library.
+you have downloaded version 2.1 of the GTK+ 1.2 port of
+the wxWindows GUI library. This is a developers release
+and is it not suited for production development. Beware
+that major changes can happen before a final release -
+Particularly the makefile system will change entirly.
More information is available from my homepage at:
./configure
make
+su <type root password>
+ldconfig
make install
+exit
Type the following to make the samples
this has no effect, but I tried...
The library produced by the install process will be called
-libwx_gtk2.a (static) and libwx_gtk2.so.0.1 (shared) so that
+libwx_gtk2.a (static) and libwx_gtk2.so.1.0 (shared) so that
once a binary incompatible version of wxWindows/Gtk comes out
we'll augment library version number to avoid linking problems.
-------------------- High priority ---------------------
+DnD
+ -> Must be rewritten for GTK+ 1.2
+
-------------------- Medium priority ---------------------
-Show accelerator in menus and control labels and actually implement them
- -> Changed in GTK 1.2 (so let's do it for 1.2). Postponed.
+Show accelerator control labels and actually implement them
+ -> Changed in GTK 1.2 (so let's do it for 1.2). Difficult.
-------------------- Low priority ---------------------
OwnerDraw for wxListCtrl and others
-> Postponed.
-DnD
- -> Must be rewritten for GTK+ 1.2
-
Implement wxPalette
-> I never understood that. Postponed.
typedef struct _GtkTooltips GtkTooltips;
typedef struct _GtkNotebook GtkNotebook;
typedef struct _GtkNotebookPage GtkNotebookPage;
+typedef struct _GtkAccelGroup GtkAccelGroup;
+typedef struct _GtkItemFactory GtkItemFactory;
#endif
bool m_ownsPrimarySelection;
wxDataBroker *m_dataBroker;
- GtkWidget *m_clipboardWidget;
+ GtkWidget *m_clipboardWidget; /* for getting and offering data */
+ GtkWidget *m_targetsWidget; /* for getting list of supported formats */
+ bool m_waiting; /* querying data or formats is asynchronous */
bool m_formatSupported;
GdkAtom m_targetRequested;
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
- // construction
wxMenu( const wxString& title = wxEmptyString,
const wxFunction func = (wxFunction) NULL );
+ ~wxMenu();
// operations
// title
wxWindow *GetInvokingWindow();
// implementation only
- GtkWidget *m_menu; // GtkMenu
- GtkWidget *m_owner;
+ GtkWidget *m_menu; // GtkMenu
+ GtkWidget *m_owner;
+
+ GtkAccelGroup *m_accel;
+ GtkItemFactory *m_factory;
private:
wxString m_title;
#ifndef __GTK_MYFIXED_H__
#define __GTK_MYFIXED_H__
-
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
-
+#include <gtk/gtkadjustment.h>
+#include <gtk/gtkfeatures.h>
#ifdef __cplusplus
extern "C" {
struct _GtkMyFixed
{
GtkContainer container;
-
GList *children;
+#if (GTK_MINOR_VERSION > 0)
+ GtkShadowType shadow_type;
+#endif
};
struct _GtkMyFixedClass
{
GtkContainerClass parent_class;
+
+#if (GTK_MINOR_VERSION > 0)
+ void (*set_scroll_adjustments) (GtkMyFixed *myfixed,
+ GtkAdjustment *hadjustment,
+ GtkAdjustment *vadjustment);
+#endif
};
struct _GtkMyFixedChild
guint gtk_myfixed_get_type (void);
GtkWidget* gtk_myfixed_new (void);
+#if (GTK_MINOR_VERSION > 0)
+void gtk_myfixed_set_shadow_type (GtkMyFixed *myfixed,
+ GtkShadowType type);
+#endif
void gtk_myfixed_put (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
GtkWidget *widget,
gint16 x,
gint16 y);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
wxString m_data;
};
-//-----------------------------------------------------------------------------
-// (debug)
-//-----------------------------------------------------------------------------
-
-#ifdef __WXDEBUG__
-
-void debug_focus_in( GtkWidget* widget, const char* name, const char* window );
-
-#endif
-
//-----------------------------------------------------------------------------
// wxWindow
//-----------------------------------------------------------------------------
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
- bool m_needParent;
+ bool m_needParent; /* ! wxFrame, wxDialog, wxNotebookPage ? */
bool m_hasScrolling;
bool m_isScrolling;
bool m_hasVMT;
bool m_resizing;
GdkGC *m_scrollGC;
GtkStyle *m_widgetStyle;
- bool m_isStaticBox;
- bool m_acceptsFocus;
+ bool m_isStaticBox; /* faster than IS_KIND_OF */
+ bool m_isFrame; /* faster than IS_KIND_OF */
+ bool m_acceptsFocus; /* ! wxStaticBox etc. */
wxInsertChildFunction m_insertCallback;
bool m_ownsPrimarySelection;
wxDataBroker *m_dataBroker;
- GtkWidget *m_clipboardWidget;
+ GtkWidget *m_clipboardWidget; /* for getting and offering data */
+ GtkWidget *m_targetsWidget; /* for getting list of supported formats */
+ bool m_waiting; /* querying data or formats is asynchronous */
bool m_formatSupported;
GdkAtom m_targetRequested;
DECLARE_DYNAMIC_CLASS(wxMenu)
public:
- // construction
wxMenu( const wxString& title = wxEmptyString,
const wxFunction func = (wxFunction) NULL );
+ ~wxMenu();
// operations
// title
wxWindow *GetInvokingWindow();
// implementation only
- GtkWidget *m_menu; // GtkMenu
- GtkWidget *m_owner;
+ GtkWidget *m_menu; // GtkMenu
+ GtkWidget *m_owner;
+
+ GtkAccelGroup *m_accel;
+ GtkItemFactory *m_factory;
private:
wxString m_title;
#ifndef __GTK_MYFIXED_H__
#define __GTK_MYFIXED_H__
-
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
-
+#include <gtk/gtkadjustment.h>
+#include <gtk/gtkfeatures.h>
#ifdef __cplusplus
extern "C" {
struct _GtkMyFixed
{
GtkContainer container;
-
GList *children;
+#if (GTK_MINOR_VERSION > 0)
+ GtkShadowType shadow_type;
+#endif
};
struct _GtkMyFixedClass
{
GtkContainerClass parent_class;
+
+#if (GTK_MINOR_VERSION > 0)
+ void (*set_scroll_adjustments) (GtkMyFixed *myfixed,
+ GtkAdjustment *hadjustment,
+ GtkAdjustment *vadjustment);
+#endif
};
struct _GtkMyFixedChild
guint gtk_myfixed_get_type (void);
GtkWidget* gtk_myfixed_new (void);
+#if (GTK_MINOR_VERSION > 0)
+void gtk_myfixed_set_shadow_type (GtkMyFixed *myfixed,
+ GtkShadowType type);
+#endif
void gtk_myfixed_put (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
GtkWidget *widget,
gint16 x,
gint16 y);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
wxString m_data;
};
-//-----------------------------------------------------------------------------
-// (debug)
-//-----------------------------------------------------------------------------
-
-#ifdef __WXDEBUG__
-
-void debug_focus_in( GtkWidget* widget, const char* name, const char* window );
-
-#endif
-
//-----------------------------------------------------------------------------
// wxWindow
//-----------------------------------------------------------------------------
GtkAdjustment *m_hAdjust,*m_vAdjust;
float m_oldHorizontalPos;
float m_oldVerticalPos;
- bool m_needParent;
+ bool m_needParent; /* ! wxFrame, wxDialog, wxNotebookPage ? */
bool m_hasScrolling;
bool m_isScrolling;
bool m_hasVMT;
bool m_resizing;
GdkGC *m_scrollGC;
GtkStyle *m_widgetStyle;
- bool m_isStaticBox;
- bool m_acceptsFocus;
+ bool m_isStaticBox; /* faster than IS_KIND_OF */
+ bool m_isFrame; /* faster than IS_KIND_OF */
+ bool m_acceptsFocus; /* ! wxStaticBox etc. */
wxInsertChildFunction m_insertCallback;
wxPanel *panel = (wxPanel*) NULL;
panel = new wxPanel(m_notebook);
- m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices );
+ m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 5, choices, wxLB_ALWAYS_SB );
m_listbox->SetCursor(*wxCROSS_CURSOR);
#if wxUSE_TOOLTIPS
m_listbox->SetToolTip( "This is a list box" );
(void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
- button = new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
+ button = new wxButton( panel, ID_LISTBOX_FONT, "Set &Italic font", wxPoint(340,130), wxSize(140,30) );
#if wxUSE_TOOLTIPS
button->SetToolTip( "Press here to set italic font" );
#endif // wxUSE_TOOLTIPS
$(includedir)/wx \
$(includedir)/wx/gtk \
$(includedir)/wx/motif \
- $(includedir)/wx/common \
+ $(includedir)/wx/unix \
$(includedir)/wx/generic \
$(includedir)/wx/protocol \
$(libdir)/wx/include/wx/gtk \
rm -f $(includedir)/wx/protocol/$$f ; \
$(INSTALL_DATA) $$f $(includedir)/wx/protocol/$$f ; \
done
+ @echo " Copying headers from /include/wx/unix"
+ @cd $(WXBASEDIR)/include/wx/unix ; \
+ for f in *.h ; do \
+ rm -f $(includedir)/wx/unix/$$f ; \
+ $(INSTALL_DATA) $$f $(includedir)/wx/unix/$$f ; \
+ done
@echo " Moving setup.h to library path"
@if test "@TOOLKIT@" = "GTK" ; then \
cd $(WXBASEDIR)/src ; \
@cd $(WXBASEDIR)/src ; \
rm -f $(libdir)/$(STATIC_LIBRARY) ; \
$(INSTALL_DATA) $(WXBASEDIR)/lib/$(OS)/$(STATIC_LIBRARY) $(libdir)/$(STATIC_LIBRARY)
- $(STRIP) $(libdir)/$(STATIC_LIBRARY)
@if test -f $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) ; then \
echo " Copying shared library" ; \
rm -f $(libdir)/lib$(LIB_TARGET).so* ; \
$(INSTALL_PROGRAM) $(WXBASEDIR)/lib/$(OS)/$(SHARED_LIBRARY) $(libdir)/$(SHARED_LIBRARY) ; \
- $(STRIP) $(libdir)/$(SHARED_LIBRARY)
+ $(STRIP) $(libdir)/$(SHARED_LIBRARY) ; \
$(LN_S) $(SHARED_LIBRARY) $(libdir)/lib$(LIB_TARGET).so.$(LIB_MAJOR) ; \
$(LN_S) $(SHARED_LIBRARY) $(libdir)/lib$(LIB_TARGET).so ; \
echo " " ; \
long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
+#if (GTK_MINOR_VERSION > 0)
+ m_acceptsFocus = TRUE;
+#endif
PreCreation( parent, id, pos, size, style, name );
#if wxUSE_CLIPBOARD
+#include "wx/utils.h"
+
#include "glib.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
static void
targets_selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data,
+#if (GTK_MINOR_VERSION > 0)
+ guint32 WXUNUSED(time),
+#endif
wxClipboard *clipboard )
{
- if (!wxTheClipboard) return;
-
- if (selection_data->length <= 0) return;
+ if (!wxTheClipboard)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct form
- if (selection_data->type != GDK_SELECTION_TYPE_ATOM) return;
+ if (selection_data->length <= 0)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
+
+ /* make sure we got the data in the correct form */
+ if (selection_data->type != GDK_SELECTION_TYPE_ATOM)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
// the atoms we received, holding a list of targets (= formats)
GdkAtom *atoms = (GdkAtom *)selection_data->data;
for (unsigned int i=0; i<selection_data->length/sizeof(GdkAtom); i++)
{
- char *name = gdk_atom_name (atoms[i]);
- if (name) printf( "Format available: %s.\n", name );
+/*
+ char *name = gdk_atom_name (atoms[i]);
+ if (name) printf( "Format available: %s.\n", name );
+*/
if (atoms[i] == clipboard->m_targetRequested)
{
+ clipboard->m_waiting = FALSE;
clipboard->m_formatSupported = TRUE;
return;
}
}
+ clipboard->m_waiting = FALSE;
return;
}
static void
selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data,
+#if (GTK_MINOR_VERSION > 0)
+ guint32 WXUNUSED(time),
+#endif
wxClipboard *clipboard )
{
- if (!wxTheClipboard) return;
+ if (!wxTheClipboard)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxDataObject *data_object = clipboard->m_receivedData;
- if (!data_object) return;
+ if (!data_object)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- if (selection_data->length <= 0) return;
+ if (selection_data->length <= 0)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct format
-
- if (data_object->GetFormat().GetAtom() != selection_data->target) return;
+ /* make sure we got the data in the correct format */
+ if (data_object->GetFormat().GetAtom() != selection_data->target)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct form (selection type).
- // if so, copy data to target object
+ /* make sure we got the data in the correct form (selection type).
+ if so, copy data to target object */
switch (data_object->GetFormat().GetType())
{
case wxDF_TEXT:
{
- if (selection_data->type != GDK_SELECTION_TYPE_STRING) return;
+ if (selection_data->type != GDK_SELECTION_TYPE_STRING)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxTextDataObject *text_object = (wxTextDataObject *) data_object;
case wxDF_BITMAP:
{
- if (selection_data->type != GDK_SELECTION_TYPE_BITMAP) return;
-
- return;
+ if (selection_data->type != GDK_SELECTION_TYPE_BITMAP)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
break;
}
case wxDF_PRIVATE:
{
- if (selection_data->type != GDK_SELECTION_TYPE_STRING) return;
+ if (selection_data->type != GDK_SELECTION_TYPE_STRING)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxPrivateDataObject *private_object = (wxPrivateDataObject *) data_object;
default:
{
+ clipboard->m_waiting = FALSE;
return;
}
}
wxTheClipboard->m_formatSupported = TRUE;
+ clipboard->m_waiting = FALSE;
}
//-----------------------------------------------------------------------------
m_receivedData = (wxDataObject*) NULL;
+ /* we use m_targetsWidget to query what formats are available */
+
+ m_targetsWidget = gtk_window_new( GTK_WINDOW_POPUP );
+ gtk_widget_realize( m_targetsWidget );
+
+ gtk_signal_connect( GTK_OBJECT(m_targetsWidget),
+ "selection_received",
+ GTK_SIGNAL_FUNC( targets_selection_received ),
+ (gpointer) this );
+
+ /* we use m_clipboardWidget to get and to offer data */
+
m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP );
gtk_widget_realize( m_clipboardWidget );
+ gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
+ "selection_received",
+ GTK_SIGNAL_FUNC( selection_received ),
+ (gpointer) this );
+
gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
"selection_clear_event",
GTK_SIGNAL_FUNC( selection_clear_clip ),
Clear();
if (m_clipboardWidget) gtk_widget_destroy( m_clipboardWidget );
+ if (m_targetsWidget) gtk_widget_destroy( m_targetsWidget );
}
void wxClipboard::Clear()
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
- /* add handler for target (= format) query */
-
- gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
- "selection_received",
- GTK_SIGNAL_FUNC( targets_selection_received ),
- (gpointer) this );
-
m_formatSupported = FALSE;
/* perform query. this will set m_formatSupported to
- * TRUE if m_targetRequested is supported */
-
- gtk_selection_convert( m_clipboardWidget,
+ TRUE if m_targetRequested is supported.
+ alsom we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
+
+ m_waiting = TRUE;
+
+ gtk_selection_convert( m_targetsWidget,
g_clipboardAtom,
g_targetsAtom,
GDK_CURRENT_TIME );
-
- gtk_signal_disconnect_by_func( GTK_OBJECT(m_clipboardWidget),
- GTK_SIGNAL_FUNC( targets_selection_received ),
- (gpointer) this );
-
+
+ while (m_waiting) gtk_main_iteration();
+
if (!m_formatSupported) return FALSE;
return TRUE;
m_formatSupported = FALSE;
- gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
- "selection_received",
- GTK_SIGNAL_FUNC( selection_received ),
- (gpointer) this );
+ /* ask for clipboard contents. this will set
+ m_formatSupported to TRUE if m_targetRequested
+ is supported.
+ also, we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
- /* ask for clipboard contents */
+ m_waiting = TRUE;
gtk_selection_convert( m_clipboardWidget,
g_clipboardAtom,
m_targetRequested,
GDK_CURRENT_TIME );
- gtk_signal_disconnect_by_func( GTK_OBJECT(m_clipboardWidget),
- GTK_SIGNAL_FUNC( selection_received ),
- (gpointer) this );
+ while (m_waiting) gtk_main_iteration();
/* this is a true error as we checked for the presence of such data before */
#include "wx/control.h"
+#include "gtk/gtkfeatures.h"
+
//-----------------------------------------------------------------------------
// wxControl
//-----------------------------------------------------------------------------
wxDataFormat::wxDataFormat()
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_type = wxDF_INVALID;
m_hasAtom = FALSE;
m_atom = (GdkAtom) 0;
wxDataFormat::wxDataFormat( wxDataType type )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
SetType( type );
}
wxDataFormat::wxDataFormat( const wxString &id )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
SetId( id );
}
wxDataFormat::wxDataFormat( wxDataFormat &format )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_type = format.GetType();
m_id = format.GetId();
m_hasAtom = TRUE;
wxDataFormat::wxDataFormat( const GdkAtom atom )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_hasAtom = TRUE;
m_atom = atom;
if (m_type == wxDF_TEXT)
{
- m_id = "text/plain";
+ m_id = "STRING";
}
else
if (m_type == wxDF_BITMAP)
gtk_widget_realize( m_widget );
+ long decor = (long) GDK_DECOR_ALL;
+ long func = (long) GDK_FUNC_ALL;
+
+ if ((m_windowStyle & wxCAPTION) == 0)
+ decor |= GDK_DECOR_TITLE;
+ if ((m_windowStyle & wxMINIMIZE) == 0)
+ func |= GDK_FUNC_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE) == 0)
+ func |= GDK_FUNC_MAXIMIZE;
+ if ((m_windowStyle & wxSYSTEM_MENU) == 0)
+ decor |= GDK_DECOR_MENU;
+ if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MAXIMIZE;
+ if ((m_windowStyle & wxRESIZE_BORDER) == 0)
+ func |= GDK_FUNC_RESIZE;
+
+ gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
+ gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
+
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
gtk_widget_realize( m_widget );
+ long decor = (long) GDK_DECOR_ALL;
+ long func = (long) GDK_FUNC_ALL;
+
+ if ((m_windowStyle & wxCAPTION) == 0)
+ decor |= GDK_DECOR_TITLE;
+ if ((m_windowStyle & wxMINIMIZE) == 0)
+ func |= GDK_FUNC_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE) == 0)
+ func |= GDK_FUNC_MAXIMIZE;
+ if ((m_windowStyle & wxSYSTEM_MENU) == 0)
+ decor |= GDK_DECOR_MENU;
+ if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MAXIMIZE;
+ if ((m_windowStyle & wxRESIZE_BORDER) == 0)
+ func |= GDK_FUNC_RESIZE;
+
+ gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
+ gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
+
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
SetValidator( validator );
m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ if (style & wxLB_ALWAYS_SB)
+ {
+ gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
+ }
+ else
+ {
+ gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ }
m_list = GTK_LIST( gtk_list_new() );
gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_list) );
#endif
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxListBox::m_widget", name );
-
- debug_focus_in( GTK_WIDGET(m_list), "wxListBox::m_list", name );
-
- GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-
- debug_focus_in( s_window->hscrollbar, "wxWindow::hsrcollbar", name );
- debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
-
-#ifdef NEW_GTK_SCROLL_CODE
- GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
-#else
- GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-#endif
-
- debug_focus_in( GTK_WIDGET(viewport), "wxWindow::viewport", name );
-#endif
-
gtk_widget_show( GTK_WIDGET(m_list) );
wxSize newSize = size;
list_item = gtk_list_item_new_with_label( str );
-#ifdef __WXDEBUG__
- debug_focus_in( list_item, "wxListBox::list_item", name );
-#endif
-
gtk_container_add( GTK_CONTAINER(m_list), list_item );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
void wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
m_menus.Append( menu );
- wxString title2 = title;
-
- int pos;
- do
+
+ wxString s = "";
+ for ( const char *pc = title; *pc != '\0'; pc++ )
{
- pos = title2.First( '&' );
- if (pos != wxNOT_FOUND)
- title2.Remove( pos, 1 );
- } while (pos != wxNOT_FOUND);
-
- menu->SetTitle(title2);
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ // s << '_'; not yet
+#endif
+ }
+ s << *pc;
+ }
- menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(title2) );
+ menu->SetTitle(s);
+ menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(s) );
gtk_widget_show( menu->m_owner );
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
m_text = "";
for ( const char *pc = str; *pc != '\0'; pc++ )
{
- if (*pc == '&') pc++; /* skip it */
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ m_text << '_';
+#endif
+ }
m_text << *pc;
}
m_title = title;
m_items.DeleteContents( TRUE );
m_invokingWindow = (wxWindow *) NULL;
+
+#if (GTK_MINOR_VERSION > 0)
+ m_accel = gtk_accel_group_new();
+ m_factory = gtk_item_factory_new( GTK_TYPE_MENU, "<main>", m_accel );
+ m_menu = gtk_item_factory_get_widget( m_factory, "<main>" );
+#else
m_menu = gtk_menu_new(); // Do not show!
+#endif
m_callback = func;
m_eventHandler = this;
m_owner = (GtkWidget*) NULL;
}
+wxMenu::~wxMenu()
+{
+ /* how do we delete an item-factory ? */
+}
+
void wxMenu::SetTitle( const wxString& title )
{
// TODO Waiting for something better
GtkWidget *menuItem = gtk_menu_item_new();
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
+
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
}
mitem->SetHelp(helpStr);
mitem->SetCheckable(checkable);
const char *text = mitem->GetText();
+
+#if (GTK_MINOR_VERSION > 0)
+ char buf[100];
+ strcpy( buf, "/" );
+ strcat( buf, text );
+
+ GtkItemFactoryEntry entry;
+ entry.path = buf;
+ entry.accelerator = (gchar*) NULL;
+ entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
+ entry.callback_action = 0;
+ if (checkable)
+ entry.item_type = "<CheckItem>";
+ else
+ entry.item_type = "<Item>";
+
+ gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
+
+ /* in order to get the pointer to the item we need the item text _without_ underscores */
+ wxString s = "<main>/";
+ for ( const char *pc = text; *pc != '\0'; pc++ )
+ {
+ if (*pc == '_') pc++; /* skip it */
+ s << *pc;
+ }
+
+ GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
+
+#else
+
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
: gtk_menu_item_new_with_label(text);
-
- mitem->SetMenuItem(menuItem);
-
+
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
- (gpointer*)this );
+ (gpointer)this );
+
+ gtk_menu_append( GTK_MENU(m_menu), menuItem );
+ gtk_widget_show( menuItem );
+
+#endif
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
- (gpointer*)this );
+ (gpointer)this );
gtk_signal_connect( GTK_OBJECT(menuItem), "deselect",
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
- (gpointer*)this );
+ (gpointer)this );
+
+ mitem->SetMenuItem(menuItem);
- gtk_menu_append( GTK_MENU(m_menu), menuItem );
- gtk_widget_show( menuItem );
m_items.Append( mitem );
}
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s( itemString );
-
- int pos;
- do
+ wxString s = "";
+ for ( const char *pc = itemString; *pc != '\0'; pc++ )
{
- pos = s.First( '&' );
- if (pos != -1) s.Remove( pos, 1 );
- } while (pos != -1);
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ s << '_';
+#endif
+ }
+ s << *pc;
+ }
wxNode *node = m_items.First();
while (node)
m_widget = gtk_notebook_new();
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxNotebook::m_widget", name );
-#endif
-
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
m_idHandler = gtk_signal_connect (
static void
gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
- win->SetModified();
+ if (!win->m_hasVMT) return;
- win->CalculateScrollbar();
+ win->SetModified();
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->m_windowId );
event.SetString( win->GetValue() );
}
//-----------------------------------------------------------------------------
-// "size_allocate"
+// "changed" from vertical scrollbar
//-----------------------------------------------------------------------------
static void
-gtk_text_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* WXUNUSED(alloc), wxTextCtrl *win )
+gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
+ if (!win->m_hasVMT) return;
+
win->CalculateScrollbar();
}
SetValidator( validator );
- m_vScrollbarVisible = TRUE;
+ m_vScrollbarVisible = FALSE;
bool multi_line = (style & wxTE_MULTILINE) != 0;
if ( multi_line )
{
- // a multi-line edit control: create a vertical scrollbar by default and
- // horizontal if requested
+ /* a multi-line edit control: create a vertical scrollbar by default and
+ horizontal if requested */
bool bHasHScrollbar = (style & wxHSCROLL) != 0;
- // create our control...
+ /* create our control ... */
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
- // ... and put into the upper left hand corner of the table
+ /* ... and put into the upper left hand corner of the table */
m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
(GtkAttachOptions)(GTK_FILL | GTK_EXPAND | GTK_SHRINK),
0, 0);
- // put the horizontal scrollbar in the lower left hand corner
+ /* put the horizontal scrollbar in the lower left hand corner */
if (bHasHScrollbar)
{
GtkWidget *hscrollbar = gtk_hscrollbar_new(GTK_TEXT(m_text)->hadj);
gtk_widget_show(hscrollbar);
}
- // finally, put the vertical scrollbar in the upper right corner
- m_vScrollbar = gtk_vscrollbar_new( GTK_TEXT(m_text)->vadj );
- GTK_WIDGET_UNSET_FLAGS( m_vScrollbar, GTK_CAN_FOCUS );
-
- gtk_table_attach(GTK_TABLE(m_widget), m_vScrollbar, 1, 2, 0, 1,
- GTK_FILL,
- (GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
- 0, 0);
- gtk_widget_show( m_vScrollbar );
+ /* we create the vertical scrollbar on demand */
+ m_vScrollbar = (GtkWidget*) NULL;
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_text_size_callback), (gpointer)this );
}
else
{
- // a single-line text control: no need for scrollbars
+ /* a single-line text control: no need for scrollbars */
m_widget =
m_text = gtk_entry_new();
}
gtk_widget_show(m_text);
}
- // we want to be notified about text changes
+ /* we want to be notified about text changes */
gtk_signal_connect( GTK_OBJECT(m_text), "changed",
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
if (multi_line)
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
}
+
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
- SetBackgroundColour( parent->GetBackgroundColour() );
- SetForegroundColour( parent->GetForegroundColour() );
+ if (multi_line)
+ {
+ gtk_signal_connect(GTK_OBJECT(GTK_TEXT(m_text)->vadj), "changed",
+ (GtkSignalFunc) gtk_scrollbar_changed_callback, (gpointer) this );
+ }
return TRUE;
}
{
if (m_vScrollbarVisible)
{
- gtk_widget_hide( m_vScrollbar );
+ gtk_widget_hide( m_vScrollbar );
- m_vScrollbarVisible = FALSE;
+ m_vScrollbarVisible = FALSE;
}
}
else
{
if (!m_vScrollbarVisible)
{
- gtk_widget_show( m_vScrollbar );
+ if (!m_vScrollbar)
+ {
+ /* finally, put the vertical scrollbar in the upper right corner */
+ m_vScrollbar = gtk_vscrollbar_new( GTK_TEXT(m_text)->vadj );
+ GTK_WIDGET_UNSET_FLAGS( m_vScrollbar, GTK_CAN_FOCUS );
+
+ gtk_table_attach(GTK_TABLE(m_widget), m_vScrollbar, 1, 2, 0, 1,
+ GTK_FILL,
+ (GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
+ 0, 0);
+ }
+
+ gtk_widget_show( m_vScrollbar );
- m_vScrollbarVisible = TRUE;
+ m_vScrollbarVisible = TRUE;
}
}
}
/////////////////////////////////////////////////////////////////////////// */
#include "wx/gtk/win_gtk.h"
-#include <gtk/gtkfeatures.h>
-
-/*-------------------------------------------------------------------------
-// conditional compilation
-//------------------------------------------------------------------------- */
-
-#if (GTK_MINOR_VERSION > 0)
-#define NEW_GTK_CONSTRUCT_CODE
-#endif
+#include "gtk/gtksignal.h"
#ifdef __cplusplus
extern "C" {
static void gtk_myfixed_class_init (GtkMyFixedClass *klass);
static void gtk_myfixed_init (GtkMyFixed *myfixed);
static void gtk_myfixed_map (GtkWidget *widget);
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
static void gtk_myfixed_unmap (GtkWidget *widget);
#endif
static void gtk_myfixed_realize (GtkWidget *widget);
#endif
GtkCallback callback,
gpointer callback_data);
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
static GtkType gtk_myfixed_child_type (GtkContainer *container);
#endif
+#if (GTK_MINOR_VERSION > 0)
+static void gtk_myfixed_scroll_set_adjustments (GtkMyFixed *myfixed,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj);
+#endif
-static GtkContainerClass *parent_class = NULL;
+static GtkContainerClass *parent_class = NULL;
+
guint
gtk_myfixed_get_type ()
{
sizeof (GtkMyFixedClass),
(GtkClassInitFunc) gtk_myfixed_class_init,
(GtkObjectInitFunc) gtk_myfixed_init,
-#ifndef NEW_GTK_CONSTRUCT_CODE
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL,
-#else
+#if (GTK_MINOR_VERSION > 0)
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
+#else
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL,
#endif
};
widget_class = (GtkWidgetClass*) klass;
container_class = (GtkContainerClass*) klass;
-#ifndef NEW_GTK_CONSTRUCT_CODE
- parent_class = gtk_type_class (gtk_container_get_type ());
-#else
+#if (GTK_MINOR_VERSION > 0)
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
+#else
+ parent_class = gtk_type_class (gtk_container_get_type ());
#endif
widget_class->map = gtk_myfixed_map;
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
widget_class->unmap = gtk_myfixed_unmap;
#endif
widget_class->realize = gtk_myfixed_realize;
container_class->foreach = gtk_myfixed_foreach;
#endif
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
container_class->child_type = gtk_myfixed_child_type;
#endif
+
+#if (GTK_MINOR_VERSION > 0)
+ klass->set_scroll_adjustments = gtk_myfixed_scroll_set_adjustments;
+
+ widget_class->set_scroll_adjustments_signal =
+ gtk_signal_new ("set_scroll_adjustments",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (GtkMyFixedClass, set_scroll_adjustments),
+ gtk_marshal_NONE__POINTER_POINTER,
+ GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
+#endif
}
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
static GtkType
gtk_myfixed_child_type (GtkContainer *container)
{
{
GTK_WIDGET_UNSET_FLAGS (myfixed, GTK_NO_WINDOW);
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
GTK_WIDGET_SET_FLAGS (myfixed, GTK_BASIC);
#endif
+#if (GTK_MINOR_VERSION > 0)
+ myfixed->shadow_type = GTK_SHADOW_NONE;
+#endif
+
myfixed->children = NULL;
}
return GTK_WIDGET (myfixed);
}
+#if (GTK_MINOR_VERSION > 0)
+void gtk_myfixed_scroll_set_adjustments (GtkMyFixed *myfixed,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj)
+{
+ /* OK, this is embarassing, but this function has to be here */
+}
+
+void
+gtk_myfixed_set_shadow_type (GtkMyFixed *myfixed,
+ GtkShadowType type)
+{
+ g_return_if_fail (myfixed != NULL);
+ g_return_if_fail (GTK_IS_MYFIXED (myfixed));
+
+ if ((GtkShadowType) myfixed->shadow_type != type)
+ {
+ myfixed->shadow_type = type;
+
+ if (GTK_WIDGET_VISIBLE (myfixed))
+ {
+ gtk_widget_size_allocate (GTK_WIDGET (myfixed), &(GTK_WIDGET (myfixed)->allocation));
+ gtk_widget_queue_draw (GTK_WIDGET (myfixed));
+ }
+ }
+}
+#endif
+
void
-gtk_myfixed_put (GtkMyFixed *myfixed,
+gtk_myfixed_put (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
gint16 y)
}
}
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
static void
gtk_myfixed_unmap (GtkWidget *widget)
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
+
+#if (GTK_MINOR_VERSION > 0)
+ if (myfixed->shadow_type != GTK_SHADOW_NONE)
+ {
+ attributes.x = 2;
+ attributes.y = 2;
+ }
+ else
+ {
+ attributes.x = 0;
+ attributes.y = 0;
+ }
+ attributes.width = MAX (1, (gint)widget->allocation.width - attributes.x * 2 );
+ attributes.height = MAX (1, (gint)widget->allocation.height - attributes.y * 2 );
+#else
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = 32000;
attributes.height = 32000;
+#endif
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
GtkAllocation *allocation)
{
GtkMyFixed *myfixed;
+ gint border;
GtkMyFixedChild *child;
- GtkAllocation child_allocation;
- GList *children;
- guint16 border_width;
+ GtkAllocation child_allocation;
+ GList *children;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_MYFIXED(widget));
myfixed = GTK_MYFIXED (widget);
+ if (myfixed->shadow_type == GTK_SHADOW_NONE)
+ border = 0;
+ else
+ border = 2;
+
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
- gdk_window_move_resize (widget->window, allocation->x, allocation->y, 32000, 32000 );
+ {
+ gdk_window_move_resize( widget->window,
+ allocation->x+border, allocation->y+border,
+#if (GTK_MINOR_VERSION > 0)
+ allocation->width-border*2, allocation->height-border*2 );
+#else
+ 32000, 32000 );
+#endif
+ }
- border_width = GTK_CONTAINER (myfixed)->border_width;
-
children = myfixed->children;
while (children)
{
if (GTK_WIDGET_VISIBLE (child->widget))
{
- child_allocation.x = child->x + border_width;
- child_allocation.y = child->y + border_width;
+ child_allocation.x = child->x;
+ child_allocation.y = child->y;
child_allocation.width = child->widget->requisition.width;
child_allocation.height = child->widget->requisition.height;
gtk_widget_size_allocate (child->widget, &child_allocation);
*/
//-------------------------------------------------------------------------
-// conditional compilation
+// constants
//-------------------------------------------------------------------------
-#if (GTK_MINOR_VERSION > 0)
-#define NEW_GTK_SCROLL_CODE
-#endif
+#define FRAME_BORDER_WIDTH 2
//-----------------------------------------------------------------------------
-// (debug)
+// data
//-----------------------------------------------------------------------------
-#ifdef __WXDEBUG__
+extern wxList wxPendingDelete;
+extern bool g_blockEventsOnDrag;
+extern bool g_blockEventsOnScroll;
+static bool g_capturing = FALSE;
+static wxWindow *g_focusWindow = (wxWindow*) NULL;
-static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget),
- GdkEvent *WXUNUSED(event),
- const char *name )
-{
- printf( "FOCUS NOW AT: " );
- printf( name );
- printf( "\n" );
+/* hack: we need something to pass to gtk_menu_popup, so we store the time of
+ the last click here */
+static guint32 gs_timeLastClick = 0;
- return FALSE;
-}
+//-----------------------------------------------------------------------------
+// local code (see below)
+//-----------------------------------------------------------------------------
-void debug_focus_in( GtkWidget* widget, const char* name, const char *window )
+static void draw_frame( GtkWidget *widget, wxWindow *win )
{
- return;
+ if (!win->HasVMT()) return;
- wxString tmp = name;
- tmp += " FROM ";
- tmp += window;
+ int dw = 0;
+ int dh = 0;
+
+ if (win->m_hasScrolling)
+ {
+ GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(widget);
+ GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(widget)->klass );
- char *s = new char[tmp.Length()+1];
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
- strcpy( s, WXSTRINGCAST tmp );
+ if (scroll_window->vscrollbar_visible)
+ {
+ dw += 15; /* dw += vscrollbar->allocation.width; */
+ dw += scroll_class->scrollbar_spacing;
+ }
- gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
- GTK_SIGNAL_FUNC(gtk_debug_focus_in_callback), (gpointer)s );
+ if (scroll_window->hscrollbar_visible)
+ {
+ dh += 15; /* dh += hscrollbar->allocation.height; */
+ dw += scroll_class->scrollbar_spacing;
+ }
+ }
+
+ int dx = 0;
+ int dy = 0;
+ if (GTK_WIDGET_NO_WINDOW (widget))
+ {
+ dx += widget->allocation.x;
+ dy += widget->allocation.y;
+ }
+ else
+ if (win->m_parent)
+ {
+ wxPoint pt(win->m_parent->GetClientAreaOrigin());
+ dx += pt.x;
+ dy += pt.y;
+ }
+
+ if (win->m_windowStyle & wxRAISED_BORDER)
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_OUT,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
+
+ if (win->m_windowStyle & wxSUNKEN_BORDER)
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
}
-#endif
-
//-----------------------------------------------------------------------------
-// data
+// "expose_event" of m_widget
//-----------------------------------------------------------------------------
-extern wxList wxPendingDelete;
-extern bool g_blockEventsOnDrag;
-extern bool g_blockEventsOnScroll;
-static bool g_capturing = FALSE;
-static wxWindow *g_focusWindow = (wxWindow*) NULL;
+static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
+{
+ if (gdk_event->count > 0) return;
+ draw_frame( widget, win );
+}
-// hack: we need something to pass to gtk_menu_popup, so we store the time of
-// the last click here
-static guint32 gs_timeLastClick = 0;
+//-----------------------------------------------------------------------------
+// "draw" of m_wxwindow
+//-----------------------------------------------------------------------------
+
+static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindow *win )
+{
+ draw_frame( widget, win );
+}
//-----------------------------------------------------------------------------
-// "expose_event" (of m_wxwindow, not of m_widget)
+// "expose_event" of m_wxwindow
//-----------------------------------------------------------------------------
static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
}
//-----------------------------------------------------------------------------
-// "draw" (of m_wxwindow, not of m_widget)
+// "draw" of m_wxwindow
//-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
if (ret)
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
+ return TRUE;
}
- return ret;
+ return FALSE;
}
//-----------------------------------------------------------------------------
event.m_y = 0;
event.SetEventObject( win );
- bool ret = win->GetEventHandler()->ProcessEvent( event );
-
- if (ret)
+ if (win->GetEventHandler()->ProcessEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
+ return TRUE;
}
- return ret;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+ if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return TRUE;
if (g_blockEventsOnScroll) return TRUE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
+
if (win->m_wxwindow)
{
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
}
}
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnButtonPress from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
gs_timeLastClick = gdk_event->time;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
- if (g_blockEventsOnDrag) return TRUE;
- if (g_blockEventsOnScroll) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (g_blockEventsOnScroll) return FALSE;
- if (!win->HasVMT()) return TRUE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
/*
printf( "OnButtonRelease from " );
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
{
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (g_blockEventsOnScroll) return FALSE;
+
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
+
if (gdk_event->is_hint)
{
int x = 0;
gdk_event->state = state;
}
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
- if (g_blockEventsOnDrag) return TRUE;
- if (g_blockEventsOnScroll) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnMotion from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
g_focusWindow = win;
}
}
- if (!win->HasVMT()) return TRUE;
/*
printf( "OnSetFocus from " );
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+
if (win->m_wxwindow)
{
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
}
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnKillFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+
+ if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
- if (widget->window != gdk_event->window) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnEnter from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.m_y -= pt.y;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (widget->window != gdk_event->window) return FALSE;
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
- if (widget->window != gdk_event->window) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnLeave from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.m_y -= pt.y;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxWindow::m_widget", name );
-#endif
-
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-#ifdef __WXDEBUG__
- debug_focus_in( s_window->hscrollbar, "wxWindow::hsrcollbar", name );
- debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
-#endif
-
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
scroll_class->scrollbar_spacing = 0;
m_wxwindow = gtk_myfixed_new();
-#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, "wxWindow::m_wxwindow", name );
-#endif
+ gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
+
+#if (GTK_MINOR_VERSION > 0)
+ GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow);
-#ifdef NEW_GTK_SCROLL_CODE
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), m_wxwindow );
- GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
+ if (m_windowStyle & wxRAISED_BORDER)
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_OUT );
+ }
+ else if (m_windowStyle & wxSUNKEN_BORDER)
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_IN );
+ }
+ else
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_NONE );
+ }
#else
- gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-#endif
-
-#ifdef __WXDEBUG__
- debug_focus_in( GTK_WIDGET(viewport), "wxWindow::viewport", name );
-#endif
if (m_windowStyle & wxRAISED_BORDER)
{
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
}
+#endif
if (m_windowStyle & wxTAB_TRAVERSAL)
{
m_acceptsFocus = TRUE;
}
+#if (GTK_MINOR_VERSION == 0)
// shut the viewport up
gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
+#endif
// I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0;
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
- // these handers het notified when screen updates are required either when
+ // these handlers get notified when screen updates are required either when
// scrolling or when the window size (and therefore scrollbar configuration)
// has changed
if (m_wxwindow)
{
+ /* these get reported to wxWindows -> wxPaintEvent */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
+
+ /* these are called when the "sunken" or "raised" borders are drawn */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event",
+ GTK_SIGNAL_FUNC(gtk_window_own_expose_callback), (gpointer)this );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "draw",
+ GTK_SIGNAL_FUNC(gtk_window_own_draw_callback), (gpointer)this );
}
ConnectWidget( GetConnectWidget() );
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-#ifdef NEW_GTK_SCROLL_CODE
- GtkWidget *viewport = GTK_BIN(scroll_window)->child;
-#else
+#if (GTK_MINOR_VERSION == 0)
GtkWidget *viewport = scroll_window->viewport;
-#endif
-
GtkStyleClass *viewport_class = viewport->style->klass;
- GtkWidget *hscrollbar = scroll_window->hscrollbar;
- GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
+#endif
+
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
if (scroll_window->vscrollbar_visible)
{
- dw += vscrollbar->allocation.width;
+ dw += 15; /* dw += vscrollbar->allocation.width; */
dw += scroll_class->scrollbar_spacing;
}
if (scroll_window->hscrollbar_visible)
{
- dh += hscrollbar->allocation.height;
+ dh += 15; /* dh += hscrollbar->allocation.height; */
dw += scroll_class->scrollbar_spacing;
}
}
- SetSize( width+dw, height+dh );
+ SetSize( width+dw, height+dh );
}
}
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-#ifdef NEW_GTK_SCROLL_CODE
- GtkWidget *viewport = GTK_BIN(scroll_window)->child;
-#else
+#if (GTK_MINOR_VERSION == 0)
GtkWidget *viewport = scroll_window->viewport;
-#endif
-
GtkStyleClass *viewport_class = viewport->style->klass;
if ((m_windowStyle & wxRAISED_BORDER) ||
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
+#endif
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
if (scroll_window->vscrollbar_visible)
{
-// dw += vscrollbar->allocation.width;
- dw += 15; // range.slider_width = 11 + 2*2pts edge
+ dw += 15; /* dw += vscrollbar->allocation.width; */
dw += scroll_class->scrollbar_spacing;
}
if (scroll_window->hscrollbar_visible)
{
-// dh += hscrollbar->allocation.height;
- dh += 15;
+ dh += 15; /* dh += hscrollbar->allocation.height; */
dh += scroll_class->scrollbar_spacing;
}
}
long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
+#if (GTK_MINOR_VERSION > 0)
+ m_acceptsFocus = TRUE;
+#endif
PreCreation( parent, id, pos, size, style, name );
#if wxUSE_CLIPBOARD
+#include "wx/utils.h"
+
#include "glib.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
static void
targets_selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data,
+#if (GTK_MINOR_VERSION > 0)
+ guint32 WXUNUSED(time),
+#endif
wxClipboard *clipboard )
{
- if (!wxTheClipboard) return;
-
- if (selection_data->length <= 0) return;
+ if (!wxTheClipboard)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct form
- if (selection_data->type != GDK_SELECTION_TYPE_ATOM) return;
+ if (selection_data->length <= 0)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
+
+ /* make sure we got the data in the correct form */
+ if (selection_data->type != GDK_SELECTION_TYPE_ATOM)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
// the atoms we received, holding a list of targets (= formats)
GdkAtom *atoms = (GdkAtom *)selection_data->data;
for (unsigned int i=0; i<selection_data->length/sizeof(GdkAtom); i++)
{
- char *name = gdk_atom_name (atoms[i]);
- if (name) printf( "Format available: %s.\n", name );
+/*
+ char *name = gdk_atom_name (atoms[i]);
+ if (name) printf( "Format available: %s.\n", name );
+*/
if (atoms[i] == clipboard->m_targetRequested)
{
+ clipboard->m_waiting = FALSE;
clipboard->m_formatSupported = TRUE;
return;
}
}
+ clipboard->m_waiting = FALSE;
return;
}
static void
selection_received( GtkWidget *WXUNUSED(widget),
GtkSelectionData *selection_data,
+#if (GTK_MINOR_VERSION > 0)
+ guint32 WXUNUSED(time),
+#endif
wxClipboard *clipboard )
{
- if (!wxTheClipboard) return;
+ if (!wxTheClipboard)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxDataObject *data_object = clipboard->m_receivedData;
- if (!data_object) return;
+ if (!data_object)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- if (selection_data->length <= 0) return;
+ if (selection_data->length <= 0)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct format
-
- if (data_object->GetFormat().GetAtom() != selection_data->target) return;
+ /* make sure we got the data in the correct format */
+ if (data_object->GetFormat().GetAtom() != selection_data->target)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
- // make sure we got the data in the correct form (selection type).
- // if so, copy data to target object
+ /* make sure we got the data in the correct form (selection type).
+ if so, copy data to target object */
switch (data_object->GetFormat().GetType())
{
case wxDF_TEXT:
{
- if (selection_data->type != GDK_SELECTION_TYPE_STRING) return;
+ if (selection_data->type != GDK_SELECTION_TYPE_STRING)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxTextDataObject *text_object = (wxTextDataObject *) data_object;
case wxDF_BITMAP:
{
- if (selection_data->type != GDK_SELECTION_TYPE_BITMAP) return;
-
- return;
+ if (selection_data->type != GDK_SELECTION_TYPE_BITMAP)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
break;
}
case wxDF_PRIVATE:
{
- if (selection_data->type != GDK_SELECTION_TYPE_STRING) return;
+ if (selection_data->type != GDK_SELECTION_TYPE_STRING)
+ {
+ clipboard->m_waiting = FALSE;
+ return;
+ }
wxPrivateDataObject *private_object = (wxPrivateDataObject *) data_object;
default:
{
+ clipboard->m_waiting = FALSE;
return;
}
}
wxTheClipboard->m_formatSupported = TRUE;
+ clipboard->m_waiting = FALSE;
}
//-----------------------------------------------------------------------------
m_receivedData = (wxDataObject*) NULL;
+ /* we use m_targetsWidget to query what formats are available */
+
+ m_targetsWidget = gtk_window_new( GTK_WINDOW_POPUP );
+ gtk_widget_realize( m_targetsWidget );
+
+ gtk_signal_connect( GTK_OBJECT(m_targetsWidget),
+ "selection_received",
+ GTK_SIGNAL_FUNC( targets_selection_received ),
+ (gpointer) this );
+
+ /* we use m_clipboardWidget to get and to offer data */
+
m_clipboardWidget = gtk_window_new( GTK_WINDOW_POPUP );
gtk_widget_realize( m_clipboardWidget );
+ gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
+ "selection_received",
+ GTK_SIGNAL_FUNC( selection_received ),
+ (gpointer) this );
+
gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
"selection_clear_event",
GTK_SIGNAL_FUNC( selection_clear_clip ),
Clear();
if (m_clipboardWidget) gtk_widget_destroy( m_clipboardWidget );
+ if (m_targetsWidget) gtk_widget_destroy( m_targetsWidget );
}
void wxClipboard::Clear()
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
- /* add handler for target (= format) query */
-
- gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
- "selection_received",
- GTK_SIGNAL_FUNC( targets_selection_received ),
- (gpointer) this );
-
m_formatSupported = FALSE;
/* perform query. this will set m_formatSupported to
- * TRUE if m_targetRequested is supported */
-
- gtk_selection_convert( m_clipboardWidget,
+ TRUE if m_targetRequested is supported.
+ alsom we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
+
+ m_waiting = TRUE;
+
+ gtk_selection_convert( m_targetsWidget,
g_clipboardAtom,
g_targetsAtom,
GDK_CURRENT_TIME );
-
- gtk_signal_disconnect_by_func( GTK_OBJECT(m_clipboardWidget),
- GTK_SIGNAL_FUNC( targets_selection_received ),
- (gpointer) this );
-
+
+ while (m_waiting) gtk_main_iteration();
+
if (!m_formatSupported) return FALSE;
return TRUE;
m_formatSupported = FALSE;
- gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
- "selection_received",
- GTK_SIGNAL_FUNC( selection_received ),
- (gpointer) this );
+ /* ask for clipboard contents. this will set
+ m_formatSupported to TRUE if m_targetRequested
+ is supported.
+ also, we have to wait for the "answer" from the
+ clipboard owner which is an asynchronous process.
+ therefore we set m_waiting = TRUE here and wait
+ until the callback "targets_selection_received"
+ sets it to FALSE */
- /* ask for clipboard contents */
+ m_waiting = TRUE;
gtk_selection_convert( m_clipboardWidget,
g_clipboardAtom,
m_targetRequested,
GDK_CURRENT_TIME );
- gtk_signal_disconnect_by_func( GTK_OBJECT(m_clipboardWidget),
- GTK_SIGNAL_FUNC( selection_received ),
- (gpointer) this );
+ while (m_waiting) gtk_main_iteration();
/* this is a true error as we checked for the presence of such data before */
#include "wx/control.h"
+#include "gtk/gtkfeatures.h"
+
//-----------------------------------------------------------------------------
// wxControl
//-----------------------------------------------------------------------------
wxDataFormat::wxDataFormat()
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_type = wxDF_INVALID;
m_hasAtom = FALSE;
m_atom = (GdkAtom) 0;
wxDataFormat::wxDataFormat( wxDataType type )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
SetType( type );
}
wxDataFormat::wxDataFormat( const wxString &id )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
SetId( id );
}
wxDataFormat::wxDataFormat( wxDataFormat &format )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_type = format.GetType();
m_id = format.GetId();
m_hasAtom = TRUE;
wxDataFormat::wxDataFormat( const GdkAtom atom )
{
- if (!g_textAtom) g_textAtom = gdk_atom_intern( "text/plain", FALSE );
+ if (!g_textAtom) g_textAtom = gdk_atom_intern( "STRING", FALSE );
m_hasAtom = TRUE;
m_atom = atom;
if (m_type == wxDF_TEXT)
{
- m_id = "text/plain";
+ m_id = "STRING";
}
else
if (m_type == wxDF_BITMAP)
gtk_widget_realize( m_widget );
+ long decor = (long) GDK_DECOR_ALL;
+ long func = (long) GDK_FUNC_ALL;
+
+ if ((m_windowStyle & wxCAPTION) == 0)
+ decor |= GDK_DECOR_TITLE;
+ if ((m_windowStyle & wxMINIMIZE) == 0)
+ func |= GDK_FUNC_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE) == 0)
+ func |= GDK_FUNC_MAXIMIZE;
+ if ((m_windowStyle & wxSYSTEM_MENU) == 0)
+ decor |= GDK_DECOR_MENU;
+ if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MAXIMIZE;
+ if ((m_windowStyle & wxRESIZE_BORDER) == 0)
+ func |= GDK_FUNC_RESIZE;
+
+ gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
+ gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
+
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
gtk_widget_realize( m_widget );
+ long decor = (long) GDK_DECOR_ALL;
+ long func = (long) GDK_FUNC_ALL;
+
+ if ((m_windowStyle & wxCAPTION) == 0)
+ decor |= GDK_DECOR_TITLE;
+ if ((m_windowStyle & wxMINIMIZE) == 0)
+ func |= GDK_FUNC_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE) == 0)
+ func |= GDK_FUNC_MAXIMIZE;
+ if ((m_windowStyle & wxSYSTEM_MENU) == 0)
+ decor |= GDK_DECOR_MENU;
+ if ((m_windowStyle & wxMINIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MINIMIZE;
+ if ((m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ decor |= GDK_DECOR_MAXIMIZE;
+ if ((m_windowStyle & wxRESIZE_BORDER) == 0)
+ func |= GDK_FUNC_RESIZE;
+
+ gdk_window_set_decorations(m_widget->window, (GdkWMDecoration)decor);
+ gdk_window_set_functions(m_widget->window, (GdkWMFunction)func);
+
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
SetValidator( validator );
m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ if (style & wxLB_ALWAYS_SB)
+ {
+ gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS );
+ }
+ else
+ {
+ gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+ }
m_list = GTK_LIST( gtk_list_new() );
gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_list) );
#endif
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxListBox::m_widget", name );
-
- debug_focus_in( GTK_WIDGET(m_list), "wxListBox::m_list", name );
-
- GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-
- debug_focus_in( s_window->hscrollbar, "wxWindow::hsrcollbar", name );
- debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
-
-#ifdef NEW_GTK_SCROLL_CODE
- GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
-#else
- GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-#endif
-
- debug_focus_in( GTK_WIDGET(viewport), "wxWindow::viewport", name );
-#endif
-
gtk_widget_show( GTK_WIDGET(m_list) );
wxSize newSize = size;
list_item = gtk_list_item_new_with_label( str );
-#ifdef __WXDEBUG__
- debug_focus_in( list_item, "wxListBox::list_item", name );
-#endif
-
gtk_container_add( GTK_CONTAINER(m_list), list_item );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
void wxMenuBar::Append( wxMenu *menu, const wxString &title )
{
m_menus.Append( menu );
- wxString title2 = title;
-
- int pos;
- do
+
+ wxString s = "";
+ for ( const char *pc = title; *pc != '\0'; pc++ )
{
- pos = title2.First( '&' );
- if (pos != wxNOT_FOUND)
- title2.Remove( pos, 1 );
- } while (pos != wxNOT_FOUND);
-
- menu->SetTitle(title2);
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ // s << '_'; not yet
+#endif
+ }
+ s << *pc;
+ }
- menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(title2) );
+ menu->SetTitle(s);
+ menu->m_owner = gtk_menu_item_new_with_label( WXSTRINGCAST(s) );
gtk_widget_show( menu->m_owner );
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
m_text = "";
for ( const char *pc = str; *pc != '\0'; pc++ )
{
- if (*pc == '&') pc++; /* skip it */
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ m_text << '_';
+#endif
+ }
m_text << *pc;
}
m_title = title;
m_items.DeleteContents( TRUE );
m_invokingWindow = (wxWindow *) NULL;
+
+#if (GTK_MINOR_VERSION > 0)
+ m_accel = gtk_accel_group_new();
+ m_factory = gtk_item_factory_new( GTK_TYPE_MENU, "<main>", m_accel );
+ m_menu = gtk_item_factory_get_widget( m_factory, "<main>" );
+#else
m_menu = gtk_menu_new(); // Do not show!
+#endif
m_callback = func;
m_eventHandler = this;
m_owner = (GtkWidget*) NULL;
}
+wxMenu::~wxMenu()
+{
+ /* how do we delete an item-factory ? */
+}
+
void wxMenu::SetTitle( const wxString& title )
{
// TODO Waiting for something better
GtkWidget *menuItem = gtk_menu_item_new();
gtk_menu_append( GTK_MENU(m_menu), menuItem );
gtk_widget_show( menuItem );
+
mitem->SetMenuItem(menuItem);
m_items.Append( mitem );
}
mitem->SetHelp(helpStr);
mitem->SetCheckable(checkable);
const char *text = mitem->GetText();
+
+#if (GTK_MINOR_VERSION > 0)
+ char buf[100];
+ strcpy( buf, "/" );
+ strcat( buf, text );
+
+ GtkItemFactoryEntry entry;
+ entry.path = buf;
+ entry.accelerator = (gchar*) NULL;
+ entry.callback = (GtkItemFactoryCallback) gtk_menu_clicked_callback;
+ entry.callback_action = 0;
+ if (checkable)
+ entry.item_type = "<CheckItem>";
+ else
+ entry.item_type = "<Item>";
+
+ gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
+
+ /* in order to get the pointer to the item we need the item text _without_ underscores */
+ wxString s = "<main>/";
+ for ( const char *pc = text; *pc != '\0'; pc++ )
+ {
+ if (*pc == '_') pc++; /* skip it */
+ s << *pc;
+ }
+
+ GtkWidget *menuItem = gtk_item_factory_get_item( m_factory, s );
+
+#else
+
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
: gtk_menu_item_new_with_label(text);
-
- mitem->SetMenuItem(menuItem);
-
+
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
- (gpointer*)this );
+ (gpointer)this );
+
+ gtk_menu_append( GTK_MENU(m_menu), menuItem );
+ gtk_widget_show( menuItem );
+
+#endif
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
- (gpointer*)this );
+ (gpointer)this );
gtk_signal_connect( GTK_OBJECT(menuItem), "deselect",
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
- (gpointer*)this );
+ (gpointer)this );
+
+ mitem->SetMenuItem(menuItem);
- gtk_menu_append( GTK_MENU(m_menu), menuItem );
- gtk_widget_show( menuItem );
m_items.Append( mitem );
}
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s( itemString );
-
- int pos;
- do
+ wxString s = "";
+ for ( const char *pc = itemString; *pc != '\0'; pc++ )
{
- pos = s.First( '&' );
- if (pos != -1) s.Remove( pos, 1 );
- } while (pos != -1);
+ if (*pc == '&')
+ {
+ pc++; /* skip it */
+#if (GTK_MINOR_VERSION > 0)
+ s << '_';
+#endif
+ }
+ s << *pc;
+ }
wxNode *node = m_items.First();
while (node)
m_widget = gtk_notebook_new();
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxNotebook::m_widget", name );
-#endif
-
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
m_idHandler = gtk_signal_connect (
static void
gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
- win->SetModified();
+ if (!win->m_hasVMT) return;
- win->CalculateScrollbar();
+ win->SetModified();
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->m_windowId );
event.SetString( win->GetValue() );
}
//-----------------------------------------------------------------------------
-// "size_allocate"
+// "changed" from vertical scrollbar
//-----------------------------------------------------------------------------
static void
-gtk_text_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* WXUNUSED(alloc), wxTextCtrl *win )
+gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
+ if (!win->m_hasVMT) return;
+
win->CalculateScrollbar();
}
SetValidator( validator );
- m_vScrollbarVisible = TRUE;
+ m_vScrollbarVisible = FALSE;
bool multi_line = (style & wxTE_MULTILINE) != 0;
if ( multi_line )
{
- // a multi-line edit control: create a vertical scrollbar by default and
- // horizontal if requested
+ /* a multi-line edit control: create a vertical scrollbar by default and
+ horizontal if requested */
bool bHasHScrollbar = (style & wxHSCROLL) != 0;
- // create our control...
+ /* create our control ... */
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
- // ... and put into the upper left hand corner of the table
+ /* ... and put into the upper left hand corner of the table */
m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
(GtkAttachOptions)(GTK_FILL | GTK_EXPAND | GTK_SHRINK),
0, 0);
- // put the horizontal scrollbar in the lower left hand corner
+ /* put the horizontal scrollbar in the lower left hand corner */
if (bHasHScrollbar)
{
GtkWidget *hscrollbar = gtk_hscrollbar_new(GTK_TEXT(m_text)->hadj);
gtk_widget_show(hscrollbar);
}
- // finally, put the vertical scrollbar in the upper right corner
- m_vScrollbar = gtk_vscrollbar_new( GTK_TEXT(m_text)->vadj );
- GTK_WIDGET_UNSET_FLAGS( m_vScrollbar, GTK_CAN_FOCUS );
-
- gtk_table_attach(GTK_TABLE(m_widget), m_vScrollbar, 1, 2, 0, 1,
- GTK_FILL,
- (GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
- 0, 0);
- gtk_widget_show( m_vScrollbar );
+ /* we create the vertical scrollbar on demand */
+ m_vScrollbar = (GtkWidget*) NULL;
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_text_size_callback), (gpointer)this );
}
else
{
- // a single-line text control: no need for scrollbars
+ /* a single-line text control: no need for scrollbars */
m_widget =
m_text = gtk_entry_new();
}
gtk_widget_show(m_text);
}
- // we want to be notified about text changes
+ /* we want to be notified about text changes */
gtk_signal_connect( GTK_OBJECT(m_text), "changed",
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
if (multi_line)
gtk_text_set_editable( GTK_TEXT(m_text), 1 );
}
+
+ SetBackgroundColour( parent->GetBackgroundColour() );
+ SetForegroundColour( parent->GetForegroundColour() );
Show( TRUE );
- SetBackgroundColour( parent->GetBackgroundColour() );
- SetForegroundColour( parent->GetForegroundColour() );
+ if (multi_line)
+ {
+ gtk_signal_connect(GTK_OBJECT(GTK_TEXT(m_text)->vadj), "changed",
+ (GtkSignalFunc) gtk_scrollbar_changed_callback, (gpointer) this );
+ }
return TRUE;
}
{
if (m_vScrollbarVisible)
{
- gtk_widget_hide( m_vScrollbar );
+ gtk_widget_hide( m_vScrollbar );
- m_vScrollbarVisible = FALSE;
+ m_vScrollbarVisible = FALSE;
}
}
else
{
if (!m_vScrollbarVisible)
{
- gtk_widget_show( m_vScrollbar );
+ if (!m_vScrollbar)
+ {
+ /* finally, put the vertical scrollbar in the upper right corner */
+ m_vScrollbar = gtk_vscrollbar_new( GTK_TEXT(m_text)->vadj );
+ GTK_WIDGET_UNSET_FLAGS( m_vScrollbar, GTK_CAN_FOCUS );
+
+ gtk_table_attach(GTK_TABLE(m_widget), m_vScrollbar, 1, 2, 0, 1,
+ GTK_FILL,
+ (GtkAttachOptions)(GTK_EXPAND | GTK_FILL | GTK_SHRINK),
+ 0, 0);
+ }
+
+ gtk_widget_show( m_vScrollbar );
- m_vScrollbarVisible = TRUE;
+ m_vScrollbarVisible = TRUE;
}
}
}
/////////////////////////////////////////////////////////////////////////// */
#include "wx/gtk/win_gtk.h"
-#include <gtk/gtkfeatures.h>
-
-/*-------------------------------------------------------------------------
-// conditional compilation
-//------------------------------------------------------------------------- */
-
-#if (GTK_MINOR_VERSION > 0)
-#define NEW_GTK_CONSTRUCT_CODE
-#endif
+#include "gtk/gtksignal.h"
#ifdef __cplusplus
extern "C" {
static void gtk_myfixed_class_init (GtkMyFixedClass *klass);
static void gtk_myfixed_init (GtkMyFixed *myfixed);
static void gtk_myfixed_map (GtkWidget *widget);
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
static void gtk_myfixed_unmap (GtkWidget *widget);
#endif
static void gtk_myfixed_realize (GtkWidget *widget);
#endif
GtkCallback callback,
gpointer callback_data);
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
static GtkType gtk_myfixed_child_type (GtkContainer *container);
#endif
+#if (GTK_MINOR_VERSION > 0)
+static void gtk_myfixed_scroll_set_adjustments (GtkMyFixed *myfixed,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj);
+#endif
-static GtkContainerClass *parent_class = NULL;
+static GtkContainerClass *parent_class = NULL;
+
guint
gtk_myfixed_get_type ()
{
sizeof (GtkMyFixedClass),
(GtkClassInitFunc) gtk_myfixed_class_init,
(GtkObjectInitFunc) gtk_myfixed_init,
-#ifndef NEW_GTK_CONSTRUCT_CODE
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL,
-#else
+#if (GTK_MINOR_VERSION > 0)
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
+#else
+ (GtkArgSetFunc) NULL,
+ (GtkArgGetFunc) NULL,
#endif
};
widget_class = (GtkWidgetClass*) klass;
container_class = (GtkContainerClass*) klass;
-#ifndef NEW_GTK_CONSTRUCT_CODE
- parent_class = gtk_type_class (gtk_container_get_type ());
-#else
+#if (GTK_MINOR_VERSION > 0)
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
+#else
+ parent_class = gtk_type_class (gtk_container_get_type ());
#endif
widget_class->map = gtk_myfixed_map;
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
widget_class->unmap = gtk_myfixed_unmap;
#endif
widget_class->realize = gtk_myfixed_realize;
container_class->foreach = gtk_myfixed_foreach;
#endif
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
container_class->child_type = gtk_myfixed_child_type;
#endif
+
+#if (GTK_MINOR_VERSION > 0)
+ klass->set_scroll_adjustments = gtk_myfixed_scroll_set_adjustments;
+
+ widget_class->set_scroll_adjustments_signal =
+ gtk_signal_new ("set_scroll_adjustments",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (GtkMyFixedClass, set_scroll_adjustments),
+ gtk_marshal_NONE__POINTER_POINTER,
+ GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
+#endif
}
-#ifdef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION > 0)
static GtkType
gtk_myfixed_child_type (GtkContainer *container)
{
{
GTK_WIDGET_UNSET_FLAGS (myfixed, GTK_NO_WINDOW);
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
GTK_WIDGET_SET_FLAGS (myfixed, GTK_BASIC);
#endif
+#if (GTK_MINOR_VERSION > 0)
+ myfixed->shadow_type = GTK_SHADOW_NONE;
+#endif
+
myfixed->children = NULL;
}
return GTK_WIDGET (myfixed);
}
+#if (GTK_MINOR_VERSION > 0)
+void gtk_myfixed_scroll_set_adjustments (GtkMyFixed *myfixed,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj)
+{
+ /* OK, this is embarassing, but this function has to be here */
+}
+
+void
+gtk_myfixed_set_shadow_type (GtkMyFixed *myfixed,
+ GtkShadowType type)
+{
+ g_return_if_fail (myfixed != NULL);
+ g_return_if_fail (GTK_IS_MYFIXED (myfixed));
+
+ if ((GtkShadowType) myfixed->shadow_type != type)
+ {
+ myfixed->shadow_type = type;
+
+ if (GTK_WIDGET_VISIBLE (myfixed))
+ {
+ gtk_widget_size_allocate (GTK_WIDGET (myfixed), &(GTK_WIDGET (myfixed)->allocation));
+ gtk_widget_queue_draw (GTK_WIDGET (myfixed));
+ }
+ }
+}
+#endif
+
void
-gtk_myfixed_put (GtkMyFixed *myfixed,
+gtk_myfixed_put (GtkMyFixed *myfixed,
GtkWidget *widget,
gint16 x,
gint16 y)
}
}
-#ifndef NEW_GTK_CONSTRUCT_CODE
+#if (GTK_MINOR_VERSION == 0)
static void
gtk_myfixed_unmap (GtkWidget *widget)
{
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
+
+#if (GTK_MINOR_VERSION > 0)
+ if (myfixed->shadow_type != GTK_SHADOW_NONE)
+ {
+ attributes.x = 2;
+ attributes.y = 2;
+ }
+ else
+ {
+ attributes.x = 0;
+ attributes.y = 0;
+ }
+ attributes.width = MAX (1, (gint)widget->allocation.width - attributes.x * 2 );
+ attributes.height = MAX (1, (gint)widget->allocation.height - attributes.y * 2 );
+#else
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = 32000;
attributes.height = 32000;
+#endif
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
GtkAllocation *allocation)
{
GtkMyFixed *myfixed;
+ gint border;
GtkMyFixedChild *child;
- GtkAllocation child_allocation;
- GList *children;
- guint16 border_width;
+ GtkAllocation child_allocation;
+ GList *children;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_MYFIXED(widget));
myfixed = GTK_MYFIXED (widget);
+ if (myfixed->shadow_type == GTK_SHADOW_NONE)
+ border = 0;
+ else
+ border = 2;
+
widget->allocation = *allocation;
if (GTK_WIDGET_REALIZED (widget))
- gdk_window_move_resize (widget->window, allocation->x, allocation->y, 32000, 32000 );
+ {
+ gdk_window_move_resize( widget->window,
+ allocation->x+border, allocation->y+border,
+#if (GTK_MINOR_VERSION > 0)
+ allocation->width-border*2, allocation->height-border*2 );
+#else
+ 32000, 32000 );
+#endif
+ }
- border_width = GTK_CONTAINER (myfixed)->border_width;
-
children = myfixed->children;
while (children)
{
if (GTK_WIDGET_VISIBLE (child->widget))
{
- child_allocation.x = child->x + border_width;
- child_allocation.y = child->y + border_width;
+ child_allocation.x = child->x;
+ child_allocation.y = child->y;
child_allocation.width = child->widget->requisition.width;
child_allocation.height = child->widget->requisition.height;
gtk_widget_size_allocate (child->widget, &child_allocation);
*/
//-------------------------------------------------------------------------
-// conditional compilation
+// constants
//-------------------------------------------------------------------------
-#if (GTK_MINOR_VERSION > 0)
-#define NEW_GTK_SCROLL_CODE
-#endif
+#define FRAME_BORDER_WIDTH 2
//-----------------------------------------------------------------------------
-// (debug)
+// data
//-----------------------------------------------------------------------------
-#ifdef __WXDEBUG__
+extern wxList wxPendingDelete;
+extern bool g_blockEventsOnDrag;
+extern bool g_blockEventsOnScroll;
+static bool g_capturing = FALSE;
+static wxWindow *g_focusWindow = (wxWindow*) NULL;
-static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget),
- GdkEvent *WXUNUSED(event),
- const char *name )
-{
- printf( "FOCUS NOW AT: " );
- printf( name );
- printf( "\n" );
+/* hack: we need something to pass to gtk_menu_popup, so we store the time of
+ the last click here */
+static guint32 gs_timeLastClick = 0;
- return FALSE;
-}
+//-----------------------------------------------------------------------------
+// local code (see below)
+//-----------------------------------------------------------------------------
-void debug_focus_in( GtkWidget* widget, const char* name, const char *window )
+static void draw_frame( GtkWidget *widget, wxWindow *win )
{
- return;
+ if (!win->HasVMT()) return;
- wxString tmp = name;
- tmp += " FROM ";
- tmp += window;
+ int dw = 0;
+ int dh = 0;
+
+ if (win->m_hasScrolling)
+ {
+ GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(widget);
+ GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(widget)->klass );
- char *s = new char[tmp.Length()+1];
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
- strcpy( s, WXSTRINGCAST tmp );
+ if (scroll_window->vscrollbar_visible)
+ {
+ dw += 15; /* dw += vscrollbar->allocation.width; */
+ dw += scroll_class->scrollbar_spacing;
+ }
- gtk_signal_connect( GTK_OBJECT(widget), "focus_in_event",
- GTK_SIGNAL_FUNC(gtk_debug_focus_in_callback), (gpointer)s );
+ if (scroll_window->hscrollbar_visible)
+ {
+ dh += 15; /* dh += hscrollbar->allocation.height; */
+ dw += scroll_class->scrollbar_spacing;
+ }
+ }
+
+ int dx = 0;
+ int dy = 0;
+ if (GTK_WIDGET_NO_WINDOW (widget))
+ {
+ dx += widget->allocation.x;
+ dy += widget->allocation.y;
+ }
+ else
+ if (win->m_parent)
+ {
+ wxPoint pt(win->m_parent->GetClientAreaOrigin());
+ dx += pt.x;
+ dy += pt.y;
+ }
+
+ if (win->m_windowStyle & wxRAISED_BORDER)
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_OUT,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
+
+ if (win->m_windowStyle & wxSUNKEN_BORDER)
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
}
-#endif
-
//-----------------------------------------------------------------------------
-// data
+// "expose_event" of m_widget
//-----------------------------------------------------------------------------
-extern wxList wxPendingDelete;
-extern bool g_blockEventsOnDrag;
-extern bool g_blockEventsOnScroll;
-static bool g_capturing = FALSE;
-static wxWindow *g_focusWindow = (wxWindow*) NULL;
+static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
+{
+ if (gdk_event->count > 0) return;
+ draw_frame( widget, win );
+}
-// hack: we need something to pass to gtk_menu_popup, so we store the time of
-// the last click here
-static guint32 gs_timeLastClick = 0;
+//-----------------------------------------------------------------------------
+// "draw" of m_wxwindow
+//-----------------------------------------------------------------------------
+
+static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindow *win )
+{
+ draw_frame( widget, win );
+}
//-----------------------------------------------------------------------------
-// "expose_event" (of m_wxwindow, not of m_widget)
+// "expose_event" of m_wxwindow
//-----------------------------------------------------------------------------
static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win )
}
//-----------------------------------------------------------------------------
-// "draw" (of m_wxwindow, not of m_widget)
+// "draw" of m_wxwindow
//-----------------------------------------------------------------------------
static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxWindow *win )
if (ret)
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
+ return TRUE;
}
- return ret;
+ return FALSE;
}
//-----------------------------------------------------------------------------
event.m_y = 0;
event.SetEventObject( win );
- bool ret = win->GetEventHandler()->ProcessEvent( event );
-
- if (ret)
+ if (win->GetEventHandler()->ProcessEvent( event ))
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
+ return TRUE;
}
- return ret;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
+ if (!win->HasVMT()) return FALSE;
if (g_blockEventsOnDrag) return TRUE;
if (g_blockEventsOnScroll) return TRUE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
+
if (win->m_wxwindow)
{
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow) && !GTK_WIDGET_HAS_FOCUS (win->m_wxwindow) )
}
}
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnButtonPress from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
gs_timeLastClick = gdk_event->time;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxWindow *win )
{
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
- if (g_blockEventsOnDrag) return TRUE;
- if (g_blockEventsOnScroll) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (g_blockEventsOnScroll) return FALSE;
- if (!win->HasVMT()) return TRUE;
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
/*
printf( "OnButtonRelease from " );
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxWindow *win )
{
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (g_blockEventsOnScroll) return FALSE;
+
+ if (!win->IsOwnGtkWindow( gdk_event->window )) return FALSE;
+
if (gdk_event->is_hint)
{
int x = 0;
gdk_event->state = state;
}
- if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
-
- if (g_blockEventsOnDrag) return TRUE;
- if (g_blockEventsOnScroll) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnMotion from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "motion_notify_event" );
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
g_focusWindow = win;
}
}
- if (!win->HasVMT()) return TRUE;
/*
printf( "OnSetFocus from " );
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_in_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED(event), wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+
if (win->m_wxwindow)
{
if (GTK_WIDGET_CAN_FOCUS(win->m_wxwindow))
GTK_WIDGET_UNSET_FLAGS (win->m_wxwindow, GTK_HAS_FOCUS);
}
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnKillFocus from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.SetEventObject( win );
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "focus_out_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+
+ if (widget->window != gdk_event->window) return FALSE;
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, win->m_cursor->GetCursor() );
- if (widget->window != gdk_event->window) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnEnter from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.m_y -= pt.y;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_event, wxWindow *win )
{
- if (g_blockEventsOnDrag) return TRUE;
+ if (!win->HasVMT()) return FALSE;
+ if (g_blockEventsOnDrag) return FALSE;
+ if (widget->window != gdk_event->window) return FALSE;
+
if ((widget->window) && (win->m_cursor))
gdk_window_set_cursor( widget->window, wxSTANDARD_CURSOR->GetCursor() );
- if (widget->window != gdk_event->window) return TRUE;
-
- if (!win->HasVMT()) return TRUE;
-
/*
printf( "OnLeave from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
event.m_y -= pt.y;
if (win->GetEventHandler()->ProcessEvent( event ))
+ {
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
-
- return TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
//-----------------------------------------------------------------------------
m_widget = gtk_scrolled_window_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-#ifdef __WXDEBUG__
- debug_focus_in( m_widget, "wxWindow::m_widget", name );
-#endif
-
GtkScrolledWindow *s_window = GTK_SCROLLED_WINDOW(m_widget);
-#ifdef __WXDEBUG__
- debug_focus_in( s_window->hscrollbar, "wxWindow::hsrcollbar", name );
- debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
-#endif
-
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
scroll_class->scrollbar_spacing = 0;
m_wxwindow = gtk_myfixed_new();
-#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, "wxWindow::m_wxwindow", name );
-#endif
+ gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
+
+#if (GTK_MINOR_VERSION > 0)
+ GtkMyFixed *myfixed = GTK_MYFIXED(m_wxwindow);
-#ifdef NEW_GTK_SCROLL_CODE
- gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), m_wxwindow );
- GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
+ if (m_windowStyle & wxRAISED_BORDER)
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_OUT );
+ }
+ else if (m_windowStyle & wxSUNKEN_BORDER)
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_IN );
+ }
+ else
+ {
+ gtk_myfixed_set_shadow_type( myfixed, GTK_SHADOW_NONE );
+ }
#else
- gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
-#endif
-
-#ifdef __WXDEBUG__
- debug_focus_in( GTK_WIDGET(viewport), "wxWindow::viewport", name );
-#endif
if (m_windowStyle & wxRAISED_BORDER)
{
{
gtk_viewport_set_shadow_type( viewport, GTK_SHADOW_NONE );
}
+#endif
if (m_windowStyle & wxTAB_TRAVERSAL)
{
m_acceptsFocus = TRUE;
}
+#if (GTK_MINOR_VERSION == 0)
// shut the viewport up
gtk_viewport_set_hadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
gtk_viewport_set_vadjustment( viewport, (GtkAdjustment*) gtk_adjustment_new( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
+#endif
// I _really_ don't want scrollbars in the beginning
m_vAdjust->lower = 0.0;
gtk_signal_connect( GTK_OBJECT(s_window->hscrollbar), "button_release_event",
(GtkSignalFunc)gtk_scrollbar_button_release_callback, (gpointer) this );
- // these handers het notified when screen updates are required either when
+ // these handlers get notified when screen updates are required either when
// scrolling or when the window size (and therefore scrollbar configuration)
// has changed
if (m_wxwindow)
{
+ /* these get reported to wxWindows -> wxPaintEvent */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "expose_event",
GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw",
GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
+
+ /* these are called when the "sunken" or "raised" borders are drawn */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event",
+ GTK_SIGNAL_FUNC(gtk_window_own_expose_callback), (gpointer)this );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "draw",
+ GTK_SIGNAL_FUNC(gtk_window_own_draw_callback), (gpointer)this );
}
ConnectWidget( GetConnectWidget() );
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-#ifdef NEW_GTK_SCROLL_CODE
- GtkWidget *viewport = GTK_BIN(scroll_window)->child;
-#else
+#if (GTK_MINOR_VERSION == 0)
GtkWidget *viewport = scroll_window->viewport;
-#endif
-
GtkStyleClass *viewport_class = viewport->style->klass;
- GtkWidget *hscrollbar = scroll_window->hscrollbar;
- GtkWidget *vscrollbar = scroll_window->vscrollbar;
-
if ((m_windowStyle & wxRAISED_BORDER) ||
(m_windowStyle & wxSUNKEN_BORDER))
{
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
+#endif
+
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
if (scroll_window->vscrollbar_visible)
{
- dw += vscrollbar->allocation.width;
+ dw += 15; /* dw += vscrollbar->allocation.width; */
dw += scroll_class->scrollbar_spacing;
}
if (scroll_window->hscrollbar_visible)
{
- dh += hscrollbar->allocation.height;
+ dh += 15; /* dh += hscrollbar->allocation.height; */
dw += scroll_class->scrollbar_spacing;
}
}
- SetSize( width+dw, height+dh );
+ SetSize( width+dw, height+dh );
}
}
GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(m_widget);
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
-#ifdef NEW_GTK_SCROLL_CODE
- GtkWidget *viewport = GTK_BIN(scroll_window)->child;
-#else
+#if (GTK_MINOR_VERSION == 0)
GtkWidget *viewport = scroll_window->viewport;
-#endif
-
GtkStyleClass *viewport_class = viewport->style->klass;
if ((m_windowStyle & wxRAISED_BORDER) ||
dw += 2 * viewport_class->xthickness;
dh += 2 * viewport_class->ythickness;
}
+#endif
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
if (scroll_window->vscrollbar_visible)
{
-// dw += vscrollbar->allocation.width;
- dw += 15; // range.slider_width = 11 + 2*2pts edge
+ dw += 15; /* dw += vscrollbar->allocation.width; */
dw += scroll_class->scrollbar_spacing;
}
if (scroll_window->hscrollbar_visible)
{
-// dh += hscrollbar->allocation.height;
- dh += 15;
+ dh += 15; /* dh += hscrollbar->allocation.height; */
dh += scroll_class->scrollbar_spacing;
}
}
Release: 1
Copyright: wxWindows Licence
Group: X11/Libraries
-Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK210.tgz
+Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK21b.tgz
URL: http://www.freiburg.linux.de/~wxxt/docs.html
Packager: Robert Roebling <roebling@ruf.uni-freiburg.de>
Requires: gtk+ >= 1.2.0