Added USE_CONFIG
A little more DnD work wxDialog now inherits from wxPanel (recompile) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -661,6 +661,7 @@ DEFAULT_USE_GDK_IMLIB=1
|
|||||||
DEFAULT_USE_LIBPNG=1
|
DEFAULT_USE_LIBPNG=1
|
||||||
DEFAULT_USE_ODBC=1
|
DEFAULT_USE_ODBC=1
|
||||||
|
|
||||||
|
DEFAULT_USE_COMBOBOX=1
|
||||||
DEFAULT_USE_GAUGE=1
|
DEFAULT_USE_GAUGE=1
|
||||||
DEFAULT_USE_SCROLLBAR=1
|
DEFAULT_USE_SCROLLBAR=1
|
||||||
DEFAULT_USE_LISTCTRL=1
|
DEFAULT_USE_LISTCTRL=1
|
||||||
@@ -787,6 +788,10 @@ AC_OVERRIDES(gauge,gauge,
|
|||||||
**--with-gauge use wxGauge class,
|
**--with-gauge use wxGauge class,
|
||||||
USE_GAUGE)
|
USE_GAUGE)
|
||||||
|
|
||||||
|
AC_OVERRIDES(combobox,combobox,
|
||||||
|
**--with-combobox use wxComboBox class,
|
||||||
|
USE_COMBOBOX)
|
||||||
|
|
||||||
AC_OVERRIDES(scrollbar,scrollbar,
|
AC_OVERRIDES(scrollbar,scrollbar,
|
||||||
**--with-scrollbar use wxScrollbar class,
|
**--with-scrollbar use wxScrollbar class,
|
||||||
USE_SCROLLBAR)
|
USE_SCROLLBAR)
|
||||||
@@ -1130,6 +1135,10 @@ if test "$USE_GAUGE" = 1 ; then
|
|||||||
AC_DEFINE_UNQUOTED(USE_GAUGE,$USE_GAUGE)
|
AC_DEFINE_UNQUOTED(USE_GAUGE,$USE_GAUGE)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$USE_COMBOBOX" = 1 ; then
|
||||||
|
AC_DEFINE_UNQUOTED(USE_COMBOBOX,$USE_COMBOBOX)
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$USE_SCROLLBAR" = 1 ; then
|
if test "$USE_SCROLLBAR" = 1 ; then
|
||||||
AC_DEFINE_UNQUOTED(USE_SCROLLBAR,$USE_SCROLLBAR)
|
AC_DEFINE_UNQUOTED(USE_SCROLLBAR,$USE_SCROLLBAR)
|
||||||
fi
|
fi
|
||||||
|
@@ -17,10 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/object.h"
|
#include "wx/panel.h"
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/event.h"
|
|
||||||
#include "wx/window.h"
|
|
||||||
#include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -45,7 +42,7 @@ extern const char *wxDialogNameStr;
|
|||||||
// wxDialog
|
// wxDialog
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxDialog: public wxWindow
|
class wxDialog: public wxPanel
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||||
|
|
||||||
|
@@ -82,7 +82,9 @@ class wxListBox: public wxControl
|
|||||||
void SetSelection( int n, bool select = TRUE );
|
void SetSelection( int n, bool select = TRUE );
|
||||||
void SetString( int n, const wxString &string );
|
void SetString( int n, const wxString &string );
|
||||||
void SetStringSelection( const wxString &string, bool select = TRUE );
|
void SetStringSelection( const wxString &string, bool select = TRUE );
|
||||||
|
|
||||||
void SetFont( const wxFont &font );
|
void SetFont( const wxFont &font );
|
||||||
|
void SetDropTarget( wxDropTarget *dropTarget );
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
|
@@ -61,6 +61,8 @@ extern const wxPoint wxDefaultPosition;
|
|||||||
|
|
||||||
class wxWindow: public wxEvtHandler
|
class wxWindow: public wxEvtHandler
|
||||||
{
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxWindow)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxWindow();
|
wxWindow();
|
||||||
inline wxWindow(wxWindow *parent, wxWindowID id,
|
inline wxWindow(wxWindow *parent, wxWindowID id,
|
||||||
@@ -228,15 +230,17 @@ public:
|
|||||||
virtual bool AcceptsFocus() const;
|
virtual bool AcceptsFocus() const;
|
||||||
void UpdateWindowUI();
|
void UpdateWindowUI();
|
||||||
|
|
||||||
public: // cannot get private going yet
|
// implementation
|
||||||
|
|
||||||
virtual GtkWidget* GetConnectWidget(void);
|
virtual GtkWidget* GetConnectWidget(void);
|
||||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
|
void ConnectWidget( GtkWidget *widget );
|
||||||
|
void ConnectDnDWidget( GtkWidget *widget );
|
||||||
|
void DisconnectDnDWidget( GtkWidget *widget );
|
||||||
|
|
||||||
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
|
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
|
||||||
const wxSize &size, long style, const wxString &name );
|
const wxSize &size, long style, const wxString &name );
|
||||||
void PostCreation();
|
void PostCreation();
|
||||||
void ConnectWidget( GtkWidget *widget );
|
|
||||||
bool HasVMT();
|
bool HasVMT();
|
||||||
virtual void ImplementSetSize();
|
virtual void ImplementSetSize();
|
||||||
virtual void ImplementSetPosition();
|
virtual void ImplementSetPosition();
|
||||||
@@ -313,7 +317,6 @@ public:
|
|||||||
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
||||||
virtual void GetPositionConstraint(int *x, int *y) const ;
|
virtual void GetPositionConstraint(int *x, int *y) const ;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindow)
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -17,10 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/object.h"
|
#include "wx/panel.h"
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/event.h"
|
|
||||||
#include "wx/window.h"
|
|
||||||
#include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -45,7 +42,7 @@ extern const char *wxDialogNameStr;
|
|||||||
// wxDialog
|
// wxDialog
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxDialog: public wxWindow
|
class wxDialog: public wxPanel
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||||
|
|
||||||
|
@@ -82,7 +82,9 @@ class wxListBox: public wxControl
|
|||||||
void SetSelection( int n, bool select = TRUE );
|
void SetSelection( int n, bool select = TRUE );
|
||||||
void SetString( int n, const wxString &string );
|
void SetString( int n, const wxString &string );
|
||||||
void SetStringSelection( const wxString &string, bool select = TRUE );
|
void SetStringSelection( const wxString &string, bool select = TRUE );
|
||||||
|
|
||||||
void SetFont( const wxFont &font );
|
void SetFont( const wxFont &font );
|
||||||
|
void SetDropTarget( wxDropTarget *dropTarget );
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
|
@@ -61,6 +61,8 @@ extern const wxPoint wxDefaultPosition;
|
|||||||
|
|
||||||
class wxWindow: public wxEvtHandler
|
class wxWindow: public wxEvtHandler
|
||||||
{
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxWindow)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxWindow();
|
wxWindow();
|
||||||
inline wxWindow(wxWindow *parent, wxWindowID id,
|
inline wxWindow(wxWindow *parent, wxWindowID id,
|
||||||
@@ -228,15 +230,17 @@ public:
|
|||||||
virtual bool AcceptsFocus() const;
|
virtual bool AcceptsFocus() const;
|
||||||
void UpdateWindowUI();
|
void UpdateWindowUI();
|
||||||
|
|
||||||
public: // cannot get private going yet
|
// implementation
|
||||||
|
|
||||||
virtual GtkWidget* GetConnectWidget(void);
|
virtual GtkWidget* GetConnectWidget(void);
|
||||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||||
|
void ConnectWidget( GtkWidget *widget );
|
||||||
|
void ConnectDnDWidget( GtkWidget *widget );
|
||||||
|
void DisconnectDnDWidget( GtkWidget *widget );
|
||||||
|
|
||||||
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
|
void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
|
||||||
const wxSize &size, long style, const wxString &name );
|
const wxSize &size, long style, const wxString &name );
|
||||||
void PostCreation();
|
void PostCreation();
|
||||||
void ConnectWidget( GtkWidget *widget );
|
|
||||||
bool HasVMT();
|
bool HasVMT();
|
||||||
virtual void ImplementSetSize();
|
virtual void ImplementSetSize();
|
||||||
virtual void ImplementSetPosition();
|
virtual void ImplementSetPosition();
|
||||||
@@ -313,7 +317,6 @@ public:
|
|||||||
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
||||||
virtual void GetPositionConstraint(int *x, int *y) const ;
|
virtual void GetPositionConstraint(int *x, int *y) const ;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindow)
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -71,6 +71,10 @@
|
|||||||
* Use gauge item
|
* Use gauge item
|
||||||
*/
|
*/
|
||||||
#undef USE_GAUGE
|
#undef USE_GAUGE
|
||||||
|
/*
|
||||||
|
* Use combobox item
|
||||||
|
*/
|
||||||
|
#undef USE_COMBOBOX
|
||||||
/*
|
/*
|
||||||
* Use scrollbar item
|
* Use scrollbar item
|
||||||
*/
|
*/
|
||||||
|
@@ -43,14 +43,14 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
// wxDialog
|
// wxDialog
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog,wxWindow)
|
BEGIN_EVENT_TABLE(wxDialog,wxPanel)
|
||||||
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
|
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
|
||||||
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
|
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
|
||||||
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
|
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
|
||||||
EVT_CLOSE (wxDialog::OnCloseWindow)
|
EVT_CLOSE (wxDialog::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel)
|
||||||
|
|
||||||
wxDialog::wxDialog(void)
|
wxDialog::wxDialog(void)
|
||||||
{
|
{
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxListBox
|
// "select" and "deselect"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
|
static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
|
||||||
@@ -57,6 +57,8 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
|
|||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
if (event.m_commandString) delete[] event.m_commandString ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxListBox
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
|
||||||
@@ -83,11 +85,10 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
m_list = GTK_LIST( gtk_list_new() );
|
m_list = GTK_LIST( gtk_list_new() );
|
||||||
|
|
||||||
// @@ what's the difference between BROWSE and SINGLE?
|
GtkSelectionMode mode = GTK_SELECTION_SINGLE;
|
||||||
GtkSelectionMode mode = GTK_SELECTION_BROWSE;
|
if (style & wxLB_MULTIPLE)
|
||||||
if ( style & wxLB_MULTIPLE )
|
|
||||||
mode = GTK_SELECTION_MULTIPLE;
|
mode = GTK_SELECTION_MULTIPLE;
|
||||||
else if ( style & wxLB_EXTENDED )
|
else if (style & wxLB_EXTENDED)
|
||||||
mode = GTK_SELECTION_EXTENDED;
|
mode = GTK_SELECTION_EXTENDED;
|
||||||
|
|
||||||
gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
|
gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
|
||||||
@@ -105,7 +106,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
if ( style & wxLB_MULTIPLE )
|
if (style & wxLB_MULTIPLE)
|
||||||
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ void wxListBox::Append( const wxString &item, char *clientData )
|
|||||||
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
if ( GetWindowStyleFlag() & wxLB_MULTIPLE )
|
if (GetWindowStyleFlag() & wxLB_MULTIPLE)
|
||||||
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
@@ -152,6 +153,11 @@ void wxListBox::Append( const wxString &item, char *clientData )
|
|||||||
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
||||||
|
|
||||||
gtk_widget_show( list_item );
|
gtk_widget_show( list_item );
|
||||||
|
|
||||||
|
ConnectWidget( list_item );
|
||||||
|
|
||||||
|
ConnectDnDWidget( list_item );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListBox::Clear(void)
|
void wxListBox::Clear(void)
|
||||||
@@ -381,6 +387,25 @@ int wxListBox::GetIndex( GtkWidget *item ) const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
|
||||||
|
{
|
||||||
|
GList *child = m_list->children;
|
||||||
|
while (child)
|
||||||
|
{
|
||||||
|
DisconnectDnDWidget( GTK_WIDGET( child->data ) );
|
||||||
|
child = child->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxWindow::SetDropTarget( dropTarget );
|
||||||
|
|
||||||
|
child = m_list->children;
|
||||||
|
while (child)
|
||||||
|
{
|
||||||
|
ConnectDnDWidget( GTK_WIDGET( child->data ) );
|
||||||
|
child = child->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *wxListBox::GetConnectWidget(void)
|
GtkWidget *wxListBox::GetConnectWidget(void)
|
||||||
{
|
{
|
||||||
return GTK_WIDGET(m_list);
|
return GTK_WIDGET(m_list);
|
||||||
@@ -389,7 +414,7 @@ GtkWidget *wxListBox::GetConnectWidget(void)
|
|||||||
void wxListBox::SetFont( const wxFont &font )
|
void wxListBox::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
wxWindow::SetFont( font );
|
wxWindow::SetFont( font );
|
||||||
|
|
||||||
GList *child = m_list->children;
|
GList *child = m_list->children;
|
||||||
while (child)
|
while (child)
|
||||||
{
|
{
|
||||||
|
@@ -1885,22 +1885,12 @@ void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
|
|||||||
{
|
{
|
||||||
GtkWidget *dnd_widget = GetConnectWidget();
|
GtkWidget *dnd_widget = GetConnectWidget();
|
||||||
|
|
||||||
if (m_pDropTarget)
|
DisconnectDnDWidget( dnd_widget );
|
||||||
{
|
|
||||||
gtk_signal_disconnect_by_func( GTK_OBJECT(dnd_widget),
|
|
||||||
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
|
||||||
|
|
||||||
m_pDropTarget->UnregisterWidget( dnd_widget );
|
if (m_pDropTarget) delete m_pDropTarget;
|
||||||
delete m_pDropTarget;
|
|
||||||
}
|
|
||||||
m_pDropTarget = dropTarget;
|
m_pDropTarget = dropTarget;
|
||||||
if (m_pDropTarget)
|
|
||||||
{
|
ConnectDnDWidget( dnd_widget );
|
||||||
m_pDropTarget->RegisterWidget( dnd_widget );
|
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(dnd_widget), "drop_data_available_event",
|
|
||||||
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDropTarget *wxWindow::GetDropTarget() const
|
wxDropTarget *wxWindow::GetDropTarget() const
|
||||||
@@ -1908,6 +1898,26 @@ wxDropTarget *wxWindow::GetDropTarget() const
|
|||||||
return m_pDropTarget;
|
return m_pDropTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindow::ConnectDnDWidget( GtkWidget *widget )
|
||||||
|
{
|
||||||
|
if (!m_pDropTarget) return;
|
||||||
|
|
||||||
|
m_pDropTarget->RegisterWidget( widget );
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
|
||||||
|
{
|
||||||
|
if (!m_pDropTarget) return;
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
||||||
|
|
||||||
|
m_pDropTarget->UnregisterWidget( widget );
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget* wxWindow::GetConnectWidget(void)
|
GtkWidget* wxWindow::GetConnectWidget(void)
|
||||||
{
|
{
|
||||||
GtkWidget *connect_widget = m_widget;
|
GtkWidget *connect_widget = m_widget;
|
||||||
|
@@ -43,14 +43,14 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
|
|||||||
// wxDialog
|
// wxDialog
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog,wxWindow)
|
BEGIN_EVENT_TABLE(wxDialog,wxPanel)
|
||||||
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
|
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
|
||||||
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
|
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
|
||||||
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
|
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
|
||||||
EVT_CLOSE (wxDialog::OnCloseWindow)
|
EVT_CLOSE (wxDialog::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel)
|
||||||
|
|
||||||
wxDialog::wxDialog(void)
|
wxDialog::wxDialog(void)
|
||||||
{
|
{
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
extern bool g_blockEventsOnDrag;
|
extern bool g_blockEventsOnDrag;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxListBox
|
// "select" and "deselect"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
|
static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
|
||||||
@@ -57,6 +57,8 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
|
|||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
if (event.m_commandString) delete[] event.m_commandString ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxListBox
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
|
||||||
@@ -83,11 +85,10 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
m_list = GTK_LIST( gtk_list_new() );
|
m_list = GTK_LIST( gtk_list_new() );
|
||||||
|
|
||||||
// @@ what's the difference between BROWSE and SINGLE?
|
GtkSelectionMode mode = GTK_SELECTION_SINGLE;
|
||||||
GtkSelectionMode mode = GTK_SELECTION_BROWSE;
|
if (style & wxLB_MULTIPLE)
|
||||||
if ( style & wxLB_MULTIPLE )
|
|
||||||
mode = GTK_SELECTION_MULTIPLE;
|
mode = GTK_SELECTION_MULTIPLE;
|
||||||
else if ( style & wxLB_EXTENDED )
|
else if (style & wxLB_EXTENDED)
|
||||||
mode = GTK_SELECTION_EXTENDED;
|
mode = GTK_SELECTION_EXTENDED;
|
||||||
|
|
||||||
gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
|
gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
|
||||||
@@ -105,7 +106,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
|||||||
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
if ( style & wxLB_MULTIPLE )
|
if (style & wxLB_MULTIPLE)
|
||||||
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
@@ -143,7 +144,7 @@ void wxListBox::Append( const wxString &item, char *clientData )
|
|||||||
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
if ( GetWindowStyleFlag() & wxLB_MULTIPLE )
|
if (GetWindowStyleFlag() & wxLB_MULTIPLE)
|
||||||
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
||||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||||
|
|
||||||
@@ -152,6 +153,11 @@ void wxListBox::Append( const wxString &item, char *clientData )
|
|||||||
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
||||||
|
|
||||||
gtk_widget_show( list_item );
|
gtk_widget_show( list_item );
|
||||||
|
|
||||||
|
ConnectWidget( list_item );
|
||||||
|
|
||||||
|
ConnectDnDWidget( list_item );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxListBox::Clear(void)
|
void wxListBox::Clear(void)
|
||||||
@@ -381,6 +387,25 @@ int wxListBox::GetIndex( GtkWidget *item ) const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
|
||||||
|
{
|
||||||
|
GList *child = m_list->children;
|
||||||
|
while (child)
|
||||||
|
{
|
||||||
|
DisconnectDnDWidget( GTK_WIDGET( child->data ) );
|
||||||
|
child = child->next;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxWindow::SetDropTarget( dropTarget );
|
||||||
|
|
||||||
|
child = m_list->children;
|
||||||
|
while (child)
|
||||||
|
{
|
||||||
|
ConnectDnDWidget( GTK_WIDGET( child->data ) );
|
||||||
|
child = child->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *wxListBox::GetConnectWidget(void)
|
GtkWidget *wxListBox::GetConnectWidget(void)
|
||||||
{
|
{
|
||||||
return GTK_WIDGET(m_list);
|
return GTK_WIDGET(m_list);
|
||||||
@@ -389,7 +414,7 @@ GtkWidget *wxListBox::GetConnectWidget(void)
|
|||||||
void wxListBox::SetFont( const wxFont &font )
|
void wxListBox::SetFont( const wxFont &font )
|
||||||
{
|
{
|
||||||
wxWindow::SetFont( font );
|
wxWindow::SetFont( font );
|
||||||
|
|
||||||
GList *child = m_list->children;
|
GList *child = m_list->children;
|
||||||
while (child)
|
while (child)
|
||||||
{
|
{
|
||||||
|
@@ -1885,22 +1885,12 @@ void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
|
|||||||
{
|
{
|
||||||
GtkWidget *dnd_widget = GetConnectWidget();
|
GtkWidget *dnd_widget = GetConnectWidget();
|
||||||
|
|
||||||
if (m_pDropTarget)
|
DisconnectDnDWidget( dnd_widget );
|
||||||
{
|
|
||||||
gtk_signal_disconnect_by_func( GTK_OBJECT(dnd_widget),
|
|
||||||
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
|
||||||
|
|
||||||
m_pDropTarget->UnregisterWidget( dnd_widget );
|
if (m_pDropTarget) delete m_pDropTarget;
|
||||||
delete m_pDropTarget;
|
|
||||||
}
|
|
||||||
m_pDropTarget = dropTarget;
|
m_pDropTarget = dropTarget;
|
||||||
if (m_pDropTarget)
|
|
||||||
{
|
ConnectDnDWidget( dnd_widget );
|
||||||
m_pDropTarget->RegisterWidget( dnd_widget );
|
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(dnd_widget), "drop_data_available_event",
|
|
||||||
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDropTarget *wxWindow::GetDropTarget() const
|
wxDropTarget *wxWindow::GetDropTarget() const
|
||||||
@@ -1908,6 +1898,26 @@ wxDropTarget *wxWindow::GetDropTarget() const
|
|||||||
return m_pDropTarget;
|
return m_pDropTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindow::ConnectDnDWidget( GtkWidget *widget )
|
||||||
|
{
|
||||||
|
if (!m_pDropTarget) return;
|
||||||
|
|
||||||
|
m_pDropTarget->RegisterWidget( widget );
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(widget), "drop_data_available_event",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindow::DisconnectDnDWidget( GtkWidget *widget )
|
||||||
|
{
|
||||||
|
if (!m_pDropTarget) return;
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_func( GTK_OBJECT(widget),
|
||||||
|
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
|
||||||
|
|
||||||
|
m_pDropTarget->UnregisterWidget( widget );
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget* wxWindow::GetConnectWidget(void)
|
GtkWidget* wxWindow::GetConnectWidget(void)
|
||||||
{
|
{
|
||||||
GtkWidget *connect_widget = m_widget;
|
GtkWidget *connect_widget = m_widget;
|
||||||
|
Reference in New Issue
Block a user