Expand tabs, identation/whitespace fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mart Raudsepp
2005-08-08 09:50:13 +00:00
parent 86e69fa54a
commit 88d197753d
8 changed files with 124 additions and 122 deletions

View File

@@ -349,11 +349,11 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title, int pos)
if (accel_key != GDK_VoidSymbol) if (accel_key != GDK_VoidSymbol)
{ {
gtk_widget_add_accelerator (menu->m_owner, gtk_widget_add_accelerator (menu->m_owner,
"activate_item", "activate_item",
m_accel,//gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)), m_accel, //gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
accel_key, accel_key,
GDK_MOD1_MASK, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED); GTK_ACCEL_LOCKED);
} }
#endif #endif
@@ -823,7 +823,7 @@ void wxMenuItem::SetText( const wxString& str )
DoSetText(str); DoSetText(str);
if (oldLabel == label1 && if (oldLabel == label1 &&
oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered
return; return;
@@ -852,7 +852,7 @@ void wxMenuItem::SetText( const wxString& str )
gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods); gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods);
if (accel_key != 0) if (accel_key != 0)
{ {
gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem), gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
m_parentMenu->m_accel, m_parentMenu->m_accel,
accel_key, accel_key,
accel_mods ); accel_mods );
@@ -907,7 +907,7 @@ void wxMenuItem::DoSetText( const wxString& str )
pc++; pc++;
m_hotKey = pc; m_hotKey = pc;
} }
// wxPrintf( wxT("DoSetText(): str %s m_text %s hotkey %s\n"), str.c_str(), m_text.c_str(), m_hotKey.c_str() ); // wxPrintf( wxT("DoSetText(): str %s m_text %s hotkey %s\n"), str.c_str(), m_text.c_str(), m_hotKey.c_str() );
} }
@@ -1012,7 +1012,7 @@ wxMenu::~wxMenu()
if ( GTK_IS_WIDGET( m_menu )) if ( GTK_IS_WIDGET( m_menu ))
{ {
// see wxMenu::Init // see wxMenu::Init
gtk_widget_unref( m_menu ); gtk_widget_unref( m_menu );
// if the menu is inserted in another menu at this time, there was // if the menu is inserted in another menu at this time, there was
// one more reference to it: // one more reference to it:
if ( m_owner ) if ( m_owner )
@@ -1054,12 +1054,12 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
else else
{ {
GdkPixmap *gdk_pixmap = bitmap->GetPixmap(); GdkPixmap *gdk_pixmap = bitmap->GetPixmap();
GdkBitmap *gdk_bitmap = bitmap->GetMask() ? GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
bitmap->GetMask()->GetBitmap() : bitmap->GetMask()->GetBitmap() :
(GdkBitmap*) NULL; (GdkBitmap*) NULL;
image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap ); image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap );
} }
gtk_widget_show(image); gtk_widget_show(image);
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image ); gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image );
@@ -1191,8 +1191,8 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
(gpointer)this ); (gpointer)this );
if ( mitem->IsSubMenu() && mitem->GetKind() != wxITEM_RADIO && mitem->GetKind() != wxITEM_CHECK ) if ( mitem->IsSubMenu() && mitem->GetKind() != wxITEM_RADIO && mitem->GetKind() != wxITEM_CHECK )
{ {
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), mitem->GetSubMenu()->m_menu ); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), mitem->GetSubMenu()->m_menu );
gtk_widget_show( mitem->GetSubMenu()->m_menu ); gtk_widget_show( mitem->GetSubMenu()->m_menu );
@@ -1202,24 +1202,25 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
// submenu // submenu
if ( m_invokingWindow ) if ( m_invokingWindow )
wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow); wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow);
} }
else else
{ {
gtk_signal_connect( GTK_OBJECT(menuItem), "activate", gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback), GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
(gpointer)this ); (gpointer)this );
} }
#ifndef __WXGTK20__ #ifndef __WXGTK20__
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) ); guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
if (accel_key != GDK_VoidSymbol) if (accel_key != GDK_VoidSymbol)
{ {
gtk_widget_add_accelerator (menuItem, gtk_widget_add_accelerator (menuItem,
"activate_item", "activate_item",
gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)), gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
accel_key, accel_key,
GDK_MOD1_MASK, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED); GTK_ACCEL_LOCKED);
} }
#endif #endif
} }
@@ -1273,7 +1274,7 @@ int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{ {
wxMenuItem *item = node->GetData(); wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem) if (item->GetMenuItem() == menuItem)
return item->GetId(); return item->GetId();
node = node->GetNext(); node = node->GetNext();
} }
@@ -1520,10 +1521,10 @@ static wxString GetGtkHotKey( const wxMenuItem& item )
hotkey << wxT("Command" ); hotkey << wxT("Command" );
break; break;
/* These probably wouldn't work as there is no SpecialX in gdk/keynames.txt /* These probably wouldn't work as there is no SpecialX in gdk/keynames.txt
case WXK_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4: case WXK_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4:
case WXK_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8: case WXK_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8:
case WXK_SPECIAL9: case WXK_SPECIAL10: case WXK_SPECIAL11: case WXK_SPECIAL12: case WXK_SPECIAL9: case WXK_SPECIAL10: case WXK_SPECIAL11: case WXK_SPECIAL12:
case WXK_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16: case WXK_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16:
case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20: case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20:
hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1); hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1);
break; break;

View File

@@ -73,7 +73,7 @@ public:
m_page = (GtkNotebookPage *) NULL; m_page = (GtkNotebookPage *) NULL;
m_box = (GtkWidget *) NULL; m_box = (GtkWidget *) NULL;
} }
wxString m_text; wxString m_text;
int m_image; int m_image;
GtkNotebookPage *m_page; GtkNotebookPage *m_page;
@@ -199,7 +199,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
if (!notebook->m_hasVMT) return FALSE; if (!notebook->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return FALSE; if (g_blockEventsOnDrag) return FALSE;
/* win is a control: tab can be propagated up */ /* win is a control: tab can be propagated up */
if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right)) if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right))
{ {
@@ -219,10 +219,10 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
{ {
return FALSE; return FALSE;
} }
// m_selection = page; // m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(widget), page ); gtk_notebook_set_page( GTK_NOTEBOOK(widget), page );
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
return TRUE; return TRUE;
} }
@@ -241,7 +241,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
/* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */ /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
event.SetDirection( (gdk_event->keyval == GDK_Tab) ); event.SetDirection( (gdk_event->keyval == GDK_Tab) );
/* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) || event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ||
(gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right) ); (gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right) );
event.SetCurrentFocus( notebook ); event.SetCurrentFocus( notebook );
@@ -710,8 +710,8 @@ bool wxNotebook::InsertPage( size_t position,
{ {
gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style); gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style);
gtk_rc_style_unref(style); gtk_rc_style_unref(style);
} }
/* show the label */ /* show the label */
gtk_widget_show( GTK_WIDGET(nb_page->m_label) ); gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
if (select && (m_pagesData.GetCount() > 1)) if (select && (m_pagesData.GetCount() > 1))
@@ -722,7 +722,7 @@ bool wxNotebook::InsertPage( size_t position,
SetSelection( GetPageCount()-1 ); SetSelection( GetPageCount()-1 );
else else
#endif #endif
SetSelection( position ); SetSelection( position );
} }
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page", gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",

