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 );
// 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.
GtkContainer container;
GList *children;
-
- gint16 scroll_offset_x;
- gint16 scroll_offset_y;
};
struct _GtkMyFixedClass
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,
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
- void GetDrawingOffset( long *x, long *y );
wxWindow *m_parent;
wxList m_children;
bool m_isShown;
bool m_isEnabled;
wxString m_windowName;
- long m_drawingOffsetX,m_drawingOffsetY;
GtkWidget *m_widget;
GtkWidget *m_wxwindow;
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 );
// 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.
GtkContainer container;
GList *children;
-
- gint16 scroll_offset_x;
- gint16 scroll_offset_y;
};
struct _GtkMyFixedClass
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,
bool HasVMT();
virtual void ImplementSetSize();
virtual void ImplementSetPosition();
- void GetDrawingOffset( long *x, long *y );
wxWindow *m_parent;
wxList m_children;
bool m_isShown;
bool m_isEnabled;
wxString m_windowName;
- long m_drawingOffsetX,m_drawingOffsetY;
GtkWidget *m_widget;
GtkWidget *m_wxwindow;
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;
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);
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)
{
long x = 0;
long y = 0;
- window->GetDrawingOffset( &x, &y );
- SetInternalDeviceOrigin( -x, -y );
}
wxPaintDC::~wxPaintDC(void)
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,
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));
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));
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;
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;
m_oldVerticalPos = 0.0;
m_isShown = FALSE;
m_isEnabled = TRUE;
- m_drawingOffsetX = 0;
- m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
}
m_windowSizer = NULL;
m_sizerParent = NULL;
m_autoLayout = FALSE;
- m_drawingOffsetX = 0;
- m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
m_windowValidator = NULL;
*/
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 );
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
{
delete child;
- if (GetChildren()->Member(child)) delete node;
+ if (GetChildren()->Member(child)) delete node;
}
}
}
{
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 );
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 );
}
{
if (!m_wxwindow) return;
+/*
bool refresh = FALSE;
if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
if (refresh) Refresh();
-/*
The code here is very nifty, but it doesn't work with
overlapping windows...
+*/
int cw = 0;
int ch = 0;
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;
}
//-------------------------------------------------------------------------------------
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;
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);
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)
{
long x = 0;
long y = 0;
- window->GetDrawingOffset( &x, &y );
- SetInternalDeviceOrigin( -x, -y );
}
wxPaintDC::~wxPaintDC(void)
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,
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));
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));
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;
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;
m_oldVerticalPos = 0.0;
m_isShown = FALSE;
m_isEnabled = TRUE;
- m_drawingOffsetX = 0;
- m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
}
m_windowSizer = NULL;
m_sizerParent = NULL;
m_autoLayout = FALSE;
- m_drawingOffsetX = 0;
- m_drawingOffsetY = 0;
m_pDropTarget = NULL;
m_resizing = FALSE;
m_windowValidator = NULL;
*/
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 );
if ((child = (wxWindow *)node->Data()) != (wxWindow *)NULL)
{
delete child;
- if (GetChildren()->Member(child)) delete node;
+ if (GetChildren()->Member(child)) delete node;
}
}
}
{
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 );
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 );
}
{
if (!m_wxwindow) return;
+/*
bool refresh = FALSE;
if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
if (refresh) Refresh();
-/*
The code here is very nifty, but it doesn't work with
overlapping windows...
+*/
int cw = 0;
int ch = 0;
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;
}
//-------------------------------------------------------------------------------------
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)
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 );