#include "wx/dcclient.h"
#include "wx/dnd.h"
#include "wx/mdi.h"
+#include "wx/menu.h"
#include "wx/notebook.h"
#include "wx/statusbr.h"
+#include <wx/intl.h>
//#include "wx/treectrl.h"
#include "gdk/gdkkeysyms.h"
#include <math.h>
if (g_blockEventsOnDrag) return;
/*
- if (IS_KIND_OF(win,wxTreeCtrl))
+ if (IS_KIND_OF(win,wxStatusBar))
{
printf( "OnExpose from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
-
+
printf( "x: %d \n", gdk_event->area.x );
printf( "y: %d \n", gdk_event->area.y );
printf( "w: %d \n", gdk_event->area.width );
if (g_blockEventsOnDrag) return;
/*
+ if (IS_KIND_OF(win,wxStatusBar))
+ {
printf( "OnDraw from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( "y: %d \n", rect->y );
printf( "w: %d \n", rect->width );
printf( "h: %d \n", rect->height );
+}
*/
win->m_updateRegion.Union( rect->x, rect->y, rect->width, rect->height );
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
*/
-
+
wxEventType event_type = wxEVT_LEFT_DOWN;
if (gdk_event->button == 1)
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
+ m_cursor = NULL;
Create( parent, id, pos, size, style, name );
};
if (m_widget) gtk_widget_destroy( m_widget );
-// delete m_cursor;
+ wxDELETE(m_cursor);
DeleteRelatedConstraints();
if (m_constraints)
long style, const wxString &name )
{
if (m_needParent && (parent == NULL))
- wxFatalError( "Need complete parent.", name );
+ wxFatalError( _("Need complete parent."), name );
m_widget = NULL;
m_hasVMT = FALSE;
m_windowValidator = NULL;
m_windowId = id;
m_sizeSet = FALSE;
- m_cursor = new wxCursor( wxCURSOR_ARROW );
+ if (m_cursor == NULL)
+ m_cursor = new wxCursor( wxCURSOR_ARROW );
m_font = *wxSWISS_FONT;
m_backgroundColour = wxWHITE;
m_foregroundColour = wxBLACK;
// GtkStyle *style = m_widget->style;
// style->font = m_font.GetInternalFont( 1.0 ); // destroy old font ?
- GtkWidget *connect_widget = m_widget;
- if (m_wxwindow) connect_widget = m_wxwindow;
+ GtkWidget *connect_widget = GetConnectWidget();
gtk_object_set_data (GTK_OBJECT (connect_widget), "MyWxWindow", (gpointer)this );
if (!m_parent)
{
- printf( "wxWindow::SetSize error.\n" );
+ printf( _("wxWindow::SetSize error.\n") );
return;
}
void wxWindow::SetFocus(void)
{
- GtkWidget *connect_widget = m_widget;
- if (m_wxwindow) connect_widget = m_wxwindow;
+ GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
{
if (GTK_WIDGET_CAN_FOCUS(connect_widget) && !GTK_WIDGET_HAS_FOCUS (connect_widget) )
void wxWindow::SetCursor( const wxCursor &cursor )
{
- if (*m_cursor == cursor) return;
+ wxASSERT(m_cursor != NULL);
+
+ if (m_cursor != NULL)
+ if (*m_cursor == cursor)
+ return;
(*m_cursor) = cursor;
if (m_widget->window)
gdk_window_set_cursor( m_widget->window, m_cursor->GetCursor() );
rect->width,
rect->height );
else
- Clear();
+ Clear();
};
if (!rect)
{
if (child->GetValidator() && /* child->GetValidator()->Ok() && */
!child->GetValidator()->TransferToWindow() )
{
- wxMessageBox( "Application Error", "Could not transfer data to window", wxOK|wxICON_EXCLAMATION );
+ wxMessageBox( _("Application Error"), _("Could not transfer data to window"), wxOK|wxICON_EXCLAMATION );
return FALSE;
};
node = node->Next();
GetEventHandler()->ProcessEvent(event);
};
+static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
+{
+ menu->SetInvokingWindow( win );
+ wxNode *node = menu->m_items.First();
+ while (node)
+ {
+ wxMenuItem *menuitem = (wxMenuItem*)node->Data();
+ if (menuitem->IsSubMenu())
+ SetInvokingWindow( menuitem->GetSubMenu(), win );
+ node = node->Next();
+ };
+};
+
+bool wxWindow::PopupMenu( wxMenu *menu, int WXUNUSED(x), int WXUNUSED(y) )
+{
+ SetInvokingWindow( menu, this );
+ gtk_menu_popup( GTK_MENU(menu->m_menu), NULL, NULL, NULL, NULL, 0, 0 );
+ return TRUE;
+}
+
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
- GtkWidget *dnd_widget = GetDropTargetWidget();
+ GtkWidget *dnd_widget = GetConnectWidget();
if (m_pDropTarget)
{
return m_pDropTarget;
};
-GtkWidget* wxWindow::GetDropTargetWidget(void)
+GtkWidget* wxWindow::GetConnectWidget(void)
{
GtkWidget *connect_widget = m_widget;
if (m_wxwindow) connect_widget = m_wxwindow;
void wxWindow::CaptureMouse(void)
{
- GtkWidget *connect_widget = m_widget;
- if (m_wxwindow) connect_widget = m_wxwindow;
+ GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_add( connect_widget );
gdk_pointer_grab ( connect_widget->window, FALSE,
(GdkEventMask)
void wxWindow::ReleaseMouse(void)
{
- GtkWidget *connect_widget = m_widget;
- if (m_wxwindow) connect_widget = m_wxwindow;
+ GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
};
wxString winName;
if (GetName() == "")
- winName = "unnamed";
+ winName = _("unnamed");
else
winName = GetName();
- wxDebugMsg("Constraint(s) not satisfied for window of type %s, name %s:\n", (const char *)windowClass, (const char *)winName);
+ wxDebugMsg(_("Constraint(s) not satisfied for window of type %s, name %s:\n"), (const char *)windowClass, (const char *)winName);
if (!constr->left.GetDone())
- wxDebugMsg(" unsatisfied 'left' constraint.\n");
+ wxDebugMsg(_(" unsatisfied 'left' constraint.\n"));
if (!constr->right.GetDone())
- wxDebugMsg(" unsatisfied 'right' constraint.\n");
+ wxDebugMsg(_(" unsatisfied 'right' constraint.\n"));
if (!constr->width.GetDone())
- wxDebugMsg(" unsatisfied 'width' constraint.\n");
+ wxDebugMsg(_(" unsatisfied 'width' constraint.\n"));
if (!constr->height.GetDone())
- wxDebugMsg(" unsatisfied 'height' constraint.\n");
- wxDebugMsg("Please check constraints: try adding AsIs() constraints.\n");
+ wxDebugMsg(_(" unsatisfied 'height' constraint.\n"));
+ wxDebugMsg(_("Please check constraints: try adding AsIs() constraints.\n"));
}
if (recurse)