{
LogEvent( _T("Char"), event);
+/* How are we supposed to test wxTE_PROCESS_TAB with this code?
+
if ( event.KeyCode() == WXK_TAB )
{
WriteText("\t");
{
event.Skip();
}
+*/
+ event.Skip();
}
void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
(int)alloc->width,
(int)alloc->height );
*/
+
win->m_width = alloc->width;
win->m_height = alloc->height;
win->UpdateSize();
}
#endif
- wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
+ DoSetSize( -1, -1, width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle, 0 );
}
void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
m_width = width;
m_height = height;
-
+
/* space occupied by m_frameToolBar and m_frameMenuBar */
int client_area_y_offset = 0;
if (m_frameToolBar)
{
/* insert into toolbar area if not already there */
- if (m_frameToolBar->m_widget->parent != m_mainWidget)
+ if ((m_frameToolBar->m_widget->parent) &&
+ (m_frameToolBar->m_widget->parent != m_mainWidget))
{
- gtk_widget_ref( m_frameToolBar->m_widget );
- gtk_widget_unparent( m_frameToolBar->m_widget );
-
- m_insertInClientArea = TRUE;
- wxInsertChildInFrame( this, m_frameToolBar );
- m_insertInClientArea = FALSE;
-
- gtk_widget_unref( m_frameToolBar->m_widget );
+ GetChildren().DeleteObject( m_frameToolBar );
+
+ gtk_widget_reparent( m_frameToolBar->m_widget, m_mainWidget );
+ UpdateSize();
}
}
}
long style, const wxString &name )
{
style = style | wxSIMPLE_BORDER;
+ style = style | wxCAPTION;
+ style = style | wxSYSTEM_MENU;
if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))
m_miniTitle = 13;
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
-//#if GTK_MINOR_VERSION == 2
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
-//#endif // GTK 1.2.x
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
tool->m_item = item;
+ GtkRequisition req;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
+ m_width = req.width;
+ m_height = req.height;
+
gtk_signal_connect( GTK_OBJECT(tool->m_item),
"enter_notify_event",
GTK_SIGNAL_FUNC(gtk_toolbar_enter_callback),
clicking on a scrollbar belonging to scrolled window will inevitably move
the window. In wxWindows, the scrollbar will only emit an event, send this
to (normally) a wxScrolledWindow and that class will call ScrollWindow()
- which actually move the window and its subchildren. Note that GtkMyFixed
+ which actually moves the window and its subchildren. Note that GtkMyFixed
memorizes how much it has been scrolled but that wxWindows forgets this
so that the two coordinates systems have to be kept in synch. This is done
in various places using the myfixed->xoffset and myfixed->yoffset values.
and then iterates down the respective size events to all window. This has
the disadvantage, that windows might get size events before the GTK widget
actually has the reported size. This doesn't normally pose any problem, but
- the OpenGl drawing routines rely in correct behaviour. Therefore, I have
+ the OpenGl drawing routines rely on correct behaviour. Therefore, I have
added the m_nativeSizeEvents flag, which is true only for the OpenGL canvas,
i.e. the wxGLCanvas will emit a size event, when (and not before) the X11
window that is used for OpenGl output really has that size (as reported by
GdkModifierType state;
if (gdk_event->window) gdk_window_get_pointer(gdk_event->window, &x, &y, &state);
+ bool ret = FALSE;
+
long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval );
-
/* sending unknown key events doesn't really make sense */
if (key_code == 0) return FALSE;
- bool ret = FALSE;
-
wxKeyEvent event( wxEVT_KEY_DOWN );
event.SetTimestamp( gdk_event->time );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.SetEventObject( win );
ret = win->GetEventHandler()->ProcessEvent( event );
- key_code = map_to_wx_keysym( gdk_event->keyval );
-
#if wxUSE_ACCEL
if (!ret)
{
}
}
#endif // wxUSE_ACCEL
+
/* wxMSW doesn't send char events with Alt pressed */
/* Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
- will only be sent if it is not a menu accelerator. */
- if ((key_code != 0) && ! ret )
+ will only be sent if it is not in an accelerator table. */
+ key_code = map_to_wx_keysym( gdk_event->keyval );
+
+ if ( (!ret) &&
+ (key_code != 0))
{
wxKeyEvent event2( wxEVT_CHAR );
event2.SetTimestamp( gdk_event->time );
event2.m_x = x;
event2.m_y = y;
event2.SetEventObject( win );
- ret = (ret || win->GetEventHandler()->ProcessEvent( event2 ));
+ ret = win->GetEventHandler()->ProcessEvent( event2 );
}
/* win is a control: tab can be propagated up */
#if (GTK_MINOR_VERSION > 0)
/* pressing F10 will activate the menu bar of the top frame */
+/*
if ( (!ret) &&
(gdk_event->keyval == GDK_F10) )
{
wxNode *node = menubar->GetMenus().First();
if (node)
{
- // doesn't work correctly
- // wxMenu *firstMenu = (wxMenu*) node->Data();
- // gtk_menu_item_select( GTK_MENU_ITEM(firstMenu->m_owner) );
- // ret = TRUE;
+ wxMenu *firstMenu = (wxMenu*) node->Data();
+ gtk_menu_item_select( GTK_MENU_ITEM(firstMenu->m_owner) );
+ ret = TRUE;
break;
}
}
ancestor = ancestor->GetParent();
}
}
+*/
#endif
/*
if (cursor.Ok())
{
- /* I now set the cursor the anew in every OnInternalIdle call
+ /* I now set the cursor anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (oldParent)
{
- gtk_container_remove( GTK_CONTAINER(oldParent->m_wxwindow), m_widget );
+ gtk_container_remove( GTK_CONTAINER(m_widget->parent), m_widget );
}
wxASSERT( GTK_IS_WIDGET(m_widget) );
(int)alloc->width,
(int)alloc->height );
*/
+
win->m_width = alloc->width;
win->m_height = alloc->height;
win->UpdateSize();
}
#endif
- wxWindow::DoSetClientSize( width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle );
+ DoSetSize( -1, -1, width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle, 0 );
}
void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height )
m_width = width;
m_height = height;
-
+
/* space occupied by m_frameToolBar and m_frameMenuBar */
int client_area_y_offset = 0;
if (m_frameToolBar)
{
/* insert into toolbar area if not already there */
- if (m_frameToolBar->m_widget->parent != m_mainWidget)
+ if ((m_frameToolBar->m_widget->parent) &&
+ (m_frameToolBar->m_widget->parent != m_mainWidget))
{
- gtk_widget_ref( m_frameToolBar->m_widget );
- gtk_widget_unparent( m_frameToolBar->m_widget );
-
- m_insertInClientArea = TRUE;
- wxInsertChildInFrame( this, m_frameToolBar );
- m_insertInClientArea = FALSE;
-
- gtk_widget_unref( m_frameToolBar->m_widget );
+ GetChildren().DeleteObject( m_frameToolBar );
+
+ gtk_widget_reparent( m_frameToolBar->m_widget, m_mainWidget );
+ UpdateSize();
}
}
}
long style, const wxString &name )
{
style = style | wxSIMPLE_BORDER;
+ style = style | wxCAPTION;
+ style = style | wxSYSTEM_MENU;
if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))
m_miniTitle = 13;
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
-//#if GTK_MINOR_VERSION == 2
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
-//#endif // GTK 1.2.x
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
tool->m_item = item;
+ GtkRequisition req;
+ (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
+ m_width = req.width;
+ m_height = req.height;
+
gtk_signal_connect( GTK_OBJECT(tool->m_item),
"enter_notify_event",
GTK_SIGNAL_FUNC(gtk_toolbar_enter_callback),
clicking on a scrollbar belonging to scrolled window will inevitably move
the window. In wxWindows, the scrollbar will only emit an event, send this
to (normally) a wxScrolledWindow and that class will call ScrollWindow()
- which actually move the window and its subchildren. Note that GtkMyFixed
+ which actually moves the window and its subchildren. Note that GtkMyFixed
memorizes how much it has been scrolled but that wxWindows forgets this
so that the two coordinates systems have to be kept in synch. This is done
in various places using the myfixed->xoffset and myfixed->yoffset values.
and then iterates down the respective size events to all window. This has
the disadvantage, that windows might get size events before the GTK widget
actually has the reported size. This doesn't normally pose any problem, but
- the OpenGl drawing routines rely in correct behaviour. Therefore, I have
+ the OpenGl drawing routines rely on correct behaviour. Therefore, I have
added the m_nativeSizeEvents flag, which is true only for the OpenGL canvas,
i.e. the wxGLCanvas will emit a size event, when (and not before) the X11
window that is used for OpenGl output really has that size (as reported by
GdkModifierType state;
if (gdk_event->window) gdk_window_get_pointer(gdk_event->window, &x, &y, &state);
+ bool ret = FALSE;
+
long key_code = map_to_unmodified_wx_keysym( gdk_event->keyval );
-
/* sending unknown key events doesn't really make sense */
if (key_code == 0) return FALSE;
- bool ret = FALSE;
-
wxKeyEvent event( wxEVT_KEY_DOWN );
event.SetTimestamp( gdk_event->time );
event.m_shiftDown = (gdk_event->state & GDK_SHIFT_MASK);
event.SetEventObject( win );
ret = win->GetEventHandler()->ProcessEvent( event );
- key_code = map_to_wx_keysym( gdk_event->keyval );
-
#if wxUSE_ACCEL
if (!ret)
{
}
}
#endif // wxUSE_ACCEL
+
/* wxMSW doesn't send char events with Alt pressed */
/* Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
- will only be sent if it is not a menu accelerator. */
- if ((key_code != 0) && ! ret )
+ will only be sent if it is not in an accelerator table. */
+ key_code = map_to_wx_keysym( gdk_event->keyval );
+
+ if ( (!ret) &&
+ (key_code != 0))
{
wxKeyEvent event2( wxEVT_CHAR );
event2.SetTimestamp( gdk_event->time );
event2.m_x = x;
event2.m_y = y;
event2.SetEventObject( win );
- ret = (ret || win->GetEventHandler()->ProcessEvent( event2 ));
+ ret = win->GetEventHandler()->ProcessEvent( event2 );
}
/* win is a control: tab can be propagated up */
#if (GTK_MINOR_VERSION > 0)
/* pressing F10 will activate the menu bar of the top frame */
+/*
if ( (!ret) &&
(gdk_event->keyval == GDK_F10) )
{
wxNode *node = menubar->GetMenus().First();
if (node)
{
- // doesn't work correctly
- // wxMenu *firstMenu = (wxMenu*) node->Data();
- // gtk_menu_item_select( GTK_MENU_ITEM(firstMenu->m_owner) );
- // ret = TRUE;
+ wxMenu *firstMenu = (wxMenu*) node->Data();
+ gtk_menu_item_select( GTK_MENU_ITEM(firstMenu->m_owner) );
+ ret = TRUE;
break;
}
}
ancestor = ancestor->GetParent();
}
}
+*/
#endif
/*
if (cursor.Ok())
{
- /* I now set the cursor the anew in every OnInternalIdle call
+ /* I now set the cursor anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
windows above so that checking for the current cursor is
not possible. */
if (oldParent)
{
- gtk_container_remove( GTK_CONTAINER(oldParent->m_wxwindow), m_widget );
+ gtk_container_remove( GTK_CONTAINER(m_widget->parent), m_widget );
}
wxASSERT( GTK_IS_WIDGET(m_widget) );
self.floatframe.SetToolBar(self)
self.oldcolor = self.GetBackgroundColour()
barsize = self.GetSizeTuple()
- self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight))
- self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1]))
+# self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight))
+# self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1]))
+ self.floatframe.SetClientSize(wxSize(50,200))
newpos = self.parentframe.GetPosition()
newpos.y = newpos.y + self.titleheight
self.floatframe.SetPosition(newpos)