View File

@@ -53,9 +53,9 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
if (child != widget) if (child != widget)
{ {
while (child) while (child)
{ {
if (child == widget) if (child == widget)
return FALSE; return FALSE;
child = child->parent; child = child->parent;
} }
} }
@@ -142,11 +142,11 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child )
{ {
gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow),
GTK_WIDGET(child->m_widget), GTK_WIDGET(child->m_widget),
child->m_x, child->m_x,
child->m_y, child->m_y,
child->m_width, child->m_width,
child->m_height ); child->m_height );
if (parent->HasFlag(wxTAB_TRAVERSAL)) if (parent->HasFlag(wxTAB_TRAVERSAL))
{ {
@@ -183,7 +183,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
// Unlike windows, top level windows are created hidden by default. // Unlike windows, top level windows are created hidden by default.
m_isShown = false; m_isShown = false;
// All dialogs should really have this style // All dialogs should really have this style
m_windowStyle |= wxTAB_TRAVERSAL; m_windowStyle |= wxTAB_TRAVERSAL;
@@ -220,7 +220,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event", gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this );
return TRUE; return TRUE;
} }
@@ -360,9 +360,9 @@ bool wxPopupWindow::Show( bool show )
GtkOnSize( m_x, m_y, m_width, m_height ); GtkOnSize( m_x, m_y, m_width, m_height );
} }
bool ret = wxWindow::Show( show ); bool ret = wxWindow::Show( show );
return ret; return ret;
} }

