been tested with GTK 1.2.3 and GTK 1.2.6 - it is known
not work with some other versions.
+wxChoice can now handle only either void client data
+(which it will not delete on destruction) or client
+data of the wxClientData type (which it will delete),
+instead of both at the same time. The same will happen
+to wxListBox and wxComboBox some time.
+
Many build fixes for various platforms have been applied,
try again, poor HP-UX and *BSD users, but don't reckon
with immediate success. Actually, when using GNU compilers,
your chances are quite good.
-My total rewrite of the wxWindows underlying GTK widget
+My rewrite of the wxWindows underlying GTK widget
has turned scrolling including subwindows from barely
-functional to pretty and fast.
+functional to pretty and fast. I also added scrolling
+of foreign windows to wxScrolledWindow.
+
+Setting size hints for the window manager might work now.
wxSocket and Co. have been improved up to the point of
calling it a rewrite. It works on wxMSW now too and
HTML widget and the wxWindows' help system based upon
it have been reorganized and improved for easier use
-from Python and C++.
+from Python and C++. Also HTML printing has been added.
wxSpinCtrl added. Like a wxSpinButton and a wxTextCtrl.
wxString GetString( int n ) const;
// implementation
- wxList m_clientDataList;
- wxList m_clientObjectList;
+ wxList m_clientList;
void DisableEvents();
void EnableEvents();
virtual void DoSetClientObject( int n, wxClientData* clientData );
virtual wxClientData* DoGetClientObject( int n ) const;
+ // the above virtuals hide these virtuals in wxChoiceBase
+ virtual void DoSetClientData(void* clientData )
+ { wxWindowBase::DoSetClientData(clientData); };
+ virtual void* DoGetClientData() const
+ { return(wxWindowBase::DoGetClientData()); };
+ virtual void DoSetClientObject( wxClientData* clientData )
+ { wxWindowBase::DoSetClientObject(clientData); };
+ virtual wxClientData* DoGetClientObject() const
+ { return(wxWindowBase::DoGetClientObject()); };
+
private:
DECLARE_DYNAMIC_CLASS(wxChoice)
};
wxString GetString( int n ) const;
// implementation
- wxList m_clientDataList;
- wxList m_clientObjectList;
+ wxList m_clientList;
void DisableEvents();
void EnableEvents();
virtual void DoSetClientObject( int n, wxClientData* clientData );
virtual wxClientData* DoGetClientObject( int n ) const;
+ // the above virtuals hide these virtuals in wxChoiceBase
+ virtual void DoSetClientData(void* clientData )
+ { wxWindowBase::DoSetClientData(clientData); };
+ virtual void* DoGetClientData() const
+ { return(wxWindowBase::DoGetClientData()); };
+ virtual void DoSetClientObject( wxClientData* clientData )
+ { wxWindowBase::DoSetClientObject(clientData); };
+ virtual wxClientData* DoGetClientObject() const
+ { return(wxWindowBase::DoGetClientObject()); };
+
private:
DECLARE_DYNAMIC_CLASS(wxChoice)
};
for (int i = 0; i < n; i++)
{
- m_clientDataList.Append( (wxObject*) NULL );
- m_clientObjectList.Append( (wxObject*) NULL );
+ m_clientList.Append( (wxObject*) NULL );
GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_show( menu_item );
- m_clientDataList.Append( (wxObject*) NULL );
- m_clientObjectList.Append( (wxObject*) NULL );
+ m_clientList.Append( (wxObject*) NULL );
// return the index of the item in the control
- return GetCount();
+ return GetCount() - 1;
}
void wxChoice::DoSetClientData( int n, void* clientData )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetClientData") );
node->SetData( (wxObject*) clientData );
{
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetClientData") );
return node->Data();
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetClientObject") );
wxClientData *cd = (wxClientData*) node->Data();
{
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxChoice::DoGetClientObject") );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
- wxNode *node = m_clientObjectList.First();
- while (node)
+ if (m_clientDataItemsType == ClientData_Object)
{
- wxClientData *cd = (wxClientData*)node->Data();
- if (cd) delete cd;
- node = node->Next();
+ wxNode *node = m_clientList.First();
+ while (node)
+ {
+ wxClientData *cd = (wxClientData*)node->Data();
+ if (cd) delete cd;
+ node = node->Next();
+ }
}
- m_clientObjectList.Clear();
-
- m_clientDataList.Clear();
+ m_clientList.Clear();
}
void wxChoice::Delete( int WXUNUSED(n) )
if (g_isIdle)
wxapp_install_idle_handler();
- /* I haven''t been able to set the position of
+ /* I haven't been able to set the position of
the dialog before it is shown, so I set the
- position in "realize" and "map" */
+ position in "realize" */
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
- /* set size hints */
- gint flag = GDK_HINT_POS;
- if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
- if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
- if (flag)
- {
- gdk_window_set_hints( win->m_widget->window,
- win->m_x, win->m_y,
- win->GetMinWidth(), win->GetMinHeight(),
- win->GetMaxWidth(), win->GetMaxHeight(),
- flag );
- }
-
- /* reset the icon */
- if (win->m_icon != wxNullIcon)
- {
- wxIcon icon( win->m_icon );
- win->m_icon = wxNullIcon;
- win->SetIcon( icon );
- }
-
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// "map" from m_widget
-//-----------------------------------------------------------------------------
-
-static gint
-gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- /* I haven''t been able to set the position of
- the dialog before it is shown, so I set the
- position in "realize" and "map" */
- gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
+ /* set size hints */
+ gint flag = GDK_HINT_POS;
+ if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
+ if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
+ if (flag)
+ {
+ gdk_window_set_hints( win->m_widget->window,
+ win->m_x, win->m_y,
+ win->GetMinWidth(), win->GetMinHeight(),
+ win->GetMaxWidth(), win->GetMaxHeight(),
+ flag );
+ }
+
+ /* reset the icon */
+ if (win->m_icon != wxNullIcon)
+ {
+ wxIcon icon( win->m_icon );
+ win->m_icon = wxNullIcon;
+ win->SetIcon( icon );
+ }
+
return FALSE;
}
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
- /* we set the position of the window after the map event. setting it
- before has no effect (with KWM) */
- gtk_signal_connect( GTK_OBJECT(m_widget), "map",
- GTK_SIGNAL_FUNC(gtk_dialog_map_callback), (gpointer) this );
-
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
for (int i = 0; i < n; i++)
{
- m_clientDataList.Append( (wxObject*) NULL );
- m_clientObjectList.Append( (wxObject*) NULL );
+ m_clientList.Append( (wxObject*) NULL );
GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_show( menu_item );
- m_clientDataList.Append( (wxObject*) NULL );
- m_clientObjectList.Append( (wxObject*) NULL );
+ m_clientList.Append( (wxObject*) NULL );
// return the index of the item in the control
- return GetCount();
+ return GetCount() - 1;
}
void wxChoice::DoSetClientData( int n, void* clientData )
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetClientData") );
node->SetData( (wxObject*) clientData );
{
wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
- wxNode *node = m_clientDataList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetClientData") );
return node->Data();
{
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetClientObject") );
wxClientData *cd = (wxClientData*) node->Data();
{
wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, wxT("invalid combobox") );
- wxNode *node = m_clientObjectList.Nth( n );
+ wxNode *node = m_clientList.Nth( n );
wxCHECK_MSG( node, (wxClientData *)NULL,
wxT("invalid index in wxChoice::DoGetClientObject") );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
- wxNode *node = m_clientObjectList.First();
- while (node)
+ if (m_clientDataItemsType == ClientData_Object)
{
- wxClientData *cd = (wxClientData*)node->Data();
- if (cd) delete cd;
- node = node->Next();
+ wxNode *node = m_clientList.First();
+ while (node)
+ {
+ wxClientData *cd = (wxClientData*)node->Data();
+ if (cd) delete cd;
+ node = node->Next();
+ }
}
- m_clientObjectList.Clear();
-
- m_clientDataList.Clear();
+ m_clientList.Clear();
}
void wxChoice::Delete( int WXUNUSED(n) )
if (g_isIdle)
wxapp_install_idle_handler();
- /* I haven''t been able to set the position of
+ /* I haven't been able to set the position of
the dialog before it is shown, so I set the
- position in "realize" and "map" */
+ position in "realize" */
gtk_widget_set_uposition( widget, win->m_x, win->m_y );
- /* set size hints */
- gint flag = GDK_HINT_POS;
- if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
- if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
- if (flag)
- {
- gdk_window_set_hints( win->m_widget->window,
- win->m_x, win->m_y,
- win->GetMinWidth(), win->GetMinHeight(),
- win->GetMaxWidth(), win->GetMaxHeight(),
- flag );
- }
-
- /* reset the icon */
- if (win->m_icon != wxNullIcon)
- {
- wxIcon icon( win->m_icon );
- win->m_icon = wxNullIcon;
- win->SetIcon( icon );
- }
-
- return FALSE;
-}
-
-//-----------------------------------------------------------------------------
-// "map" from m_widget
-//-----------------------------------------------------------------------------
-
-static gint
-gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- /* I haven''t been able to set the position of
- the dialog before it is shown, so I set the
- position in "realize" and "map" */
- gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
/* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_BORDER;
else
gtk_window_set_policy(GTK_WINDOW(win->m_widget), 1, 1, 1);
+ /* set size hints */
+ gint flag = GDK_HINT_POS;
+ if ((win->GetMinWidth() != -1) || (win->GetMinHeight() != -1)) flag |= GDK_HINT_MIN_SIZE;
+ if ((win->GetMaxWidth() != -1) || (win->GetMaxHeight() != -1)) flag |= GDK_HINT_MAX_SIZE;
+ if (flag)
+ {
+ gdk_window_set_hints( win->m_widget->window,
+ win->m_x, win->m_y,
+ win->GetMinWidth(), win->GetMinHeight(),
+ win->GetMaxWidth(), win->GetMaxHeight(),
+ flag );
+ }
+
+ /* reset the icon */
+ if (win->m_icon != wxNullIcon)
+ {
+ wxIcon icon( win->m_icon );
+ win->m_icon = wxNullIcon;
+ win->SetIcon( icon );
+ }
+
return FALSE;
}
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
- /* we set the position of the window after the map event. setting it
- before has no effect (with KWM) */
- gtk_signal_connect( GTK_OBJECT(m_widget), "map",
- GTK_SIGNAL_FUNC(gtk_dialog_map_callback), (gpointer) this );
-
/* the user resized the frame by dragging etc. */
gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );