a bit of debug code

radiobox gets frames again


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-05-07 21:26:56 +00:00
parent 6a2f310358
commit ba2a0103aa
5 changed files with 92 additions and 79 deletions

View File

@@ -79,11 +79,12 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size ) const wxPoint &pos, const wxSize &size )
: wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER ) : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER )
{ {
(void) new wxButton( this, -1, "wxButton", wxPoint(10,10) );
(void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) ); // (void) new wxButton( this, -1, "wxButton", wxPoint(10,10) );
(void) new wxCheckBox( this, -1, "Disable", wxPoint(10,90) ); // (void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) );
(void) new wxRadioButton( this, -1, "Disable", wxPoint(10,90) );
wxString choices[] = wxString choices[] =
{ {
@@ -94,9 +95,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
"examples." "examples."
}; };
(void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices ); // (void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices );
(void) new wxRadioBox( this, -1, "This", wxPoint(10,200), wxDefaultSize, 5, choices ); // (void) new wxRadioBox( this, -1, "This", wxPoint(10,200), wxDefaultSize, 5, choices );
} }
MyCanvas::~MyCanvas() MyCanvas::~MyCanvas()
@@ -105,6 +106,8 @@ MyCanvas::~MyCanvas()
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
return;
wxPaintDC dc( this ); wxPaintDC dc( this );
PrepareDC( dc ); PrepareDC( dc );

View File

@@ -249,7 +249,7 @@ bool wxRadioBox::Show( bool show )
wxWindow::Show( show ); wxWindow::Show( show );
if ((m_windowStyle & wxNO_BORDER) == 0) if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget ); gtk_widget_hide( m_widget );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.First();

View File

@@ -339,6 +339,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() ); wxPrintf( win->GetClassInfo()->GetClassName() );
wxPrintf( _T(".\n") ); wxPrintf( _T(".\n") );
wxPrintf( _T("keyval: %d.\n"), (int) gdk_event->keyval );
*/ */
long key_code = 0; long key_code = 0;
@@ -3331,25 +3333,24 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
wxNode *node = m_children.First(); if (!m_scrollGC)
while (node)
{ {
wxWindow *child = (wxWindow*) node->Data(); m_scrollGC = gdk_gc_new( m_wxwindow->window );
child->Move( child->m_x + dx, child->m_y + dy ); gdk_gc_set_exposures( m_scrollGC, TRUE );
node = node->Next();
} }
int cw = 0; int cw = 0;
int ch = 0; int ch = 0;
GetClientSize( &cw, &ch ); GetClientSize( &cw, &ch );
int w = cw - abs(dx); int w = cw - abs(dx);
int h = ch - abs(dy); int h = ch - abs(dy);
if ((h < 0) || (w < 0)) if ((h < 0) || (w < 0))
{ {
Refresh(); Refresh();
return;
} }
else
{
int s_x = 0; int s_x = 0;
int s_y = 0; int s_y = 0;
if (dx < 0) s_x = -dx; if (dx < 0) s_x = -dx;
@@ -3359,12 +3360,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
if (dx > 0) d_x = dx; if (dx > 0) d_x = dx;
if (dy > 0) d_y = dy; if (dy > 0) d_y = dy;
if (!m_scrollGC)
{
m_scrollGC = gdk_gc_new( m_wxwindow->window );
gdk_gc_set_exposures( m_scrollGC, TRUE );
}
gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y, gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h ); m_wxwindow->window, s_x, s_y, w, h );
@@ -3377,6 +3372,16 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
Refresh( TRUE, &rect ); Refresh( TRUE, &rect );
} }
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();
}
}
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
// Layout // Layout
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------

View File

@@ -249,7 +249,7 @@ bool wxRadioBox::Show( bool show )
wxWindow::Show( show ); wxWindow::Show( show );
if ((m_windowStyle & wxNO_BORDER) == 0) if ((m_windowStyle & wxNO_BORDER) != 0)
gtk_widget_hide( m_widget ); gtk_widget_hide( m_widget );
wxNode *node = m_boxes.First(); wxNode *node = m_boxes.First();

View File

@@ -339,6 +339,8 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_e
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() ); wxPrintf( win->GetClassInfo()->GetClassName() );
wxPrintf( _T(".\n") ); wxPrintf( _T(".\n") );
wxPrintf( _T("keyval: %d.\n"), (int) gdk_event->keyval );
*/ */
long key_code = 0; long key_code = 0;
@@ -3331,25 +3333,24 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
wxNode *node = m_children.First(); if (!m_scrollGC)
while (node)
{ {
wxWindow *child = (wxWindow*) node->Data(); m_scrollGC = gdk_gc_new( m_wxwindow->window );
child->Move( child->m_x + dx, child->m_y + dy ); gdk_gc_set_exposures( m_scrollGC, TRUE );
node = node->Next();
} }
int cw = 0; int cw = 0;
int ch = 0; int ch = 0;
GetClientSize( &cw, &ch ); GetClientSize( &cw, &ch );
int w = cw - abs(dx); int w = cw - abs(dx);
int h = ch - abs(dy); int h = ch - abs(dy);
if ((h < 0) || (w < 0)) if ((h < 0) || (w < 0))
{ {
Refresh(); Refresh();
return;
} }
else
{
int s_x = 0; int s_x = 0;
int s_y = 0; int s_y = 0;
if (dx < 0) s_x = -dx; if (dx < 0) s_x = -dx;
@@ -3359,12 +3360,6 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
if (dx > 0) d_x = dx; if (dx > 0) d_x = dx;
if (dy > 0) d_y = dy; if (dy > 0) d_y = dy;
if (!m_scrollGC)
{
m_scrollGC = gdk_gc_new( m_wxwindow->window );
gdk_gc_set_exposures( m_scrollGC, TRUE );
}
gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y, gdk_window_copy_area( m_wxwindow->window, m_scrollGC, d_x, d_y,
m_wxwindow->window, s_x, s_y, w, h ); m_wxwindow->window, s_x, s_y, w, h );
@@ -3377,6 +3372,16 @@ void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
Refresh( TRUE, &rect ); Refresh( TRUE, &rect );
} }
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();
}
}
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
// Layout // Layout
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------