if (event.GetEventType() == wxEVT_MOUSEWHEEL)
{
event.m_linesPerAction = 3;
+ event.m_wheelDelta = 120;
if (((GdkEventButton*)gdk_event)->button == 4)
event.m_wheelRotation = 120;
else if (((GdkEventButton*)gdk_event)->button == 5)
// a chance to correct this
win->FixUpMouseEvent(widget, event.m_x, event.m_y);
+ if ( event_type == wxEVT_RIGHT_DOWN )
+ {
+ // generate a "context menu" event: this is similar to right mouse
+ // click under many GUIs except that it is generated differently
+ // (right up under MSW, ctrl-click under Mac, right down here) and
+ //
+ // (a) it's a command event and so is propagated to the parent
+ // (b) under MSW it can be generated from kbd too
+ // (c) it uses screen coords (because of (a))
+ wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU,
+ win->GetId(),
+ win->ClientToScreen(event.GetPosition()));
+ (void)win->GetEventHandler()->ProcessEvent(evtCtx);
+ }
+
// find the correct window to send the event too: it may be a different one
// from the one which got it at GTK+ level because some control don't have
// their own X window and thus cannot get any events.
gs_timeLastClick = gdk_event->time;
-/*
- wxPrintf( wxT("2) OnButtonPress from ") );
- if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
- wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( wxT(".\n") );
-*/
-
#ifndef __WXGTK20__
if (event_type == wxEVT_LEFT_DCLICK)
{
// same wxListBox hack as above
win->FixUpMouseEvent(widget, event.m_x, event.m_y);
- if ( event_type == wxEVT_RIGHT_UP )
- {
- // generate a "context menu" event: this is similar to wxEVT_RIGHT_UP
- // except that:
- //
- // (a) it's a command event and so is propagated to the parent
- // (b) under MSW it can be generated from kbd too
- // (c) it uses screen coords (because of (a))
- wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU,
- win->GetId(),
- win->ClientToScreen(event.GetPosition()));
- (void)win->GetEventHandler()->ProcessEvent(evtCtx);
- }
-
if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
event.m_middleDown = (gdk_event->state & GDK_BUTTON2_MASK);
event.m_rightDown = (gdk_event->state & GDK_BUTTON3_MASK);
event.m_linesPerAction = 3;
+ event.m_wheelDelta = 120;
if (gdk_event->direction == GDK_SCROLL_UP)
event.m_wheelRotation = 120;
else
(gpointer) this );
}
+ InheritAttributes();
+
m_hasVMT = TRUE;
// unless the window was created initially hidden (i.e. Hide() had been
pango_layout_set_text(layout, (const char*) data, strlen( (const char*) data ));
#endif
}
- PangoLayoutLine *line = pango_layout_get_line(layout, 0);
PangoRectangle rect;
- pango_layout_line_get_extents(line, NULL, &rect);
+ pango_layout_get_extents(layout, NULL, &rect);
if (x) (*x) = (wxCoord) PANGO_PIXELS(rect.width);
if (y) (*y) = (wxCoord) PANGO_PIXELS(rect.height);
DoApplyWidgetStyle(style);
gtk_rc_style_unref(style);
}
+
+ // Style change may affect GTK+'s size calculation:
+ InvalidateBestSize();
}
void wxWindowGTK::DoApplyWidgetStyle(GtkRcStyle *style)
{
if (m_wxwindow)
- // should we also do m_widget in this case?
gtk_widget_modify_style(m_wxwindow, style);
- else
- gtk_widget_modify_style(m_widget, style);
+ gtk_widget_modify_style(m_widget, style);
}
bool is_waiting = true;
- gtk_signal_connect( GTK_OBJECT(menu->m_menu),
- "hide",
- GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
- (gpointer)&is_waiting );
+ gulong handler = gtk_signal_connect( GTK_OBJECT(menu->m_menu),
+ "hide",
+ GTK_SIGNAL_FUNC(gtk_pop_hide_callback),
+ (gpointer)&is_waiting );
wxPoint pos;
gpointer userdata;
gtk_main_iteration();
}
+ gtk_signal_disconnect(GTK_OBJECT(menu->m_menu), handler);
+
return true;
}