const wxString& name = wxToolBarNameStr)
: wxToolBarSimple(parent, id, pos, size, style, name) { }
+ // the most commonly used version of AddTool()
+ wxToolBarToolBase *AddTool(int id,
+ const wxBitmap& bitmap,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString)
+ {
+ return wxToolBarSimple::AddTool(id, bitmap, wxNullBitmap, FALSE, -1, -1, NULL,
+ shortHelpString, longHelpString);
+ }
+
+ // old form
+ wxToolBarToolBase *AddTool
+ (
+ int id,
+ const wxBitmap& bitmap,
+ const wxBitmap& pushedBitmap,
+ bool toggle,
+ wxObject *clientData = NULL,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString
+ )
+ {
+ return wxToolBarSimple::AddTool(id, bitmap, pushedBitmap, toggle, -1, -1, clientData,
+ shortHelpString, longHelpString);
+ }
+
+ // virtual overridden
+ virtual wxToolBarToolBase *AddTool
+ (
+ int id,
+ const wxBitmap& bitmap,
+ const wxBitmap& pushedBitmap,
+ bool toggle,
+ wxCoord xPos,
+ wxCoord yPos = -1,
+ wxObject *clientData = NULL,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString
+ )
+ {
+ return wxToolBarSimple::AddTool(id, bitmap, pushedBitmap, toggle, xPos, yPos, clientData,
+ shortHelpString, longHelpString);
+ }
+
private:
DECLARE_DYNAMIC_CLASS(wxToolBar)
};
MyCanvas::MyCanvas( MyFrame *parent )
: wxScrolledWindow( parent, -1, wxDefaultPosition, wxDefaultSize,
- wxScrolledWindowStyle|wxNO_FULL_REPAINT_ON_RESIZE )
+ wxScrolledWindowStyle|wxNO_FULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER )
{
SetScrollbars( 10, 10, 40, 100, 0, 0 );
}
{
wxPaintDC dc(this);
PrepareDC( dc );
+
+ wxRegionIterator upd( GetUpdateRegion() );
+ while (upd)
+ {
+ wxLogDebug( "Paint: %d %d %d %d", upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
+ upd ++;
+ }
+
+ dc.SetPen( *wxWHITE_PEN );
+ for (int i = 0; i < 20; i += 2)
+ dc.DrawLine( i,i, i+100,i );
wxRegion region( 110, 110, 80, 80 );
wxRegion hole( 130, 130, 40, 1 );
dc.SetBrush( *wxRED_BRUSH );
dc.DrawRectangle( 100, 100, 200, 200 );
- dc.DestroyClipingRegion();
+ dc.DestroyClippingRegion();
dc.SetPen( *wxTRANSPARENT_PEN );
wxColour wxNullColour;
// Default window names
+const char *wxControlNameStr = "control";
const char *wxButtonNameStr = "button";
const char *wxCanvasNameStr = "canvas";
const char *wxCheckBoxNameStr = "check";
const char *wxEnhDialogNameStr = "Shell";
const char *wxToolBarNameStr = "toolbar";
const char *wxStatusLineNameStr = "status_line";
-#if 0 // this is defined in string.cpp
-const char *wxEmptyString = "";
-#endif
const char *wxGetTextFromUserPromptStr = "Input Text";
const char *wxMessageBoxCaptionStr = "Message";
const char *wxFileSelectorPromptStr = "Select a file";
Cursor xcursor = (Cursor) cursorToUse.GetCursor();
- XDefineCursor( (Display*) wxGlobalDisplay(), xwindow, xcursor );
+ XDefineCursor( wxGlobalDisplay(), xwindow, xcursor );
return TRUE;
}
GC xgc = XCreateGC( xdisplay, xwindow, 0, NULL );
XSetGraphicsExposures( xdisplay, xgc, True );
- int s_x;
- int s_y;
+ int s_x = 0;
+ int s_y = 0;
int cw;
int ch;
if (rect)
{
s_x = rect->x;
s_y = rect->y;
+
cw = rect->width;
ch = rect->height;
}
wxPoint offset = GetClientAreaOrigin();
s_x += offset.x;
s_y += offset.y;
-
+
int w = cw - abs(dx);
int h = ch - abs(dy);
int d_x = s_x;
int d_y = s_y;
+
if (dx < 0) s_x += -dx;
if (dy < 0) s_y += -dy;
- if (dx > 0) d_x = dx;
- if (dy > 0) d_y = dy;
+ if (dx > 0) d_x = dx + offset.x;
+ if (dy > 0) d_y = dy + offset.y;
XCopyArea( xdisplay, xwindow, xwindow, xgc, s_x, s_y, w, h, d_x, d_y );
- // printf( "s_x %d s_y %d w %d h %d d_x %d d_y %d\n", s_x, s_y, w, h, d_x, d_y );
+ // wxLogDebug( "Copy: s_x %d s_y %d w %d h %d d_x %d d_y %d", s_x, s_y, w, h, d_x, d_y );
- // printf( "rect %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height );
+ // wxLogDebug( "Update: %d %d %d %d", rect.x, rect.y, rect.width, rect.height );
m_updateRegion.Union( rect );
m_clearRegion.Union( rect );