]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxDF_HTML
authorJulian Smart <julian@anthemion.co.uk>
Wed, 17 Apr 2002 11:48:11 +0000 (11:48 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 17 Apr 2002 11:48:11 +0000 (11:48 +0000)
Added VC++/non-Unicode for setting HTML clipboard data
Changed FloodFill to return a bool value

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

28 files changed:
docs/latex/wx/dataform.tex
docs/latex/wx/dc.tex
docs/latex/wx/valtext.tex
include/wx/dc.h
include/wx/defs.h
include/wx/dragimag.h
include/wx/generic/dcpsg.h
include/wx/gtk/dcclient.h
include/wx/gtk1/dcclient.h
include/wx/mac/dc.h
include/wx/mgl/dc.h
include/wx/motif/dcclient.h
include/wx/msw/dc.h
include/wx/os2/dc.h
include/wx/x11/dcclient.h
src/common/imagfill.cpp
src/generic/dcpsg.cpp
src/gtk/dcclient.cpp
src/gtk1/dcclient.cpp
src/mac/carbon/dc.cpp
src/mac/dc.cpp
src/mgl/dc.cpp
src/motif/dcclient.cpp
src/msw/clipbrd.cpp
src/msw/dc.cpp
src/os2/dc.cpp
src/univ/renderer.cpp
src/x11/dcclient.cpp

index 292c086835c72856acff686d70dc3f152fd97b8a..bf80cd95d033972fbe63b14274a99ada48726013 100644 (file)
@@ -29,6 +29,8 @@ functions taking a wxDataFormat argument sometimes}
 \twocolitem{wxDF\_BITMAP}{A bitmap (wxBitmap)}
 \twocolitem{wxDF\_METAFILE}{A metafile (wxMetafile, Windows only)}
 \twocolitem{wxDF\_FILENAME}{A list of filenames}
+\twocolitem{wxDF\_HTML}{An HTML string. This is only valid when passed to wxSetClipboardData
+when compiled with Visual C++ in non-Unicode mode}
 \end{twocollist}
 
 As mentioned above, these standard formats may be passed to any function taking
index dc731b363de887e4fed7a5a7f79138472b9c61d6..caf0d997aedc9863271ea4e0314801a322998583 100644 (file)
@@ -487,7 +487,7 @@ Ends a document page (only relevant when outputting to a printer).
 
 \membersection{wxDC::FloodFill}\label{wxdcfloodfill}
 
-\func{void}{FloodFill}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{const wxColour\&}{ colour}, \param{int}{ style=wxFLOOD\_SURFACE}}
+\func{bool}{FloodFill}{\param{wxCoord}{ x}, \param{wxCoord}{ y}, \param{const wxColour\&}{ colour}, \param{int}{ style=wxFLOOD\_SURFACE}}
 
 Flood fills the device context starting from the given point, using
 the {\it current brush colour}, and using a style:
@@ -497,8 +497,11 @@ the {\it current brush colour}, and using a style:
 \item wxFLOOD\_BORDER: the area to be flooded is bounded by the given colour.
 \end{itemize}
 
+Returns FALSE if the operation failed.
+
 {\it Note:} The present implementation for non-Windows platforms may fail to find
-colour borders if the pixels do not match the colour exactly.
+colour borders if the pixels do not match the colour exactly. However the
+function will still return TRUE.
 
 \membersection{wxDC::GetBackground}\label{wxdcgetbackground}
 
