if (accel_key != GDK_VoidSymbol)
{
gtk_widget_add_accelerator (menu->m_owner,
- "activate_item",
- m_accel,//gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
- accel_key,
- GDK_MOD1_MASK,
- GTK_ACCEL_LOCKED);
+ "activate_item",
+ m_accel, //gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
+ accel_key,
+ GDK_MOD1_MASK,
+ GTK_ACCEL_LOCKED);
}
#endif
DoSetText(str);
- if (oldLabel == label1 &&
+ if (oldLabel == label1 &&
oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered
return;
gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods);
if (accel_key != 0)
{
- gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
+ gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
m_parentMenu->m_accel,
accel_key,
accel_mods );
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() );
}
if ( GTK_IS_WIDGET( m_menu ))
{
// 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
// one more reference to it:
if ( m_owner )
else
{
GdkPixmap *gdk_pixmap = bitmap->GetPixmap();
- GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
+ GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
bitmap->GetMask()->GetBitmap() :
(GdkBitmap*) NULL;
image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap );
}
-
+
gtk_widget_show(image);
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image );
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
(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_widget_show( mitem->GetSubMenu()->m_menu );
// submenu
if ( m_invokingWindow )
wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow);
- }
- else
- {
+ }
+ else
+ {
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
- GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
- (gpointer)this );
- }
+ GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
+ (gpointer)this );
+ }
+
#ifndef __WXGTK20__
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
if (accel_key != GDK_VoidSymbol)
{
gtk_widget_add_accelerator (menuItem,
- "activate_item",
- gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
- accel_key,
- GDK_MOD1_MASK,
- GTK_ACCEL_LOCKED);
- }
+ "activate_item",
+ gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
+ accel_key,
+ GDK_MOD1_MASK,
+ GTK_ACCEL_LOCKED);
+ }
#endif
}
{
wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem)
- return item->GetId();
+ return item->GetId();
node = node->GetNext();
}
hotkey << wxT("Command" );
break;
/* 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_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8:
- 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_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4:
+ 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_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16:
case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20:
hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1);
break;
m_page = (GtkNotebookPage *) NULL;
m_box = (GtkWidget *) NULL;
}
-
+
wxString m_text;
int m_image;
GtkNotebookPage *m_page;
if (!notebook->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
-
+
/* win is a control: tab can be propagated up */
if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right))
{
{
return FALSE;
}
-
+
// m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(widget), page );
-
+
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
return TRUE;
}
/* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
event.SetDirection( (gdk_event->keyval == GDK_Tab) );
/* 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) );
event.SetCurrentFocus( notebook );
{
gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style);
gtk_rc_style_unref(style);
- }
-
+ }
+
/* show the label */
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
if (select && (m_pagesData.GetCount() > 1))
SetSelection( GetPageCount()-1 );
else
#endif
- SetSelection( position );
+ SetSelection( position );
}
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
if (child != widget)
{
while (child)
- {
- if (child == widget)
- return FALSE;
+ {
+ if (child == widget)
+ return FALSE;
child = child->parent;
}
}
static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child )
{
gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y,
- child->m_width,
- child->m_height );
+ GTK_WIDGET(child->m_widget),
+ child->m_x,
+ child->m_y,
+ child->m_width,
+ child->m_height );
if (parent->HasFlag(wxTAB_TRAVERSAL))
{
// Unlike windows, top level windows are created hidden by default.
m_isShown = false;
-
+
// All dialogs should really have this style
m_windowStyle |= wxTAB_TRAVERSAL;
gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this );
-
+
return TRUE;
}
GtkOnSize( m_x, m_y, m_width, m_height );
}
-
+
bool ret = wxWindow::Show( show );
-
+
return ret;
}
{
/* program has vetoed */
win->m_adjust->value = win->m_oldPos;
-
+
gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust),
- (GtkSignalFunc) gtk_spinbutt_callback,
- (gpointer) win );
-
+ (GtkSignalFunc) gtk_spinbutt_callback,
+ (gpointer) win );
+
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
gtk_signal_connect( GTK_OBJECT (win->m_adjust),
- "value_changed",
- (GtkSignalFunc) gtk_spinbutt_callback,
- (gpointer) win );
+ "value_changed",
+ (GtkSignalFunc) gtk_spinbutt_callback,
+ (gpointer) win );
return;
}
-
+
win->m_oldPos = win->m_adjust->value;
-
+
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxXX creation failed") );
- return FALSE;
+ return FALSE;
}
m_oldPos = 0.0;
m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-
+
// these two calls are required due to some bug in GTK
Refresh();
SetFocus();
if (accel_key != GDK_VoidSymbol)
{
gtk_widget_add_accelerator (menu->m_owner,
- "activate_item",
- m_accel,//gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
- accel_key,
- GDK_MOD1_MASK,
- GTK_ACCEL_LOCKED);
+ "activate_item",
+ m_accel, //gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menubar)),
+ accel_key,
+ GDK_MOD1_MASK,
+ GTK_ACCEL_LOCKED);
}
#endif
DoSetText(str);
- if (oldLabel == label1 &&
+ if (oldLabel == label1 &&
oldhotkey == GetHotKey()) // Make sure we can change a hotkey even if the label is unaltered
return;
gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods);
if (accel_key != 0)
{
- gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
+ gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem),
m_parentMenu->m_accel,
accel_key,
accel_mods );
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() );
}
if ( GTK_IS_WIDGET( m_menu ))
{
// 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
// one more reference to it:
if ( m_owner )
else
{
GdkPixmap *gdk_pixmap = bitmap->GetPixmap();
- GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
+ GdkBitmap *gdk_bitmap = bitmap->GetMask() ?
bitmap->GetMask()->GetBitmap() :
(GdkBitmap*) NULL;
image = gtk_image_new_from_pixmap( gdk_pixmap, gdk_bitmap );
}
-
+
gtk_widget_show(image);
gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(menuItem), image );
GTK_SIGNAL_FUNC(gtk_menu_nolight_callback),
(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_widget_show( mitem->GetSubMenu()->m_menu );
// submenu
if ( m_invokingWindow )
wxMenubarSetInvokingWindow(mitem->GetSubMenu(), m_invokingWindow);
- }
- else
- {
+ }
+ else
+ {
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
- GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
- (gpointer)this );
- }
+ GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
+ (gpointer)this );
+ }
+
#ifndef __WXGTK20__
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
if (accel_key != GDK_VoidSymbol)
{
gtk_widget_add_accelerator (menuItem,
- "activate_item",
- gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
- accel_key,
- GDK_MOD1_MASK,
- GTK_ACCEL_LOCKED);
- }
+ "activate_item",
+ gtk_menu_ensure_uline_accel_group(GTK_MENU(m_menu)),
+ accel_key,
+ GDK_MOD1_MASK,
+ GTK_ACCEL_LOCKED);
+ }
#endif
}
{
wxMenuItem *item = node->GetData();
if (item->GetMenuItem() == menuItem)
- return item->GetId();
+ return item->GetId();
node = node->GetNext();
}
hotkey << wxT("Command" );
break;
/* 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_SPECIAL5: case WXK_SPECIAL6: case WXK_SPECIAL7: case WXK_SPECIAL8:
- 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_SPECIAL1: case WXK_SPECIAL2: case WXK_SPECIAL3: case WXK_SPECIAL4:
+ 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_SPECIAL13: case WXK_SPECIAL14: case WXK_SPECIAL15: case WXK_SPECIAL16:
case WXK_SPECIAL17: case WXK_SPECIAL18: case WXK_SPECIAL19: case WXK_SPECIAL20:
hotkey += wxString::Format(wxT("Special%d"), code - WXK_SPECIAL1 + 1);
break;
m_page = (GtkNotebookPage *) NULL;
m_box = (GtkWidget *) NULL;
}
-
+
wxString m_text;
int m_image;
GtkNotebookPage *m_page;
if (!notebook->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return FALSE;
-
+
/* win is a control: tab can be propagated up */
if ((gdk_event->keyval == GDK_Left) || (gdk_event->keyval == GDK_Right))
{
{
return FALSE;
}
-
+
// m_selection = page;
gtk_notebook_set_page( GTK_NOTEBOOK(widget), page );
-
+
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
return TRUE;
}
/* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
event.SetDirection( (gdk_event->keyval == GDK_Tab) );
/* 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) );
event.SetCurrentFocus( notebook );
{
gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style);
gtk_rc_style_unref(style);
- }
-
+ }
+
/* show the label */
gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
if (select && (m_pagesData.GetCount() > 1))
SetSelection( GetPageCount()-1 );
else
#endif
- SetSelection( position );
+ SetSelection( position );
}
gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
if (child != widget)
{
while (child)
- {
- if (child == widget)
- return FALSE;
+ {
+ if (child == widget)
+ return FALSE;
child = child->parent;
}
}
static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child )
{
gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y,
- child->m_width,
- child->m_height );
+ GTK_WIDGET(child->m_widget),
+ child->m_x,
+ child->m_y,
+ child->m_width,
+ child->m_height );
if (parent->HasFlag(wxTAB_TRAVERSAL))
{
// Unlike windows, top level windows are created hidden by default.
m_isShown = false;
-
+
// All dialogs should really have this style
m_windowStyle |= wxTAB_TRAVERSAL;
gtk_signal_connect (GTK_OBJECT(m_widget), "button_press_event",
GTK_SIGNAL_FUNC(gtk_popup_button_press), (gpointer)this );
-
+
return TRUE;
}
GtkOnSize( m_x, m_y, m_width, m_height );
}
-
+
bool ret = wxWindow::Show( show );
-
+
return ret;
}
{
/* program has vetoed */
win->m_adjust->value = win->m_oldPos;
-
+
gtk_signal_disconnect_by_func( GTK_OBJECT (win->m_adjust),
- (GtkSignalFunc) gtk_spinbutt_callback,
- (gpointer) win );
-
+ (GtkSignalFunc) gtk_spinbutt_callback,
+ (gpointer) win );
+
gtk_signal_emit_by_name( GTK_OBJECT(win->m_adjust), "value_changed" );
gtk_signal_connect( GTK_OBJECT (win->m_adjust),
- "value_changed",
- (GtkSignalFunc) gtk_spinbutt_callback,
- (gpointer) win );
+ "value_changed",
+ (GtkSignalFunc) gtk_spinbutt_callback,
+ (gpointer) win );
return;
}
-
+
win->m_oldPos = win->m_adjust->value;
-
+
/* always send a thumbtrack event */
if (command != wxEVT_SCROLL_THUMBTRACK)
{
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( wxT("wxXX creation failed") );
- return FALSE;
+ return FALSE;
}
m_oldPos = 0.0;
m_adjust->upper = fmax;
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-
+
// these two calls are required due to some bug in GTK
Refresh();
SetFocus();