int m_lineHeight;
wxPen m_dottedPen;
bool m_isCreated;
- wxPaintDC *m_dc;
wxBrush *m_hilightBrush;
wxImageList *m_imageList;
wxImageList *m_smallImageList;
m_yScrollPosition = yPos;
m_xScrollLines = noUnitsX;
m_yScrollLines = noUnitsY;
-
+
AdjustScrollbars();
if (do_refresh && !noRefresh) Refresh();
m_lineHeight = 10;
m_indent = 15;
m_isCreated = FALSE;
- m_dc = NULL;
m_hilightBrush = new wxBrush( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHT), wxSOLID );
m_imageList = NULL;
m_smallImageList = NULL;
m_lineHeight = 10;
m_indent = 15;
m_isCreated = FALSE;
- m_dc = NULL;
m_hilightBrush = new wxBrush( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHT), wxSOLID );
m_imageList = NULL;
m_smallImageList = NULL;
wxTreeCtrl::~wxTreeCtrl()
{
- if (m_dc) delete m_dc;
};
bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
int ch = 0;
GetClientSize( NULL, &ch );
+ PrepareDC( dc );
+
wxRectangle rect;
- rect.x = 0; rect.y = 0;
- rect.width = 10000; rect.height = ch;
+ rect.x = dc.LogicalToDeviceX( 0 );
+ rect.y = 0;
+ rect.width = 10000;
+ rect.height = ch;
- PrepareDC( dc );
if (p->m_children.Number() == 1)
{
rect.y = dc.LogicalToDeviceY( p->m_y );
rect.y = dc.LogicalToDeviceY( last_child->m_y );
};
- long doX = 0;
- long doY = 0;
- dc.GetDeviceOrigin( &doX, &doY );
- rect.height = ch-rect.y-doY;
-
AdjustMyScrollbars();
if (rect.height > 0) Refresh( FALSE, &rect);
int ch = 0;
GetClientSize( NULL, &ch );
+ PrepareDC( dc );
+
wxRectangle rect;
- rect.x = 0; rect.y = 0;
- rect.width = 10000; rect.height = ch;
+ rect.x = dc.LogicalToDeviceX( 0 );
+ rect.y = 0;
+ rect.width = 10000;
+ rect.height = ch;
- PrepareDC( dc );
if (p->m_children.Number() == 1)
{
rect.y = dc.LogicalToDeviceY( p->m_y );
rect.y = dc.LogicalToDeviceY( last_child->m_y );
};
- long doX = 0;
- long doY = 0;
- dc.GetDeviceOrigin( &doX, &doY );
- rect.height = ch-rect.y-doY;
-
AdjustMyScrollbars();
if (rect.height > 0) Refresh( FALSE, &rect);
}
};
+ wxClientDC dc(this);
+ PrepareDC(dc);
+
int cw = 0;
int ch = 0;
GetClientSize( &cw, &ch );
+
wxRect rect;
- rect.x = 0;
+ rect.x = dc.LogicalToDeviceX( 0 );
rect.width = cw;
- wxClientDC dc(this);
- PrepareDC(dc);
rect.y = dc.LogicalToDeviceY( i->m_y );
-
- long doY = 0;
- dc.GetDeviceOrigin( NULL, &doY );
- rect.height = ch-rect.y-doY;
+ rect.height = ch;
Refresh( TRUE, &rect );
AdjustMyScrollbars();
int oldY = y;
- if (IsExposed( 0, item->m_y-2, 10000, m_lineHeight+4 ))
+ int exposed_x = dc.LogicalToDeviceX( 0 );
+ int exposed_y = dc.LogicalToDeviceY( item->m_y-2 );
+
+ if (IsExposed( exposed_x, exposed_y, 1000, m_lineHeight+4 ))
{
int startX = horizX;
int endX = horizX + 10;
if (!item->HasChildren()) endX += 20;
+
dc.DrawLine( startX, y, endX, y );
if (item->HasChildren())
}
else
{
+ dc.SetBrush( *wxWHITE_BRUSH );
dc.SetPen( *wxTRANSPARENT_PEN );
long tw, th;
dc.GetTextExtent( item->m_text, &tw, &th );
{
if (!m_anchor) return;
- if (!m_dc)
- {
- m_dc = new wxPaintDC(this);
- PrepareDC( *m_dc );
- };
+ wxPaintDC dc(this);
+ PrepareDC( dc );
- m_dc->SetFont( wxSystemSettings::GetSystemFont( wxSYS_SYSTEM_FONT ) );
+ dc.SetFont( wxSystemSettings::GetSystemFont( wxSYS_SYSTEM_FONT ) );
- m_dc->SetPen( m_dottedPen );
- m_lineHeight = (int)(m_dc->GetCharHeight() + 4);
+ dc.SetPen( m_dottedPen );
+ m_lineHeight = (int)(dc.GetCharHeight() + 4);
int y = m_lineHeight / 2 + 2;
- PaintLevel( m_anchor, *m_dc, 0, y );
+ PaintLevel( m_anchor, dc, 0, y );
};
void wxTreeCtrl::OnSetFocus( const wxFocusEvent &WXUNUSED(event) )
rect.x = dc.LogicalToDeviceX( item->m_x-2 );
rect.y = dc.LogicalToDeviceY( item->m_y-2 );
rect.width = 1000;
- rect.height = dc.GetCharHeight()+4;
+ rect.height = dc.GetCharHeight()+6;
Refresh( TRUE, &rect );
};
void wxDC::GetDeviceOrigin( long *x, long *y )
{
- if (x) *x = m_externalDeviceOriginX;
- if (y) *y = m_externalDeviceOriginY;
+// 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 )
#include "wx/menu.h"
#include "wx/toolbar.h"
#include "wx/statusbr.h"
+#include "wx/mdi.h"
#include "wx/gtk/win_gtk.h"
const wxMENU_HEIGHT = 28;
main_y += toolbar_height;
main_height -= toolbar_height;
- gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y );
- gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_wxwindow, main_x, main_y );
+ gtk_widget_set_usize( m_wxwindow, main_width, main_height );
if (m_frameMenuBar)
{
- gtk_widget_set_uposition( m_frameMenuBar->m_widget, 1, 1 );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_frameMenuBar->m_widget, 1, 1 );
gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 );
};
if (m_frameToolBar)
{
- gtk_widget_set_uposition( m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
gtk_widget_set_usize( m_frameToolBar->m_widget, width-2, toolbar_height );
};
{
// wxFrame and wxDialog as children aren't placed into the parents
- if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
+ if (IS_KIND_OF(child,wxMDIChildFrame)) printf( "wxFrame::AddChild error.\n" );
+
+ if ( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog))
{
m_children.Append( child );
child_info = g_new (GtkMyFixedChild, 1);
child_info->widget = widget;
- child_info->x = x;
- child_info->y = y;
-
+ child_info->x = x - myfixed->scroll_offset_x;
+ child_info->y = y - myfixed->scroll_offset_y;
+
gtk_widget_set_parent (widget, GTK_WIDGET (myfixed));
myfixed->children = g_list_append (myfixed->children, child_info);
if (child->widget == widget)
{
- child->x = x;
- child->y = y;
+ child->x = x - myfixed->scroll_offset_x;
+ child->y = y - myfixed->scroll_offset_y;
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
gtk_widget_queue_resize (GTK_WIDGET (myfixed));
static void
gtk_myfixed_realize (GtkWidget *widget)
{
+ GtkMyFixed *myfixed;
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_MYFIXED (widget));
+ myfixed = GTK_MYFIXED (widget);
+
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
+ attributes.x = widget->allocation.x + myfixed->scroll_offset_x;
+ attributes.y = widget->allocation.y + myfixed->scroll_offset_x;
attributes.width = 32000;
attributes.height = 32000;
attributes.wclass = GDK_INPUT_OUTPUT;
#include "wx/dnd.h"
#include "wx/mdi.h"
#include "wx/notebook.h"
+#include "wx/statusbr.h"
+#include "wx/treectrl.h"
#include "gdk/gdkkeysyms.h"
#include <math.h>
#include "wx/gtk/win_gtk.h"
if (g_blockEventsOnDrag) return;
/*
- printf( "OnExpose from " );
+ if (IS_KIND_OF(win,wxTreeCtrl))
+ {
+ printf( "OnExpose from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
printf( "y: %d \n", gdk_event->area.y );
printf( "w: %d \n", gdk_event->area.width );
printf( "h: %d \n", gdk_event->area.height );
+}
*/
win->m_updateRegion.Union( gdk_event->area.x,
void wxWindow::Centre( int direction )
{
- int x = 0;
- int y = 0;
- GetPosition( &x, &y );
if (this->IsKindOf(CLASSINFO(wxDialog)) || this->IsKindOf(CLASSINFO(wxFrame)))
{
- if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
- if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
- gtk_widget_set_uposition( m_widget, x, y );
+ if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
+ if (direction & wxVERTICAL == wxVERTICAL) m_y = (gdk_screen_height () - m_height) / 2;
+ ImplementSetPosition();
}
else
{
int p_w = 0;
int p_h = 0;
m_parent->GetSize( &p_w, &p_h );
- if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (p_w - m_width) / 2;
- if (direction & wxVERTICAL == wxVERTICAL) y = (p_h - m_height) / 2;
- gtk_widget_set_uposition( m_widget, x, y );
+ if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (p_w - m_width) / 2;
+ if (direction & wxVERTICAL == wxVERTICAL) m_y = (p_h - m_height) / 2;
+ ImplementSetPosition();
};
}
};
// wxFrame and wxDialog as children aren't placed into the parents
- if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
+ if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
+ (!IS_KIND_OF(child,wxMDIChildFrame)))
{
m_children.Append( child );
// In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
- if (IsKindOf(CLASSINFO(wxMDIParentFrame)))
+ if (IS_KIND_OF(this,wxMDIParentFrame))
{
- if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
+ if (IS_KIND_OF(child,wxMDIChildFrame))
{
wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
if (client)
// wxNotebook is very special, so it has a private AddChild()
- if (IsKindOf(CLASSINFO(wxNotebook)))
+ if (IS_KIND_OF(this,wxNotebook))
{
wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child );
// wxFrame has a private AddChild
- if (IsKindOf(CLASSINFO(wxFrame)))
+ if (IS_KIND_OF(this,wxFrame))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
// All the rest
m_children.Append( child );
- if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
+ if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
+ child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
};
if (rect)
gdk_window_clear_area( m_wxwindow->window,
rect->x,
- rect->y,
- rect->width,
- rect->height );
+ rect->y,
+ rect->width,
+ rect->height );
else
Clear();
};
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
+
+ if (IS_KIND_OF(this,wxTreeCtrl))
+ {
+ printf( "x: %d y: %d w: %d h: %d .\n",
+ gdk_rect.x, gdk_rect.y, gdk_rect.width, gdk_rect.height );
+ }
+
if (m_wxwindow)
gtk_widget_draw( m_wxwindow, &gdk_rect );
else
};
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
+ }
+ 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;
- m_drawingOffsetX += dx;
- m_drawingOffsetY += dy;
+ bool refresh = FALSE;
+
+ if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
+ {
+ m_drawingOffsetX = -16000;
+ m_drawingOffsetY = -16000;
+ refresh = TRUE;
+ }
+ else
+ {
+ m_drawingOffsetX += dx;
+ m_drawingOffsetY += dy;
+ }
// printf( "X: %d Y: %d \n", (int)m_drawingOffsetX, (int)m_drawingOffsetY );
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
+ if (refresh) Refresh();
+
/*
The code here is very nifty, but it doesn't work with
overlapping windows...
void wxDC::GetDeviceOrigin( long *x, long *y )
{
- if (x) *x = m_externalDeviceOriginX;
- if (y) *y = m_externalDeviceOriginY;
+// 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 )
#include "wx/menu.h"
#include "wx/toolbar.h"
#include "wx/statusbr.h"
+#include "wx/mdi.h"
#include "wx/gtk/win_gtk.h"
const wxMENU_HEIGHT = 28;
main_y += toolbar_height;
main_height -= toolbar_height;
- gtk_widget_set_uposition( GTK_WIDGET(m_wxwindow), main_x, main_y );
- gtk_widget_set_usize( GTK_WIDGET(m_wxwindow), main_width, main_height );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_wxwindow, main_x, main_y );
+ gtk_widget_set_usize( m_wxwindow, main_width, main_height );
if (m_frameMenuBar)
{
- gtk_widget_set_uposition( m_frameMenuBar->m_widget, 1, 1 );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_frameMenuBar->m_widget, 1, 1 );
gtk_widget_set_usize( m_frameMenuBar->m_widget, width-2, wxMENU_HEIGHT-2 );
};
if (m_frameToolBar)
{
- gtk_widget_set_uposition( m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWindow), m_frameToolBar->m_widget, 1, wxMENU_HEIGHT );
gtk_widget_set_usize( m_frameToolBar->m_widget, width-2, toolbar_height );
};
{
// wxFrame and wxDialog as children aren't placed into the parents
- if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
+ if (IS_KIND_OF(child,wxMDIChildFrame)) printf( "wxFrame::AddChild error.\n" );
+
+ if ( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog))
{
m_children.Append( child );
child_info = g_new (GtkMyFixedChild, 1);
child_info->widget = widget;
- child_info->x = x;
- child_info->y = y;
-
+ child_info->x = x - myfixed->scroll_offset_x;
+ child_info->y = y - myfixed->scroll_offset_y;
+
gtk_widget_set_parent (widget, GTK_WIDGET (myfixed));
myfixed->children = g_list_append (myfixed->children, child_info);
if (child->widget == widget)
{
- child->x = x;
- child->y = y;
+ child->x = x - myfixed->scroll_offset_x;
+ child->y = y - myfixed->scroll_offset_y;
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
gtk_widget_queue_resize (GTK_WIDGET (myfixed));
static void
gtk_myfixed_realize (GtkWidget *widget)
{
+ GtkMyFixed *myfixed;
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_MYFIXED (widget));
+ myfixed = GTK_MYFIXED (widget);
+
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
+ attributes.x = widget->allocation.x + myfixed->scroll_offset_x;
+ attributes.y = widget->allocation.y + myfixed->scroll_offset_x;
attributes.width = 32000;
attributes.height = 32000;
attributes.wclass = GDK_INPUT_OUTPUT;
#include "wx/dnd.h"
#include "wx/mdi.h"
#include "wx/notebook.h"
+#include "wx/statusbr.h"
+#include "wx/treectrl.h"
#include "gdk/gdkkeysyms.h"
#include <math.h>
#include "wx/gtk/win_gtk.h"
if (g_blockEventsOnDrag) return;
/*
- printf( "OnExpose from " );
+ if (IS_KIND_OF(win,wxTreeCtrl))
+ {
+ printf( "OnExpose from " );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
printf( win->GetClassInfo()->GetClassName() );
printf( ".\n" );
printf( "y: %d \n", gdk_event->area.y );
printf( "w: %d \n", gdk_event->area.width );
printf( "h: %d \n", gdk_event->area.height );
+}
*/
win->m_updateRegion.Union( gdk_event->area.x,
void wxWindow::Centre( int direction )
{
- int x = 0;
- int y = 0;
- GetPosition( &x, &y );
if (this->IsKindOf(CLASSINFO(wxDialog)) || this->IsKindOf(CLASSINFO(wxFrame)))
{
- if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2;
- if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2;
- gtk_widget_set_uposition( m_widget, x, y );
+ if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (gdk_screen_width () - m_width) / 2;
+ if (direction & wxVERTICAL == wxVERTICAL) m_y = (gdk_screen_height () - m_height) / 2;
+ ImplementSetPosition();
}
else
{
int p_w = 0;
int p_h = 0;
m_parent->GetSize( &p_w, &p_h );
- if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (p_w - m_width) / 2;
- if (direction & wxVERTICAL == wxVERTICAL) y = (p_h - m_height) / 2;
- gtk_widget_set_uposition( m_widget, x, y );
+ if (direction & wxHORIZONTAL == wxHORIZONTAL) m_x = (p_w - m_width) / 2;
+ if (direction & wxVERTICAL == wxVERTICAL) m_y = (p_h - m_height) / 2;
+ ImplementSetPosition();
};
}
};
// wxFrame and wxDialog as children aren't placed into the parents
- if (child->IsKindOf(CLASSINFO(wxFrame)) || child->IsKindOf(CLASSINFO(wxDialog)))
+ if (( IS_KIND_OF(child,wxFrame) || IS_KIND_OF(child,wxDialog) ) &&
+ (!IS_KIND_OF(child,wxMDIChildFrame)))
{
m_children.Append( child );
// In the case of an wxMDIChildFrame descendant, we use the
// client windows's AddChild()
- if (IsKindOf(CLASSINFO(wxMDIParentFrame)))
+ if (IS_KIND_OF(this,wxMDIParentFrame))
{
- if (child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
+ if (IS_KIND_OF(child,wxMDIChildFrame))
{
wxMDIClientWindow *client = ((wxMDIParentFrame*)this)->GetClientWindow();
if (client)
// wxNotebook is very special, so it has a private AddChild()
- if (IsKindOf(CLASSINFO(wxNotebook)))
+ if (IS_KIND_OF(this,wxNotebook))
{
wxNotebook *tab = (wxNotebook*)this;
tab->AddChild( child );
// wxFrame has a private AddChild
- if (IsKindOf(CLASSINFO(wxFrame)))
+ if (IS_KIND_OF(this,wxFrame))
{
wxFrame *frame = (wxFrame*)this;
frame->AddChild( child );
// All the rest
m_children.Append( child );
- if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget, child->m_x, child->m_y );
+ if (m_wxwindow) gtk_myfixed_put( GTK_MYFIXED(m_wxwindow), child->m_widget,
+ child->m_x, child->m_y );
gtk_widget_set_usize( child->m_widget, child->m_width, child->m_height );
};
if (rect)
gdk_window_clear_area( m_wxwindow->window,
rect->x,
- rect->y,
- rect->width,
- rect->height );
+ rect->y,
+ rect->width,
+ rect->height );
else
Clear();
};
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
+
+ if (IS_KIND_OF(this,wxTreeCtrl))
+ {
+ printf( "x: %d y: %d w: %d h: %d .\n",
+ gdk_rect.x, gdk_rect.y, gdk_rect.width, gdk_rect.height );
+ }
+
if (m_wxwindow)
gtk_widget_draw( m_wxwindow, &gdk_rect );
else
};
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
+ }
+ 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;
- m_drawingOffsetX += dx;
- m_drawingOffsetY += dy;
+ bool refresh = FALSE;
+
+ if ((m_drawingOffsetX == 0) && (m_drawingOffsetY == 0))
+ {
+ m_drawingOffsetX = -16000;
+ m_drawingOffsetY = -16000;
+ refresh = TRUE;
+ }
+ else
+ {
+ m_drawingOffsetX += dx;
+ m_drawingOffsetY += dy;
+ }
// printf( "X: %d Y: %d \n", (int)m_drawingOffsetX, (int)m_drawingOffsetY );
gtk_myfixed_set_offset( GTK_MYFIXED(m_wxwindow), m_drawingOffsetX, m_drawingOffsetY );
+ if (refresh) Refresh();
+
/*
The code here is very nifty, but it doesn't work with
overlapping windows...