View File

@@ -73,22 +73,22 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
{ {
/* program has vetoed */ /* program has vetoed */
win->m_adjust->value = win->m_oldPos; win->m_adjust->value = win->m_oldPos;
gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust), gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust),
(GtkSignalFunc) gtk_spinbutt_callback, (GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) win ); (gpointer) win );
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" ); gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
gtk_signal_connect( GTK_OBJECT (win->m_adjust), gtk_signal_connect( GTK_OBJECT (win->m_adjust),
"value_changed", "value_changed",
(GtkSignalFunc) gtk_spinbutt_callback, (GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) win ); (gpointer) win );
return; return;
} }
win->m_oldPos = win->m_adjust->value; win->m_oldPos = win->m_adjust->value;
/* always send a thumbtrack event */ /* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK) if (command != wxEVT_SCROLL_THUMBTRACK)
{ {
@@ -131,7 +131,7 @@ bool wxSpinButton::Create(wxWindow *parent,
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxXX creation failed") ); wxFAIL_MSG( wxT("wxXX creation failed") );
return FALSE; return FALSE;
} }
m_oldPos = 0.0; m_oldPos = 0.0;
@@ -206,7 +206,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
m_adjust->upper = fmax; m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
// these two calls are required due to some bug in GTK // these two calls are required due to some bug in GTK
Refresh(); Refresh();
SetFocus(); SetFocus();

View File

@@ -349,11 +349,11 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title, int pos)
if (accel_key != GDK_VoidSymbol) if (accel_key != GDK_VoidSymbol)
{ {
gtk_widget_add_accelerator (menu->m_owner, gtk_widget_add_accelerator (menu->m_owner,
"activate_item", "activate_item",
m_accel,//gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)), m_accel, //gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
accel_key, accel_key,
GDK_MOD1_MASK, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED); GTK_ACCEL_LOCKED);
} }
#endif #endif
@@ -823,7 +823,7 @@ void wxMenuItem::SetText( const wxString& str )
DoSetText(str); DoSetText(str);
if (oldLabel == label1 && if (oldLabel == label1 &&
oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered
return; return;
@@ -852,7 +852,7 @@ void wxMenuItem::SetText( const wxString& str )
gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods); gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods);
if (accel_key != 0) if (accel_key != 0)
{ {
gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem), gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
m_parentMenu->m_accel, m_parentMenu->m_accel,
accel_key, accel_key,
accel_mods ); accel_mods );
@@ -907,7 +907,7 @@ void wxMenuItem::DoSetText( const wxString& str )
pc++; pc++;
m_hotKey = pc; m_hotKey = pc;
} }
// wxPrintf( wxT("DoSetText(): str %s m_text %s hotkey %s\n"), str.c_str(), m_text.c_str(), m_hotKey.c_str() ); // wxPrintf( wxT("DoSetText(): str %s m_text %s hotkey %s\n"), str.c_str(), m_text.c_str(), m_hotKey.c_str() );
} }
@@ -1012,7 +1012,7 @@ wxMenu::~wxMenu()
if ( GTK_IS_WIDGET( m_menu )) if ( GTK_IS_WIDGET( m_menu ))
{ {
// see wxMenu::Init // see wxMenu::Init
gtk_widget_unref( m_menu ); gtk_widget_unref( m_menu );
// if the menu is inserted in another menu at this time, there was // if the menu is inserted in another menu at this time, there was
// one more reference to it: // one more reference to it:
if ( m_owner ) if ( m_owner )
@@ -1054,12 +1054,12 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
else else
{ {
GdkPixmap *gdk_pixmap = bitmap->GetPixmap(); GdkPixmap *gdk_pixmap = bitmap->GetPixmap();
GdkBitmap *gdk_bitmap = bitmap->GetMask() ? GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
bitmap->GetMask()->GetBitmap() : bitmap->GetMask()->GetBitmap() :
(GdkBitmap*) NULL; (GdkBitmap*) NULL;
image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap ); image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap );
} }
gtk_widget_show(image); gtk_widget_show(image);
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image ); gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image );
@@ -1191,8 +1191,8 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback), GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
(gpointer)this ); (gpointer)this );
if ( mitem->IsSubMenu() && mitem->GetKind() != wxITEM_RADIO && mitem->GetKind() != wxITEM_CHECK ) if ( mitem->IsSubMenu() && mitem->GetKind() != wxITEM_RADIO && mitem->GetKind() != wxITEM_CHECK )
{ {
gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), mitem->GetSubMenu()->m_menu ); gtk_menu_item_set_submenu( GTK_MENU_ITEM(menuItem), mitem->GetSubMenu()->m_menu );
gtk_widget_show( mitem->GetSubMenu()->m_menu ); gtk_widget_show( mitem->GetSubMenu()->m_menu );
@@ -1202,24 +1202,25 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
// submenu // submenu
if ( m_invokingWindow ) if ( m_invokingWindow )
wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow); wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow);
} }
else else
{ {
gtk_signal_connect( GTK_OBJECT(menuItem), "activate", gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback), GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
(gpointer)this ); (gpointer)this );
} }
#ifndef __WXGTK20__ #ifndef __WXGTK20__
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) ); guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
if (accel_key != GDK_VoidSymbol) if (accel_key != GDK_VoidSymbol)
{ {
gtk_widget_add_accelerator (menuItem, gtk_widget_add_accelerator (menuItem,
"activate_item", "activate_item",
gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)), gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
accel_key, accel_key,
GDK_MOD1_MASK, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED); GTK_ACCEL_LOCKED);
} }
#endif #endif
} }
@@ -1273,7 +1274,7 @@ int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{ {
wxMenuItem *item = node->GetData(); wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem) if (item->GetMenuItem() == menuItem)
return item->GetId(); return item->GetId();
node = node->GetNext(); node = node->GetNext();
} }
@@ -1520,10 +1521,10 @@ static wxString GetGtkHotKey( const wxMenuItem& item )
hotkey << wxT("Command" ); hotkey << wxT("Command" );
break; break;
/* These probably wouldn't work as there is no SpecialX in gdk/keynames.txt /* These probably wouldn't work as there is no SpecialX in gdk/keynames.txt
case WXK_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4: case WXK_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4:
case WXK_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8: case WXK_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8:
case WXK_SPECIAL9: case WXK_SPECIAL10: case WXK_SPECIAL11: case WXK_SPECIAL12: case WXK_SPECIAL9: case WXK_SPECIAL10: case WXK_SPECIAL11: case WXK_SPECIAL12:
case WXK_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16: case WXK_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16:
case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20: case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20:
hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1); hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1);
break; break;

View File

@@ -73,7 +73,7 @@ public:
m_page = (GtkNotebookPage *) NULL; m_page = (GtkNotebookPage *) NULL;
m_box = (GtkWidget *) NULL; m_box = (GtkWidget *) NULL;
} }
wxString m_text; wxString m_text;
int m_image; int m_image;
GtkNotebookPage *m_page; GtkNotebookPage *m_page;
@@ -199,7 +199,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
if (!notebook->m_hasVMT) return FALSE; if (!notebook->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return FALSE; if (g_blockEventsOnDrag) return FALSE;
/* win is a control: tab can be propagated up */ /* win is a control: tab can be propagated up */
if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right)) if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right))
{ {
@@ -219,10 +219,10 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
{ {
return FALSE; return FALSE;
} }
// m_selection = page; // m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(widget), page ); gtk_notebook_set_page( GTK_NOTEBOOK(widget), page );
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" ); gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
return TRUE; return TRUE;
} }
@@ -241,7 +241,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
/* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */ /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
event.SetDirection( (gdk_event->keyval == GDK_Tab) ); event.SetDirection( (gdk_event->keyval == GDK_Tab) );
/* CTRL-TAB changes the (parent) window, i.e. switch notebook page */ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) || event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) ||
(gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right) ); (gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right) );
event.SetCurrentFocus( notebook ); event.SetCurrentFocus( notebook );
@@ -710,8 +710,8 @@ bool wxNotebook::InsertPage( size_t position,
{ {
gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style); gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style);
gtk_rc_style_unref(style); gtk_rc_style_unref(style);
} }
/* show the label */ /* show the label */
gtk_widget_show( GTK_WIDGET(nb_page->m_label) ); gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
if (select && (m_pagesData.GetCount() > 1)) if (select && (m_pagesData.GetCount() > 1))
@@ -722,7 +722,7 @@ bool wxNotebook::InsertPage( size_t position,
SetSelection( GetPageCount()-1 ); SetSelection( GetPageCount()-1 );
else else
#endif #endif
SetSelection( position ); SetSelection( position );
} }
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page", gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",

