X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/034be8882cc091cf8ca1ccdf307190ac73adfe54..07fa75bc31fd49da3e4bd4a8bf056a96493bf26b:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index a83c194439..a84758ad85 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -121,12 +121,6 @@ */ -//------------------------------------------------------------------------- -// constants -//------------------------------------------------------------------------- - -#define FRAME_BORDER_WIDTH 2 - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -141,6 +135,8 @@ static wxWindow *g_focusWindow = (wxWindow*) NULL; the last click here */ static guint32 gs_timeLastClick = 0; +#if (GTK_MINOR_VERSION > 0) + //----------------------------------------------------------------------------- // local code (see below) //----------------------------------------------------------------------------- @@ -184,13 +180,6 @@ static void draw_frame( GtkWidget *widget, wxWindow *win ) dx += widget->allocation.x; dy += widget->allocation.y; } - else - if (win->m_parent) - { - wxPoint pt(win->m_parent->GetClientAreaOrigin()); - dx += pt.x; - dy += pt.y; - } if (win->m_windowStyle & wxRAISED_BORDER) { @@ -234,6 +223,8 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU draw_frame( widget, win ); } +#endif + //----------------------------------------------------------------------------- // "expose_event" of m_wxwindow //----------------------------------------------------------------------------- @@ -706,10 +697,6 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton } } - wxPoint pt(win->GetClientAreaOrigin()); - event.m_x -= pt.x; - event.m_y -= pt.y; - event.SetEventObject( win ); gs_timeLastClick = gdk_event->time; @@ -816,10 +803,6 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto } } - wxPoint pt(win->GetClientAreaOrigin()); - event.m_x -= pt.x; - event.m_y -= pt.y; - event.SetEventObject( win ); if (win->GetEventHandler()->ProcessEvent( event )) @@ -927,10 +910,6 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion } } - wxPoint pt(win->GetClientAreaOrigin()); - event.m_x -= pt.x; - event.m_y -= pt.y; - event.SetEventObject( win ); if (win->GetEventHandler()->ProcessEvent( event )) @@ -1064,10 +1043,6 @@ static gint gtk_window_enter_callback( GtkWidget *widget, GdkEventCrossing *gdk_ event.m_x = (long)x; event.m_y = (long)y; - wxPoint pt(win->GetClientAreaOrigin()); - event.m_x -= pt.x; - event.m_y -= pt.y; - if (win->GetEventHandler()->ProcessEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" ); @@ -1118,10 +1093,6 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_ event.m_x = (long)x; event.m_y = (long)y; - wxPoint pt(win->GetClientAreaOrigin()); - event.m_x -= pt.x; - event.m_y -= pt.y; - if (win->GetEventHandler()->ProcessEvent( event )) { gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" ); @@ -1345,11 +1316,6 @@ static void wxInsertChildInWindow( wxWindow* parent, wxWindow* child ) child->m_width, child->m_height ); - if (wxIS_KIND_OF(parent,wxFrame)) - { - parent->m_sizeSet = FALSE; - } - if (parent->m_windowStyle & wxTAB_TRAVERSAL) { /* we now allow a window to get the focus as long as it @@ -1468,7 +1434,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - wxASSERT_MSG( m_isWindow, "Init() must have been called before!" ); + wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") ); PreCreation( parent, id, pos, size, style, name ); @@ -1675,7 +1641,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - wxASSERT_MSG( (!m_needParent) || (parent), "Need complete parent." ); + wxASSERT_MSG( (!m_needParent) || (parent), _T("Need complete parent.") ); m_widget = (GtkWidget*) NULL; m_wxwindow = (GtkWidget*) NULL; @@ -1761,7 +1727,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id, void wxWindow::PostCreation() { - wxASSERT_MSG( (m_widget != NULL), "invalid window" ); + wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); if (m_wxwindow) { @@ -1772,12 +1738,14 @@ void wxWindow::PostCreation() gtk_signal_connect( GTK_OBJECT(m_wxwindow), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); +#if (GTK_MINOR_VERSION > 0) /* these are called when the "sunken" or "raised" borders are drawn */ gtk_signal_connect( GTK_OBJECT(m_widget), "expose_event", GTK_SIGNAL_FUNC(gtk_window_own_expose_callback), (gpointer)this ); gtk_signal_connect( GTK_OBJECT(m_widget), "draw", GTK_SIGNAL_FUNC(gtk_window_own_draw_callback), (gpointer)this ); +#endif } ConnectWidget( GetConnectWidget() ); @@ -1829,7 +1797,7 @@ bool wxWindow::HasVMT() bool wxWindow::Close( bool force ) { - wxASSERT_MSG( (m_widget != NULL), "invalid window" ); + wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId); event.SetEventObject(this); @@ -1842,7 +1810,7 @@ bool wxWindow::Close( bool force ) bool wxWindow::Destroy() { - wxASSERT_MSG( (m_widget != NULL), "invalid window" ); + wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); m_hasVMT = FALSE; delete this; @@ -1869,25 +1837,10 @@ void wxWindow::PrepareDC( wxDC &WXUNUSED(dc) ) // are we to set fonts here ? } -wxPoint wxWindow::GetClientAreaOrigin() const -{ - return wxPoint(0,0); -} - -void wxWindow::AdjustForParentClientOrigin( int& x, int& y, int sizeFlags ) -{ - if (((sizeFlags & wxSIZE_NO_ADJUSTMENTS) == 0) && GetParent()) - { - wxPoint pt(GetParent()->GetClientAreaOrigin()); - x += pt.x; - y += pt.y; - } -} - void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), "invalid window" ); - wxASSERT_MSG( (m_parent != NULL), "wxWindow::SetSize requires parent.\n" ); + wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -1940,15 +1893,13 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) /* the default button has a border around it */ int border = 5; - wxPoint pt( m_parent->GetClientAreaOrigin() ); - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x-border, m_y+pt.y-border ); + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x-border, m_y-border ); gtk_widget_set_usize( m_widget, m_width+2*border, m_height+2*border ); } else { - wxPoint pt( m_parent->GetClientAreaOrigin() ); - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y ); + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y ); if ((old_width != m_width) || (old_height != m_height)) gtk_widget_set_usize( m_widget, m_width, m_height ); @@ -1971,7 +1922,7 @@ void wxWindow::OnInternalIdle() void wxWindow::GetSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (width) (*width) = m_width; if (height) (*height) = m_height; @@ -1979,7 +1930,7 @@ void wxWindow::GetSize( int *width, int *height ) const void wxWindow::DoSetClientSize( int width, int height ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (!m_wxwindow) { @@ -2044,7 +1995,7 @@ void wxWindow::DoSetClientSize( int width, int height ) void wxWindow::GetClientSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (!m_wxwindow) { @@ -2110,7 +2061,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const void wxWindow::GetPosition( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (x) (*x) = m_x; if (y) (*y) = m_y; @@ -2118,7 +2069,7 @@ void wxWindow::GetPosition( int *x, int *y ) const void wxWindow::ClientToScreen( int *x, int *y ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); GdkWindow *source = (GdkWindow *) NULL; if (m_wxwindow) @@ -2139,17 +2090,13 @@ void wxWindow::ClientToScreen( int *x, int *y ) } } - wxPoint pt(GetClientAreaOrigin()); - org_x += pt.x; - org_y += pt.y; - if (x) *x += org_x; if (y) *y += org_y; } void wxWindow::ScreenToClient( int *x, int *y ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); GdkWindow *source = (GdkWindow *) NULL; if (m_wxwindow) @@ -2170,17 +2117,13 @@ void wxWindow::ScreenToClient( int *x, int *y ) } } - wxPoint pt(GetClientAreaOrigin()); - org_x -= pt.x; - org_y -= pt.y; - if (x) *x -= org_x; if (y) *y -= org_y; } void wxWindow::Centre( int direction ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); int x = m_x; int y = m_y; @@ -2204,7 +2147,7 @@ void wxWindow::Centre( int direction ) void wxWindow::Fit() { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); int maxX = 0; int maxY = 0; @@ -2226,7 +2169,7 @@ void wxWindow::Fit() void wxWindow::SetSizeHints( int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH) ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); m_minWidth = minW; m_minHeight = minH; @@ -2241,7 +2184,7 @@ void wxWindow::OnSize( wxSizeEvent &WXUNUSED(event) ) bool wxWindow::Show( bool show ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, "invalid window" ); + wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); if (show == m_isShown) return TRUE; @@ -2257,7 +2200,7 @@ bool wxWindow::Show( bool show ) void wxWindow::Enable( bool enable ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); m_isEnabled = enable; @@ -2267,9 +2210,9 @@ void wxWindow::Enable( bool enable ) int wxWindow::GetCharHeight() const { - wxCHECK_MSG( (m_widget != NULL), 12, "invalid window" ); + wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 12, "invalid font" ); + wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2278,9 +2221,9 @@ int wxWindow::GetCharHeight() const int wxWindow::GetCharWidth() const { - wxCHECK_MSG( (m_widget != NULL), 8, "invalid window" ); + wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 8, "invalid font" ); + wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2293,10 +2236,10 @@ void wxWindow::GetTextExtent( const wxString& string, int *x, int *y, wxFont fontToUse = m_font; if (theFont) fontToUse = *theFont; - wxCHECK_RET( fontToUse.Ok(), "invalid font" ); + wxCHECK_RET( fontToUse.Ok(), _T("invalid font") ); GdkFont *font = fontToUse.GetInternalFont( 1.0 ); - if (x) (*x) = gdk_string_width( font, string ); + if (x) (*x) = gdk_string_width( font, string.mbc_str() ); if (y) (*y) = font->ascent + font->descent; if (descent) (*descent) = font->descent; if (externalLeading) (*externalLeading) = 0; // ?? @@ -2332,7 +2275,7 @@ void wxWindow::OnKeyDown( wxKeyEvent &event ) void wxWindow::SetFocus() { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); GtkWidget *connect_widget = GetConnectWidget(); if (connect_widget) @@ -2363,15 +2306,15 @@ bool wxWindow::AcceptsFocus() const void wxWindow::AddChild( wxWindow *child ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); - wxCHECK_RET( (child != NULL), "invalid child" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (child != NULL), _T("invalid child") ); m_children.Append( child ); } wxWindow *wxWindow::ReParent( wxWindow *newParent ) { - wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, "invalid window" ); + wxCHECK_MSG( (m_widget != NULL), (wxWindow*) NULL, _T("invalid window") ); wxWindow *oldParent = GetParent(); @@ -2406,14 +2349,14 @@ int wxWindow::GetReturnCode() void wxWindow::Raise() { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (m_widget) gdk_window_raise( m_widget->window ); } void wxWindow::Lower() { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (m_widget) gdk_window_lower( m_widget->window ); } @@ -2504,7 +2447,7 @@ wxWindowID wxWindow::GetId() const void wxWindow::SetCursor( const wxCursor &cursor ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (cursor.Ok()) { @@ -2530,7 +2473,7 @@ void wxWindow::WarpPointer( int WXUNUSED(x), int WXUNUSED(y) ) void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) { - wxCHECK_RET( (m_widget != NULL), "invalid window" ); + wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); if (eraseBackground && m_wxwindow && m_wxwindow->window) { @@ -2595,7 +2538,7 @@ bool wxWindow::IsExposed( const wxRect& rect ) const void wxWindow::Clear() { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); if (m_wxwindow && m_wxwindow->window) { @@ -2633,9 +2576,9 @@ void wxWindow::SetToolTip( wxToolTip *tip ) m_toolTip->Apply( this ); } -void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip ) +void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) { - gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL ); + gtk_tooltips_set_tip( tips, GetConnectWidget(), wxConv_current->cWX2MB(tip), (gchar*) NULL ); } #endif // wxUSE_TOOLTIPS @@ -2646,7 +2589,7 @@ wxColour wxWindow::GetBackgroundColour() const void wxWindow::SetBackgroundColour( const wxColour &colour ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); if (m_backgroundColour == colour) return; @@ -2686,7 +2629,7 @@ wxColour wxWindow::GetForegroundColour() const void wxWindow::SetForegroundColour( const wxColour &colour ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); if (m_foregroundColour == colour) return; @@ -2754,7 +2697,7 @@ void wxWindow::ApplyWidgetStyle() bool wxWindow::Validate() { - wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); wxNode *node = m_children.First(); while (node) @@ -2771,7 +2714,7 @@ bool wxWindow::Validate() bool wxWindow::TransferDataToWindow() { - wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); wxNode *node = m_children.First(); while (node) @@ -2790,7 +2733,7 @@ bool wxWindow::TransferDataToWindow() bool wxWindow::TransferDataFromWindow() { - wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); wxNode *node = m_children.First(); while (node) @@ -2817,7 +2760,7 @@ void wxWindow::OnInitDialog( wxInitDialogEvent &WXUNUSED(event) ) void wxWindow::InitDialog() { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); wxInitDialogEvent event(GetId()); event.SetEventObject( this ); @@ -2851,9 +2794,9 @@ static void pop_pos_callback( GtkMenu *menu, gint *x, gint *y, wxWindow *win ) bool wxWindow::PopupMenu( wxMenu *menu, int x, int y ) { - wxCHECK_MSG( m_widget != NULL, FALSE, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); - wxCHECK_MSG( menu != NULL, FALSE, "invalid popup-menu" ); + wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") ); SetInvokingWindow( menu, this ); @@ -2878,7 +2821,7 @@ bool wxWindow::PopupMenu( wxMenu *menu, int x, int y ) void wxWindow::SetDropTarget( wxDropTarget *dropTarget ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); GtkWidget *dnd_widget = GetConnectWidget(); @@ -2913,7 +2856,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window ) void wxWindow::SetFont( const wxFont &font ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); if (m_font == font) return; @@ -2949,9 +2892,9 @@ long wxWindow::GetWindowStyleFlag() const void wxWindow::CaptureMouse() { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); - wxCHECK_RET( g_capturing == FALSE, "CaptureMouse called twice" ); + wxCHECK_RET( g_capturing == FALSE, _T("CaptureMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); gtk_grab_add( connect_widget ); @@ -2968,9 +2911,9 @@ void wxWindow::CaptureMouse() void wxWindow::ReleaseMouse() { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); - wxCHECK_RET( g_capturing == TRUE, "ReleaseMouse called twice" ); + wxCHECK_RET( g_capturing == TRUE, _T("ReleaseMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); gtk_grab_remove( connect_widget ); @@ -3043,9 +2986,9 @@ wxWindow *wxWindow::FindWindow( const wxString& name ) void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" ); + wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); m_hasScrolling = TRUE; @@ -3111,9 +3054,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" ); + wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) { @@ -3150,9 +3093,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) int wxWindow::GetScrollThumb( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" ); + wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->page_size+0.5); @@ -3162,9 +3105,9 @@ int wxWindow::GetScrollThumb( int orient ) const int wxWindow::GetScrollPos( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" ); + wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->value+0.5); @@ -3174,9 +3117,9 @@ int wxWindow::GetScrollPos( int orient ) const int wxWindow::GetScrollRange( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid window" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, "window needs client area for scrolling" ); + wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->upper+0.5); @@ -3186,9 +3129,17 @@ int wxWindow::GetScrollRange( int orient ) const void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) { - wxCHECK_RET( m_widget != NULL, "invalid window" ); + wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + + wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); - wxCHECK_RET( m_wxwindow != NULL, "window needs client area for scrolling" ); + wxNode *node = m_children.First(); + while (node) + { + wxWindow *child = (wxWindow*) node->Data(); + child->Move( child->m_x + dx, child->m_y + dy ); + node = node->Next(); + } int cw = 0; int ch = 0; @@ -3531,21 +3482,21 @@ void wxWindow::SetConstraintSizes(bool recurse) } else if (constr) { - char *windowClass = this->GetClassInfo()->GetClassName(); + wxChar *windowClass = this->GetClassInfo()->GetClassName(); wxString winName; - if (GetName() == "") - winName = "unnamed"; + if (GetName() == _T("")) + winName = _T("unnamed"); else winName = GetName(); - wxLogDebug( "Constraint(s) not satisfied for window of type %s, name %s:\n", - (const char *)windowClass, - (const char *)winName); - if (!constr->left.GetDone()) wxLogDebug( " unsatisfied 'left' constraint.\n" ); - if (!constr->right.GetDone()) wxLogDebug( " unsatisfied 'right' constraint.\n" ); - if (!constr->width.GetDone()) wxLogDebug( " unsatisfied 'width' constraint.\n" ); - if (!constr->height.GetDone()) wxLogDebug( " unsatisfied 'height' constraint.\n" ); - wxLogDebug( "Please check constraints: try adding AsIs() constraints.\n" ); + wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"), + (const wxChar *)windowClass, + (const wxChar *)winName); + if (!constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") ); + if (!constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") ); + if (!constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") ); + if (!constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") ); + wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") ); } if (recurse)