index c3c286ecc58ce6266ee75f3b5a9edeb5179a2c63..0973e9df2000d5d8d9e0c8b34e73e344848dc5f4 100644 (file)
@@ -48,7 +48,7 @@ checks if the user input is on the list, complaining if not.}
 checks if the user input is on the list, complaining if it is.}
 \twocolitem{{\bf wxFILTER\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
 checks if each input character is in the list (one character per list element), complaining if not.}
-\twocolitem{{\bf wxFILTER\_INCLUDE\_CHAR\_LIST}}{Use an include list. The validator
+\twocolitem{{\bf wxFILTER\_EXCLUDE\_CHAR\_LIST}}{Use an include list. The validator
 checks if each input character is in the list (one character per list element), complaining if it is.}
 \end{twocollist}
 }
index 8366a5c4794aeb3e202777b2c6a6e9bb666de543..c14bbea8aebaea1259fccd21ea4ff279d6ffcab3 100644 (file)
@@ -147,12 +147,12 @@ public:
         CalcBoundingBox(drawobject->MaxX(),drawobject->MaxY());
     }
 
-    void FloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    bool FloodFill(wxCoord x, wxCoord y, const wxColour& col,
                    int style = wxFLOOD_SURFACE)
-        { DoFloodFill(x, y, col, style); }
-    void FloodFill(const wxPoint& pt, const wxColour& col,
+        { return DoFloodFill(x, y, col, style); }
+    bool FloodFill(const wxPoint& pt, const wxColour& col,
                    int style = wxFLOOD_SURFACE)
-        { DoFloodFill(pt.x, pt.y, col, style); }
+        { return DoFloodFill(pt.x, pt.y, col, style); }
 
     bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const
         { return DoGetPixel(x, y, col); }
@@ -607,7 +607,7 @@ public:
 
 protected:
     // the pure virtual functions which should be implemented by wxDC
-    virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
                              int style = wxFLOOD_SURFACE) = 0;
 
     virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0;
index 80b4fbb8458a8e219deb9edb90ac2357df7a9743..a3ea865ebd1303bc6f23c338a825df7e5aae09bf 100644 (file)
@@ -1463,6 +1463,7 @@ enum wxDataFormatId
     wxDF_FILENAME =         15, /* CF_HDROP */
     wxDF_LOCALE =           16,
     wxDF_PRIVATE =          20,
+    wxDF_HTML =             30, /* Note: does not correspond to CF_ constant */
     wxDF_MAX
 };
 
index 0cee7e64cccf8ceb500c4ebd8bbd6b74e779c573..097edaacd30d0b29fe0dcd29ad0cb867ed63d884 100644 (file)
@@ -3,6 +3,10 @@
 
 #if wxUSE_DRAGIMAGE
 
+class WXDLLEXPORT wxRect;
+class WXDLLEXPORT wxMemoryDC;
+class WXDLLEXPORT wxDC;
+
 #if defined(__WXMSW__)
 #ifdef __WIN16__
 #include "wx/generic/dragimgg.h"
index fb1b61bce2164d3d593241e79f7be324b22d85dd..bbfcbba91214f46807f1ffac27a613ebbf7ac88f 100644 (file)
@@ -62,7 +62,7 @@ public:
   virtual void BeginDrawing() {}
   virtual void EndDrawing() {}
 
-  void DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
+  bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
   bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
 
   void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
index 77331532da0b56aed7aef283c1bc059fe882a986..ab21e69e4a21c50e1ad9a7a780baf9101ae09f73 100644 (file)
@@ -42,7 +42,7 @@ public:
 
 protected:
     virtual void DoGetSize(int *width, int *height) const;
-    virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
+    virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
     virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
 
     virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
index 77331532da0b56aed7aef283c1bc059fe882a986..ab21e69e4a21c50e1ad9a7a780baf9101ae09f73 100644 (file)
@@ -42,7 +42,7 @@ public:
 
 protected:
     virtual void DoGetSize(int *width, int *height) const;
-    virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
+    virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
     virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
 
     virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 );
index cfc9958cf8726f65ddd2caf1a0c1c5a6e13d4467..ead1ae68d96415f8220f8a2cf316ac3d29b0a79a 100644 (file)
@@ -189,7 +189,7 @@ class WXDLLEXPORT wxDC: public wxDCBase
 //
 
 protected:
-    virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
                              int style = wxFLOOD_SURFACE);
 
     virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