View File

@@ -53,9 +53,9 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
if (child != widget) if (child != widget)
{ {
while (child) while (child)
{ {
if (child == widget) if (child == widget)
return FALSE; return FALSE;
child = child->parent; child = child->parent;
} }
} }
@@ -142,11 +142,11 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win )
static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child )
{ {
gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow),
GTK_WIDGET(child->m_widget), GTK_WIDGET(child->m_widget),
child->m_x, child->m_x,
child->m_y, child->m_y,
child->m_width, child->m_width,
child->m_height ); child->m_height );
if (parent->HasFlag(wxTAB_TRAVERSAL)) if (parent->HasFlag(wxTAB_TRAVERSAL))
{ {
@@ -183,7 +183,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
// Unlike windows, top level windows are created hidden by default. // Unlike windows, top level windows are created hidden by default.
m_isShown = false; m_isShown = false;
// All dialogs should really have this style // All dialogs should really have this style
m_windowStyle |= wxTAB_TRAVERSAL; m_windowStyle |= wxTAB_TRAVERSAL;
@@ -220,7 +220,7 @@ bool wxPopupWindow::Create( wxWindow *parent, int style )
gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event", gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this ); GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this );
return TRUE; return TRUE;
} }
@@ -360,9 +360,9 @@ bool wxPopupWindow::Show( bool show )
GtkOnSize( m_x, m_y, m_width, m_height ); GtkOnSize( m_x, m_y, m_width, m_height );
} }
bool ret = wxWindow::Show( show ); bool ret = wxWindow::Show( show );
return ret; return ret;
} }

