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:
Robert Roebling 1998-09-07 17:23:29 +00:00
parent c9dac6640f
commit a60c99e6a9
15 changed files with 464 additions and 337 deletions

582
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -661,6 +661,7 @@ DEFAULT_USE_GDK_IMLIB=1
DEFAULT_USE_LIBPNG=1
DEFAULT_USE_ODBC=1
DEFAULT_USE_COMBOBOX=1
DEFAULT_USE_GAUGE=1
DEFAULT_USE_SCROLLBAR=1
DEFAULT_USE_LISTCTRL=1
@ -787,6 +788,10 @@ AC_OVERRIDES(gauge,gauge,
**--with-gauge use wxGauge class,
USE_GAUGE)
AC_OVERRIDES(combobox,combobox,
**--with-combobox use wxComboBox class,
USE_COMBOBOX)
AC_OVERRIDES(scrollbar,scrollbar,
**--with-scrollbar use wxScrollbar class,
USE_SCROLLBAR)
@ -1130,6 +1135,10 @@ if test "$USE_GAUGE" = 1 ; then
AC_DEFINE_UNQUOTED(USE_GAUGE,$USE_GAUGE)
fi
if test "$USE_COMBOBOX" = 1 ; then
AC_DEFINE_UNQUOTED(USE_COMBOBOX,$USE_COMBOBOX)
fi
if test "$USE_SCROLLBAR" = 1 ; then
AC_DEFINE_UNQUOTED(USE_SCROLLBAR,$USE_SCROLLBAR)
fi

View File

@ -17,10 +17,7 @@
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/event.h"
#include "wx/window.h"
#include "wx/panel.h"
#include "wx/icon.h"
//-----------------------------------------------------------------------------
@ -45,7 +42,7 @@ extern const char *wxDialogNameStr;
// wxDialog
//-----------------------------------------------------------------------------
class wxDialog: public wxWindow
class wxDialog: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxDialog)

View File

@ -82,7 +82,9 @@ class wxListBox: public wxControl
void SetSelection( int n, bool select = TRUE );
void SetString( int n, const wxString &string );
void SetStringSelection( const wxString &string, bool select = TRUE );
void SetFont( const wxFont &font );
void SetDropTarget( wxDropTarget *dropTarget );
// implementation

View File

@ -61,6 +61,8 @@ extern const wxPoint wxDefaultPosition;
class wxWindow: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxWindow)
public:
wxWindow();
inline wxWindow(wxWindow *parent, wxWindowID id,
@ -228,15 +230,17 @@ public:
virtual bool AcceptsFocus() const;
void UpdateWindowUI();
public: // cannot get private going yet
// implementation
virtual GtkWidget* GetConnectWidget(void);
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,
const wxSize &size, long style, const wxString &name );
void PostCreation();
void ConnectWidget( GtkWidget *widget );
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
@ -313,7 +317,6 @@ public:
virtual void GetClientSizeConstraint(int *w, int *h) const ;
virtual void GetPositionConstraint(int *x, int *y) const ;
DECLARE_DYNAMIC_CLASS(wxWindow)
DECLARE_EVENT_TABLE()
};

View File

@ -17,10 +17,7 @@
#endif
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/event.h"
#include "wx/window.h"
#include "wx/panel.h"
#include "wx/icon.h"
//-----------------------------------------------------------------------------
@ -45,7 +42,7 @@ extern const char *wxDialogNameStr;
// wxDialog
//-----------------------------------------------------------------------------
class wxDialog: public wxWindow
class wxDialog: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxDialog)

View File

@ -82,7 +82,9 @@ class wxListBox: public wxControl
void SetSelection( int n, bool select = TRUE );
void SetString( int n, const wxString &string );
void SetStringSelection( const wxString &string, bool select = TRUE );
void SetFont( const wxFont &font );
void SetDropTarget( wxDropTarget *dropTarget );
// implementation

View File

@ -61,6 +61,8 @@ extern const wxPoint wxDefaultPosition;
class wxWindow: public wxEvtHandler
{
DECLARE_DYNAMIC_CLASS(wxWindow)
public:
wxWindow();
inline wxWindow(wxWindow *parent, wxWindowID id,
@ -228,15 +230,17 @@ public:
virtual bool AcceptsFocus() const;
void UpdateWindowUI();
public: // cannot get private going yet
// implementation
virtual GtkWidget* GetConnectWidget(void);
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,
const wxSize &size, long style, const wxString &name );
void PostCreation();
void ConnectWidget( GtkWidget *widget );
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
@ -313,7 +317,6 @@ public:
virtual void GetClientSizeConstraint(int *w, int *h) const ;
virtual void GetPositionConstraint(int *x, int *y) const ;
DECLARE_DYNAMIC_CLASS(wxWindow)
DECLARE_EVENT_TABLE()
};

View File

@ -71,6 +71,10 @@
* Use gauge item
*/
#undef USE_GAUGE
/*
* Use combobox item
*/
#undef USE_COMBOBOX
/*
* Use scrollbar item
*/

View File