index d1559dc4aebdb37368cff5c355071c010248550d..9e0cccd4548b065188e84e70f8956b6962461759 100644 (file)
@@ -167,7 +167,7 @@ public:
     void SetMGLDC(MGLDevCtx *mgldc, bool OwnsMGLDC = FALSE);
 
 protected:
-    virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
                              int style = wxFLOOD_SURFACE);
 
     virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
index ec974c1bb308c7eba3f24a3c40d643d85ab4e4d4..5288b917634046b5fbaf1f7deeeb46d2ca00b721 100644 (file)
@@ -90,7 +90,7 @@ public:
     void SetAutoSetting(bool flag) { m_autoSetting = flag; }
     
 protected:
-    virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
         int style = wxFLOOD_SURFACE);
     
     virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
index f28ffedd8d82f52c44258e1f7bf375220651fc24..dde2cf42460d790039936457f078a900d4621483 100644 (file)
@@ -135,7 +135,7 @@ public:
 #endif
 
 protected:
-    virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
                              int style = wxFLOOD_SURFACE);
 
     virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
index 87d00092a235072983cef044010bb0ca1f1aa40a..c3d383cd2a78796baa77bac5370df84d17a0799b 100644 (file)
@@ -202,7 +202,7 @@ public:
 #endif
 
 protected:
-    virtual void DoFloodFill( wxCoord         vX
+    virtual bool DoFloodFill( wxCoord         vX
                              ,wxCoord         vY
                              ,const wxColour& rCol
                              ,int             nStyle = wxFLOOD_SURFACE
index 0b35e74731a28861a7554278e9c6cbfa11571d59..ce76814dcae2b60d0c795922426d322419c6e546 100644 (file)
@@ -46,7 +46,7 @@ public:
 
 protected:
     virtual void DoGetSize(int *width, int *height) const;
-    virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE );
+    virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE );
     virtual bool DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const;
     
     virtual void DoDrawPoint(wxCoord x, wxCoord y);
index b5a6c66a5300031da30fe282ff5cda60a13ec8cf..a3d595ccff68354bbee43c28a2c3853cc296574e 100644 (file)
@@ -273,11 +273,11 @@ wxImageFloodFill(wxImage *image,
 }
 
 
-void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
+bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
                    const wxColour& col, int style)
 {
     if (dc->GetBrush().GetStyle() == wxTRANSPARENT)
-        return;
+        return TRUE;
 
     int height = 0;
     int width  = 0;
@@ -285,6 +285,9 @@ void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
 
     //it would be nice to fail if we don't get a sensible size...
     wxCHECK_RET(width >= 1 && height >= 1, wxT("In FloodFill, dc.GetSize routine failed, method not supported by this DC"));
+    
+    if (width <= 1 || height <= 1)
+        return FALSE;
 
     //this is much faster than doing the individual pixels
     wxMemoryDC memdc;
@@ -300,6 +303,8 @@ void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
     memdc.SelectObject(bitmap);
     dc->Blit(0, 0, width, height, &memdc, 0, 0);
     memdc.SelectObject(wxNullBitmap);
+    
+    return TRUE;
 }
 
 #endif // wxUSE_IMAGE
index a81806e5acf10a1a0747b766718c7830ad5c1798..359d8aafa6f045afd763b3d3226f5106291ff8f8 100644 (file)
@@ -441,9 +441,10 @@ void wxPostScriptDC::Clear()
     wxFAIL_MSG( wxT("wxPostScriptDC::Clear not implemented.") );
 }
 
-void wxPostScriptDC::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style))
+bool wxPostScriptDC::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style))
 {
     wxFAIL_MSG( wxT("wxPostScriptDC::FloodFill not implemented.") );
+    return FALSE;
 }
 
 bool wxPostScriptDC::DoGetPixel (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxColour * WXUNUSED(col)) const
