New scrolling for GTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
82dc15db08
commit
11026f7b59
@ -169,8 +169,6 @@ class wxDC: public wxObject
|
||||
virtual void GetLogicalOrigin( long *x, long *y );
|
||||
virtual void SetDeviceOrigin( long x, long y );
|
||||
virtual void GetDeviceOrigin( long *x, long *y );
|
||||
virtual void SetInternalDeviceOrigin( long x, long y );
|
||||
virtual void GetInternalDeviceOrigin( long *x, long *y );
|
||||
|
||||
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||
|
||||
@ -283,14 +281,6 @@ class wxDC: public wxObject
|
||||
// not sure what for, but what is a mm on a screen you don't know the size of?
|
||||
double m_mm_to_pix_x,m_mm_to_pix_y;
|
||||
|
||||
long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or
|
||||
// d.o. changes with scrolling.
|
||||
// Set using SetInternalDeviceOrigin().
|
||||
|
||||
long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes
|
||||
// such as wxScrolledWindow
|
||||
// using SetDeviceOrigin()
|
||||
|
||||
long m_deviceOriginX,m_deviceOriginY; // Sum of the two above.
|
||||
|
||||
long m_logicalOriginX,m_logicalOriginY; // User defined.
|
||||
|
@ -36,9 +36,6 @@ struct _GtkMyFixed
|
||||
GtkContainer container;
|
||||
|
||||
GList *children;
|
||||
|
||||
gint16 scroll_offset_x;
|
||||
gint16 scroll_offset_y;
|
||||
};
|
||||
|
||||
struct _GtkMyFixedClass
|
||||
@ -55,9 +52,6 @@ struct _GtkMyFixedChild
|
||||
|
||||
guint gtk_myfixed_get_type (void);
|
||||
GtkWidget* gtk_myfixed_new (void);
|
||||
void gtk_myfixed_set_offset (GtkMyFixed *myfixed,
|
||||
gint16 x,
|
||||
gint16 y);
|
||||
void gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
GtkWidget *widget,
|
||||
gint16 x,
|
||||
|
@ -235,7 +235,6 @@ public: // cannot get private going yet
|
||||
bool HasVMT();
|
||||
virtual void ImplementSetSize();
|
||||
virtual void ImplementSetPosition();
|
||||
void GetDrawingOffset( long *x, long *y );
|
||||
|
||||
wxWindow *m_parent;
|
||||
wxList m_children;
|
||||
@ -257,7 +256,6 @@ public: // cannot get private going yet
|
||||
bool m_isShown;
|
||||
bool m_isEnabled;
|
||||
wxString m_windowName;
|
||||
long m_drawingOffsetX,m_drawingOffsetY;
|
||||
|
||||
GtkWidget *m_widget;
|
||||
GtkWidget *m_wxwindow;
|
||||
|
@ -169,8 +169,6 @@ class wxDC: public wxObject
|
||||
virtual void GetLogicalOrigin( long *x, long *y );
|
||||
virtual void SetDeviceOrigin( long x, long y );
|
||||
virtual void GetDeviceOrigin( long *x, long *y );
|
||||
virtual void SetInternalDeviceOrigin( long x, long y );
|
||||
virtual void GetInternalDeviceOrigin( long *x, long *y );
|
||||
|
||||
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
||||
|
||||
@ -283,14 +281,6 @@ class wxDC: public wxObject
|
||||
// not sure what for, but what is a mm on a screen you don't know the size of?
|
||||
double m_mm_to_pix_x,m_mm_to_pix_y;
|
||||
|
||||
long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or
|
||||
// d.o. changes with scrolling.
|
||||
// Set using SetInternalDeviceOrigin().
|
||||
|
||||
long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes
|
||||
// such as wxScrolledWindow
|
||||
// using SetDeviceOrigin()
|
||||
|
||||
long m_deviceOriginX,m_deviceOriginY; // Sum of the two above.
|
||||
|
||||
long m_logicalOriginX,m_logicalOriginY; // User defined.
|
||||
|
@ -36,9 +36,6 @@ struct _GtkMyFixed
|
||||
GtkContainer container;
|
||||
|
||||
GList *children;
|
||||
|
||||
gint16 scroll_offset_x;
|
||||
gint16 scroll_offset_y;
|
||||
};
|
||||
|
||||
struct _GtkMyFixedClass
|
||||
@ -55,9 +52,6 @@ struct _GtkMyFixedChild
|
||||
|
||||
guint gtk_myfixed_get_type (void);
|
||||
GtkWidget* gtk_myfixed_new (void);
|
||||
void gtk_myfixed_set_offset (GtkMyFixed *myfixed,
|
||||
gint16 x,
|
||||
gint16 y);
|
||||
void gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
GtkWidget *widget,
|
||||
gint16 x,
|
||||
|
@ -235,7 +235,6 @@ public: // cannot get private going yet
|
||||
bool HasVMT();
|
||||
virtual void ImplementSetSize();
|
||||
virtual void ImplementSetPosition();
|
||||
void GetDrawingOffset( long *x, long *y );
|
||||
|
||||
wxWindow *m_parent;
|
||||
wxList m_children;
|
||||
@ -257,7 +256,6 @@ public: // cannot get private going yet
|
||||
bool m_isShown;
|
||||
bool m_isEnabled;
|
||||
wxString m_windowName;
|
||||
long m_drawingOffsetX,m_drawingOffsetY;
|
||||
|
||||
GtkWidget *m_widget;
|
||||
GtkWidget *m_wxwindow;
|
||||
|
@ -47,10 +47,6 @@ wxDC::wxDC(void)
|
||||
m_logicalOriginY = 0;
|
||||
m_deviceOriginX = 0;
|
||||
m_deviceOriginY = 0;
|
||||
m_internalDeviceOriginX = 0;
|
||||
m_internalDeviceOriginY = 0;
|
||||
m_externalDeviceOriginX = 0;
|
||||
m_externalDeviceOriginY = 0;
|
||||
|
||||
m_logicalScaleX = 1.0;
|
||||
m_logicalScaleY = 1.0;
|
||||
@ -286,32 +282,17 @@ void wxDC::GetLogicalOrigin( long *x, long *y )
|
||||
|
||||
void wxDC::SetDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
m_externalDeviceOriginY = y;
|
||||
m_deviceOriginX = x;
|
||||
m_deviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
// if (x) *x = m_externalDeviceOriginX;
|
||||
// if (y) *y = m_externalDeviceOriginY;
|
||||
if (x) *x = m_deviceOriginX;
|
||||
if (y) *y = m_deviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_internalDeviceOriginX = x;
|
||||
m_internalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetInternalDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_internalDeviceOriginX;
|
||||
if (y) *y = m_internalDeviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
{
|
||||
m_signX = (xLeftRight ? 1 : -1);
|
||||
@ -376,9 +357,6 @@ void wxDC::ComputeScaleAndOrigin(void)
|
||||
m_scaleX = m_logicalScaleX * m_userScaleX;
|
||||
m_scaleY = m_logicalScaleY * m_userScaleY;
|
||||
|
||||
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
|
||||
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
|
||||
|
||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||
{
|
||||
|
@ -118,8 +118,6 @@ wxPaintDC::wxPaintDC( wxWindow *window )
|
||||
|
||||
long x = 0;
|
||||
long y = 0;
|
||||
window->GetDrawingOffset( &x, &y );
|
||||
SetInternalDeviceOrigin( -x, -y );
|
||||
}
|
||||
|
||||
wxPaintDC::~wxPaintDC(void)
|
||||
|
@ -107,35 +107,9 @@ gtk_myfixed_new ()
|
||||
|
||||
myfixed = gtk_type_new (gtk_myfixed_get_type ());
|
||||
|
||||
myfixed->scroll_offset_x = 0;
|
||||
myfixed->scroll_offset_y = 0;
|
||||
|
||||
return GTK_WIDGET (myfixed);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_myfixed_set_offset (GtkMyFixed *myfixed,
|
||||
gint16 x,
|
||||
gint16 y)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (myfixed != NULL);
|
||||
g_return_if_fail (GTK_IS_MYFIXED (myfixed));
|
||||
|
||||
myfixed->scroll_offset_x = x;
|
||||
myfixed->scroll_offset_y = y;
|
||||
|
||||
widget = GTK_WIDGET( myfixed );
|
||||
|
||||
if (GTK_WIDGET_REALIZED( GTK_WIDGET(myfixed) ))
|
||||
gdk_window_move_resize (widget->window,
|
||||
widget->allocation.x + x,
|
||||
widget->allocation.y + y,
|
||||
32000,
|
||||
32000);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
GtkWidget *widget,
|
||||
@ -150,8 +124,8 @@ gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
|
||||
child_info = g_new (GtkMyFixedChild, 1);
|
||||
child_info->widget = widget;
|
||||
child_info->x = x - myfixed->scroll_offset_x;
|
||||
child_info->y = y - myfixed->scroll_offset_y;
|
||||
child_info->x = x;
|
||||
child_info->y = y;
|
||||
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (myfixed));
|
||||
|
||||
@ -188,8 +162,8 @@ gtk_myfixed_move (GtkMyFixed *myfixed,
|
||||
|
||||
if (child->widget == widget)
|
||||
{
|
||||
child->x = x - myfixed->scroll_offset_x;
|
||||
child->y = y - myfixed->scroll_offset_y;
|
||||
child->x = x;
|
||||
child->y = y;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (myfixed));
|
||||
@ -250,8 +224,8 @@ gtk_myfixed_realize (GtkWidget *widget)
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.x = widget->allocation.x + myfixed->scroll_offset_x;
|
||||
attributes.y = widget->allocation.y + myfixed->scroll_offset_x;
|
||||
attributes.x = widget->allocation.x;
|
||||
attributes.y = widget->allocation.y;
|
||||
attributes.width = 32000;
|
||||
attributes.height = 32000;
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
@ -331,12 +305,7 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
||||
|
||||
widget->allocation = *allocation;
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (widget->window,
|
||||
allocation->x + myfixed->scroll_offset_x,
|
||||
allocation->y + myfixed->scroll_offset_y,
|
||||
32000,
|
||||
32000
|
||||
);
|
||||
gdk_window_move_resize (widget->window, allocation->x, allocation->y, 32000, 32000 );
|
||||
|
||||
border_width = GTK_CONTAINER (myfixed)->border_width;
|
||||
|
||||
|
@ -746,8 +746,6 @@ wxWindow::wxWindow()
|
||||
m_oldVerticalPos = 0.0;
|
||||
m_isShown = FALSE;
|
||||
m_isEnabled = TRUE;
|
||||
m_drawingOffsetX = 0;
|
||||
m_drawingOffsetY = 0;
|
||||
m_pDropTarget = NULL;
|
||||
m_resizing = FALSE;
|
||||
}
|
||||
@ -927,8 +925,6 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
|
||||
m_windowSizer = NULL;
|
||||
m_sizerParent = NULL;
|
||||
m_autoLayout = FALSE;
|
||||
m_drawingOffsetX = 0;
|
||||
m_drawingOffsetY = 0;
|
||||
m_pDropTarget = NULL;
|
||||
m_resizing = FALSE;
|
||||
m_windowValidator = NULL;
|
||||
@ -1008,7 +1004,12 @@ void wxWindow::PostCreation(void)
|
||||
*/
|
||||
|
||||
if (m_widget && m_parent) gtk_widget_realize( m_widget );
|
||||
if (m_wxwindow) gtk_widget_realize( m_wxwindow );
|
||||
|
||||
if (m_wxwindow)
|
||||
{
|
||||
gtk_widget_realize( m_wxwindow );
|
||||
gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
|
||||
}
|
||||
|
||||
SetCursor( wxSTANDARD_CURSOR );
|
||||
|
||||
@ -1047,7 +1048,7 @@ bool wxWindow::DestroyChildren(void)
|
||||
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
|
||||
{
|
||||
delete child;
|
||||
if (GetChildren()->Member(child)) delete node;
|
||||
if (GetChildren()->Member(child)) delete node;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1645,19 +1646,13 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
|
||||
{
|
||||
if (m_wxwindow)
|
||||
{
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
long x = 0;
|
||||
long y = 0;
|
||||
dc.GetInternalDeviceOrigin( &x, &y );
|
||||
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
GetClientSize( &w, &h );
|
||||
|
||||
GdkRectangle gdk_rect;
|
||||
gdk_rect.x = x;
|
||||
gdk_rect.y = y;
|
||||
gdk_rect.x = 0;
|
||||
gdk_rect.y = 0;
|
||||
gdk_rect.width = w;
|
||||
gdk_rect.height = h;
|
||||
gtk_widget_draw( m_wxwindow, &gdk_rect );
|
||||
@ -1993,23 +1988,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
if (m_wxwindow->window)
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
/*
|
||||
m_drawingOffsetX = -16000;
|
||||
|
||||
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
|
||||
*/
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
m_drawingOffsetY = -16000;
|
||||
|
||||
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
|
||||
*/
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
||||
}
|
||||
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
}
|
||||
@ -2078,6 +2059,7 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
{
|
||||
if (!m_wxwindow) return;
|
||||
|
||||
/*
|
||||
bool refresh = FALSE;
|
||||
|
||||
if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
|
||||
@ -2098,9 +2080,9 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
|
||||
if (refresh) Refresh();
|
||||
|
||||
/*
|
||||
The code here is very nifty, but it doesn't work with
|
||||
overlapping windows...
|
||||
*/
|
||||
|
||||
int cw = 0;
|
||||
int ch = 0;
|
||||
@ -2131,13 +2113,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
if (dx != 0) rect.height = ch; else rect.height = abs(dy);
|
||||
|
||||
Refresh( TRUE, &rect );
|
||||
*/
|
||||
}
|
||||
|
||||
void wxWindow::GetDrawingOffset( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_drawingOffsetX;
|
||||
if (y) *y = m_drawingOffsetY;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
@ -47,10 +47,6 @@ wxDC::wxDC(void)
|
||||
m_logicalOriginY = 0;
|
||||
m_deviceOriginX = 0;
|
||||
m_deviceOriginY = 0;
|
||||
m_internalDeviceOriginX = 0;
|
||||
m_internalDeviceOriginY = 0;
|
||||
m_externalDeviceOriginX = 0;
|
||||
m_externalDeviceOriginY = 0;
|
||||
|
||||
m_logicalScaleX = 1.0;
|
||||
m_logicalScaleY = 1.0;
|
||||
@ -286,32 +282,17 @@ void wxDC::GetLogicalOrigin( long *x, long *y )
|
||||
|
||||
void wxDC::SetDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
m_externalDeviceOriginY = y;
|
||||
m_deviceOriginX = x;
|
||||
m_deviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
// if (x) *x = m_externalDeviceOriginX;
|
||||
// if (y) *y = m_externalDeviceOriginY;
|
||||
if (x) *x = m_deviceOriginX;
|
||||
if (y) *y = m_deviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
m_internalDeviceOriginX = x;
|
||||
m_internalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
};
|
||||
|
||||
void wxDC::GetInternalDeviceOrigin( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_internalDeviceOriginX;
|
||||
if (y) *y = m_internalDeviceOriginY;
|
||||
};
|
||||
|
||||
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
{
|
||||
m_signX = (xLeftRight ? 1 : -1);
|
||||
@ -376,9 +357,6 @@ void wxDC::ComputeScaleAndOrigin(void)
|
||||
m_scaleX = m_logicalScaleX * m_userScaleX;
|
||||
m_scaleY = m_logicalScaleY * m_userScaleY;
|
||||
|
||||
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
|
||||
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
|
||||
|
||||
// CMB: if scale has changed call SetPen to recalulate the line width
|
||||
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
|
||||
{
|
||||
|
@ -118,8 +118,6 @@ wxPaintDC::wxPaintDC( wxWindow *window )
|
||||
|
||||
long x = 0;
|
||||
long y = 0;
|
||||
window->GetDrawingOffset( &x, &y );
|
||||
SetInternalDeviceOrigin( -x, -y );
|
||||
}
|
||||
|
||||
wxPaintDC::~wxPaintDC(void)
|
||||
|
@ -107,35 +107,9 @@ gtk_myfixed_new ()
|
||||
|
||||
myfixed = gtk_type_new (gtk_myfixed_get_type ());
|
||||
|
||||
myfixed->scroll_offset_x = 0;
|
||||
myfixed->scroll_offset_y = 0;
|
||||
|
||||
return GTK_WIDGET (myfixed);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_myfixed_set_offset (GtkMyFixed *myfixed,
|
||||
gint16 x,
|
||||
gint16 y)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (myfixed != NULL);
|
||||
g_return_if_fail (GTK_IS_MYFIXED (myfixed));
|
||||
|
||||
myfixed->scroll_offset_x = x;
|
||||
myfixed->scroll_offset_y = y;
|
||||
|
||||
widget = GTK_WIDGET( myfixed );
|
||||
|
||||
if (GTK_WIDGET_REALIZED( GTK_WIDGET(myfixed) ))
|
||||
gdk_window_move_resize (widget->window,
|
||||
widget->allocation.x + x,
|
||||
widget->allocation.y + y,
|
||||
32000,
|
||||
32000);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
GtkWidget *widget,
|
||||
@ -150,8 +124,8 @@ gtk_myfixed_put (GtkMyFixed *myfixed,
|
||||
|
||||
child_info = g_new (GtkMyFixedChild, 1);
|
||||
child_info->widget = widget;
|
||||
child_info->x = x - myfixed->scroll_offset_x;
|
||||
child_info->y = y - myfixed->scroll_offset_y;
|
||||
child_info->x = x;
|
||||
child_info->y = y;
|
||||
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (myfixed));
|
||||
|
||||
@ -188,8 +162,8 @@ gtk_myfixed_move (GtkMyFixed *myfixed,
|
||||
|
||||
if (child->widget == widget)
|
||||
{
|
||||
child->x = x - myfixed->scroll_offset_x;
|
||||
child->y = y - myfixed->scroll_offset_y;
|
||||
child->x = x;
|
||||
child->y = y;
|
||||
|
||||
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
|
||||
gtk_widget_queue_resize (GTK_WIDGET (myfixed));
|
||||
@ -250,8 +224,8 @@ gtk_myfixed_realize (GtkWidget *widget)
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.x = widget->allocation.x + myfixed->scroll_offset_x;
|
||||
attributes.y = widget->allocation.y + myfixed->scroll_offset_x;
|
||||
attributes.x = widget->allocation.x;
|
||||
attributes.y = widget->allocation.y;
|
||||
attributes.width = 32000;
|
||||
attributes.height = 32000;
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
@ -331,12 +305,7 @@ gtk_myfixed_size_allocate (GtkWidget *widget,
|
||||
|
||||
widget->allocation = *allocation;
|
||||
if (GTK_WIDGET_REALIZED (widget))
|
||||
gdk_window_move_resize (widget->window,
|
||||
allocation->x + myfixed->scroll_offset_x,
|
||||
allocation->y + myfixed->scroll_offset_y,
|
||||
32000,
|
||||
32000
|
||||
);
|
||||
gdk_window_move_resize (widget->window, allocation->x, allocation->y, 32000, 32000 );
|
||||
|
||||
border_width = GTK_CONTAINER (myfixed)->border_width;
|
||||
|
||||
|
@ -746,8 +746,6 @@ wxWindow::wxWindow()
|
||||
m_oldVerticalPos = 0.0;
|
||||
m_isShown = FALSE;
|
||||
m_isEnabled = TRUE;
|
||||
m_drawingOffsetX = 0;
|
||||
m_drawingOffsetY = 0;
|
||||
m_pDropTarget = NULL;
|
||||
m_resizing = FALSE;
|
||||
}
|
||||
@ -927,8 +925,6 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
|
||||
m_windowSizer = NULL;
|
||||
m_sizerParent = NULL;
|
||||
m_autoLayout = FALSE;
|
||||
m_drawingOffsetX = 0;
|
||||
m_drawingOffsetY = 0;
|
||||
m_pDropTarget = NULL;
|
||||
m_resizing = FALSE;
|
||||
m_windowValidator = NULL;
|
||||
@ -1008,7 +1004,12 @@ void wxWindow::PostCreation(void)
|
||||
*/
|
||||
|
||||
if (m_widget && m_parent) gtk_widget_realize( m_widget );
|
||||
if (m_wxwindow) gtk_widget_realize( m_wxwindow );
|
||||
|
||||
if (m_wxwindow)
|
||||
{
|
||||
gtk_widget_realize( m_wxwindow );
|
||||
gdk_gc_set_exposures( m_wxwindow->style->fg_gc[0], TRUE );
|
||||
}
|
||||
|
||||
SetCursor( wxSTANDARD_CURSOR );
|
||||
|
||||
@ -1047,7 +1048,7 @@ bool wxWindow::DestroyChildren(void)
|
||||
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
|
||||
{
|
||||
delete child;
|
||||
if (GetChildren()->Member(child)) delete node;
|
||||
if (GetChildren()->Member(child)) delete node;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1645,19 +1646,13 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
|
||||
{
|
||||
if (m_wxwindow)
|
||||
{
|
||||
wxClientDC dc(this);
|
||||
PrepareDC(dc);
|
||||
long x = 0;
|
||||
long y = 0;
|
||||
dc.GetInternalDeviceOrigin( &x, &y );
|
||||
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
GetClientSize( &w, &h );
|
||||
|
||||
GdkRectangle gdk_rect;
|
||||
gdk_rect.x = x;
|
||||
gdk_rect.y = y;
|
||||
gdk_rect.x = 0;
|
||||
gdk_rect.y = 0;
|
||||
gdk_rect.width = w;
|
||||
gdk_rect.height = h;
|
||||
gtk_widget_draw( m_wxwindow, &gdk_rect );
|
||||
@ -1993,23 +1988,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
if (m_wxwindow->window)
|
||||
{
|
||||
if (orient == wxHORIZONTAL)
|
||||
{
|
||||
/*
|
||||
m_drawingOffsetX = -16000;
|
||||
|
||||
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
|
||||
*/
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "changed" );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
m_drawingOffsetY = -16000;
|
||||
|
||||
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
|
||||
*/
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_vAdjust), "changed" );
|
||||
}
|
||||
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
}
|
||||
@ -2078,6 +2059,7 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
{
|
||||
if (!m_wxwindow) return;
|
||||
|
||||
/*
|
||||
bool refresh = FALSE;
|
||||
|
||||
if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
|
||||
@ -2098,9 +2080,9 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
|
||||
if (refresh) Refresh();
|
||||
|
||||
/*
|
||||
The code here is very nifty, but it doesn't work with
|
||||
overlapping windows...
|
||||
*/
|
||||
|
||||
int cw = 0;
|
||||
int ch = 0;
|
||||
@ -2131,13 +2113,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
||||
if (dx != 0) rect.height = ch; else rect.height = abs(dy);
|
||||
|
||||
Refresh( TRUE, &rect );
|
||||
*/
|
||||
}
|
||||
|
||||
void wxWindow::GetDrawingOffset( long *x, long *y )
|
||||
{
|
||||
if (x) *x = m_drawingOffsetX;
|
||||
if (y) *y = m_drawingOffsetY;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
@ -434,7 +434,6 @@ const ID_ABOUT = 109;
|
||||
IMPLEMENT_DYNAMIC_CLASS( MyFrame, wxFrame )
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame,wxFrame)
|
||||
EVT_SIZE (MyFrame::OnSize)
|
||||
EVT_MENU (ID_OPEN, MyFrame::OnOpenDialog)
|
||||
EVT_MENU (ID_FONT, MyFrame::OnFontDialog)
|
||||
EVT_MENU (ID_MSG, MyFrame::OnMsg)
|
||||
@ -474,21 +473,11 @@ MyFrame::MyFrame(void) :
|
||||
m_tb->SetMargins( 2, 2 );
|
||||
m_tb->AddTool( 0, wxBitmap( list_xpm ), wxNullBitmap, FALSE, -1, -1, NULL, "This is a button" );
|
||||
m_tb->AddTool( 0, wxBitmap( folder_xpm ), wxNullBitmap, TRUE, -1, -1, NULL, "This is a toggle" );
|
||||
m_tb->Layout();
|
||||
m_tb->Realize();
|
||||
|
||||
// m_timer.Start( 1000, TRUE );
|
||||
};
|
||||
|
||||
void MyFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
GetClientSize( &x, &y );
|
||||
|
||||
m_tb->SetSize( 1, 0, x-2, 42 );
|
||||
m_canvas-> SetSize( 0, 42, x, y-42 );
|
||||
};
|
||||
|
||||
void MyFrame::OnDialog( wxCommandEvent &WXUNUSED(event) )
|
||||
{
|
||||
MyDialog *dialog = new MyDialog( this );
|
||||
|
Loading…
Reference in New Issue
Block a user