@ -43,14 +43,14 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
// wxDialog
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxDialog,wxWindow)
BEGIN_EVENT_TABLE(wxDialog,wxPanel)
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel)
wxDialog::wxDialog(void)
{

View File

@ -25,7 +25,7 @@
extern bool g_blockEventsOnDrag;
//-----------------------------------------------------------------------------
// wxListBox
// "select" and "deselect"
//-----------------------------------------------------------------------------
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 ;
}
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
@ -83,11 +85,10 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
m_list = GTK_LIST( gtk_list_new() );
// @@ what's the difference between BROWSE and SINGLE?
GtkSelectionMode mode = GTK_SELECTION_BROWSE;
if ( style & wxLB_MULTIPLE )
GtkSelectionMode mode = GTK_SELECTION_SINGLE;
if (style & wxLB_MULTIPLE)
mode = GTK_SELECTION_MULTIPLE;
else if ( style & wxLB_EXTENDED )
else if (style & wxLB_EXTENDED)
mode = GTK_SELECTION_EXTENDED;
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_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_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_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_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_widget_show( list_item );
ConnectWidget( list_item );
ConnectDnDWidget( list_item );
}
void wxListBox::Clear(void)
@ -381,6 +387,25 @@ int wxListBox::GetIndex( GtkWidget *item ) const
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)
{
return GTK_WIDGET(m_list);
@ -389,7 +414,7 @@ GtkWidget *wxListBox::GetConnectWidget(void)
void wxListBox::SetFont( const wxFont &font )
{
wxWindow::SetFont( font );
GList *child = m_list->children;
while (child)
{

View File

@ -1885,22 +1885,12 @@ void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
GtkWidget *dnd_widget = GetConnectWidget();
if (m_pDropTarget)
{
gtk_signal_disconnect_by_func( GTK_OBJECT(dnd_widget),
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
DisconnectDnDWidget( dnd_widget );
m_pDropTarget->UnregisterWidget( dnd_widget );
delete m_pDropTarget;
}
if (m_pDropTarget) delete m_pDropTarget;
m_pDropTarget = dropTarget;
if (m_pDropTarget)
{
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 );
}
ConnectDnDWidget( dnd_widget );
}
wxDropTarget *wxWindow::GetDropTarget() const
@ -1908,6 +1898,26 @@ wxDropTarget *wxWindow::GetDropTarget() const
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 *connect_widget = m_widget;

View File

@ -43,14 +43,14 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
// wxDialog
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(wxDialog,wxWindow)
BEGIN_EVENT_TABLE(wxDialog,wxPanel)
EVT_BUTTON (wxID_OK, wxDialog::OnOK)
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
EVT_CLOSE (wxDialog::OnCloseWindow)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel)
wxDialog::wxDialog(void)
{

View File

@ -25,7 +25,7 @@
extern bool g_blockEventsOnDrag;
//-----------------------------------------------------------------------------
// wxListBox
// "select" and "deselect"
//-----------------------------------------------------------------------------
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 ;
}
//-----------------------------------------------------------------------------
// wxListBox
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
@ -83,11 +85,10 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
m_list = GTK_LIST( gtk_list_new() );
// @@ what's the difference between BROWSE and SINGLE?
GtkSelectionMode mode = GTK_SELECTION_BROWSE;
if ( style & wxLB_MULTIPLE )
GtkSelectionMode mode = GTK_SELECTION_SINGLE;
if (style & wxLB_MULTIPLE)
mode = GTK_SELECTION_MULTIPLE;
else if ( style & wxLB_EXTENDED )
else if (style & wxLB_EXTENDED)
mode = GTK_SELECTION_EXTENDED;
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_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_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_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_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_widget_show( list_item );
ConnectWidget( list_item );
ConnectDnDWidget( list_item );
}
void wxListBox::Clear(void)
@ -381,6 +387,25 @@ int wxListBox::GetIndex( GtkWidget *item ) const
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)
{
return GTK_WIDGET(m_list);
@ -389,7 +414,7 @@ GtkWidget *wxListBox::GetConnectWidget(void)
void wxListBox::SetFont( const wxFont &font )
{
wxWindow::SetFont( font );
GList *child = m_list->children;
while (child)
{

View File

@ -1885,22 +1885,12 @@ void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
GtkWidget *dnd_widget = GetConnectWidget();
if (m_pDropTarget)
{
gtk_signal_disconnect_by_func( GTK_OBJECT(dnd_widget),
GTK_SIGNAL_FUNC(gtk_window_drop_callback), (gpointer)this );
DisconnectDnDWidget( dnd_widget );
m_pDropTarget->UnregisterWidget( dnd_widget );
delete m_pDropTarget;
}
if (m_pDropTarget) delete m_pDropTarget;
m_pDropTarget = dropTarget;
if (m_pDropTarget)
{
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 );
}
ConnectDnDWidget( dnd_widget );
}
wxDropTarget *wxWindow::GetDropTarget() const
@ -1908,6 +1898,26 @@ wxDropTarget *wxWindow::GetDropTarget() const
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 *connect_widget = m_widget;