index 8ed9bff19b7201721ba9bf762e67920e6584c881..fc69b408a99a2879bd19cc0fc16a12b2dbf4f217 100644 (file)
@@ -401,13 +401,13 @@ void wxWindowDC::DoGetSize( int* width, int* height ) const
     m_owner->GetSize(width, height);
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
                              const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
index 8ed9bff19b7201721ba9bf762e67920e6584c881..fc69b408a99a2879bd19cc0fc16a12b2dbf4f217 100644 (file)
@@ -401,13 +401,13 @@ void wxWindowDC::DoGetSize( int* width, int* height ) const
     m_owner->GetSize(width, height);
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
                              const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
index 5778b90b072740d901e9e6591795d84405ec4b8d..0b9ac3ab1e8817fd982d4344cd12521e6d61d470 100644 (file)
@@ -649,13 +649,13 @@ void  wxDC::SetLogicalFunction( int function )
        m_macPenInstalled = false ;
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
                        const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool  wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const 
index 5778b90b072740d901e9e6591795d84405ec4b8d..0b9ac3ab1e8817fd982d4344cd12521e6d61d470 100644 (file)
@@ -649,13 +649,13 @@ void  wxDC::SetLogicalFunction( int function )
        m_macPenInstalled = false ;
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
                        const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool  wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const 
index 2409fcaaa211ab4911c91b8e98bbc8bc64e84b61..410e1b4016bc09d2e50209eca181a771775fef72 100644 (file)
@@ -332,13 +332,13 @@ void wxDC::Clear()
     }
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
                        const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
index a5e57af9d1c9acd096899e55473bbba50c8f8bf8..7c1602b346943dd13acc83425eedcf6f6d441f76 100644 (file)
@@ -231,13 +231,13 @@ wxWindowDC::~wxWindowDC()
     m_userRegion = (WXRegion) 0;
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
                              const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
   
 bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
index a3b4611af4125afeda6e654fe50882987ad67b97..7f07e896eb2ac169c443fa05be377ca8fb321b5e 100644 (file)
@@ -298,6 +298,80 @@ bool wxSetClipboardData(wxDataFormat dataFormat,
                 handle = SetClipboardData(dataFormat, hGlobalMemory);
                 break;
             }
+            // Only tested with non-Unicode, Visual C++ 6.0 so far
+#if defined(__VISUALC__) && !defined(UNICODE)
+        case wxDF_HTML:
+            {
+                char* html = (char *)data;
+                
+                // Create temporary buffer for HTML header...
+                char *buf = new char [400 + strlen(html)];
+                if(!buf) return FALSE;
+                
+                // Get clipboard id for HTML format...
+                static int cfid = 0;
+                if(!cfid) cfid = RegisterClipboardFormat(wxT("HTML Format"));
+                
+                // Create a template string for the HTML header...
+                strcpy(buf,
+                    "Version:0.9\r\n"
+                    "StartHTML:00000000\r\n"
+                    "EndHTML:00000000\r\n"
+                    "StartFragment:00000000\r\n"
+                    "EndFragment:00000000\r\n"
+                    "<html><body>\r\n"
+                    "<!--StartFragment -->\r\n");
+                
+                // Append the HTML...
+                strcat(buf, html);
+                strcat(buf, "\r\n");
+                // Finish up the HTML format...
+                strcat(buf,
+                    "<!--EndFragment-->\r\n"
+                    "</body>\r\n"
+                    "</html>");
+                
+                // Now go back, calculate all the lengths, and write out the
+                // necessary header information. Note, wsprintf() truncates the
+                // string when you overwrite it so you follow up with code to replace
+                // the 0 appended at the end with a '\r'...
+                char *ptr = strstr(buf, "StartHTML");
+                wsprintf(ptr+10, "%08u", strstr(buf, "<html>") - buf);
+                *(ptr+10+8) = '\r';
+                
+                ptr = strstr(buf, "EndHTML");
+                wsprintf(ptr+8, "%08u", strlen(buf));
+                *(ptr+8+8) = '\r';
+                
+                ptr = strstr(buf, "StartFragment");
+                wsprintf(ptr+14, "%08u", strstr(buf, "<!--StartFrag") - buf);
+                *(ptr+14+8) = '\r';
+                
+                ptr = strstr(buf, "EndFragment");
+                wsprintf(ptr+12, "%08u", strstr(buf, "<!--EndFrag") - buf);
+                *(ptr+12+8) = '\r';
+                
+                // Now you have everything in place ready to put on the
+                // clipboard.
+                
+                // Allocate global memory for transfer...
+                HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE |GMEM_DDESHARE, strlen(buf)+4);
+                
+                // Put your string in the global memory...
+                ptr = (char *)GlobalLock(hText);
+                strcpy(ptr, buf);
+                GlobalUnlock(hText);
+                
+                handle = ::SetClipboardData(cfid, hText);
+                
+                // Free memory...
+                GlobalFree(hText);
+                
+                // Clean up...
+                delete [] buf;
+                break;
+            }
+#endif
     }
 
     if ( handle == 0 )