View File

@@ -73,22 +73,22 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
{ {
/* program has vetoed */ /* program has vetoed */
win->m_adjust->value = win->m_oldPos; win->m_adjust->value = win->m_oldPos;
gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust), gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust),
(GtkSignalFunc) gtk_spinbutt_callback, (GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) win ); (gpointer) win );
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" ); gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
gtk_signal_connect( GTK_OBJECT (win->m_adjust), gtk_signal_connect( GTK_OBJECT (win->m_adjust),
"value_changed", "value_changed",
(GtkSignalFunc) gtk_spinbutt_callback, (GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) win ); (gpointer) win );
return; return;
} }
win->m_oldPos = win->m_adjust->value; win->m_oldPos = win->m_adjust->value;
/* always send a thumbtrack event */ /* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK) if (command != wxEVT_SCROLL_THUMBTRACK)
{ {
@@ -131,7 +131,7 @@ bool wxSpinButton::Create(wxWindow *parent,
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name )) !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{ {
wxFAIL_MSG( wxT("wxXX creation failed") ); wxFAIL_MSG( wxT("wxXX creation failed") );
return FALSE; return FALSE;
} }
m_oldPos = 0.0; m_oldPos = 0.0;
@@ -206,7 +206,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
m_adjust->upper = fmax; m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" ); gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
// these two calls are required due to some bug in GTK // these two calls are required due to some bug in GTK
Refresh(); Refresh();
SetFocus(); SetFocus();