index 09d21ad3d03a48040fd1e786f42e600422756cdc..293626093c0528412fde19c0414c3075596f5c47 100644 (file)
@@ -468,16 +468,17 @@ void wxDC::Clear()
     ::SetWindowOrgEx(GetHdc(), (int)m_logicalOriginX, (int)m_logicalOriginY, NULL);
 }
 
-void wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
+bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
 {
 #ifdef __WXMICROWIN__
-    if (!GetHDC()) return;
+    if (!GetHDC()) return FALSE;
 #endif
 
-    if ( !::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
+    bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
                          col.GetPixel(),
                          style == wxFLOOD_SURFACE ? FLOODFILLSURFACE
-                                                  : FLOODFILLBORDER) )
+                                                  : FLOODFILLBORDER) ) ;
+    if (!success)
     {
         // quoting from the MSDN docs:
         //
@@ -495,6 +496,8 @@ void wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
     }
 
     CalcBoundingBox(x, y);
+    
+    return success;
 }
 
 bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
index 9912e149cecb2426c6488abf65d80daa23f775f7..0fa3c05f7add093296744d6502620b44ca807d0a 100644 (file)
@@ -557,7 +557,7 @@ void wxDC::Clear()
     ::GpiErase(m_hPS);
 } // end of wxDC::Clear
 
-void wxDC::DoFloodFill(
+bool wxDC::DoFloodFill(
   wxCoord                           vX
 , wxCoord                           vY
 , const wxColour&                   rCol
@@ -577,6 +577,8 @@ void wxDC::DoFloodFill(
         lOptions = FF_SURFACE;
 
     ::GpiFloodFill(m_hPS, lOptions, lColor);
+    
+    return TRUE;
 } // end of wxDC::DoFloodFill
 
 bool wxDC::DoGetPixel(
index 75539ac04cbc80eaa0b99d3b1be1dabc31d34c40..13db530ddb9e79476de7535b64d37812e1a1d76e 100644 (file)
@@ -512,7 +512,7 @@ void wxControlRenderer::DrawBitmap(wxDC &dc,
     else if ( stretch & wxEXPAND )
     {
         // stretch bitmap to fill the entire control
-        bmp = wxImage(bmp.ConvertToImage()).Scale(rect.width, rect.height);
+        bmp = wxBitmap(wxImage(bmp.ConvertToImage()).Scale(rect.width, rect.height));
     }
     else // not stretched, not tiled
     {
index 5ea0c08e591c5951106e5a6a90a622e826f0ceae..200762065f47fd222611edb9c9f24b4699418d69 100644 (file)
@@ -313,13 +313,13 @@ void wxWindowDC::DoGetSize( int* width, int* height ) const
     m_owner->GetSize(width, height);
 }
 
-extern void wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, 
                           const wxColour & col, int style);
 
-void wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
                              const wxColour& col, int style)
 {
-    wxDoFloodFill(this, x, y, col, style);
+    return wxDoFloodFill(this, x, y, col, style);
 }
 
 bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const