From: Dimitri Schoolwerth Date: Tue, 3 May 2011 16:29:04 +0000 (+0000) Subject: Replaced Ok() occurrences with IsOk() throughout trunk. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b Replaced Ok() occurrences with IsOk() throughout trunk. Additionally renamed wxOSX' private wxNativePrinterDC::Ok() function to IsOk(). Didn't deprecate the various Ok() functions: given the amount of changes already introduced in 3.0 a trivial one like this seems more suitable for after 3.0. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/demos/forty/card.cpp b/demos/forty/card.cpp index f1f9dea885..ccb8102ef4 100644 --- a/demos/forty/card.cpp +++ b/demos/forty/card.cpp @@ -60,7 +60,7 @@ Card::Card(int value, WayUp way_up) : if (!m_symbolBmap) { m_symbolBmap = new wxBitmap(symbols_xpm); - if (!m_symbolBmap->Ok()) + if (!m_symbolBmap->IsOk()) { ::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error")); } @@ -68,7 +68,7 @@ Card::Card(int value, WayUp way_up) : if (!m_pictureBmap) { m_pictureBmap = new wxBitmap(Pictures); - if (!m_pictureBmap->Ok()) + if (!m_pictureBmap->IsOk()) { ::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error")); } diff --git a/include/wx/aboutdlg.h b/include/wx/aboutdlg.h index 9c5a12ee03..edcf6fd105 100644 --- a/include/wx/aboutdlg.h +++ b/include/wx/aboutdlg.h @@ -69,7 +69,7 @@ public: // icon to be shown in the dialog, defaults to the main frame icon void SetIcon(const wxIcon& icon) { m_icon = icon; } - bool HasIcon() const { return m_icon.Ok(); } + bool HasIcon() const { return m_icon.IsOk(); } wxIcon GetIcon() const; // web site for the program and its description (defaults to URL itself if diff --git a/include/wx/calctrl.h b/include/wx/calctrl.h index 4cbf5720d9..ce056a11fe 100644 --- a/include/wx/calctrl.h +++ b/include/wx/calctrl.h @@ -112,10 +112,10 @@ public: void SetHoliday(bool holiday) { m_holiday = holiday; } // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasBorderColour() const { return m_colBorder.Ok(); } - bool HasFont() const { return m_font.Ok(); } + bool HasTextColour() const { return m_colText.IsOk(); } + bool HasBackgroundColour() const { return m_colBack.IsOk(); } + bool HasBorderColour() const { return m_colBorder.IsOk(); } + bool HasFont() const { return m_font.IsOk(); } bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; } bool IsHoliday() const { return m_holiday; } diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 8ac018ce65..ecd42d07f2 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -189,7 +189,7 @@ public: // Is this data OK for showing the print dialog? bool Ok() const { return IsOk(); } - bool IsOk() const { return m_printData.Ok() ; } + bool IsOk() const { return m_printData.IsOk() ; } wxPrintData& GetPrintData() { return m_printData; } void SetPrintData(const wxPrintData& printData) { m_printData = printData; } @@ -249,7 +249,7 @@ public: // Is this data OK for showing the page setup dialog? bool Ok() const { return IsOk(); } - bool IsOk() const { return m_printData.Ok() ; } + bool IsOk() const { return m_printData.IsOk() ; } // If a corresponding paper type is found in the paper database, will set the m_printData // paper size id member as well. diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 540babf79f..7fcc15873f 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -163,7 +163,7 @@ public: void SetItalic( bool set ) { m_italic = set; } // accessors - bool HasColour() const { return m_colour.Ok(); } + bool HasColour() const { return m_colour.IsOk(); } const wxColour& GetColour() const { return m_colour; } bool HasFont() const { return m_bold || m_italic; } diff --git a/include/wx/dc.h b/include/wx/dc.h index 5734cde438..1f1731d4a6 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1344,13 +1344,13 @@ public: ~wxDCTextColourChanger() { - if ( m_colFgOld.Ok() ) + if ( m_colFgOld.IsOk() ) m_dc.SetTextForeground(m_colFgOld); } void Set(const wxColour& col) { - if ( !m_colFgOld.Ok() ) + if ( !m_colFgOld.IsOk() ) m_colFgOld = m_dc.GetTextForeground(); m_dc.SetTextForeground(col); } @@ -1378,7 +1378,7 @@ public: ~wxDCPenChanger() { - if ( m_penOld.Ok() ) + if ( m_penOld.IsOk() ) m_dc.SetPen(m_penOld); } @@ -1405,7 +1405,7 @@ public: ~wxDCBrushChanger() { - if ( m_brushOld.Ok() ) + if ( m_brushOld.IsOk() ) m_dc.SetBrush(m_brushOld); } @@ -1461,14 +1461,14 @@ public: void Set(const wxFont& font) { - if ( !m_fontOld.Ok() ) + if ( !m_fontOld.IsOk() ) m_fontOld = m_dc.GetFont(); m_dc.SetFont(font); } ~wxDCFontChanger() { - if ( m_fontOld.Ok() ) + if ( m_fontOld.IsOk() ) m_dc.SetFont(m_fontOld); } diff --git a/include/wx/event.h b/include/wx/event.h index 01b681c9a1..8fc2dcb6af 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1528,7 +1528,7 @@ public: void SetCursor(const wxCursor& cursor) { m_cursor = cursor; } const wxCursor& GetCursor() const { return m_cursor; } - bool HasCursor() const { return m_cursor.Ok(); } + bool HasCursor() const { return m_cursor.IsOk(); } virtual wxEvent *Clone() const { return new wxSetCursorEvent(*this); } diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index e02f4848e1..c65d2e2f50 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -432,9 +432,9 @@ public: void SetKind(wxAttrKind kind) { m_attrkind = kind; } // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } + bool HasTextColour() const { return m_colText.IsOk(); } + bool HasBackgroundColour() const { return m_colBack.IsOk(); } + bool HasFont() const { return m_font.IsOk(); } bool HasAlignment() const { return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID; diff --git a/include/wx/generic/statbmpg.h b/include/wx/generic/statbmpg.h index 4a2ece335c..6948c9d521 100644 --- a/include/wx/generic/statbmpg.h +++ b/include/wx/generic/statbmpg.h @@ -61,7 +61,7 @@ public: private: wxSize GetBitmapSize() { - return m_bitmap.Ok() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) + return m_bitmap.IsOk() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) : wxSize(16, 16); // this is completely arbitrary } diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index c1a8c66f6e..3ac71b7f5c 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -52,13 +52,13 @@ extern const gchar *wx_pango_version_check(int major, int minor, int micro); // helper: use the encoding of the given font if it's valid inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font) { - return wxConvertToGTK(s, font.Ok() ? font.GetEncoding() + return wxConvertToGTK(s, font.IsOk() ? font.GetEncoding() : wxFONTENCODING_SYSTEM); } inline wxCharBuffer wxConvertFromGTK(const wxString& s, const wxFont& font) { - return wxConvertFromGTK(s, font.Ok() ? font.GetEncoding() + return wxConvertFromGTK(s, font.IsOk() ? font.GetEncoding() : wxFONTENCODING_SYSTEM); } diff --git a/include/wx/listbase.h b/include/wx/listbase.h index df07401a0e..34ae276499 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -183,9 +183,9 @@ public: void SetFont(const wxFont& font) { m_font = font; } // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } + bool HasTextColour() const { return m_colText.IsOk(); } + bool HasBackgroundColour() const { return m_colBack.IsOk(); } + bool HasFont() const { return m_font.IsOk(); } const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetBackgroundColour() const { return m_colBack; } diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index a3ff7f5216..7a35da3666 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -3644,7 +3644,7 @@ public: /// image size. virtual wxTextAttrSize GetNaturalSize() const; - virtual bool IsEmpty() const { return false; /* !m_imageBlock.Ok(); */ } + virtual bool IsEmpty() const { return false; /* !m_imageBlock.IsOk(); */ } virtual bool CanEditProperties() const { return true; } diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index eb7c2140ce..f26cb8aa10 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -379,8 +379,8 @@ public: int GetOutlineLevel() const { return m_outlineLevel; } // accessors - bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } - bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } + bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } + bool HasBackgroundColour() const { return m_colBack.IsOk() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; } bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; } bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); } diff --git a/include/wx/treebase.h b/include/wx/treebase.h index 37dfb0e333..e623660865 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -252,9 +252,9 @@ public: void SetFont(const wxFont& font) { m_font = font; } // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } + bool HasTextColour() const { return m_colText.IsOk(); } + bool HasBackgroundColour() const { return m_colBack.IsOk(); } + bool HasFont() const { return m_font.IsOk(); } const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetBackgroundColour() const { return m_colBack; } diff --git a/samples/animate/anitest.cpp b/samples/animate/anitest.cpp index 413558002f..e2500c0fc5 100644 --- a/samples/animate/anitest.cpp +++ b/samples/animate/anitest.cpp @@ -293,7 +293,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) m_animationCtrl->Play(); #else wxFileInputStream stream(filename); - if (!stream.Ok()) + if (!stream.IsOk()) { wxLogError(wxT("Sorry, this animation is not a valid format for wxAnimation.")); return; diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index 596522bfda..e58377e3da 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -34,7 +34,7 @@ { \ int ind; \ wxIcon icon = wxArtProvider::GetIcon(id, client, size); \ - if ( icon.Ok() ) \ + if ( icon.IsOk() ) \ ind = images->Add(icon); \ else \ ind = 0; \ diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 79e9eebecf..8cf794f121 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -721,7 +721,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) for ( size_t n = 0; n < Image_Max; n++ ) { wxBitmap bmp(s_iconNames[n]); - if ( !bmp.Ok() || (imagelist->Add(bmp) == -1) ) + if ( !bmp.IsOk() || (imagelist->Add(bmp) == -1) ) { wxLogWarning(wxT("Couldn't load the image '%s' for the book control page %d."), s_iconNames[n], n); @@ -957,7 +957,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #if defined(__WXMSW__) || defined(__WXMOTIF__) // test for masked bitmap display bitmap = wxBitmap(wxT("test2.bmp"), wxBITMAP_TYPE_BMP); - if (bitmap.Ok()) + if (bitmap.IsOk()) { bitmap.SetMask(new wxMask(bitmap, *wxBLUE)); @@ -1183,7 +1183,7 @@ void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event)) SetThemeEnabled(false); // test panel colour changing and propagation to the subcontrols - if ( s_colOld.Ok() ) + if ( s_colOld.IsOk() ) { SetBackgroundColour(s_colOld); s_colOld = wxNullColour; diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index c2175a9d4b..7916600905 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -141,7 +141,7 @@ public: { wxPaintDC dc(this); - if ( m_bitmap.Ok() ) + if ( m_bitmap.IsOk() ) { PrepareDC(dc); @@ -177,7 +177,7 @@ public: { wxPaintDC dc(this); - if ( m_metafile.Ok() ) + if ( m_metafile.IsOk() ) { PrepareDC(dc); @@ -1327,7 +1327,7 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) wxBITMAP_TYPE_BMP #endif ); - if (!image.Ok()) + if (!image.IsOk()) { wxLogError( wxT("Invalid image file...") ); return; diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index db5c14b430..c3364c7a0a 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -87,7 +87,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) void MyCanvas::OnEraseBackground(wxEraseEvent& event) { - if (wxGetApp().GetBackgroundBitmap().Ok()) + if (wxGetApp().GetBackgroundBitmap().IsOk()) { wxSize sz = GetClientSize(); wxRect rect(0, 0, sz.x, sz.y); @@ -468,7 +468,7 @@ bool DragShape::HitTest(const wxPoint& pt) const bool DragShape::Draw(wxDC& dc, bool highlight) { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { wxMemoryDC memDC; memDC.SelectObject(m_bitmap); @@ -498,7 +498,7 @@ bool MyDragImage::UpdateBackingFromWindow(wxDC& WXUNUSED(windowDC), wxMemoryDC& { destDC.SetClippingRegion(destRect); - if (wxGetApp().GetBackgroundBitmap().Ok()) + if (wxGetApp().GetBackgroundBitmap().IsOk()) wxGetApp().TileBitmap(destRect, destDC, wxGetApp().GetBackgroundBitmap()); m_canvas->DrawShapes(destDC); diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 3a4e689552..7d9060710b 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -580,7 +580,7 @@ void MyCanvas::DrawDefault(wxDC& dc) // rectangle above) //dc.SetBrush( *wxTRANSPARENT_BRUSH ); - if (m_smile_bmp.Ok()) + if (m_smile_bmp.IsOk()) dc.DrawBitmap(m_smile_bmp, x + rectSize - 20, rectSize - 10, true); dc.SetBrush( *wxBLACK_BRUSH ); @@ -1468,7 +1468,7 @@ void MyCanvas::DrawRegionsHelper(wxDC& dc, wxCoord x, bool firstTime) dc.SetBrush( *wxGREY_BRUSH ); dc.DrawRectangle( x, y, 310, 310 ); - if (m_smile_bmp.Ok()) + if (m_smile_bmp.IsOk()) { dc.DrawBitmap( m_smile_bmp, x + 150, y + 150, true ); dc.DrawBitmap( m_smile_bmp, x + 130, y + 10, true ); @@ -1503,15 +1503,15 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event)) m_owner->PrepareDC(dc); dc.SetBackgroundMode( m_owner->m_backgroundMode ); - if ( m_owner->m_backgroundBrush.Ok() ) + if ( m_owner->m_backgroundBrush.IsOk() ) dc.SetBackground( m_owner->m_backgroundBrush ); - if ( m_owner->m_colourForeground.Ok() ) + if ( m_owner->m_colourForeground.IsOk() ) dc.SetTextForeground( m_owner->m_colourForeground ); - if ( m_owner->m_colourBackground.Ok() ) + if ( m_owner->m_colourBackground.IsOk() ) dc.SetTextBackground( m_owner->m_colourBackground ); if ( m_owner->m_textureBackground) { - if ( ! m_owner->m_backgroundBrush.Ok() ) { + if ( ! m_owner->m_backgroundBrush.IsOk() ) { wxColour clr(0,128,0); wxBrush b(clr, wxSOLID); dc.SetBackground(b); @@ -1916,7 +1916,7 @@ void MyFrame::OnOption(wxCommandEvent& event) case Colour_Background: { wxColour col = SelectColour(); - if ( col.Ok() ) + if ( col.IsOk() ) { m_backgroundBrush.SetColour(col); } diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index 6fe2ff9dd5..586b129719 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -503,7 +503,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) m_lbox = new wxListBox(this, wxID_ANY); wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); - if ( font.Ok() ) + if ( font.IsOk() ) m_lbox->SetFont(font); #if wxUSE_STATUSBAR diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 0bd4df1c5b..fce11afd27 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -553,7 +553,7 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event)) wxFont font; font.SetNativeFontInfo(fontInfo); - if ( !font.Ok() ) + if ( !font.IsOk() ) { wxLogError(wxT("Font info string \"%s\" is invalid."), fontInfo.c_str()); @@ -576,12 +576,12 @@ void MyFrame::OnSetNativeUserDesc(wxCommandEvent& WXUNUSED(event)) wxFont font; if (font.SetNativeFontInfoUserDesc(fontUserInfo)) { - wxASSERT_MSG(font.Ok(), wxT("The font should now be valid")); + wxASSERT_MSG(font.IsOk(), wxT("The font should now be valid")); DoChangeFont(font); } else { - wxASSERT_MSG(!font.Ok(), wxT("The font should now be invalid")); + wxASSERT_MSG(!font.IsOk(), wxT("The font should now be invalid")); wxMessageBox(wxT("Error trying to create a font with such description...")); } } @@ -608,12 +608,12 @@ void MyFrame::OnSetFaceName(wxCommandEvent& WXUNUSED(event)) wxFont font(GetCanvas()->GetTextFont()); if (font.SetFaceName(newFaceName)) // change facename only { - wxASSERT_MSG(font.Ok(), wxT("The font should now be valid")); + wxASSERT_MSG(font.IsOk(), wxT("The font should now be valid")); DoChangeFont(font); } else { - wxASSERT_MSG(!font.Ok(), wxT("The font should now be invalid")); + wxASSERT_MSG(!font.IsOk(), wxT("The font should now be invalid")); wxMessageBox(wxT("There is no font with such face name..."), wxT("Invalid face name"), wxOK|wxICON_ERROR, this); } @@ -806,12 +806,12 @@ void MyFrame::OnwxSystemSettingsFont(wxCommandEvent& event) void MyFrame::DoChangeFont(const wxFont& font, const wxColour& col) { m_canvas->SetTextFont(font); - if ( col.Ok() ) + if ( col.IsOk() ) m_canvas->SetColour(col); m_canvas->Refresh(); m_textctrl->SetFont(font); - if ( col.Ok() ) + if ( col.IsOk() ) m_textctrl->SetForegroundColour(col); // update the state of the bold/italic/underlined menu items @@ -968,7 +968,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false /* !underlined */, wxEmptyString /* facename */, fontenc); - if ( font.Ok() ) + if ( font.IsOk() ) { DoChangeFont(font); } @@ -1047,7 +1047,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawText(fontInfo, x, y); y += hLine; - if ( m_font.Ok() ) + if ( m_font.IsOk() ) { const wxNativeFontInfo *info = m_font.GetNativeFontInfo(); if ( info ) diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 4b2353dec6..93b1d95155 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -702,7 +702,7 @@ void GridFrame::SetLabelTextColour( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetLabelFont( wxCommandEvent& WXUNUSED(ev) ) { wxFont font = wxGetFontFromUser(this); - if ( font.Ok() ) + if ( font.IsOk() ) { grid->SetLabelFont(font); } @@ -945,7 +945,7 @@ void GridFrame::SelectRowsOrCols( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) ) { wxColour col = wxGetColourFromUser(this); - if ( col.Ok() ) + if ( col.IsOk() ) { grid->SetDefaultCellTextColour(col); grid->Refresh(); @@ -955,7 +955,7 @@ void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) ) { wxColour col = wxGetColourFromUser(this); - if ( col.Ok() ) + if ( col.IsOk() ) { // Check the new Refresh function by passing it a rectangle // which exactly fits the grid. diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index 091a1d77aa..6ffdb33017 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -449,7 +449,7 @@ void MyFrame::OnGetItemRect(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) { wxColour col = wxGetColourFromUser(this, m_hlbox->GetBackgroundColour()); - if ( col.Ok() ) + if ( col.IsOk() ) { m_hlbox->SetBackgroundColour(col); m_hlbox->Refresh(); @@ -463,7 +463,7 @@ void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event)) { wxColour col = wxGetColourFromUser(this, m_hlbox->GetSelectionBackground()); - if ( col.Ok() ) + if ( col.IsOk() ) { m_hlbox->SetSelectionBackground(col); m_hlbox->Refresh(); diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 5b98dcf07b..3bff81316f 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -272,7 +272,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, smile_height, 1 ); // demonstrates XPM automatically using the mask when saving - if ( m_bmpSmileXpm.Ok() ) + if ( m_bmpSmileXpm.IsOk() ) m_bmpSmileXpm.SaveFile(wxT("saved.xpm"), wxBITMAP_TYPE_XPM); #if wxUSE_ICO_CUR @@ -389,7 +389,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) PrepareDC( dc ); dc.DrawText( wxT("Loaded image"), 30, 10 ); - if (my_square.Ok()) + if (my_square.IsOk()) dc.DrawBitmap( my_square, 30, 30 ); dc.DrawText( wxT("Drawn directly"), 150, 10 ); @@ -399,11 +399,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.SetBrush( *wxWHITE_BRUSH ); dc.DrawRectangle( 170, 50, 60, 60 ); - if (my_anti.Ok()) + if (my_anti.IsOk()) dc.DrawBitmap( my_anti, 280, 30 ); dc.DrawText( wxT("PNG handler"), 30, 135 ); - if (my_horse_png.Ok()) + if (my_horse_png.IsOk()) { dc.DrawBitmap( my_horse_png, 30, 150 ); wxRect rect(0,0,100,100); @@ -413,55 +413,55 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) } dc.DrawText( wxT("JPEG handler"), 30, 365 ); - if (my_horse_jpeg.Ok()) + if (my_horse_jpeg.IsOk()) dc.DrawBitmap( my_horse_jpeg, 30, 380 ); dc.DrawText( wxT("Green rotated to red"), 280, 365 ); - if (colorized_horse_jpeg.Ok()) + if (colorized_horse_jpeg.IsOk()) dc.DrawBitmap( colorized_horse_jpeg, 280, 380 ); dc.DrawText( wxT("CMYK JPEG image"), 530, 365 ); - if (my_cmyk_jpeg.Ok()) + if (my_cmyk_jpeg.IsOk()) dc.DrawBitmap( my_cmyk_jpeg, 530, 380 ); dc.DrawText( wxT("GIF handler"), 30, 595 ); - if (my_horse_gif.Ok()) + if (my_horse_gif.IsOk()) dc.DrawBitmap( my_horse_gif, 30, 610 ); dc.DrawText( wxT("PCX handler"), 30, 825 ); - if (my_horse_pcx.Ok()) + if (my_horse_pcx.IsOk()) dc.DrawBitmap( my_horse_pcx, 30, 840 ); dc.DrawText( wxT("BMP handler"), 30, 1055 ); - if (my_horse_bmp.Ok()) + if (my_horse_bmp.IsOk()) dc.DrawBitmap( my_horse_bmp, 30, 1070 ); dc.DrawText( wxT("BMP read from memory"), 280, 1055 ); - if (my_horse_bmp2.Ok()) + if (my_horse_bmp2.IsOk()) dc.DrawBitmap( my_horse_bmp2, 280, 1070 ); dc.DrawText( wxT("PNM handler"), 30, 1285 ); - if (my_horse_pnm.Ok()) + if (my_horse_pnm.IsOk()) dc.DrawBitmap( my_horse_pnm, 30, 1300 ); dc.DrawText( wxT("PNM handler (ascii grey)"), 280, 1285 ); - if (my_horse_asciigrey_pnm.Ok()) + if (my_horse_asciigrey_pnm.IsOk()) dc.DrawBitmap( my_horse_asciigrey_pnm, 280, 1300 ); dc.DrawText( wxT("PNM handler (raw grey)"), 530, 1285 ); - if (my_horse_rawgrey_pnm.Ok()) + if (my_horse_rawgrey_pnm.IsOk()) dc.DrawBitmap( my_horse_rawgrey_pnm, 530, 1300 ); dc.DrawText( wxT("TIFF handler"), 30, 1515 ); - if (my_horse_tiff.Ok()) + if (my_horse_tiff.IsOk()) dc.DrawBitmap( my_horse_tiff, 30, 1530 ); dc.DrawText( wxT("TGA handler"), 30, 1745 ); - if (my_horse_tga.Ok()) + if (my_horse_tga.IsOk()) dc.DrawBitmap( my_horse_tga, 30, 1760 ); dc.DrawText( wxT("XPM handler"), 30, 1975 ); - if (my_horse_xpm.Ok()) + if (my_horse_xpm.IsOk()) dc.DrawBitmap( my_horse_xpm, 30, 2000 ); // toucans @@ -501,7 +501,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawBitmap(my_toucan_blur, x, y+15, true); } - if (my_smile_xbm.Ok()) + if (my_smile_xbm.IsOk()) { int x = 300, y = 1800; @@ -543,7 +543,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) memdc.DrawLine( 5, 42, 50, 42 ); memdc.SelectObject( wxNullBitmap ); - if (mono.Ok()) + if (mono.IsOk()) { int x = 300, y = 1900; @@ -572,20 +572,20 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawRectangle( 20, 2220, 560, 68 ); dc.DrawText(wxT("XPM bitmap"), 30, 2230 ); - if ( m_bmpSmileXpm.Ok() ) + if ( m_bmpSmileXpm.IsOk() ) dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true); dc.DrawText(wxT("XPM icon"), 110, 2230 ); - if ( m_iconSmileXpm.Ok() ) + if ( m_iconSmileXpm.IsOk() ) dc.DrawIcon(m_iconSmileXpm, 110, 2250); // testing icon -> bitmap conversion wxBitmap to_blit( m_iconSmileXpm ); - if (to_blit.Ok()) + if (to_blit.IsOk()) { dc.DrawText( wxT("SubBitmap"), 170, 2230 ); wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) ); - if (sub.Ok()) + if (sub.IsOk()) dc.DrawBitmap( sub, 170, 2250, true ); dc.DrawText( wxT("Enlarged"), 250, 2230 ); @@ -607,19 +607,19 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) } dc.DrawText( wxT("ICO handler (1st image)"), 30, 2290 ); - if (my_horse_ico32.Ok()) + if (my_horse_ico32.IsOk()) dc.DrawBitmap( my_horse_ico32, 30, 2330, true ); dc.DrawText( wxT("ICO handler (2nd image)"), 230, 2290 ); - if (my_horse_ico16.Ok()) + if (my_horse_ico16.IsOk()) dc.DrawBitmap( my_horse_ico16, 230, 2330, true ); dc.DrawText( wxT("ICO handler (best image)"), 430, 2290 ); - if (my_horse_ico.Ok()) + if (my_horse_ico.IsOk()) dc.DrawBitmap( my_horse_ico, 430, 2330, true ); dc.DrawText( wxT("CUR handler"), 30, 2390 ); - if (my_horse_cur.Ok()) + if (my_horse_cur.IsOk()) { dc.DrawBitmap( my_horse_cur, 30, 2420, true ); dc.SetPen (*wxRED_PEN); @@ -630,7 +630,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawText( wxT("ANI handler"), 230, 2390 ); for ( int i=0; i < m_ani_images; i++ ) { - if (my_horse_ani[i].Ok()) + if (my_horse_ani[i].IsOk()) { dc.DrawBitmap( my_horse_ani[i], 230 + i * 2 * my_horse_ani[i].GetWidth() , 2420, true ); } diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 9ba854ebe6..7fa9637561 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -407,7 +407,7 @@ private: wxImage img(m_bitmap.ConvertToImage()); img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2)); - if ( !img.Ok() ) + if ( !img.IsOk() ) { wxLogWarning(wxT("Rotation failed")); return; diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp index aa01dc0ccb..a50f6dfd4d 100644 --- a/samples/opengl/penguin/penguin.cpp +++ b/samples/opengl/penguin/penguin.cpp @@ -223,7 +223,7 @@ void TestGLCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event)) void TestGLCanvas::LoadDXF(const wxString& filename) { wxFileInputStream stream(filename); - if (stream.Ok()) + if (stream.IsOk()) #if wxUSE_ZLIB { if (filename.Right(3).Lower() == wxT(".gz")) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 4d36f39bfe..afd52d9cb7 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -711,7 +711,7 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) if ( name == wxT("Font") ) { wxFont font = wxANY_AS(value, wxFont); - wxASSERT( font.Ok() ); + wxASSERT( font.IsOk() ); m_pPropGridManager->SetFont( font ); } diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index cc68db21f6..61438b7488 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -60,7 +60,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n // Fix value. fontData.SetChosenFont(value.GetInitialFont()); - if ( !fontData.GetColour().Ok() ) + if ( !fontData.GetColour().IsOk() ) fontData.SetColour(*wxBLACK); // Set initial value - should be done in a simpler way like this @@ -113,7 +113,7 @@ void wxFontDataProperty::OnSetValue() fontData << m_value_wxFontData; wxFont font = fontData.GetChosenFont(); - if ( !font.Ok() ) + if ( !font.IsOk() ) font = wxFont(10,wxSWISS,wxNORMAL,wxNORMAL); m_value = WXVARIANT(font); diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 6868d5a6f4..ef733e27b6 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -1248,7 +1248,7 @@ void MyFrame::OnFont(wxCommandEvent& WXUNUSED(event)) fontData = dialog.GetFontData(); attr.SetFlags(wxTEXT_ATTR_FONT); attr.SetFont(fontData.GetChosenFont()); - if (attr.GetFont().Ok()) + if (attr.GetFont().IsOk()) { m_richTextCtrl->SetStyle(range, attr); } @@ -1589,7 +1589,7 @@ void MyFrame::OnInsertSymbol(wxCommandEvent& WXUNUSED(event)) m_richTextCtrl->GetStyle(m_richTextCtrl->GetInsertionPoint(), attr); wxString currentFontName; - if (attr.HasFont() && attr.GetFont().Ok()) + if (attr.HasFont() && attr.GetFont().IsOk()) currentFontName = attr.GetFont().GetFaceName(); // Don't set the initial font in the dialog (so the user is choosing diff --git a/samples/sockets/baseserver.cpp b/samples/sockets/baseserver.cpp index 0d4c8de9f1..ac856e80a2 100644 --- a/samples/sockets/baseserver.cpp +++ b/samples/sockets/baseserver.cpp @@ -315,7 +315,7 @@ bool Server::OnInit() m_listeningSocket->SetEventHandler(*this); m_listeningSocket->SetNotify(wxSOCKET_CONNECTION_FLAG); m_listeningSocket->Notify(true); - if (!m_listeningSocket->Ok()) + if (!m_listeningSocket->IsOk()) { wxLogError("Cannot bind listening socket"); return false; diff --git a/samples/sockets/server.cpp b/samples/sockets/server.cpp index a57137cbed..853fb4b278 100644 --- a/samples/sockets/server.cpp +++ b/samples/sockets/server.cpp @@ -217,8 +217,8 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, // Create the socket m_server = new wxSocketServer(addr); - // We use Ok() here to see if the server is really listening - if (! m_server->Ok()) + // We use IsOk() here to see if the server is really listening + if (! m_server->IsOk()) { wxLogMessage("Could not listen at the specified port !"); return; diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index de0654b1dc..93fbb7f708 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -137,7 +137,7 @@ bool MyApp::OnInit() bitmap = wxBitmap(mobile_xpm); bool ok = frame->m_isPda - ? bitmap.Ok() + ? bitmap.IsOk() : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); if (ok) @@ -218,7 +218,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) if (m_isPda) bitmap = wxBitmap(mobile_xpm); bool ok = m_isPda - ? bitmap.Ok() + ? bitmap.IsOk() : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); if (ok) diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp index 069008b544..93eb644522 100644 --- a/samples/stc/stctest.cpp +++ b/samples/stc/stctest.cpp @@ -430,7 +430,7 @@ void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) { new wxPrintPreview (new EditPrint (m_edit), new EditPrint (m_edit), &printDialogData); - if (!preview->Ok()) { + if (!preview->IsOk()) { delete preview; wxMessageBox (_("There was a problem with previewing.\n\ Perhaps your current printer is not correctly?"), diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 6de6576370..624770bc0e 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -1848,7 +1848,7 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) { wxString msg; wxString facename(wxT("unknown")); - if (attr.GetFont().Ok()) + if (attr.GetFont().IsOk()) { facename = attr.GetFont().GetFaceName(); } diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 180ac7ccd4..6f8327a911 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -494,7 +494,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) { // create a tool with a custom bitmap for testing wxImage img(m_pathBmp); - if ( img.Ok() ) + if ( img.IsOk() ) { if ( img.GetWidth() > w && img.GetHeight() > h ) img = img.GetSubImage(wxRect(0, 0, w, h)); diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 96a72c2940..8bfb579636 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -901,14 +901,14 @@ void MyFrame::OnSelectLast(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetFgColour(wxCommandEvent& WXUNUSED(event)) { wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetForegroundColour()); - if ( col.Ok() ) + if ( col.IsOk() ) m_treeCtrl->SetForegroundColour(col); } void MyFrame::OnSetBgColour(wxCommandEvent& WXUNUSED(event)) { wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetBackgroundColour()); - if ( col.Ok() ) + if ( col.IsOk() ) m_treeCtrl->SetBackgroundColour(col); } diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index 5de17c9b84..d65f82c259 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -712,10 +712,10 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag #if wxUSE_IMAGE wxASSERT(fn.FileExists()); wxImage image(fn.GetFullPath()); - wxASSERT(image.Ok()); + wxASSERT(image.IsOk()); RescaleImage(image, foundSize.x, foundSize.y); wxBitmap bmp(image); - wxASSERT( bmp.Ok() ); + wxASSERT( bmp.IsOk() ); #else wxBitmap bmp(wxNullBitmap); #endif @@ -842,7 +842,7 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& filepath) } wxImage image(filepath); - if ( image.Ok() ) + if ( image.IsOk() ) { // Rescale very large images int ow = image.GetWidth(); diff --git a/samples/widgets/statbmp.cpp b/samples/widgets/statbmp.cpp index c5f1a1f09b..6449d23ef9 100644 --- a/samples/widgets/statbmp.cpp +++ b/samples/widgets/statbmp.cpp @@ -122,7 +122,7 @@ void StatBmpWidgetsPage::RecreateWidget() return; wxImage image(filepath); - if (! image.Ok() ) + if (! image.IsOk() ) { wxLogMessage("Reading image from file '%s' failed.", filepath.c_str()); return; diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index c858d3f753..84943cbff7 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -800,11 +800,11 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event)) // allow for debugging the default colour the first time this is called WidgetsPage *page = CurrentPage(); - if (!m_colFg.Ok()) + if (!m_colFg.IsOk()) m_colFg = page->GetForegroundColour(); wxColour col = GetColourFromUser(this, m_colFg); - if ( !col.Ok() ) + if ( !col.IsOk() ) return; m_colFg = col; @@ -823,11 +823,11 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) { WidgetsPage *page = CurrentPage(); - if ( !m_colBg.Ok() ) + if ( !m_colBg.IsOk() ) m_colBg = page->GetBackgroundColour(); wxColour col = GetColourFromUser(this, m_colBg); - if ( !col.Ok() ) + if ( !col.IsOk() ) return; m_colBg = col; @@ -845,7 +845,7 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) void WidgetsFrame::OnSetPageBg(wxCommandEvent& WXUNUSED(event)) { wxColour col = GetColourFromUser(this, GetBackgroundColour()); - if ( !col.Ok() ) + if ( !col.IsOk() ) return; CurrentPage()->SetBackgroundColour(col); @@ -857,11 +857,11 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) #if wxUSE_FONTDLG WidgetsPage *page = CurrentPage(); - if (!m_font.Ok()) + if (!m_font.IsOk()) m_font = page->GetFont(); wxFont font = wxGetFontFromUser(this, m_font); - if ( !font.Ok() ) + if ( !font.IsOk() ) return; m_font = font; diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 3ce0eee2a7..16ca2a7847 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -166,7 +166,7 @@ WX_NSBitmapImageRep wxBitmap::GetNSBitmapImageRep() WX_NSImage wxBitmap::GetNSImage(bool useMask) const { - if(!Ok()) + if(!IsOk()) return nil; NSImage *nsimage = [[[NSImage alloc] initWithSize:NSMakeSize(GetWidth(), GetHeight())] autorelease]; @@ -351,7 +351,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) wxImage image; if(!image.LoadFile(filename,type)) return false; - if(!image.Ok()) + if(!image.IsOk()) return false; *this = wxBitmap(image); return true; @@ -428,7 +428,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const { wxAutoNSAutoreleasePool pool; - if(!Ok()) + if(!IsOk()) return wxNullBitmap; NSImage *nsimage = GetNSImage(false); @@ -450,7 +450,7 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const wxImage wxBitmap::ConvertToImage() const { wxAutoNSAutoreleasePool pool; - if(!Ok()) + if(!IsOk()) return /*wxImage(5,5)*/wxNullImage; NSImage *nsimage = GetNSImage(false /* don't use mask */); wxImage newImage(M_BITMAPDATA->m_width,M_BITMAPDATA->m_height); @@ -476,7 +476,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) wxAutoNSAutoreleasePool pool; UnRef(); - wxCHECK_MSG(image.Ok(), false, wxT("invalid image")); + wxCHECK_MSG(image.IsOk(), false, wxT("invalid image")); wxCHECK_MSG(depth == -1 || depth == 1, false, wxT("invalid bitmap depth")); m_refData = new wxBitmapRefData(); @@ -511,7 +511,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { - if(!Ok()) + if(!IsOk()) return NULL; NSBitmapImageRep *bitmapRep = M_BITMAPDATA->m_cocoaNSBitmapImageRep; @@ -657,7 +657,7 @@ static bool wxMask_CreateFromBitmapData(PixelData srcData, const wxColour& colou bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) { wxAutoNSAutoreleasePool pool; - if(!bitmap.Ok()) + if(!bitmap.IsOk()) return false; int bmpWidth = bitmap.GetWidth(); int bmpHeight = bitmap.GetHeight(); diff --git a/src/cocoa/brush.mm b/src/cocoa/brush.mm index a631c1302e..2a75f403f9 100644 --- a/src/cocoa/brush.mm +++ b/src/cocoa/brush.mm @@ -202,19 +202,19 @@ void wxBrush::SetStipple(const wxBitmap& stipple) wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index 01df15a010..0f24ba758f 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -456,7 +456,7 @@ void wxCocoaDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool { wxAutoNSAutoreleasePool pool; if(!CocoaTakeFocus()) return; - if(!bmp.Ok()) + if(!bmp.IsOk()) return; #if 0 @@ -540,13 +540,13 @@ void wxCocoaDCImpl::DoGetSizeMM( int* width, int* height ) const void wxCocoaDCImpl::SetTextForeground( const wxColour &col ) { -// if (!Ok()) return; +// if (!IsOk()) return; m_textForegroundColour = col; }; void wxCocoaDCImpl::SetTextBackground( const wxColour &col ) { -// if (!Ok()) return; +// if (!IsOk()) return; m_textBackgroundColour = col; }; diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 5c74dd212c..c8f1ff94b4 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -75,7 +75,7 @@ bool wxMemoryDCImpl::CocoaUnlockFocus() void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { wxAutoNSAutoreleasePool pool; - if(m_selectedBitmap.Ok()) + if(m_selectedBitmap.IsOk()) { CocoaTakeFocus(); wxASSERT(m_cocoaNSImage); @@ -95,7 +95,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) [m_cocoaNSImage release]; m_cocoaNSImage = nil; m_selectedBitmap = bitmap; - if(m_selectedBitmap.Ok()) + if(m_selectedBitmap.IsOk()) { // Create an offscreen window of the same size m_cocoaNSImage = [[NSImage alloc] @@ -137,7 +137,7 @@ bool wxMemoryDCImpl::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { - if(!m_selectedBitmap.Ok()) + if(!m_selectedBitmap.IsOk()) return false; NSAffineTransform *transform = [NSAffineTransform transform]; diff --git a/src/cocoa/font.mm b/src/cocoa/font.mm index be2717fb1f..abb9ddd09e 100644 --- a/src/cocoa/font.mm +++ b/src/cocoa/font.mm @@ -350,7 +350,7 @@ wxFontEncoding wxFont::GetEncoding() const int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_info.pointSize; } @@ -364,7 +364,7 @@ bool wxFont::GetUnderlined() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_info.style; } @@ -375,13 +375,13 @@ wxFontFamily wxFont::DoGetFamily() const wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_info.weight; } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return &M_FONTDATA->m_info; } diff --git a/src/cocoa/icon.mm b/src/cocoa/icon.mm index 77a622e4f7..3dc3027c48 100644 --- a/src/cocoa/icon.mm +++ b/src/cocoa/icon.mm @@ -114,7 +114,7 @@ bool wxIcon::CreateFromXpm(const char* const* xpm) { wxBitmap bitmap(xpm); CopyFromBitmap(bitmap); - return Ok(); + return IsOk(); } bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, @@ -122,7 +122,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, { wxBitmap bitmap(filename, type); CopyFromBitmap(bitmap); - return bitmap.Ok(); + return bitmap.IsOk(); } void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) @@ -133,7 +133,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) M_ICONDATA->m_height = bitmap.GetHeight(); wxAutoNSAutoreleasePool pool; M_ICONDATA->m_cocoaNSImage = [bitmap.GetNSImage(true) retain]; - M_ICONDATA->m_ok = bitmap.Ok(); + M_ICONDATA->m_ok = bitmap.IsOk(); M_ICONDATA->m_numColors = 0; M_ICONDATA->m_quality = 0; } diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index 11b575fa95..b5d1daa220 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -225,7 +225,7 @@ void wxMenuItem::SetBitmaps(const wxBitmap& bmpChecked, } else { - wxASSERT_MSG(!bmpUnchecked.Ok(),wxT("Normal menu items should only have one bitmap")); + wxASSERT_MSG(!bmpUnchecked.IsOk(),wxT("Normal menu items should only have one bitmap")); [m_cocoaNSMenuItem setImage: bmpChecked.GetNSImage(true)]; } } diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index dac5bd30b7..69c6928528 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -231,12 +231,12 @@ wxArtProvider::~wxArtProvider() node; node = node->GetNext()) { bmp = node->GetData()->CreateBitmap(id, client, size); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) break; } wxSize sizeNeeded = size; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { // no bitmap created -- as a fallback, try if we can find desired // icon in a bundle diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index 49fbe51d33..542247d4ae 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -207,7 +207,7 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id, wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id); #if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) - if (bmp.Ok()) + if (bmp.IsOk()) { // fit into transparent image with desired size hint from the client if (reqSize == wxDefaultSize) diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index bae77c18ce..34bf85608e 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -156,7 +156,7 @@ wxBitmap::wxBitmap(const char* const* bits) #if wxUSE_IMAGE && wxUSE_XPM wxImage image(bits); - wxCHECK2_MSG(image.Ok(), return, wxT("invalid bitmap data")); + wxCHECK2_MSG(image.IsOk(), return, wxT("invalid bitmap data")); *this = wxBitmap(image); #else diff --git a/src/common/clrpickercmn.cpp b/src/common/clrpickercmn.cpp index 1f9622c886..510488dd11 100644 --- a/src/common/clrpickercmn.cpp +++ b/src/common/clrpickercmn.cpp @@ -84,7 +84,7 @@ void wxColourPickerCtrl::SetColour(const wxColour &col) bool wxColourPickerCtrl::SetColour(const wxString &text) { wxColour col(text); // smart wxString->wxColour conversion - if ( !col.Ok() ) + if ( !col.IsOk() ) return false; M_PICKER->SetColour(col); UpdateTextCtrlFromPicker(); @@ -105,7 +105,7 @@ void wxColourPickerCtrl::UpdatePickerFromTextCtrl() // wxString -> wxColour conversion wxColour col(m_text->GetValue()); - if ( !col.Ok() ) + if ( !col.IsOk() ) return; // invalid user input if (M_PICKER->GetColour() != col) diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index e3138fe06b..46c8b1f9d8 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -170,7 +170,7 @@ bool wxPrintData::IsOk() const { m_nativeData->TransferFrom( *this ); - return m_nativeData->Ok(); + return m_nativeData->IsOk(); } // ---------------------------------------------------------------------------- diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 7bbb17260f..013b17cee3 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -177,13 +177,13 @@ bool wxColourBase::FromString(const wxString& str) // because this place can be called from constructor // and 'this' could not be available yet wxColour clr = wxTheColourDatabase->Find(str); - if (clr.Ok()) + if (clr.IsOk()) Set((unsigned char)clr.Red(), (unsigned char)clr.Green(), (unsigned char)clr.Blue()); } - if (Ok()) + if (IsOk()) return true; wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str); diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 8b2ff1940b..ff3563c2db 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1172,7 +1172,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) // its platform default or bitmap+pushbutton background is used, but not if // there is vertical size adjustment or horizontal spacing. if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) || - (m_bmpNormal.Ok() && m_blankButtonBg) ) && + (m_bmpNormal.IsOk() && m_blankButtonBg) ) && m_btnSpacingX == 0 && m_btnHei <= 0 ) { @@ -1180,7 +1180,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) btnBorder = 0; } else if ( (m_iFlags & wxCC_BUTTON_COVERS_BORDER) && - m_btnSpacingX == 0 && !m_bmpNormal.Ok() ) + m_btnSpacingX == 0 && !m_bmpNormal.IsOk() ) { m_iFlags &= ~(wxCC_IFLAG_BUTTON_OUTSIDE); btnBorder = 0; @@ -1237,7 +1237,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) // It is larger // OR // button width is set to default and blank button bg is not drawn - if ( m_bmpNormal.Ok() ) + if ( m_bmpNormal.IsOk() ) { int bmpReqWidth = m_bmpNormal.GetWidth(); int bmpReqHeight = m_bmpNormal.GetHeight(); @@ -1259,7 +1259,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth ) { int newY = butHeight+(customBorder*2); SetClientSize(wxDefaultCoord,newY); - if ( m_bmpNormal.Ok() || m_btnArea.width != butWidth || m_btnArea.height != butHeight ) + if ( m_bmpNormal.IsOk() || m_btnArea.width != butWidth || m_btnArea.height != butHeight ) m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; else m_iFlags &= ~wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; @@ -1368,16 +1368,16 @@ wxSize wxComboCtrlBase::DoGetBestSize() const // TODO: Better method to calculate close-to-native control height. int fhei; - if ( m_font.Ok() ) + if ( m_font.IsOk() ) fhei = (m_font.GetPointSize()*2) + 5; - else if ( wxNORMAL_FONT->Ok() ) + else if ( wxNORMAL_FONT->IsOk() ) fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5; else fhei = sizeText.y + 4; // Need to force height to accomodate bitmap? int btnSizeY = m_btnSize.y; - if ( m_bmpNormal.Ok() && fhei < btnSizeY ) + if ( m_bmpNormal.IsOk() && fhei < btnSizeY ) fhei = btnSizeY; // Control height doesn't depend on border @@ -1702,7 +1702,7 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int flags ) dc.DrawRectangle(rect); } - if ( !m_bmpNormal.Ok() ) + if ( !m_bmpNormal.IsOk() ) { if ( flags & Button_BitmapOnly ) return; @@ -2564,17 +2564,17 @@ void wxComboCtrlBase::SetButtonBitmaps( const wxBitmap& bmpNormal, m_bmpNormal = bmpNormal; m_blankButtonBg = blankButtonBg; - if ( bmpPressed.Ok() ) + if ( bmpPressed.IsOk() ) m_bmpPressed = bmpPressed; else m_bmpPressed = bmpNormal; - if ( bmpHover.Ok() ) + if ( bmpHover.IsOk() ) m_bmpHover = bmpHover; else m_bmpHover = bmpNormal; - if ( bmpDisabled.Ok() ) + if ( bmpDisabled.IsOk() ) m_bmpDisabled = bmpDisabled; else m_bmpDisabled = bmpNormal; diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 82bcefd814..1382c3102c 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -588,7 +588,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const { wxSize best; wxBitmap bmp = GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) best = wxSize(bmp.GetWidth(), bmp.GetHeight()); else // this is completely arbitrary diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 02f5ee8a3e..d1e8ddea76 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -1182,7 +1182,7 @@ void wxDC::DrawLabel(const wxString& text, GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine); wxCoord width, height; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { width = widthText + bitmap.GetWidth(); height = bitmap.GetHeight(); @@ -1224,7 +1224,7 @@ void wxDC::DrawLabel(const wxString& text, wxCoord x0 = x, y0 = y, width0 = width; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { DrawBitmap(bitmap, x, y, true /* use mask */); diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 1a71c1d51c..449ad4791a 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -139,7 +139,7 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou ////////////////////code here m_outfile = new wxFileOutputStream(filename); - m_OK = m_outfile->Ok(); + m_OK = m_outfile->IsOk(); if (m_OK) { m_filename = filename; @@ -643,14 +643,14 @@ void wxSVGFileDCImpl::DoDrawBitmap(const class wxBitmap & bmp, wxCoord x, wxCoor { write(s); } - m_OK = m_outfile->Ok() && bPNG_OK; + m_OK = m_outfile->IsOk() && bPNG_OK; } void wxSVGFileDCImpl::write(const wxString &s) { const wxCharBuffer buf = s.utf8_str(); m_outfile->Write(buf, strlen((const char *)buf)); - m_OK = m_outfile->Ok(); + m_OK = m_outfile->IsOk(); } diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 680ff2bde4..34df0b1c27 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -1181,7 +1181,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event)) preview = new wxPrintPreview(printout, view->OnCreatePrintout(), &printDialogData); - if ( !preview->Ok() ) + if ( !preview->IsOk() ) { delete preview; wxLogError(_("Print preview creation failed.")); diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index bf6fbc2efe..f94b3f5d91 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -255,7 +255,7 @@ wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& #else #error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work #endif - if ( !is->Ok() ) + if ( !is->IsOk() ) { delete is; return NULL; diff --git a/src/common/fontpickercmn.cpp b/src/common/fontpickercmn.cpp index ff1ed56aee..6718668c01 100644 --- a/src/common/fontpickercmn.cpp +++ b/src/common/fontpickercmn.cpp @@ -137,7 +137,7 @@ void wxFontPickerCtrl::UpdatePickerFromTextCtrl() // string returned by wxFont::GetNativeFontInfoDesc() and not // the user-friendly one returned by wxFont::GetNativeFontInfoUserDesc() wxFont f = String2Font(m_text->GetValue()); - if (!f.Ok()) + if (!f.IsOk()) return; // invalid user input if (M_PICKER->GetSelectedFont() != f) diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 3ad28089e6..e306437de4 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -253,7 +253,7 @@ wxMemoryFSHandler::AddFile(const wxString& filename, return; wxMemoryOutputStream mems; - if ( image.Ok() && image.SaveFile(mems, type) ) + if ( image.IsOk() && image.SaveFile(mems, type) ) { m_Hash[filename] = new wxMemoryFSFile ( diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index ae77931ca7..d1bc22eeec 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -587,9 +587,9 @@ wxSocketBase *wxFTP::GetActivePort() addrNew.Service(0); // pick an open port number. wxSocketServer *sockSrv = new wxSocketServer(addrNew); - if (!sockSrv->Ok()) + if (!sockSrv->IsOk()) { - // We use Ok() here to see if everything is ok + // We use IsOk() here to see if everything is ok m_lastError = wxPROTO_PROTERR; delete sockSrv; return NULL; diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index b6325e6d15..885ebec144 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -499,7 +499,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& name) static wxColour s_col; s_col = Find(name); - if ( !s_col.Ok() ) + if ( !s_col.IsOk() ) return NULL; return new wxColour(s_col); @@ -780,7 +780,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, wxPenStyle wxPen* pen = NULL; wxPen penTmp(colour, width, style); - if (penTmp.Ok()) + if (penTmp.IsOk()) { pen = new wxPen(penTmp); list.Append(pen); @@ -802,7 +802,7 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, wxBrushStyle st wxBrush* brush = NULL; wxBrush brushTmp(colour, style); - if (brushTmp.Ok()) + if (brushTmp.IsOk()) { brush = new wxBrush(brushTmp); list.Append(brush); @@ -872,7 +872,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize, // font not found, create the new one font = NULL; wxFont fontTmp(pointSize, family, style, weight, underline, facename, encoding); - if (fontTmp.Ok()) + if (fontTmp.IsOk()) { font = new wxFont(fontTmp); list.Append(font); diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index 36e8ed276e..cd119826f2 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -138,7 +138,7 @@ bool wxGIFDecoder::ConvertToImage(unsigned int frame, wxImage *image) const image->Create(sz.GetWidth(), sz.GetHeight()); image->SetType(wxBITMAP_TYPE_GIF); - if (!image->Ok()) + if (!image->IsOk()) return false; pal = GetPalette(frame); diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index 94c1327432..4d9e2dd144 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -66,7 +66,7 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const bool wxGLCanvasBase::SetColour(const wxString& colour) { wxColour col = wxTheColourDatabase->Find(colour); - if ( !col.Ok() ) + if ( !col.IsOk() ) return false; #ifdef wxHAS_OPENGL_ES diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index 665621e274..34dae699a5 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -595,7 +595,7 @@ void wxGraphicsContext::SetPen( const wxGraphicsPen& pen ) void wxGraphicsContext::SetPen( const wxPen& pen ) { - if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) SetPen( wxNullGraphicsPen ); else SetPen( CreatePen( pen ) ); @@ -609,7 +609,7 @@ void wxGraphicsContext::SetBrush( const wxGraphicsBrush& brush ) void wxGraphicsContext::SetBrush( const wxBrush& brush ) { - if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) SetBrush( wxNullGraphicsBrush ); else SetBrush( CreateBrush( brush ) ); @@ -623,7 +623,7 @@ void wxGraphicsContext::SetFont( const wxGraphicsFont& font ) void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour ) { - if ( font.Ok() ) + if ( font.IsOk() ) SetFont( CreateFont( font, colour ) ); else SetFont( wxNullGraphicsFont ); diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index b59a47864e..186d4df0cc 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -163,7 +163,7 @@ void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type) if ( type == wxBITMAP_TYPE_ICON_RESOURCE ) { wxIcon tmp(file, type); - if (tmp.Ok()) + if (tmp.IsOk()) { AddIcon(tmp); return; @@ -245,7 +245,7 @@ wxIcon wxIconBundle::GetIcon(const wxSize& size) const wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const { wxIcon icon = GetIcon(size); - if ( icon.Ok() && + if ( icon.IsOk() && (icon.GetWidth() != size.x || icon.GetHeight() != size.y) ) { icon = wxNullIcon; @@ -267,7 +267,7 @@ void wxIconBundle::AddIcon(const wxIcon& icon) for ( size_t i = 0; i < count; ++i ) { wxIcon& tmp = iconArray[i]; - if ( tmp.Ok() && + if ( tmp.IsOk() && tmp.GetWidth() == icon.GetWidth() && tmp.GetHeight() == icon.GetHeight() ) { diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 875da6e3f0..71dd36d635 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -91,7 +91,7 @@ bool wxBMPHandler::SaveDib(wxImage *image, { wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") ); - if ( !image->Ok() ) + if ( !image->IsOk() ) { if ( verbose ) { @@ -351,7 +351,7 @@ bool wxBMPHandler::SaveDib(wxImage *image, // pointer to the image data, use quantized if available wxUint8 *data = (wxUint8*) image->GetData(); - if (q_image) if (q_image->Ok()) data = (wxUint8*) q_image->GetData(); + if (q_image) if (q_image->IsOk()) data = (wxUint8*) q_image->GetData(); wxUint8 *buffer = new wxUint8[row_width]; memset(buffer, 0, row_width); @@ -1249,7 +1249,7 @@ bool wxICOHandler::SaveFile(wxImage *image, // wxCountingOutputStream::IsOk() always returns true for now and this // "if" provokes VC++ warnings in optimized build #if 0 - if ( !cStream.Ok() ) + if ( !cStream.IsOk() ) { if ( verbose ) { diff --git a/src/common/image.cpp b/src/common/image.cpp index de87a34257..0cb1adf788 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -140,7 +140,7 @@ bool wxImage::Create(const char* const* xpmData) wxXPMDecoder decoder; (*this) = decoder.ReadData(xpmData); - return Ok(); + return IsOk(); #else return false; #endif @@ -258,7 +258,7 @@ wxImage wxImage::MakeEmptyClone(int flags) const { wxImage image; - wxCHECK_MSG( Ok(), image, wxS("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxS("invalid image") ); long height = M_IMGDATA->m_height; long width = M_IMGDATA->m_width; @@ -293,7 +293,7 @@ wxImage wxImage::Copy() const { wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); image.m_refData = CloneRefData(m_refData); @@ -307,7 +307,7 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); // can't scale to/from 0 size wxCHECK_MSG( (xFactor > 0) && (yFactor > 0), image, @@ -426,7 +426,7 @@ wxImage::Scale( int width, int height, wxImageResizeQuality quality ) const { wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); // can't scale to/from 0 size wxCHECK_MSG( (width > 0) && (height > 0), image, @@ -856,7 +856,7 @@ wxImage wxImage::BlurHorizontal(int blurRadius) const { wxImage ret_image(MakeEmptyClone()); - wxCHECK( ret_image.Ok(), ret_image ); + wxCHECK( ret_image.IsOk(), ret_image ); const unsigned char* src_data = M_IMGDATA->m_data; unsigned char* dst_data = ret_image.GetData(); @@ -959,7 +959,7 @@ wxImage wxImage::BlurVertical(int blurRadius) const { wxImage ret_image(MakeEmptyClone()); - wxCHECK( ret_image.Ok(), ret_image ); + wxCHECK( ret_image.IsOk(), ret_image ); const unsigned char* src_data = M_IMGDATA->m_data; unsigned char* dst_data = ret_image.GetData(); @@ -1074,7 +1074,7 @@ wxImage wxImage::Rotate90( bool clockwise ) const { wxImage image(MakeEmptyClone(Clone_SwapOrientation)); - wxCHECK( image.Ok(), image ); + wxCHECK( image.IsOk(), image ); long height = M_IMGDATA->m_height; long width = M_IMGDATA->m_width; @@ -1168,7 +1168,7 @@ wxImage wxImage::Rotate180() const { wxImage image(MakeEmptyClone()); - wxCHECK( image.Ok(), image ); + wxCHECK( image.IsOk(), image ); long height = M_IMGDATA->m_height; long width = M_IMGDATA->m_width; @@ -1221,7 +1221,7 @@ wxImage wxImage::Mirror( bool horizontally ) const { wxImage image(MakeEmptyClone()); - wxCHECK( image.Ok(), image ); + wxCHECK( image.IsOk(), image ); long height = M_IMGDATA->m_height; long width = M_IMGDATA->m_width; @@ -1298,7 +1298,7 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const { wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()), @@ -1351,7 +1351,7 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos, { wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); wxCHECK_MSG( (size.GetWidth() > 0) && (size.GetHeight() > 0), image, wxT("invalid size") ); int width = GetWidth(), height = GetHeight(); @@ -1399,8 +1399,8 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos, void wxImage::Paste( const wxImage &image, int x, int y ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); - wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); + wxCHECK_RET( image.IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -1503,7 +1503,7 @@ void wxImage::Paste( const wxImage &image, int x, int y ) void wxImage::Replace( unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2 ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -1534,7 +1534,7 @@ wxImage wxImage::ConvertToGreyscale(double weight_r, double weight_g, double wei { wxImage image(MakeEmptyClone()); - wxCHECK( image.Ok(), image ); + wxCHECK( image.IsOk(), image ); const unsigned char *src = M_IMGDATA->m_data; unsigned char *dest = image.GetData(); @@ -1568,7 +1568,7 @@ wxImage wxImage::ConvertToMono( unsigned char r, unsigned char g, unsigned char { wxImage image; - wxCHECK_MSG( Ok(), image, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), image, wxT("invalid image") ); image.Create( M_IMGDATA->m_width, M_IMGDATA->m_height, false ); @@ -1631,14 +1631,14 @@ wxImage wxImage::ConvertToDisabled(unsigned char brightness) const int wxImage::GetWidth() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid image") ); return M_IMGDATA->m_width; } int wxImage::GetHeight() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid image") ); return M_IMGDATA->m_height; } @@ -1662,7 +1662,7 @@ void wxImage::SetType(wxBitmapType type) long wxImage::XYToIndex(int x, int y) const { - if ( Ok() && + if ( IsOk() && x >= 0 && y >= 0 && x < M_IMGDATA->m_width && y < M_IMGDATA->m_height ) { @@ -1688,7 +1688,7 @@ void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned c void wxImage::SetRGB( const wxRect& rect_, unsigned char r, unsigned char g, unsigned char b ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -1764,14 +1764,14 @@ bool wxImage::IsOk() const unsigned char *wxImage::GetData() const { - wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), (unsigned char *)NULL, wxT("invalid image") ); return M_IMGDATA->m_data; } void wxImage::SetData( unsigned char *data, bool static_data ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); wxImageRefData *newRefData = new wxImageRefData(); @@ -1872,7 +1872,7 @@ wxImage::ConvertColourToAlpha(unsigned char r, unsigned char g, unsigned char b) void wxImage::SetAlpha( unsigned char *alpha, bool static_data ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -1890,7 +1890,7 @@ void wxImage::SetAlpha( unsigned char *alpha, bool static_data ) unsigned char *wxImage::GetAlpha() const { - wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), (unsigned char *)NULL, wxT("invalid image") ); return M_IMGDATA->m_alpha; } @@ -1948,7 +1948,7 @@ void wxImage::ClearAlpha() void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -1960,7 +1960,7 @@ void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const { - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); if (M_IMGDATA->m_hasMask) { @@ -1978,28 +1978,28 @@ bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned unsigned char wxImage::GetMaskRed() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid image") ); return M_IMGDATA->m_maskRed; } unsigned char wxImage::GetMaskGreen() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid image") ); return M_IMGDATA->m_maskGreen; } unsigned char wxImage::GetMaskBlue() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid image") ); return M_IMGDATA->m_maskBlue; } void wxImage::SetMask( bool mask ) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -2008,7 +2008,7 @@ void wxImage::SetMask( bool mask ) bool wxImage::HasMask() const { - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); return M_IMGDATA->m_hasMask; } @@ -2155,22 +2155,22 @@ bool wxImage::ConvertAlphaToMask(unsigned char mr, bool wxImage::HasPalette() const { - if (!Ok()) + if (!IsOk()) return false; - return M_IMGDATA->m_palette.Ok(); + return M_IMGDATA->m_palette.IsOk(); } const wxPalette& wxImage::GetPalette() const { - wxCHECK_MSG( Ok(), wxNullPalette, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), wxNullPalette, wxT("invalid image") ); return M_IMGDATA->m_palette; } void wxImage::SetPalette(const wxPalette& palette) { - wxCHECK_RET( Ok(), wxT("invalid image") ); + wxCHECK_RET( IsOk(), wxT("invalid image") ); AllocExclusive(); @@ -2292,7 +2292,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), wxBitmapType WXUNUSED_UNLESS_STREAMS(type) ) const { #if HAS_FILE_STREAMS - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); @@ -2312,7 +2312,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename), const wxString& WXUNUSED_UNLESS_STREAMS(mimetype) ) const { #if HAS_FILE_STREAMS - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename); @@ -2343,7 +2343,7 @@ int wxImage::GetImageCount( const wxString& WXUNUSED_UNLESS_STREAMS(name), { #if HAS_FILE_STREAMS wxImageFileInputStream stream(name); - if (stream.Ok()) + if (stream.IsOk()) return GetImageCount(stream, type); #endif @@ -2545,7 +2545,7 @@ bool wxImage::DoSave(wxImageHandler& handler, wxOutputStream& stream) const bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) const { - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); wxImageHandler *handler = FindHandler(type); if ( !handler ) @@ -2559,7 +2559,7 @@ bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) const bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) const { - wxCHECK_MSG( Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid image") ); wxImageHandler *handler = FindHandlerMime(mimetype); if ( !handler ) diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index bf214b15c8..f71aaf3f7b 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -140,7 +140,7 @@ bool wxIFFDecoder::ConvertToImage(wxImage *image) const // create the image image->Create(GetWidth(), GetHeight()); - if (!image->Ok()) + if (!image->IsOk()) return false; unsigned char *pal = GetPalette(); diff --git a/src/common/imagjpeg.cpp b/src/common/imagjpeg.cpp index 51ba2d1e9c..2a24dce990 100644 --- a/src/common/imagjpeg.cpp +++ b/src/common/imagjpeg.cpp @@ -257,7 +257,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos } (cinfo.src->term_source)(&cinfo); jpeg_destroy_decompress(&cinfo); - if (image->Ok()) image->Destroy(); + if (image->IsOk()) image->Destroy(); return false; } @@ -291,7 +291,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos jpeg_start_decompress( &cinfo ); image->Create( cinfo.output_width, cinfo.output_height ); - if (!image->Ok()) { + if (!image->IsOk()) { jpeg_finish_decompress( &cinfo ); jpeg_destroy_decompress( &cinfo ); return false; diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 09a4612cbf..fdbb60c16d 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -214,7 +214,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream) image->Create(width, height); - if (!image->Ok()) + if (!image->IsOk()) return wxPCX_MEMERR; if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL) @@ -331,7 +331,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream) // according to PCX specs) and allocate space for one complete // scanline. - if (!image->Ok()) + if (!image->IsOk()) return wxPCX_INVFORMAT; width = image->GetWidth(); diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 5b151d568d..578d0baf6d 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -558,7 +558,7 @@ wxPNGHandler::LoadFile(wxImage *image, image->Create((int)width, (int)height, (bool) false /* no need to init pixels */); - if (!image->Ok()) + if (!image->IsOk()) goto error; // initialize all line pointers to NULL to ensure that they can be safely @@ -660,7 +660,7 @@ error: wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory.")); } - if ( image->Ok() ) + if ( image->IsOk() ) { image->Destroy(); } diff --git a/src/common/imagtga.cpp b/src/common/imagtga.cpp index 319324ef9a..e7203f3065 100644 --- a/src/common/imagtga.cpp +++ b/src/common/imagtga.cpp @@ -227,7 +227,7 @@ int ReadTGA(wxImage* image, wxInputStream& stream) image->Create(width, height); - if (!image->Ok()) + if (!image->IsOk()) { return wxTGA_MEMERR; } diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 5e69ff9f5b..2501e91f3e 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -344,7 +344,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos } image->Create( (int)w, (int)h ); - if (!image->Ok()) + if (!image->IsOk()) { if (verbose) { diff --git a/src/common/imagxpm.cpp b/src/common/imagxpm.cpp index 2850e770e6..de2530e84c 100644 --- a/src/common/imagxpm.cpp +++ b/src/common/imagxpm.cpp @@ -97,7 +97,7 @@ bool wxXPMHandler::LoadFile(wxImage *image, wxXPMDecoder decoder; wxImage img = decoder.ReadFile(stream); - if ( !img.Ok() ) + if ( !img.IsOk() ) return false; *image = img; return true; diff --git a/src/common/overlaycmn.cpp b/src/common/overlaycmn.cpp index eeb08b7cdd..f08cb238e5 100644 --- a/src/common/overlaycmn.cpp +++ b/src/common/overlaycmn.cpp @@ -139,7 +139,7 @@ wxOverlayImpl::~wxOverlayImpl() bool wxOverlayImpl::IsOk() { - return m_bmpSaved.Ok() ; + return m_bmpSaved.IsOk() ; } void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height ) diff --git a/src/common/ownerdrwcmn.cpp b/src/common/ownerdrwcmn.cpp index e9163b6829..29e646a163 100644 --- a/src/common/ownerdrwcmn.cpp +++ b/src/common/ownerdrwcmn.cpp @@ -93,11 +93,11 @@ void wxOwnerDrawnBase::GetColourToUse(wxODStatus stat, wxColour& colText, wxColo } else { - colText = m_colText.Ok() ? m_colText + colText = m_colText.IsOk() ? m_colText : wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT); } - colBack = m_colBack.Ok() ? m_colBack + colBack = m_colBack.IsOk() ? m_colBack : wxSystemSettings::GetColour(wxSYS_COLOUR_MENU); } } diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index c9e587b700..afc15eec5c 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -1989,7 +1989,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) { m_previewBitmap = new wxBitmap(pageRect.width, pageRect.height); - if (!m_previewBitmap || !m_previewBitmap->Ok()) + if (!m_previewBitmap || !m_previewBitmap->IsOk()) { InvalidatePreviewBitmap(); wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK); @@ -2210,7 +2210,7 @@ int wxPrintPreview::GetMinPage() const bool wxPrintPreview::IsOk() const { - return m_pimpl->Ok(); + return m_pimpl->IsOk(); } void wxPrintPreview::SetOk(bool ok) diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp index 57b311ec3a..cbd53cc468 100644 --- a/src/common/quantize.cpp +++ b/src/common/quantize.cpp @@ -1546,7 +1546,7 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE) { - if (!dest.Ok()) + if (!dest.IsOk()) dest.Create(w, h); imgdt = dest.GetData(); diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index 1b87a7d421..cccbd9c891 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -45,7 +45,7 @@ wxFileProto::~wxFileProto() wxInputStream *wxFileProto::GetInputStream(const wxString& path) { wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path)); - if ( retval->Ok() ) + if ( retval->IsOk() ) { m_lastError = wxPROTO_NOERR; return retval; diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 0f1173baa6..31d1273191 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -498,7 +498,7 @@ bool wxTCPServer::Create(const wxString& serverName) delete addr; - if (!m_server->Ok()) + if (!m_server->IsOk()) { m_server->Destroy(); m_server = NULL; @@ -877,7 +877,7 @@ void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event) wxSocketBase *sock = server->Accept(); if (!sock) return; - if (!sock->Ok()) + if (!sock->IsOk()) { sock->Destroy(); return; diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 8288e947d4..ced3746df2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -757,7 +757,7 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out) { #if wxUSE_IMAGE out = in.ConvertToGreyscale(); - if ( out.Ok() ) + if ( out.IsOk() ) return true; #endif // wxUSE_IMAGE return false; diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index d38b4dfbb0..96f70e5d47 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -143,8 +143,8 @@ wxTextAttr::wxTextAttr(const wxColour& colText, { Init(); - if (m_colText.Ok()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR; - if (m_colBack.Ok()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; + if (m_colText.IsOk()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR; + if (m_colBack.IsOk()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; if (alignment != wxTEXT_ALIGNMENT_DEFAULT) m_flags |= wxTEXT_ATTR_ALIGNMENT; @@ -422,7 +422,7 @@ wxFont wxTextAttr::GetFont() const // Get attributes from font. bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags) { - if (!font.Ok()) + if (!font.IsOk()) return false; if (flags & wxTEXT_ATTR_FONT_SIZE) @@ -518,13 +518,13 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith) destStyle.SetFontFamily(style.GetFontFamily()); } - if (style.GetTextColour().Ok() && style.HasTextColour()) + if (style.GetTextColour().IsOk() && style.HasTextColour()) { if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour())) destStyle.SetTextColour(style.GetTextColour()); } - if (style.GetBackgroundColour().Ok() && style.HasBackgroundColour()) + if (style.GetBackgroundColour().IsOk() && style.HasBackgroundColour()) { if (!(compareWith && compareWith->HasBackgroundColour() && compareWith->GetBackgroundColour() == style.GetBackgroundColour())) destStyle.SetBackgroundColour(style.GetBackgroundColour()); @@ -670,30 +670,30 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr, if (attr.HasFont()) font = attr.GetFont(); - if ( !font.Ok() ) + if ( !font.IsOk() ) { if (attrDef.HasFont()) font = attrDef.GetFont(); - if ( text && !font.Ok() ) + if ( text && !font.IsOk() ) font = text->GetFont(); } wxColour colFg = attr.GetTextColour(); - if ( !colFg.Ok() ) + if ( !colFg.IsOk() ) { colFg = attrDef.GetTextColour(); - if ( text && !colFg.Ok() ) + if ( text && !colFg.IsOk() ) colFg = text->GetForegroundColour(); } wxColour colBg = attr.GetBackgroundColour(); - if ( !colBg.Ok() ) + if ( !colBg.IsOk() ) { colBg = attrDef.GetBackgroundColour(); - if ( text && !colBg.Ok() ) + if ( text && !colBg.IsOk() ) colBg = text->GetBackgroundColour(); } diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index ceee633abf..5d452fab3d 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -352,7 +352,7 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon) // passing wxNullIcon to SetIcon() is possible (it means that we shouldn't // have any icon), but adding an invalid icon to wxIconBundle is not wxIconBundle icons; - if ( icon.Ok() ) + if ( icon.IsOk() ) icons.AddIcon(icon); SetIcons(icons); diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 15908b65e7..6e9a224e9d 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1536,7 +1536,7 @@ wxColour wxGetColourFromUser(wxWindow *parent, wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption) { wxFontData data; - if ( fontInit.Ok() ) + if ( fontInit.IsOk() ) { data.SetInitialFont(fontInit); } diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 77729d68c6..2d34340f70 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1528,7 +1528,7 @@ wxColour wxWindowBase::GetBackgroundColour() const // wxWidgets versions where GetBackgroundColour() always returned // something -- so give them something even if it doesn't make sense // for this window (e.g. it has a themed background) - if ( !colBg.Ok() ) + if ( !colBg.IsOk() ) colBg = GetClassDefaultAttributes().colBg; return colBg; @@ -1540,7 +1540,7 @@ wxColour wxWindowBase::GetBackgroundColour() const wxColour wxWindowBase::GetForegroundColour() const { // logic is the same as above - if ( !m_hasFgCol && !m_foregroundColour.Ok() ) + if ( !m_hasFgCol && !m_foregroundColour.IsOk() ) { wxColour colFg = GetDefaultAttributes().colFg; @@ -1562,7 +1562,7 @@ bool wxWindowBase::SetBackgroundColour( const wxColour &colour ) m_inheritBgCol = m_hasBgCol; m_backgroundColour = colour; - SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() ); + SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.IsOk() ); return true; } @@ -1574,7 +1574,7 @@ bool wxWindowBase::SetForegroundColour( const wxColour &colour ) m_hasFgCol = colour.IsOk(); m_inheritFgCol = m_hasFgCol; m_foregroundColour = colour; - SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.Ok() ); + SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.IsOk() ); return true; } diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 7a5b619a35..4902738a07 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -1341,7 +1341,7 @@ void wxZipInputStream::Init(const wxString& file) ffile = static_cast(m_parent_i_stream); wxZipEntryPtr_ entry; - if (ffile->Ok()) { + if (ffile->IsOk()) { do { entry.reset(GetNextEntry()); } diff --git a/src/dfb/bitmap.cpp b/src/dfb/bitmap.cpp index 35206ace5f..9e472a0edd 100644 --- a/src/dfb/bitmap.cpp +++ b/src/dfb/bitmap.cpp @@ -193,7 +193,7 @@ CreateSurfaceWithFormat(int w, int h, DFBSurfacePixelFormat format) // Creates a surface that will use wxImage's pixel data (RGB only) wxIDirectFBSurfacePtr CreateSurfaceForImage(const wxImage& image) { - wxCHECK_MSG( image.Ok(), NULL, "invalid image" ); + wxCHECK_MSG( image.IsOk(), NULL, "invalid image" ); // FIXME_DFB: implement alpha handling by merging alpha buffer with RGB // into a temporary RGBA surface wxCHECK_MSG( !image.HasAlpha(), NULL, "alpha channel not supported" ); @@ -423,7 +423,7 @@ bool wxBitmap::CreateWithFormat(int width, int height, int dfbFormat) #if wxUSE_IMAGE wxBitmap::wxBitmap(const wxImage& imageOrig, int depth) { - wxCHECK_RET( imageOrig.Ok(), wxT("invalid image") ); + wxCHECK_RET( imageOrig.IsOk(), wxT("invalid image") ); wxImage image(imageOrig); @@ -469,7 +469,7 @@ wxBitmap::wxBitmap(const wxImage& imageOrig, int depth) wxImage wxBitmap::ConvertToImage() const { - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); wxImage img(GetWidth(), GetHeight()); wxIDirectFBSurfacePtr src = M_BITMAP->m_surface; @@ -505,7 +505,7 @@ wxImage wxBitmap::ConvertToImage() const void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { - wxCHECK_MSG( Ok(), NULL, "invalid bitmap" ); + wxCHECK_MSG( IsOk(), NULL, "invalid bitmap" ); AllocExclusive(); @@ -543,7 +543,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data)) bool wxBitmap::HasAlpha() const { - wxCHECK_MSG( Ok(), false, "invalid bitmap" ); + wxCHECK_MSG( IsOk(), false, "invalid bitmap" ); return M_BITMAP->m_surface->GetPixelFormat() == DSPF_ARGB; } @@ -568,7 +568,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); int h = -1; M_BITMAP->m_surface->GetSize(NULL, &h); @@ -577,7 +577,7 @@ int wxBitmap::GetHeight() const int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); int w = -1; M_BITMAP->m_surface->GetSize(&w, NULL); @@ -586,21 +586,21 @@ int wxBitmap::GetWidth() const int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BITMAP->m_surface->GetDepth(); } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BITMAP->m_mask; } void wxBitmap::SetMask(wxMask *mask) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); AllocExclusive(); delete M_BITMAP->m_mask; @@ -615,7 +615,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && rect.x >= 0 && rect.y >= 0 && rect.x+rect.width <= GetWidth() && rect.y+rect.height <= GetHeight(), @@ -638,7 +638,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type) if ( handler == NULL ) { wxImage image; - if ( !image.LoadFile(name, type) || !image.Ok() ) + if ( !image.LoadFile(name, type) || !image.IsOk() ) { wxLogError(_("No bitmap handler for type %d defined."), type); return false; @@ -658,7 +658,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type) #warning "to common code" bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const { - wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") ); wxBitmapHandler *handler = FindHandler(type); @@ -670,7 +670,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal image.SetPalette(*palette); #endif // wxUSE_PALETTE - if ( image.Ok() ) + if ( image.IsOk() ) return image.SaveFile(filename, type); else { @@ -685,20 +685,20 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal #if wxUSE_PALETTE wxPalette *wxBitmap::GetPalette() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BITMAP->m_palette; } void wxBitmap::SetPalette(const wxPalette& palette) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") ); AllocExclusive(); wxDELETE(M_BITMAP->m_palette); - if ( !palette.Ok() ) return; + if ( !palette.IsOk() ) return; M_BITMAP->m_palette = new wxPalette(palette); } @@ -741,7 +741,7 @@ void wxBitmap::SetDepth(int depth) wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BITMAP->m_surface; } diff --git a/src/dfb/brush.cpp b/src/dfb/brush.cpp index 87ba89e309..620a04aed9 100644 --- a/src/dfb/brush.cpp +++ b/src/dfb/brush.cpp @@ -91,14 +91,14 @@ bool wxBrush::operator==(const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index 02bc3d22fa..0f00dfffbf 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -346,7 +346,7 @@ void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y) // if background mode is solid, DrawText must paint text's background: if ( m_backgroundMode == wxSOLID ) { - wxCHECK_RET( m_textBackgroundColour.Ok(), + wxCHECK_RET( m_textBackgroundColour.IsOk(), wxT("invalid background color") ); SelectColour(m_textBackgroundColour); @@ -354,7 +354,7 @@ void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y) } // finally draw the text itself: - wxCHECK_RET( m_textForegroundColour.Ok(), + wxCHECK_RET( m_textForegroundColour.IsOk(), wxT("invalid foreground color") ); SelectColour(m_textForegroundColour); m_surface->DrawString(text.utf8_str(), -1, xx, yy, DSTF_LEFT | DSTF_TOP); @@ -379,14 +379,14 @@ void wxDFBDCImpl::DoDrawRotatedText(const wxString& WXUNUSED(text), void wxDFBDCImpl::SetPen(const wxPen& pen) { - m_pen = pen.Ok() ? pen : DEFAULT_PEN; + m_pen = pen.IsOk() ? pen : DEFAULT_PEN; SelectColour(m_pen.GetColour()); } void wxDFBDCImpl::SetBrush(const wxBrush& brush) { - m_brush = brush.Ok() ? brush : DEFAULT_BRUSH; + m_brush = brush.IsOk() ? brush : DEFAULT_BRUSH; } void wxDFBDCImpl::SelectColour(const wxColour& clr) @@ -408,7 +408,7 @@ void wxDFBDCImpl::SetFont(const wxFont& font) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); - wxFont f(font.Ok() ? font : DEFAULT_FONT); + wxFont f(font.IsOk() ? font : DEFAULT_FONT); wxFont oldfont(m_font); @@ -431,7 +431,7 @@ void wxDFBDCImpl::SetBackground(const wxBrush& brush) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); - if (!brush.Ok()) return; + if (!brush.IsOk()) return; m_backgroundBrush = brush; } @@ -478,7 +478,7 @@ void wxDFBDCImpl::EndPage() wxCoord wxDFBDCImpl::GetCharHeight() const { wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") ); - wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") ); + wxCHECK_MSG( m_font.IsOk(), -1, wxT("no font selected") ); int h = -1; GetCurrentFont()->GetHeight(&h); @@ -488,7 +488,7 @@ wxCoord wxDFBDCImpl::GetCharHeight() const wxCoord wxDFBDCImpl::GetCharWidth() const { wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") ); - wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") ); + wxCHECK_MSG( m_font.IsOk(), -1, wxT("no font selected") ); int w = -1; GetCurrentFont()->GetStringWidth("H", 1, &w); @@ -502,8 +502,8 @@ void wxDFBDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y const wxFont *theFont) const { wxCHECK_RET( IsOk(), wxT("invalid dc") ); - wxCHECK_RET( m_font.Ok(), wxT("no font selected") ); - wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") ); + wxCHECK_RET( m_font.IsOk(), wxT("no font selected") ); + wxCHECK_RET( !theFont || theFont->IsOk(), wxT("invalid font") ); wxFont oldFont; if ( theFont != NULL ) @@ -640,7 +640,7 @@ bool wxDFBDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, void wxDFBDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") ); DoDrawSubBitmap(bmp, 0, 0, bmp.GetWidth(), bmp.GetHeight(), @@ -659,7 +659,7 @@ void wxDFBDCImpl::DoDrawSubBitmap(const wxBitmap &bmp, wxCoord destx, wxCoord desty, int rop, bool useMask) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") ); // NB: we could also support XOR here (via DSBLIT_XOR) // and possibly others via SetSrc/DstBlendFunction() diff --git a/src/dfb/dcmemory.cpp b/src/dfb/dcmemory.cpp index 5c77771059..8929ca41ce 100644 --- a/src/dfb/dcmemory.cpp +++ b/src/dfb/dcmemory.cpp @@ -65,7 +65,7 @@ void wxMemoryDCImpl::DoSelect(const wxBitmap& bitmap) { m_bmp = bitmap; - if ( !bitmap.Ok() ) + if ( !bitmap.IsOk() ) { // select the bitmap out of the DC m_surface = NULL; diff --git a/src/dfb/font.cpp b/src/dfb/font.cpp index cb36d55968..4311923e67 100644 --- a/src/dfb/font.cpp +++ b/src/dfb/font.cpp @@ -75,7 +75,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); // we don't support DC scaling yet, so use scale=1 wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased); @@ -84,14 +84,14 @@ wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); } @@ -103,21 +103,21 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } @@ -125,21 +125,21 @@ bool wxFont::GetUnderlined() const wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); } bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->IsFixedWidth(); } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); return M_FONTDATA->GetNativeFontInfo(); } diff --git a/src/dfb/pen.cpp b/src/dfb/pen.cpp index 5b70c698bf..f1b9f9d686 100644 --- a/src/dfb/pen.cpp +++ b/src/dfb/pen.cpp @@ -155,7 +155,7 @@ wxDash* wxPen::GetDash() const wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); wxFAIL_MSG( "GetCap not implemented" ); return wxCAP_INVALID; @@ -163,7 +163,7 @@ wxPenCap wxPen::GetCap() const wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); wxFAIL_MSG( "GetJoin not implemented" ); return wxJOIN_INVALID; @@ -171,28 +171,28 @@ wxPenJoin wxPen::GetJoin() const wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return 1; } wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } wxBitmap *wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); wxFAIL_MSG( "GetStipple not implemented" ); return NULL; diff --git a/src/dfb/region.cpp b/src/dfb/region.cpp index f30e4be345..7a2cb28b7d 100644 --- a/src/dfb/region.cpp +++ b/src/dfb/region.cpp @@ -149,13 +149,13 @@ bool wxRegion::DoUnionWithRect(const wxRect& rect) bool wxRegion::DoUnionWithRegion(const wxRegion& region) { - wxCHECK_MSG( region.Ok(), false, "invalid region" ); + wxCHECK_MSG( region.IsOk(), false, "invalid region" ); return DoUnionWithRect(M_REGION_OF(region)->m_rect); } bool wxRegion::DoIntersect(const wxRegion& region) { - wxCHECK_MSG( region.Ok(), false, "invalid region" ); + wxCHECK_MSG( region.IsOk(), false, "invalid region" ); AllocExclusive(); M_REGION->m_rect.Intersect(M_REGION_OF(region)->m_rect); @@ -164,8 +164,8 @@ bool wxRegion::DoIntersect(const wxRegion& region) bool wxRegion::DoSubtract(const wxRegion& region) { - wxCHECK_MSG( region.Ok(), false, "invalid region" ); - wxCHECK_MSG( Ok(), false, "invalid region" ); + wxCHECK_MSG( region.IsOk(), false, "invalid region" ); + wxCHECK_MSG( IsOk(), false, "invalid region" ); const wxRect& rect = M_REGION_OF(region)->m_rect; @@ -190,7 +190,7 @@ bool wxRegion::DoSubtract(const wxRegion& region) bool wxRegion::DoXor(const wxRegion& region) { - wxCHECK_MSG( region.Ok(), false, "invalid region" ); + wxCHECK_MSG( region.IsOk(), false, "invalid region" ); wxFAIL_MSG( "Xor not implemented" ); return false; } @@ -202,7 +202,7 @@ bool wxRegion::DoXor(const wxRegion& region) wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const { - wxCHECK_MSG( Ok(), wxOutRegion, "invalid region" ); + wxCHECK_MSG( IsOk(), wxOutRegion, "invalid region" ); if (M_REGION->m_rect.Contains(x, y)) return wxInRegion; @@ -212,7 +212,7 @@ wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const wxRegionContain wxRegion::DoContainsRect(const wxRect& rect) const { - wxCHECK_MSG( Ok(), wxOutRegion, "invalid region" ); + wxCHECK_MSG( IsOk(), wxOutRegion, "invalid region" ); // 1) is the rectangle entirely covered by the region? if (M_REGION->m_rect.Contains(rect)) diff --git a/src/dfb/window.cpp b/src/dfb/window.cpp index 51707653a8..06d9619065 100644 --- a/src/dfb/window.cpp +++ b/src/dfb/window.cpp @@ -323,7 +323,7 @@ bool wxWindowDFB::SetCursor(const wxCursor& cursor) #warning "implement this" #if 0 - if ( m_cursor.Ok() ) + if ( m_cursor.IsOk() ) DFB_wmSetWindowCursor(m_wnd, *m_cursor.GetDFBCursor()); else DFB_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetDFBCursor()); diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 117dddf817..fc38c186d6 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -85,7 +85,7 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const wxIcon wxAboutDialogInfo::GetIcon() const { wxIcon icon = m_icon; - if ( !icon.Ok() && wxTheApp ) + if ( !icon.IsOk() && wxTheApp ) { const wxTopLevelWindow * const tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow); @@ -196,7 +196,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); #if wxUSE_STATBMP wxIcon icon = info.GetIcon(); - if ( icon.Ok() ) + if ( icon.IsOk() ) { sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), wxSizerFlags().Border(wxRIGHT)); diff --git a/src/generic/accel.cpp b/src/generic/accel.cpp index 15054cb158..0185018d42 100644 --- a/src/generic/accel.cpp +++ b/src/generic/accel.cpp @@ -162,7 +162,7 @@ void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry) const wxAcceleratorEntry * wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const { - if ( !Ok() ) + if ( !IsOk() ) { // not an error, the accel table is just empty return NULL; diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index 227ac07e7a..d6e44ba9a2 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -308,7 +308,7 @@ wxAnimationCtrl::~wxAnimationCtrl() bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type) { wxFileInputStream fis(filename); - if (!fis.Ok()) + if (!fis.IsOk()) return false; return Load(fis, type); } diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index c19710b5b8..f8a14221c6 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -1002,13 +1002,13 @@ void wxGenericCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) colBg = attr->GetBackgroundColour(); } - if ( colFg.Ok() ) + if ( colFg.IsOk() ) { dc.SetTextForeground(colFg); changedColours = true; } - if ( colBg.Ok() ) + if ( colBg.IsOk() ) { dc.SetTextBackground(colBg); changedColours = true; diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index c1d81ee82f..3b5695ab7d 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -315,7 +315,7 @@ void wxGenericColourDialog::InitializeColours(void) for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++) { wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]); - if (col.Ok()) + if (col.IsOk()) m_standardColours[i].Set(col.Red(), col.Green(), col.Blue()); else m_standardColours[i].Set(0, 0, 0); @@ -324,14 +324,14 @@ void wxGenericColourDialog::InitializeColours(void) for (i = 0; i < WXSIZEOF(m_customColours); i++) { wxColour c = m_colourData.GetCustomColour(i); - if (c.Ok()) + if (c.IsOk()) m_customColours[i] = m_colourData.GetCustomColour(i); else m_customColours[i] = wxColour(255, 255, 255); } wxColour curr = m_colourData.GetColour(); - if ( curr.Ok() ) + if ( curr.IsOk() ) { bool m_initColourFound = false; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 97a61a7347..673a83b765 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -796,9 +796,9 @@ bool wxDataViewBitmapRenderer::GetValue( wxVariant& WXUNUSED(value) ) const bool wxDataViewBitmapRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) ) { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) dc->DrawBitmap( m_bitmap, cell.x, cell.y ); - else if (m_icon.Ok()) + else if (m_icon.IsOk()) dc->DrawIcon( m_icon, cell.x, cell.y ); return true; @@ -806,9 +806,9 @@ bool wxDataViewBitmapRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state wxSize wxDataViewBitmapRenderer::GetSize() const { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) return wxSize( m_bitmap.GetWidth(), m_bitmap.GetHeight() ); - else if (m_icon.Ok()) + else if (m_icon.IsOk()) return wxSize( m_icon.GetWidth(), m_icon.GetHeight() ); return wxSize(wxDVC_DEFAULT_RENDERER_SIZE,wxDVC_DEFAULT_RENDERER_SIZE); diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index b340cd4efb..5693d2f236 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -968,11 +968,11 @@ void wxPostScriptDCImpl::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoor { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - if (!bitmap.Ok()) return; + if (!bitmap.IsOk()) return; wxImage image = bitmap.ConvertToImage(); - if (!image.Ok()) return; + if (!image.IsOk()) return; wxCoord w = image.GetWidth(); wxCoord h = image.GetHeight(); @@ -1038,7 +1038,7 @@ void wxPostScriptDCImpl::SetFont( const wxFont& font ) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - if (!font.Ok()) return; + if (!font.IsOk()) return; m_font = font; @@ -1133,7 +1133,7 @@ void wxPostScriptDCImpl::SetPen( const wxPen& pen ) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - if (!pen.Ok()) return; + if (!pen.IsOk()) return; int oldStyle = m_pen.GetStyle(); @@ -1240,7 +1240,7 @@ void wxPostScriptDCImpl::SetBrush( const wxBrush& brush ) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); - if (!brush.Ok()) return; + if (!brush.IsOk()) return; m_brush = brush; @@ -1288,7 +1288,7 @@ void wxPostScriptDCImpl::DoDrawText( const wxString& text, wxCoord x, wxCoord y if ( !textbuf ) return; - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { unsigned char red = m_textForegroundColour.Red(); unsigned char blue = m_textForegroundColour.Blue(); @@ -1398,7 +1398,7 @@ void wxPostScriptDCImpl::DoDrawRotatedText( const wxString& text, wxCoord x, wxC SetFont( m_font ); - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { unsigned char red = m_textForegroundColour.Red(); unsigned char blue = m_textForegroundColour.Blue(); @@ -1957,7 +1957,7 @@ bool wxPostScriptDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord wxPostScriptDCImpl::GetCharHeight() const { - if (m_font.Ok()) + if (m_font.IsOk()) return m_font.GetPointSize(); else return 12; @@ -2055,7 +2055,7 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string, / example: / / wxPostScriptDC dc(NULL, true); - / if (dc.Ok()){ + / if (dc.IsOk()){ / wxSetAFMPath("d:\\wxw161\\afm\\"); / dc.StartDoc("Test"); / dc.StartPage(); diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index f29e04c31f..e27a75acd3 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -1708,7 +1708,7 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) delete ft; - if ( !ic.Ok() ) + if ( !ic.IsOk() ) { int newid = file; m_HashTable->Put(extension, new wxFileIconEntry(newid)); @@ -1718,7 +1718,7 @@ int wxFileIconsTable::GetIconID(const wxString& extension, const wxString& mime) wxBitmap bmp; bmp.CopyFromIcon(ic); - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { int newid = file; m_HashTable->Put(extension, new wxFileIconEntry(newid)); diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index e4b50c9f34..6e3fbad8be 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -249,7 +249,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, m_isDirty = false; m_isDirty = false; - if (m_cursor.Ok()) + if (m_cursor.IsOk()) { m_oldCursor = window->GetCursor(); window->SetCursor(m_cursor); @@ -288,7 +288,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, #ifndef wxHAS_NATIVE_OVERLAY wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); - if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y)) + if (!backing->IsOk() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y)) (*backing) = wxBitmap(clientSize.x, clientSize.y); #endif // !wxHAS_NATIVE_OVERLAY @@ -345,7 +345,7 @@ bool wxGenericDragImage::EndDrag() #endif m_window->ReleaseMouse(); - if (m_cursor.Ok() && m_oldCursor.Ok()) + if (m_cursor.IsOk() && m_oldCursor.IsOk()) { m_window->SetCursor(m_oldCursor); } @@ -467,7 +467,7 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, DoDrawImage(*m_windowDC, newPos); #else // !wxHAS_NATIVE_OVERLAY wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap); - if (!backing->Ok()) + if (!backing->IsOk()) return false; wxRect oldRect(GetImageRect(oldPos)); @@ -499,7 +499,7 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, // keep reallocating all the time. int excess = 50; - if (!m_repairBitmap.Ok() || (m_repairBitmap.GetWidth() < fullRect.GetWidth() || m_repairBitmap.GetHeight() < fullRect.GetHeight())) + if (!m_repairBitmap.IsOk() || (m_repairBitmap.GetWidth() < fullRect.GetWidth() || m_repairBitmap.GetHeight() < fullRect.GetHeight())) { m_repairBitmap = wxBitmap(fullRect.GetWidth() + excess, fullRect.GetHeight() + excess); } @@ -539,12 +539,12 @@ bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, // Override this if you are using a virtual image (drawing your own image) bool wxGenericDragImage::DoDrawImage(wxDC& dc, const wxPoint& pos) const { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { dc.DrawBitmap(m_bitmap, pos.x, pos.y, (m_bitmap.GetMask() != 0)); return true; } - else if (m_icon.Ok()) + else if (m_icon.IsOk()) { dc.DrawIcon(m_icon, pos.x, pos.y); return true; @@ -556,11 +556,11 @@ bool wxGenericDragImage::DoDrawImage(wxDC& dc, const wxPoint& pos) const // Override this if you are using a virtual image (drawing your own image) wxRect wxGenericDragImage::GetImageRect(const wxPoint& pos) const { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { return wxRect(pos.x, pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight()); } - else if (m_icon.Ok()) + else if (m_icon.IsOk()) { return wxRect(pos.x, pos.y, m_icon.GetWidth(), m_icon.GetHeight()); } diff --git a/src/generic/filectrlg.cpp b/src/generic/filectrlg.cpp index c0086dbd19..b5009721aa 100644 --- a/src/generic/filectrlg.cpp +++ b/src/generic/filectrlg.cpp @@ -377,7 +377,7 @@ void wxFileData::MakeItem( wxListItem &item ) if (IsLink()) { wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") ); - if ( dg.Ok() ) + if ( dg.IsOk() ) item.SetTextColour(dg); } item.m_data = wxPtrToUInt(this); diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 2a986588cf..70c59b66f9 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -76,7 +76,7 @@ void wxFontPreviewer::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.SetBrush(*wxWHITE_BRUSH); dc.DrawRectangle(0, 0, size.x, size.y); - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); dc.SetTextForeground(GetForegroundColour()); @@ -550,7 +550,7 @@ void wxGenericFontDialog::InitializeFont() int fontSize = 12; bool fontUnderline = false; - if (m_fontData.m_initialFont.Ok()) + if (m_fontData.m_initialFont.IsOk()) { fontFamily = m_fontData.m_initialFont.GetFamily(); fontWeight = m_fontData.m_initialFont.GetWeight(); @@ -602,7 +602,7 @@ void wxGenericFontDialog::DoChangeFont() if ( !m_colourChoice->GetStringSelection().empty() ) { wxColour col = wxTheColourDatabase->Find(m_colourChoice->GetStringSelection()); - if (col.Ok()) + if (col.IsOk()) { m_fontData.m_fontColour = col; } @@ -610,7 +610,7 @@ void wxGenericFontDialog::DoChangeFont() } // Update color here so that we can also use the color originally passed in // (EnableEffects may be false) - if (m_fontData.m_fontColour.Ok()) + if (m_fontData.m_fontColour.IsOk()) m_previewer->SetForegroundColour(m_fontData.m_fontColour); m_previewer->Refresh(); diff --git a/src/generic/fontpickerg.cpp b/src/generic/fontpickerg.cpp index 7d1cfb908a..ffcbb91de3 100644 --- a/src/generic/fontpickerg.cpp +++ b/src/generic/fontpickerg.cpp @@ -97,7 +97,7 @@ void wxGenericFontButton::OnButtonClick(wxCommandEvent& WXUNUSED(ev)) void wxGenericFontButton::UpdateFont() { - if ( !m_selectedFont.Ok() ) + if ( !m_selectedFont.IsOk() ) return; SetForegroundColour(m_data.GetColour()); diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index c7bbf5cbcf..280c56ad02 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -551,7 +551,7 @@ wxCairoPenData::wxCairoPenData( wxGraphicsRenderer* renderer, const wxPen &pen ) { /* wxBitmap* bmp = pen.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { wxDELETE( m_penImage ); wxDELETE( m_penBrush ); @@ -666,7 +666,7 @@ wxCairoBrushData::wxCairoBrushData( wxGraphicsRenderer* renderer, const wxBrush else { wxBitmap* bmp = brush.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { wxDELETE( m_brushImage ); m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE()); @@ -1918,7 +1918,7 @@ wxGraphicsMatrix wxCairoRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDouble wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen) { - if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) return wxNullGraphicsPen; else { @@ -1930,7 +1930,7 @@ wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen) wxGraphicsBrush wxCairoRenderer::CreateBrush(const wxBrush& brush ) { - if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) return wxNullGraphicsBrush; else { @@ -1967,7 +1967,7 @@ wxCairoRenderer::CreateRadialGradientBrush(wxDouble xo, wxDouble yo, // sets the font wxGraphicsFont wxCairoRenderer::CreateFont( const wxFont &font , const wxColour &col ) { - if ( font.Ok() ) + if ( font.IsOk() ) { wxGraphicsFont p; p.SetRefData(new wxCairoFontData( this , font, col )); @@ -1979,7 +1979,7 @@ wxGraphicsFont wxCairoRenderer::CreateFont( const wxFont &font , const wxColour wxGraphicsBitmap wxCairoRenderer::CreateBitmap( const wxBitmap& bmp ) { - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxGraphicsBitmap p; p.SetRefData(new wxCairoBitmapData( this , bmp )); diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 6574ed6cb8..ac90aa3310 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -300,13 +300,13 @@ void wxGridCellEditor::Show(bool show, wxGridCellAttr *attr) else { // restore the standard colours fonts - if ( m_colFgOld.Ok() ) + if ( m_colFgOld.IsOk() ) { m_control->SetForegroundColour(m_colFgOld); m_colFgOld = wxNullColour; } - if ( m_colBgOld.Ok() ) + if ( m_colBgOld.IsOk() ) { m_control->SetBackgroundColour(m_colBgOld); m_colBgOld = wxNullColour; @@ -314,7 +314,7 @@ void wxGridCellEditor::Show(bool show, wxGridCellAttr *attr) // Workaround for GTK+1 font setting problem on some platforms #if !defined(__WXGTK__) || defined(__WXGTK20__) - if ( m_fontOld.Ok() ) + if ( m_fontOld.IsOk() ) { m_control->SetFont(m_fontOld); m_fontOld = wxNullFont; diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index ccae40819f..af7666efe3 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -308,7 +308,7 @@ void wxHtmlListBox::CacheItem(size_t n) const m_htmlParser->SetDC(new wxClientDC(self)); m_htmlParser->SetFS(&self->m_filesystem); #if !wxUSE_UNICODE - if (GetFont().Ok()) + if (GetFont().IsOk()) m_htmlParser->SetInputEncoding(GetFont().GetEncoding()); #endif // use system's default GUI font by default: diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index ee1c9d7bdd..54203dbb7b 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -106,7 +106,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap ) int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) { wxBitmap bmp(bitmap); - if (mask.Ok()) + if (mask.IsOk()) bmp.SetMask(new wxMask(mask)); return Add(bmp); } @@ -214,7 +214,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit m_images.Insert( next, newBitmap ); } - if (mask.Ok()) + if (mask.IsOk()) newBitmap->SetMask(new wxMask(mask)); return true; diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 55bdeaec45..1cb929ddb0 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -850,7 +850,7 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent) // This may very well fail if there are insufficient colours available. // Degrade gracefully. - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { loadedIcons = false; diff --git a/src/generic/mask.cpp b/src/generic/mask.cpp index aec9a245c0..d5fe5cbff7 100644 --- a/src/generic/mask.cpp +++ b/src/generic/mask.cpp @@ -49,12 +49,12 @@ bool wxMask::InitFromColour(const wxBitmap& bitmap, const wxColour& colour) wxImage imgSrc(bitmap.ConvertToImage()); imgSrc.SetMask(false); wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue())); - if ( !image.Ok() ) + if ( !image.IsOk() ) return false; m_bitmap = wxBitmap(image, 1); - return m_bitmap.Ok(); + return m_bitmap.IsOk(); #else // !wxUSE_IMAGE wxUnusedVar(bitmap); wxUnusedVar(colour); @@ -65,7 +65,7 @@ bool wxMask::InitFromColour(const wxBitmap& bitmap, const wxColour& colour) bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap) { - wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap") ); + wxCHECK_MSG( bitmap.IsOk(), false, wxT("Invalid bitmap") ); wxCHECK_MSG( bitmap.GetDepth() == 1, false, wxT("Cannot create mask from colour bitmap") ); m_bitmap = bitmap; diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 0024bcec60..0601a60f38 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -281,7 +281,7 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, // native hot-tracking line (on XP) const int penwidth = 3; int y = rect.y + rect.height + 1 - penwidth; - wxColour c = (params && params->m_selectionColour.Ok()) ? + wxColour c = (params && params->m_selectionColour.IsOk()) ? params->m_selectionColour : wxColour(0x66, 0x66, 0x66); wxPen pen(c, penwidth); pen.SetCap(wxCAP_BUTT); @@ -322,7 +322,7 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, triPt[2].y = ar.height; } - wxColour c = (params && params->m_arrowColour.Ok()) ? + wxColour c = (params && params->m_arrowColour.IsOk()) ? params->m_arrowColour : wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW); wxDCPenChanger setPen(dc, c); @@ -336,7 +336,7 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, int bmpWidth = 0; // draw the bitmap if there is one - if ( params && params->m_labelBitmap.Ok() ) + if ( params && params->m_labelBitmap.IsOk() ) { int w = params->m_labelBitmap.GetWidth(); int h = params->m_labelBitmap.GetHeight(); @@ -379,9 +379,9 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win, const int margin = 5; // number of pixels to reserve on either side of the label labelWidth += 2*margin; - wxFont font = params->m_labelFont.Ok() ? + wxFont font = params->m_labelFont.IsOk() ? params->m_labelFont : win->GetFont(); - wxColour clr = params->m_labelColour.Ok() ? + wxColour clr = params->m_labelColour.IsOk() ? params->m_labelColour : win->GetForegroundColour(); wxString label( params->m_labelText ); diff --git a/src/generic/splash.cpp b/src/generic/splash.cpp index ee4512b788..da0795d71d 100644 --- a/src/generic/splash.cpp +++ b/src/generic/splash.cpp @@ -171,20 +171,20 @@ static void wxDrawSplashBitmap(wxDC& dc, const wxBitmap& bitmap, int WXUNUSED(x) void wxSplashScreenWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) wxDrawSplashBitmap(dc, m_bitmap, 0, 0); } void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event) { - if (event.GetDC() && m_bitmap.Ok()) + if (event.GetDC() && m_bitmap.IsOk()) { wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0); } else { wxClientDC dc(this); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) wxDrawSplashBitmap(dc, m_bitmap, 0, 0); } } diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 328a11d54b..7292ca9032 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -799,7 +799,7 @@ bool wxSearchCtrl::SetFont(const wxFont& font) void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap ) { m_searchBitmap = bitmap; - m_searchBitmapUser = bitmap.Ok(); + m_searchBitmapUser = bitmap.IsOk(); if ( m_searchBitmapUser ) { if ( m_searchButton && !HasMenu() ) @@ -819,7 +819,7 @@ void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap ) void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap ) { m_searchMenuBitmap = bitmap; - m_searchMenuBitmapUser = bitmap.Ok(); + m_searchMenuBitmapUser = bitmap.IsOk(); if ( m_searchMenuBitmapUser ) { if ( m_searchButton && m_menu ) @@ -839,7 +839,7 @@ void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap ) void wxSearchCtrl::SetCancelBitmap( const wxBitmap& bitmap ) { m_cancelBitmap = bitmap; - m_cancelBitmapUser = bitmap.Ok(); + m_cancelBitmapUser = bitmap.IsOk(); if ( m_cancelBitmapUser ) { if ( m_cancelButton ) @@ -1119,7 +1119,7 @@ void wxSearchCtrl::RecalcBitmaps() if ( !m_searchBitmapUser ) { if ( - !m_searchBitmap.Ok() || + !m_searchBitmap.IsOk() || m_searchBitmap.GetHeight() != bitmapHeight || m_searchBitmap.GetWidth() != bitmapWidth ) @@ -1137,7 +1137,7 @@ void wxSearchCtrl::RecalcBitmaps() if ( !m_searchMenuBitmapUser ) { if ( - !m_searchMenuBitmap.Ok() || + !m_searchMenuBitmap.IsOk() || m_searchMenuBitmap.GetHeight() != bitmapHeight || m_searchMenuBitmap.GetWidth() != bitmapWidth ) @@ -1155,7 +1155,7 @@ void wxSearchCtrl::RecalcBitmaps() if ( !m_cancelBitmapUser ) { if ( - !m_cancelBitmap.Ok() || + !m_cancelBitmap.IsOk() || m_cancelBitmap.GetHeight() != bitmapHeight || m_cancelBitmap.GetWidth() != bitmapHeight ) diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 8490534ae9..d87d766a07 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -324,7 +324,7 @@ void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn) ); #if wxUSE_STATBMP - if ( m_bitmap.Ok() ) + if ( m_bitmap.IsOk() ) { wxSize bitmapSize(wxDefaultSize); if (GetBitmapPlacement()) @@ -604,10 +604,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) if ( m_statbmp ) { bmp = m_page->GetBitmap(); - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) bmp = m_bitmap; - if ( !bmpPrev.Ok() ) + if ( !bmpPrev.IsOk() ) bmpPrev = m_bitmap; if (!GetBitmapPlacement()) @@ -928,7 +928,7 @@ bool wxWizard::ResizeBitmap(wxBitmap& bmp) if (!GetBitmapPlacement()) return false; - if (bmp.Ok()) + if (bmp.IsOk()) { wxSize pageSize = m_sizerPage->GetSize(); if (pageSize == wxSize(0,0)) @@ -936,7 +936,7 @@ bool wxWizard::ResizeBitmap(wxBitmap& bmp) int bitmapWidth = wxMax(bmp.GetWidth(), GetMinimumBitmapWidth()); int bitmapHeight = pageSize.y; - if (!m_statbmp->GetBitmap().Ok() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight) + if (!m_statbmp->GetBitmap().IsOk() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight) { wxBitmap bitmap(bitmapWidth, bitmapHeight); { diff --git a/src/gtk/aboutdlg.cpp b/src/gtk/aboutdlg.cpp index 6728f212a8..dc17913122 100644 --- a/src/gtk/aboutdlg.cpp +++ b/src/gtk/aboutdlg.cpp @@ -145,7 +145,7 @@ void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent)) gtk_about_dialog_set_license(dlg, NULL); wxIcon icon = info.GetIcon(); - if ( icon.Ok() ) + if ( icon.IsOk() ) gtk_about_dialog_set_logo(dlg, info.GetIcon().GetPixbuf()); if ( info.HasWebSite() ) diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index e7ba31b30d..667c6df8e4 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -104,21 +104,21 @@ bool wxBrush::operator==(const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/gtk/colordlg.cpp b/src/gtk/colordlg.cpp index ca9e536a65..76dc32e935 100644 --- a/src/gtk/colordlg.cpp +++ b/src/gtk/colordlg.cpp @@ -105,7 +105,7 @@ int wxColourDialog::ShowModal() void wxColourDialog::ColourDataToDialog() { const GdkColor * const - col = m_data.GetColour().Ok() ? m_data.GetColour().GetColor() + col = m_data.GetColour().IsOk() ? m_data.GetColour().GetColor() : NULL; #if wxUSE_LIBHILDON @@ -138,7 +138,7 @@ void wxColourDialog::ColourDataToDialog() for (unsigned i = 0; i < 16; i++) { wxColour c = m_data.GetCustomColour(i); - if (c.Ok()) + if (c.IsOk()) { colors[n_colors] = *c.GetColor(); n_colors++; @@ -161,7 +161,7 @@ void wxColourDialog::DialogToColourData() m_data.SetColour(*clr); #elif wxUSE_LIBHILDON2 // !wxUSE_LIBHILDON const GdkColor * const - col = m_data.GetColour().Ok() ? m_data.GetColour().GetColor() : NULL; + col = m_data.GetColour().IsOk() ? m_data.GetColour().GetColor() : NULL; GdkColor clr; if (col) diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 322689db99..185cb5c1d4 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -127,49 +127,49 @@ void wxColour::InitRGBA(unsigned char red, unsigned char green, unsigned char bl unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return wxByte(M_COLDATA->m_red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return wxByte(M_COLDATA->m_green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return wxByte(M_COLDATA->m_blue >> SHIFT); } unsigned char wxColour::Alpha() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return M_COLDATA->m_alpha; } void wxColour::CalcPixel( GdkColormap *cmap ) { - if (!Ok()) return; + if (!IsOk()) return; M_COLDATA->AllocColour( cmap ); } int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return M_COLDATA->m_color.pixel; } const GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 73983f1351..525bccdb7e 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -423,7 +423,7 @@ void wxBeginBusyCursor(const wxCursor* cursor) if (gs_busyCount++ > 0) return; - wxASSERT_MSG( !gs_savedCursor.Ok(), + wxASSERT_MSG( !gs_savedCursor.IsOk(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index dbe0952d50..5d8854134c 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -384,12 +384,12 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) m_bitmap = wxBitmap(image); - return m_bitmap.Ok(); + return m_bitmap.IsOk(); } void wxBitmapDataObject::DoConvertToPng() { - if ( !m_bitmap.Ok() ) + if ( !m_bitmap.IsOk() ) return; wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL, diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 249abb706d..19ddb6a8d8 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -3083,7 +3083,7 @@ void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap ) { wxDataViewColumnBase::SetBitmap( bitmap ); - if (bitmap.Ok()) + if (bitmap.IsOk()) { GtkImage *gtk_image = GTK_IMAGE(m_image); diff --git a/src/gtk/dcmemory.cpp b/src/gtk/dcmemory.cpp index 4590917127..d502b5bd48 100644 --- a/src/gtk/dcmemory.cpp +++ b/src/gtk/dcmemory.cpp @@ -65,7 +65,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) Destroy(); m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { m_gdkwindow = m_selected.GetPixmap(); @@ -83,7 +83,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::SetPen( const wxPen& penOrig ) { wxPen pen( penOrig ); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetDepth() == 1 && (pen != *wxTRANSPARENT_PEN) ) { @@ -96,7 +96,7 @@ void wxMemoryDCImpl::SetPen( const wxPen& penOrig ) void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig ) { wxBrush brush( brushOrig ); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetDepth() == 1 && (brush != *wxTRANSPARENT_BRUSH) ) { @@ -110,7 +110,7 @@ void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig ) { wxBrush brush(brushOrig); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetDepth() == 1 && (brush != *wxTRANSPARENT_BRUSH) ) { @@ -122,7 +122,7 @@ void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig ) void wxMemoryDCImpl::SetTextForeground( const wxColour& col ) { - if ( m_selected.Ok() && m_selected.GetDepth() == 1 ) + if ( m_selected.IsOk() && m_selected.GetDepth() == 1 ) wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE); else wxWindowDCImpl::SetTextForeground( col ); @@ -130,7 +130,7 @@ void wxMemoryDCImpl::SetTextForeground( const wxColour& col ) void wxMemoryDCImpl::SetTextBackground( const wxColour &col ) { - if (m_selected.Ok() && m_selected.GetDepth() == 1) + if (m_selected.IsOk() && m_selected.GetDepth() == 1) wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE ); else wxWindowDCImpl::SetTextBackground( col ); @@ -138,7 +138,7 @@ void wxMemoryDCImpl::SetTextBackground( const wxColour &col ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) (*width) = m_selected.GetWidth(); if (height) (*height) = m_selected.GetHeight(); diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 88e4402a80..c7bdf480a8 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -737,11 +737,11 @@ void wxDropSource::SetIcons(const wxIcon &iconCopy, m_iconMove = iconMove; m_iconNone = iconNone; - if ( !m_iconCopy.Ok() ) + if ( !m_iconCopy.IsOk() ) m_iconCopy = wxIcon(page_xpm); - if ( !m_iconMove.Ok() ) + if ( !m_iconMove.IsOk() ) m_iconMove = m_iconCopy; - if ( !m_iconNone.Ok() ) + if ( !m_iconNone.IsOk() ) m_iconNone = m_iconCopy; } diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index d50f46bfc5..ce8afcb7ad 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -116,7 +116,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) G_CALLBACK (gtk_fontdialog_delete_callback), this); wxFont font = m_fontData.GetInitialFont(); - if( font.Ok() ) + if( font.IsOk() ) { const wxNativeFontInfo *info = font.GetNativeFontInfo(); diff --git a/src/gtk/gnome/gprint.cpp b/src/gtk/gnome/gprint.cpp index abe6b7ba62..5902314417 100644 --- a/src/gtk/gnome/gprint.cpp +++ b/src/gtk/gnome/gprint.cpp @@ -1534,7 +1534,7 @@ wxGnomePrinterDCImpl::DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool WXUNUSED(useMask)) { - if (!bitmap.Ok()) return; + if (!bitmap.IsOk()) return; if (bitmap.HasPixbuf()) { @@ -1565,7 +1565,7 @@ wxGnomePrinterDCImpl::DoDrawBitmap(const wxBitmap& bitmap, { wxImage image = bitmap.ConvertToImage(); - if (!image.Ok()) return; + if (!image.IsOk()) return; gs_libGnomePrint->gnome_print_gsave( m_gpc ); double matrix[6]; @@ -1592,7 +1592,7 @@ void wxGnomePrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wx double xx = XLOG2DEV(x); double yy = YLOG2DEV(y); - bool underlined = m_font.Ok() && m_font.GetUnderlined(); + bool underlined = m_font.IsOk() && m_font.GetUnderlined(); const wxScopedCharBuffer data(text.utf8_str()); @@ -1610,7 +1610,7 @@ void wxGnomePrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wx pango_attr_list_unref(attrs); } - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { unsigned char red = m_textForegroundColour.Red(); unsigned char blue = m_textForegroundColour.Blue(); @@ -1674,7 +1674,7 @@ void wxGnomePrinterDCImpl::SetFont( const wxFont& font ) { m_font = font; - if (m_font.Ok()) + if (m_font.IsOk()) { if (m_fontdesc) pango_font_description_free( m_fontdesc ); @@ -1691,7 +1691,7 @@ void wxGnomePrinterDCImpl::SetFont( const wxFont& font ) void wxGnomePrinterDCImpl::SetPen( const wxPen& pen ) { - if (!pen.Ok()) return; + if (!pen.IsOk()) return; m_pen = pen; @@ -1757,7 +1757,7 @@ void wxGnomePrinterDCImpl::SetPen( const wxPen& pen ) void wxGnomePrinterDCImpl::SetBrush( const wxBrush& brush ) { - if (!brush.Ok()) return; + if (!brush.IsOk()) return; m_brush = brush; diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 09b0b4a12a..d76523b681 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -855,7 +855,7 @@ GdkWindow *wxListBox::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) { - if (m_hasBgCol && m_backgroundColour.Ok()) + if (m_hasBgCol && m_backgroundColour.IsOk()) { GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview); if (window) diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index e118019c71..4081bf6dfc 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -182,7 +182,7 @@ void wxPen::SetWidth( int width ) int wxPen::GetDashes( wxDash **ptr ) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = (wxDash*)M_PENDATA->m_dash; return M_PENDATA->m_countDashes; @@ -190,49 +190,49 @@ int wxPen::GetDashes( wxDash **ptr ) const int wxPen::GetDashCount() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return (M_PENDATA->m_countDashes); } wxDash* wxPen::GetDash() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return (wxDash*)M_PENDATA->m_dash; } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_capStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_joinStyle; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; } wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index d72c2a9a5e..071c5e6733 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -1738,7 +1738,7 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo angle = -angle; - bool underlined = m_font.Ok() && m_font.GetUnderlined(); + bool underlined = m_font.IsOk() && m_font.GetUnderlined(); const wxScopedCharBuffer data = text.utf8_str(); @@ -1756,7 +1756,7 @@ void wxGtkPrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wxCo pango_attr_list_unref(attrs); } - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { unsigned char red = m_textForegroundColour.Red(); unsigned char blue = m_textForegroundColour.Blue(); @@ -1844,7 +1844,7 @@ void wxGtkPrinterDCImpl::SetFont( const wxFont& font ) { m_font = font; - if (m_font.Ok()) + if (m_font.IsOk()) { if (m_fontdesc) pango_font_description_free( m_fontdesc ); @@ -1861,7 +1861,7 @@ void wxGtkPrinterDCImpl::SetFont( const wxFont& font ) void wxGtkPrinterDCImpl::SetPen( const wxPen& pen ) { - if (!pen.Ok()) return; + if (!pen.IsOk()) return; m_pen = pen; @@ -1940,7 +1940,7 @@ void wxGtkPrinterDCImpl::SetPen( const wxPen& pen ) void wxGtkPrinterDCImpl::SetBrush( const wxBrush& brush ) { - if (!brush.Ok()) return; + if (!brush.IsOk()) return; m_brush = brush; diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 2073c24046..669dc09424 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -179,7 +179,7 @@ bool wxRegion::DoUnionWithRect(const wxRect& r) bool wxRegion::DoUnionWithRegion( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -198,7 +198,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -215,7 +215,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -232,7 +232,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 51f5a3eb08..0712e10fe7 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -258,7 +258,7 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) case wxSYS_SYSTEM_FONT: case wxSYS_DEVICE_DEFAULT_FONT: case wxSYS_DEFAULT_GUI_FONT: - if (!gs_fontSystem.Ok()) + if (!gs_fontSystem.IsOk()) { wxNativeFontInfo info; info.description = ButtonStyle()->font_desc; diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index dc9b639711..a1c66085e3 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -47,7 +47,7 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi m_widget = gtk_image_new(); g_object_ref(m_widget); - if (bitmap.Ok()) + if (bitmap.IsOk()) SetBitmap(bitmap); PostCreation(size); @@ -60,7 +60,7 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap ) { m_bitmap = bitmap; - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { // always use pixbuf, because pixmap mask does not // work with disabled images in some themes diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 59111db0c4..ee0c631afc 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1289,7 +1289,7 @@ void wxTextCtrl::OnEnabled(bool WXUNUSED(enable)) // disabled and enabled mode, or we end up with a different colour under the // text. wxColour oldColour = GetBackgroundColour(); - if (oldColour.Ok()) + if (oldColour.IsOk()) { // Need to set twice or it'll optimize the useful stuff out if (oldColour == * wxWHITE) @@ -1666,7 +1666,7 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) if ( !wxControl::SetBackgroundColour( colour ) ) return false; - if (!m_backgroundColour.Ok()) + if (!m_backgroundColour.IsOk()) return false; // change active background color too diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 3880012995..52b95ba1fe 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -130,7 +130,7 @@ void wxBitmapToggleButton::SetLabel(const wxBitmap& label) void wxBitmapToggleButton::OnSetBitmap() { - if (!m_bitmap.Ok()) return; + if (!m_bitmap.IsOk()) return; GtkWidget* image = gtk_bin_get_child(GTK_BIN(m_widget)); if (image == NULL) @@ -178,7 +178,7 @@ wxSize wxBitmapToggleButton::DoGetBestSize() const { wxSize best; - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { int border = HasFlag(wxNO_BORDER) ? 4 : 10; best.x = m_bitmap.GetWidth()+border; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 4ac089ebcc..b45d923700 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2886,7 +2886,7 @@ int wxWindowGTK::GetCharHeight() const wxCHECK_MSG( (m_widget != NULL), 12, wxT("invalid window") ); wxFont font = GetFont(); - wxCHECK_MSG( font.Ok(), 12, wxT("invalid font") ); + wxCHECK_MSG( font.IsOk(), 12, wxT("invalid font") ); PangoContext* context = gtk_widget_get_pango_context(m_widget); @@ -2912,7 +2912,7 @@ int wxWindowGTK::GetCharWidth() const wxCHECK_MSG( (m_widget != NULL), 8, wxT("invalid window") ); wxFont font = GetFont(); - wxCHECK_MSG( font.Ok(), 8, wxT("invalid font") ); + wxCHECK_MSG( font.IsOk(), 8, wxT("invalid font") ); PangoContext* context = gtk_widget_get_pango_context(m_widget); @@ -2942,7 +2942,7 @@ void wxWindowGTK::DoGetTextExtent( const wxString& string, { wxFont fontToUse = theFont ? *theFont : GetFont(); - wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); + wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") ); if (string.empty()) { @@ -3450,7 +3450,7 @@ void wxWindowGTK::Lower() bool wxWindowGTK::SetCursor( const wxCursor &cursor ) { - if ( !wxWindowBase::SetCursor(cursor.Ok() ? cursor : *wxSTANDARD_CURSOR) ) + if ( !wxWindowBase::SetCursor(cursor.IsOk() ? cursor : *wxSTANDARD_CURSOR) ) return false; GTKUpdateCursor(); @@ -3462,8 +3462,8 @@ void wxWindowGTK::GTKUpdateCursor(bool update_self /*=true*/, bool recurse /*=tr { if (update_self) { - wxCursor cursor(g_globalCursor.Ok() ? g_globalCursor : GetCursor()); - if ( cursor.Ok() ) + wxCursor cursor(g_globalCursor.IsOk() ? g_globalCursor : GetCursor()); + if ( cursor.IsOk() ) { wxArrayGdkWindows windowsThis; GdkWindow* window = GTKGetWindow(windowsThis); @@ -3795,7 +3795,7 @@ bool wxWindowGTK::SetBackgroundColour( const wxColour &colour ) if (!wxWindowBase::SetBackgroundColour(colour)) return false; - if (colour.Ok()) + if (colour.IsOk()) { // We need the pixel value e.g. for background clearing. m_backgroundColour.CalcPixel(gtk_widget_get_colormap(m_widget)); @@ -3817,7 +3817,7 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour ) return false; } - if (colour.Ok()) + if (colour.IsOk()) { // We need the pixel value e.g. for background clearing. m_foregroundColour.CalcPixel(gtk_widget_get_colormap(m_widget)); @@ -3839,15 +3839,15 @@ GtkRcStyle *wxWindowGTK::GTKCreateWidgetStyle(bool forceStyle) { // do we need to apply any changes at all? if ( !forceStyle && - !m_font.Ok() && - !m_foregroundColour.Ok() && !m_backgroundColour.Ok() ) + !m_font.IsOk() && + !m_foregroundColour.IsOk() && !m_backgroundColour.IsOk() ) { return NULL; } GtkRcStyle *style = gtk_rc_style_new(); - if ( m_font.Ok() ) + if ( m_font.IsOk() ) { style->font_desc = pango_font_description_copy( m_font.GetNativeFontInfo()->description ); @@ -3858,7 +3858,7 @@ GtkRcStyle *wxWindowGTK::GTKCreateWidgetStyle(bool forceStyle) flagsActive = 0, flagsInsensitive = 0; - if ( m_foregroundColour.Ok() ) + if ( m_foregroundColour.IsOk() ) { const GdkColor *fg = m_foregroundColour.GetColor(); @@ -3875,7 +3875,7 @@ GtkRcStyle *wxWindowGTK::GTKCreateWidgetStyle(bool forceStyle) flagsActive |= GTK_RC_FG | GTK_RC_TEXT; } - if ( m_backgroundColour.Ok() ) + if ( m_backgroundColour.IsOk() ) { const GdkColor *bg = m_backgroundColour.GetColor(); @@ -4129,7 +4129,7 @@ void wxWindowGTK::DoCaptureMouse() wxCHECK_RET( window, wxT("CaptureMouse() failed") ); const wxCursor* cursor = &m_cursor; - if (!cursor->Ok()) + if (!cursor->IsOk()) cursor = wxSTANDARD_CURSOR; gdk_pointer_grab( window, FALSE, diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 109450dc55..a16c5d4a5c 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -93,7 +93,7 @@ bool wxMask::Create( const wxBitmap& bitmap, } wxImage image = bitmap.ConvertToImage(); - if (!image.Ok()) return false; + if (!image.IsOk()) return false; m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, image.GetWidth(), image.GetHeight(), 1 ); GdkGC *gc = gdk_gc_new( m_bitmap ); @@ -198,7 +198,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) m_bitmap = NULL; } - if (!bitmap.Ok()) return false; + if (!bitmap.IsOk()) return false; wxCHECK_MSG( bitmap.GetBitmap(), false, wxT("Cannot create mask from colour bitmap") ); @@ -407,7 +407,7 @@ wxBitmap::wxBitmap(const char* const* bits) wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy ) { - wxCHECK_MSG( Ok(), wxNullBitmap, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullBitmap, wxT("invalid bitmap") ); if (newy==M_BMPDATA->m_width && newy==M_BMPDATA->m_height) return *this; @@ -592,7 +592,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) { UnRef(); - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") ); wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") ); if (image.GetWidth() <= 0 || image.GetHeight() <= 0) @@ -954,7 +954,7 @@ wxImage wxBitmap::ConvertToImage() const { wxImage image; - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); image.Create(GetWidth(), GetHeight()); unsigned char *data = image.GetData(); @@ -1136,35 +1136,35 @@ wxBitmap::~wxBitmap() int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); AllocExclusive(); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -1180,13 +1180,13 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rect.x >= 0) && (rect.y >= 0) && (rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height), wxNullBitmap, wxT("invalid bitmap or bitmap region") ); wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); if (ret.GetPixmap()) { @@ -1228,12 +1228,12 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalette *WXUNUSED(palette) ) const { - wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") ); // Try to save the bitmap via wxImage handlers: { wxImage image = ConvertToImage(); - if (image.Ok()) return image.SaveFile( name, type ); + if (image.IsOk()) return image.SaveFile( name, type ); } return false; @@ -1275,7 +1275,7 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type ) else // try if wxImage can load it { wxImage image; - if ( !image.LoadFile( name, type ) || !image.Ok() ) + if ( !image.LoadFile( name, type ) || !image.IsOk() ) return false; *this = wxBitmap(image); @@ -1287,7 +1287,7 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type ) #if wxUSE_PALETTE wxPalette *wxBitmap::GetPalette() const { - if (!Ok()) + if (!IsOk()) return NULL; return M_BMPDATA->m_palette; @@ -1335,21 +1335,21 @@ void wxBitmap::SetBitmap( GdkPixmap *bitmap ) GdkPixmap *wxBitmap::GetPixmap() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_pixmap; } bool wxBitmap::HasPixmap() const { - wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") ); return M_BMPDATA->m_pixmap != NULL; } GdkBitmap *wxBitmap::GetBitmap() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_bitmap; } diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index d38da098ab..175e861c48 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -111,21 +111,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index 5d3dd8738c..e52bdc4b01 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -172,10 +172,10 @@ bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window ) void wxCheckBox::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *event_window = TOGGLE_BUTTON_EVENT_WIN(m_widgetCheckbox); - if ( event_window && cursor.Ok() ) + if ( event_window && cursor.IsOk() ) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp index eb133b79e1..2057133fe5 100644 --- a/src/gtk1/colour.cpp +++ b/src/gtk1/colour.cpp @@ -182,42 +182,42 @@ void wxColour::InitRGBA(unsigned char red, unsigned char green, unsigned char bl unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); } void wxColour::CalcPixel( GdkColormap *cmap ) { - if (!Ok()) return; + if (!IsOk()) return; M_COLDATA->AllocColour( cmap ); } int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return M_COLDATA->m_color.pixel; } GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 50a08c7f90..b3e56ef837 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -374,7 +374,7 @@ void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) ) if (gs_busyCount++ > 0) return; - wxASSERT_MSG( !gs_savedCursor.Ok(), + wxASSERT_MSG( !gs_savedCursor.IsOk(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 7fc4bb83dc..04fc4a4675 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -357,12 +357,12 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) m_bitmap = wxBitmap(image); - return m_bitmap.Ok(); + return m_bitmap.IsOk(); } void wxBitmapDataObject::DoConvertToPng() { - if ( !m_bitmap.Ok() ) + if ( !m_bitmap.IsOk() ) return; wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL, diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 5b5774bbab..bff8a142c0 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1004,7 +1004,7 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap, { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); - wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( bitmap.IsOk(), wxT("invalid bitmap") ); bool is_mono = (bitmap.GetBitmap() != NULL); @@ -1160,7 +1160,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, if (srcDC->m_isMemDC) { - if (!memDC->m_selected.Ok()) return false; + if (!memDC->m_selected.IsOk()) return false; is_mono = (memDC->m_selected.GetDepth() == 1); @@ -1650,7 +1650,7 @@ void wxWindowDCImpl::SetPen( const wxPen &pen ) m_pen = pen; - if (!m_pen.Ok()) return; + if (!m_pen.IsOk()) return; if (!m_window) return; @@ -1800,7 +1800,7 @@ void wxWindowDCImpl::SetBrush( const wxBrush &brush ) m_brush = brush; - if (!m_brush.Ok()) return; + if (!m_brush.IsOk()) return; if (!m_window) return; @@ -1809,7 +1809,7 @@ void wxWindowDCImpl::SetBrush( const wxBrush &brush ) gdk_gc_set_fill( m_brushGC, GDK_SOLID ); - if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok())) + if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->IsOk())) { if (m_brush.GetStipple()->GetPixmap()) { @@ -1848,7 +1848,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) m_backgroundBrush = brush; - if (!m_backgroundBrush.Ok()) return; + if (!m_backgroundBrush.IsOk()) return; if (!m_window) return; @@ -1860,7 +1860,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) gdk_gc_set_fill( m_bgGC, GDK_SOLID ); - if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok())) + if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->IsOk())) { if (m_backgroundBrush.GetStipple()->GetPixmap()) { @@ -1937,7 +1937,7 @@ void wxWindowDCImpl::SetTextForeground( const wxColour &col ) // don't set m_textForegroundColour to an invalid colour as we'd crash // later then (we use m_textForegroundColour.GetColor() without checking // in a few places) - if ( !col.Ok() || (m_textForegroundColour == col) ) + if ( !col.IsOk() || (m_textForegroundColour == col) ) return; m_textForegroundColour = col; @@ -1954,7 +1954,7 @@ void wxWindowDCImpl::SetTextBackground( const wxColour &col ) wxCHECK_RET( IsOk(), wxT("invalid window dc") ); // same as above - if ( !col.Ok() || (m_textBackgroundColour == col) ) + if ( !col.IsOk() || (m_textBackgroundColour == col) ) return; m_textBackgroundColour = col; @@ -2103,7 +2103,7 @@ void wxWindowDCImpl::ComputeScaleAndOrigin() wxGTKDCImpl::ComputeScaleAndOrigin(); // if scale has changed call SetPen to recalulate the line width - if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.Ok() ) + if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.IsOk() ) { // this is a bit artificial, but we need to force wxDC to think the pen // has changed diff --git a/src/gtk1/dcmemory.cpp b/src/gtk1/dcmemory.cpp index 18bc2d0975..90b866b034 100644 --- a/src/gtk1/dcmemory.cpp +++ b/src/gtk1/dcmemory.cpp @@ -43,7 +43,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) Destroy(); m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (m_selected.GetPixmap()) { @@ -68,7 +68,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::SetPen( const wxPen& penOrig ) { wxPen pen( penOrig ); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetBitmap() && (pen != *wxTRANSPARENT_PEN) ) { @@ -81,7 +81,7 @@ void wxMemoryDCImpl::SetPen( const wxPen& penOrig ) void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig ) { wxBrush brush( brushOrig ); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetBitmap() && (brush != *wxTRANSPARENT_BRUSH) ) { @@ -95,7 +95,7 @@ void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig ) { wxBrush brush(brushOrig); - if ( m_selected.Ok() && + if ( m_selected.IsOk() && m_selected.GetBitmap() && (brush != *wxTRANSPARENT_BRUSH) ) { @@ -107,7 +107,7 @@ void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig ) void wxMemoryDCImpl::SetTextForeground( const wxColour& col ) { - if ( m_selected.Ok() && m_selected.GetBitmap() ) + if ( m_selected.IsOk() && m_selected.GetBitmap() ) { wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE); } @@ -119,7 +119,7 @@ void wxMemoryDCImpl::SetTextForeground( const wxColour& col ) void wxMemoryDCImpl::SetTextBackground( const wxColour &col ) { - if (m_selected.Ok() && m_selected.GetBitmap()) + if (m_selected.IsOk() && m_selected.GetBitmap()) { wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE ); } @@ -131,7 +131,7 @@ void wxMemoryDCImpl::SetTextBackground( const wxColour &col ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) (*width) = m_selected.GetWidth(); if (height) (*height) = m_selected.GetHeight(); diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index d21b31386a..42b4bc790b 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -777,11 +777,11 @@ void wxDropSource::SetIcons(const wxIcon &iconCopy, m_iconMove = iconMove; m_iconNone = iconNone; - if ( !m_iconCopy.Ok() ) + if ( !m_iconCopy.IsOk() ) m_iconCopy = wxIcon(page_xpm); - if ( !m_iconMove.Ok() ) + if ( !m_iconMove.IsOk() ) m_iconMove = m_iconCopy; - if ( !m_iconNone.Ok() ) + if ( !m_iconNone.IsOk() ) m_iconNone = m_iconCopy; } diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index c6a1888c16..735585d3d3 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -520,14 +520,14 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } @@ -539,28 +539,28 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->m_style; } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); // m_encoding is unused in wxGTK2, return encoding that the user set. return M_FONTDATA->m_encoding; @@ -568,7 +568,7 @@ wxFontEncoding wxFont::GetEncoding() const const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); if ( !M_FONTDATA->HasNativeFont() ) { @@ -583,7 +583,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); if ( M_FONTDATA->HasNativeFont() ) { @@ -696,7 +696,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { GdkFont *font = NULL; - wxCHECK_MSG( Ok(), font, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), font, wxT("invalid font") ); long int_scale = long(scale * 100.0 + 0.5); // key for fontlist int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100); diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 4a26646450..5b9a04bba4 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -148,7 +148,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this ); wxFont font = m_fontData.GetInitialFont(); - if( font.Ok() ) + if( font.IsOk() ) { const wxNativeFontInfo *info = font.GetNativeFontInfo(); diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index c0e55bae2a..a3bb9f6acf 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -1012,7 +1012,7 @@ bool wxListBox::IsOwnGtkWindow( GdkWindow *window ) void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) { - if (m_hasBgCol && m_backgroundColour.Ok()) + if (m_hasBgCol && m_backgroundColour.IsOk()) { GdkWindow *window = GTK_WIDGET(m_list)->window; if ( window ) @@ -1039,9 +1039,9 @@ void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) void wxListBox::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; - if (GTK_WIDGET(m_list)->window && cursor.Ok()) + if (GTK_WIDGET(m_list)->window && cursor.IsOk()) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 3a75190b66..e41086721f 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -976,7 +976,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) // TODO menuItem = gtk_menu_item_new(); } - else if (mitem->GetBitmap().Ok()) + else if (mitem->GetBitmap().IsOk()) { text = mitem->wxMenuItemBase::GetItemLabel(); const wxBitmap *bitmap = &mitem->GetBitmap(); diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 8fa09cd73f..64484abbee 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -182,7 +182,7 @@ void wxPen::SetStipple(const wxBitmap& WXUNUSED(stipple)) int wxPen::GetDashes( wxDash **ptr ) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = (wxDash*)M_PENDATA->m_dash; return M_PENDATA->m_countDashes; @@ -190,49 +190,49 @@ int wxPen::GetDashes( wxDash **ptr ) const int wxPen::GetDashCount() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return (M_PENDATA->m_countDashes); } wxDash* wxPen::GetDash() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return (wxDash*)M_PENDATA->m_dash; } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_capStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_joinStyle; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; } wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index 35c377163e..d07bbcdeea 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -180,10 +180,10 @@ bool wxRadioButton::IsOwnGtkWindow( GdkWindow *window ) void wxRadioButton::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget); - if ( win && cursor.Ok()) + if ( win && cursor.IsOk()) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index d128d9f973..bc33b74551 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -219,7 +219,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -238,7 +238,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -257,7 +257,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index 36ba1f63d6..815c1e0aee 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -165,7 +165,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_BTNFACE: case wxSYS_COLOUR_MENUBAR: case wxSYS_COLOUR_3DLIGHT: - if (!gs_objects.m_colBtnFace.Ok()) + if (!gs_objects.m_colBtnFace.IsOk()) { int red, green, blue; if ( !GetColourFromGTKWidget(red, green, blue) ) @@ -190,7 +190,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_GRAYTEXT: case wxSYS_COLOUR_BTNSHADOW: //case wxSYS_COLOUR_3DSHADOW: - if (!gs_objects.m_colBtnShadow.Ok()) + if (!gs_objects.m_colBtnShadow.IsOk()) { wxColour faceColour(GetColour(wxSYS_COLOUR_3DFACE)); gs_objects.m_colBtnShadow = @@ -206,7 +206,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) return * wxWHITE; case wxSYS_COLOUR_HIGHLIGHT: - if (!gs_objects.m_colHighlight.Ok()) + if (!gs_objects.m_colHighlight.IsOk()) { int red, green, blue; if ( !GetColourFromGTKWidget(red, green, blue, @@ -225,7 +225,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) return gs_objects.m_colHighlight; case wxSYS_COLOUR_LISTBOX: - if (!gs_objects.m_colListBox.Ok()) + if (!gs_objects.m_colListBox.IsOk()) { int red, green, blue; if ( GetColourFromGTKWidget(red, green, blue, @@ -250,7 +250,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_INACTIVECAPTIONTEXT: case wxSYS_COLOUR_BTNTEXT: case wxSYS_COLOUR_LISTBOXTEXT: - if (!gs_objects.m_colBtnText.Ok()) + if (!gs_objects.m_colBtnText.IsOk()) { int red, green, blue; if ( !GetColourFromGTKWidget(red, green, blue, @@ -270,20 +270,20 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) return gs_objects.m_colBtnText; case wxSYS_COLOUR_INFOBK: - if (!gs_objects.m_colTooltip.Ok()) { + if (!gs_objects.m_colTooltip.IsOk()) { GetTooltipColors(); } return gs_objects.m_colTooltip; case wxSYS_COLOUR_INFOTEXT: - if (!gs_objects.m_colTooltipText.Ok()) { + if (!gs_objects.m_colTooltipText.IsOk()) { GetTooltipColors(); } return gs_objects.m_colTooltipText; case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT: case wxSYS_COLOUR_HIGHLIGHTTEXT: - if (!gs_objects.m_colHighlightText.Ok()) + if (!gs_objects.m_colHighlightText.IsOk()) { wxColour hclr = GetColour(wxSYS_COLOUR_HIGHLIGHT); if (hclr.Red() > 200 && hclr.Green() > 200 && hclr.Blue() > 200) @@ -298,7 +298,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_ACTIVECAPTION: case wxSYS_COLOUR_MENUHILIGHT: - if (!gs_objects.m_colMenuItemHighlight.Ok()) + if (!gs_objects.m_colMenuItemHighlight.IsOk()) { int red, green, blue; if ( !GetColourFromGTKWidget(red, green, blue, @@ -346,7 +346,7 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) case wxSYS_DEVICE_DEFAULT_FONT: case wxSYS_DEFAULT_GUI_FONT: { - if (!gs_objects.m_fontSystem.Ok()) + if (!gs_objects.m_fontSystem.IsOk()) { gs_objects.m_fontSystem = wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL ); } diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp index 6437e2b3fb..c92e00c40c 100644 --- a/src/gtk1/statbmp.cpp +++ b/src/gtk1/statbmp.cpp @@ -54,10 +54,10 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi m_bitmap = bitmap; - wxBitmap bmp(bitmap.Ok() ? bitmap : wxBitmap(bogus_xpm)); + wxBitmap bmp(bitmap.IsOk() ? bitmap : wxBitmap(bogus_xpm)); m_widget = gtk_pixmap_new(bmp.GetPixmap(), NULL); - if (bitmap.Ok()) + if (bitmap.IsOk()) SetBitmap(bitmap); PostCreation(size); @@ -70,7 +70,7 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap ) { m_bitmap = bitmap; - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { GdkBitmap *mask = NULL; if (m_bitmap.GetMask()) diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 1aa82a3fff..7ce0d35e3d 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -726,7 +726,7 @@ void wxTextCtrl::OnEnabled( bool WXUNUSED(enable) ) // disabled and enabled mode, or we end up with a different colour under the // text. wxColour oldColour = GetBackgroundColour(); - if (oldColour.Ok()) + if (oldColour.IsOk()) { // Need to set twice or it'll optimize the useful stuff out if (oldColour == * wxWHITE) @@ -1110,7 +1110,7 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) if (!m_widget->window) return false; - if (!m_backgroundColour.Ok()) + if (!m_backgroundColour.IsOk()) return false; if (m_windowStyle & wxTE_MULTILINE) @@ -1242,9 +1242,9 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) void wxTextCtrl::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; - if (cursor.Ok()) + if (cursor.IsOk()) { GdkWindow *window = NULL; if (HasFlag(wxTE_MULTILINE)) @@ -1255,7 +1255,7 @@ void wxTextCtrl::OnInternalIdle() if (window) gdk_window_set_cursor( window, cursor.GetCursor() ); - if (!g_globalCursor.Ok()) + if (!g_globalCursor.IsOk()) cursor = *wxSTANDARD_CURSOR; window = m_widget->window; diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index f54630f874..286f3fc478 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -81,7 +81,7 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id, if (style & wxNO_BORDER) gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { OnSetBitmap(); } @@ -134,7 +134,7 @@ void wxToggleBitmapButton::SetLabel(const wxBitmap& label) void wxToggleBitmapButton::OnSetBitmap() { - if (!m_bitmap.Ok()) return; + if (!m_bitmap.IsOk()) return; GdkBitmap *mask = NULL; if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap(); @@ -179,11 +179,11 @@ void wxToggleBitmapButton::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget); - if ( win && cursor.Ok() ) + if ( win && cursor.IsOk() ) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the @@ -203,7 +203,7 @@ wxSize wxToggleBitmapButton::DoGetBestSize() const { wxSize best; - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { int border = HasFlag(wxNO_BORDER) ? 4 : 10; best.x = m_bitmap.GetWidth()+border; @@ -320,11 +320,11 @@ void wxToggleButton::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget); - if ( win && cursor.Ok() ) + if ( win && cursor.IsOk() ) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the diff --git a/src/gtk1/toolbar.cpp b/src/gtk1/toolbar.cpp index 21ed937b0c..0ab3c6798b 100644 --- a/src/gtk1/toolbar.cpp +++ b/src/gtk1/toolbar.cpp @@ -122,7 +122,7 @@ public: void SetPixmap(const wxBitmap& bitmap) { - if (bitmap.Ok()) + if (bitmap.IsOk()) { GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap() : NULL; @@ -357,7 +357,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) { wxBitmap bitmap = tool->GetNormalBitmap(); - wxCHECK_MSG( bitmap.Ok(), false, + wxCHECK_MSG( bitmap.IsOk(), false, wxT("invalid bitmap for wxToolBar icon") ); wxCHECK_MSG( bitmap.GetBitmap() == NULL, false, @@ -597,9 +597,9 @@ void wxToolBar::SetToolShortHelp( int id, const wxString& helpString ) void wxToolBar::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; - if (cursor.Ok()) + if (cursor.IsOk()) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 19067668d0..22364cdcdc 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -1100,7 +1100,7 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons ) return; wxIcon icon = icons.GetIcon(-1); - if (icon.Ok()) + if (icon.IsOk()) { wxMask *mask = icon.GetMask(); GdkBitmap *bm = NULL; diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 58956c1c97..42a37b7df2 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -2929,9 +2929,9 @@ void wxWindowGTK::OnInternalIdle() GtkUpdate(); wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; - if (cursor.Ok()) + if (cursor.IsOk()) { /* I now set the cursor anew in every OnInternalIdle call as setting the cursor in a parent window also effects the @@ -2944,7 +2944,7 @@ void wxWindowGTK::OnInternalIdle() if (window) gdk_window_set_cursor( window, cursor.GetCursor() ); - if (!g_globalCursor.Ok()) + if (!g_globalCursor.IsOk()) cursor = *wxSTANDARD_CURSOR; window = m_widget->window; @@ -3218,7 +3218,7 @@ int wxWindowGTK::GetCharHeight() const wxCHECK_MSG( (m_widget != NULL), 12, wxT("invalid window") ); wxFont font = GetFont(); - wxCHECK_MSG( font.Ok(), 12, wxT("invalid font") ); + wxCHECK_MSG( font.IsOk(), 12, wxT("invalid font") ); GdkFont *gfont = font.GetInternalFont( 1.0 ); @@ -3230,7 +3230,7 @@ int wxWindowGTK::GetCharWidth() const wxCHECK_MSG( (m_widget != NULL), 8, wxT("invalid window") ); wxFont font = GetFont(); - wxCHECK_MSG( font.Ok(), 8, wxT("invalid font") ); + wxCHECK_MSG( font.IsOk(), 8, wxT("invalid font") ); GdkFont *gfont = font.GetInternalFont( 1.0 ); @@ -3246,7 +3246,7 @@ void wxWindowGTK::DoGetTextExtent(const wxString& string, { wxFont fontToUse = theFont ? *theFont : GetFont(); - wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); + wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") ); if (string.empty()) { @@ -3697,7 +3697,7 @@ bool wxWindowGTK::SetBackgroundColour( const wxColour &colour ) if (!wxWindowBase::SetBackgroundColour(colour)) return false; - if (colour.Ok()) + if (colour.IsOk()) { // We need the pixel value e.g. for background clearing. m_backgroundColour.CalcPixel(gtk_widget_get_colormap(m_widget)); @@ -3720,7 +3720,7 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour ) return false; } - if (colour.Ok()) + if (colour.IsOk()) { // We need the pixel value e.g. for background clearing. m_foregroundColour.CalcPixel(gtk_widget_get_colormap(m_widget)); @@ -3737,21 +3737,21 @@ GtkRcStyle *wxWindowGTK::CreateWidgetStyle(bool forceStyle) { // do we need to apply any changes at all? if ( !forceStyle && - !m_font.Ok() && - !m_foregroundColour.Ok() && !m_backgroundColour.Ok() ) + !m_font.IsOk() && + !m_foregroundColour.IsOk() && !m_backgroundColour.IsOk() ) { return NULL; } GtkRcStyle *style = gtk_rc_style_new(); - if ( m_font.Ok() ) + if ( m_font.IsOk() ) { wxString xfontname = m_font.GetNativeFontInfo()->GetXFontName(); style->fontset_name = g_strdup(xfontname.c_str()); } - if ( m_foregroundColour.Ok() ) + if ( m_foregroundColour.IsOk() ) { GdkColor *fg = m_foregroundColour.GetColor(); @@ -3765,7 +3765,7 @@ GtkRcStyle *wxWindowGTK::CreateWidgetStyle(bool forceStyle) style->color_flags[GTK_STATE_ACTIVE] = GTK_RC_FG; } - if ( m_backgroundColour.Ok() ) + if ( m_backgroundColour.IsOk() ) { GdkColor *bg = m_backgroundColour.GetColor(); @@ -3913,7 +3913,7 @@ void wxWindowGTK::DoCaptureMouse() wxCHECK_RET( window, wxT("CaptureMouse() failed") ); const wxCursor* cursor = &m_cursor; - if (!cursor->Ok()) + if (!cursor->IsOk()) cursor = wxSTANDARD_CURSOR; gdk_pointer_grab( window, FALSE, diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index cb04eea749..ef7e57bc32 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -658,11 +658,11 @@ void wxHtmlHelpWindow::AddToolbarButtons(wxToolBar *toolBar, int style) wxBitmap woptionsBitmap = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_TOOLBAR); - wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() && - wforwardBitmap.Ok() && wupnodeBitmap.Ok() && - wupBitmap.Ok() && wdownBitmap.Ok() && - wopenBitmap.Ok() && wprintBitmap.Ok() && - woptionsBitmap.Ok()), + wxASSERT_MSG( (wpanelBitmap.IsOk() && wbackBitmap.IsOk() && + wforwardBitmap.IsOk() && wupnodeBitmap.IsOk() && + wupBitmap.IsOk() && wdownBitmap.IsOk() && + wopenBitmap.IsOk() && wprintBitmap.IsOk() && + woptionsBitmap.IsOk()), wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ; diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index f79224c539..50e178a6da 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -205,7 +205,7 @@ wxCursor wxHtmlCell::GetMouseCursor(wxHtmlWindowInterface *window) const // wxHtmlCell::GetCursor() method simply returns wxNullCursor, so we // know that GetCursor() was overridden iff it returns valid cursor. wxCursor cur = GetCursor(); - if (cur.Ok()) + if (cur.IsOk()) return cur; #endif // WXWIN_COMPATIBILITY_2_6 diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 4ce2e3b80a..9becb22f5b 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -695,7 +695,7 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr // Pass two printout objects: for preview, and possible printing. wxPrintDialogData printDialogData(*GetPrintData()); wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData); - if (!preview->Ok()) + if (!preview->IsOk()) { delete preview; return false; @@ -731,7 +731,7 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout) void wxHtmlEasyPrinting::PageSetup() { - if (!GetPrintData()->Ok()) + if (!GetPrintData()->IsOk()) { wxLogError(_("There was a problem during page setup: you may need to set a default printer.")); return; diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 423ecf7bf5..60fee4e25e 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -417,7 +417,7 @@ wxHtmlImageCell::wxHtmlImageCell(wxHtmlWindowInterface *windowIface, #endif // wxUSE_GIF && wxUSE_TIMER { wxImage image(*s, wxBITMAP_TYPE_ANY); - if ( image.Ok() ) + if ( image.IsOk() ) SetImage(image); } } @@ -446,7 +446,7 @@ wxHtmlImageCell::wxHtmlImageCell(wxHtmlWindowInterface *windowIface, void wxHtmlImageCell::SetImage(const wxImage& img) { #if !defined(__WXMSW__) || wxUSE_WXDIB - if ( img.Ok() ) + if ( img.IsOk() ) { delete m_bitmap; diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index b373e85a9d..c54b437c86 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -340,7 +340,7 @@ TAG_HANDLER_BEGIN(BODY, "BODY") if ( is ) { wxImage image(*is); - if ( image.Ok() ) + if ( image.IsOk() ) winIface->SetHTMLBackgroundImage(image); } diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index 078525080b..7bca5a4c3f 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -135,7 +135,7 @@ wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell *parent, const wxHtmlTag& t if (tag.HasParam(wxT("BGCOLOR"))) { tag.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg); - if (m_tBkg.Ok()) + if (m_tBkg.IsOk()) SetBackgroundColour(m_tBkg); } if (tag.HasParam(wxT("VALIGN"))) @@ -344,7 +344,7 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag) wxColour bk = m_rBkg; if (tag.HasParam(wxT("BGCOLOR"))) tag.GetParamAsColour(wxT("BGCOLOR"), &bk); - if (bk.Ok()) + if (bk.IsOk()) cell->SetBackgroundColour(bk); } if (m_Border > 0) diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp index 5cf71c1672..bae5a0c596 100644 --- a/src/mgl/bitmap.cpp +++ b/src/mgl/bitmap.cpp @@ -198,14 +198,14 @@ bool wxBitmap::Create(int width, int height, int depth) SetMonoPalette(wxColour(255, 255, 255), wxColour(0, 0, 0)); } - return Ok(); + return IsOk(); } wxBitmap::wxBitmap(const wxImage& image, int depth) { long width, height; - wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( image.IsOk(), wxT("invalid image") ); width = image.GetWidth(); height = image.GetHeight(); @@ -237,14 +237,14 @@ wxBitmap::wxBitmap(const wxImage& image, int depth) wxImage wxBitmap::ConvertToImage() const { - wxCHECK_MSG( Ok(), wxImage(), wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxImage(), wxT("invalid bitmap") ); int width, height; width = GetWidth(); height = GetHeight(); wxImage image(width, height); - wxASSERT_MSG( image.Ok(), wxT("cannot create image") ); + wxASSERT_MSG( image.IsOk(), wxT("cannot create image") ); MGLMemoryDC idc(width, height, 24, &gs_pixel_format_wxImage, width * 3, (void*)image.GetData(), NULL); @@ -299,35 +299,35 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask(wxMask *mask) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); AllocExclusive(); delete M_BMPDATA->m_mask; @@ -343,13 +343,13 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rect.x >= 0) && (rect.y >= 0) && (rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height), wxNullBitmap, wxT("invalid bitmap or bitmap region") ); wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); if ( GetPalette() ) ret.SetPalette(*GetPalette()); @@ -371,7 +371,7 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const void wxBitmap::SetMonoPalette(const wxColour& fg, const wxColour& bg) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); AllocExclusive(); palette_t *mono = M_BMPDATA->m_bitmap->pal; @@ -394,7 +394,7 @@ void wxBitmap::SetMonoPalette(const wxColour& fg, const wxColour& bg) MGLDevCtx *wxBitmap::CreateTmpDC() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); MGLDevCtx *tdc = new MGLMemoryDC(GetWidth(), GetHeight(), M_BMPDATA->m_bitmap->bitsPerPixel, @@ -446,7 +446,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type) if ( handler == NULL ) { wxImage image; - if ( !image.LoadFile(name, type) || !image.Ok() ) + if ( !image.LoadFile(name, type) || !image.IsOk() ) { wxLogError("no bitmap handler for type %d defined.", type); return false; @@ -463,7 +463,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type) bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const { - wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") ); wxBitmapHandler *handler = FindHandler(type); @@ -473,7 +473,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal if ( palette ) image.SetPalette(*palette); - if ( image.Ok() ) + if ( image.IsOk() ) return image.SaveFile(filename, type); else { @@ -487,20 +487,20 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal wxPalette *wxBitmap::GetPalette() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_palette; } void wxBitmap::SetPalette(const wxPalette& palette) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") ); AllocExclusive(); wxDELETE(M_BMPDATA->m_palette); - if ( !palette.Ok() ) return; + if ( !palette.IsOk() ) return; M_BMPDATA->m_palette = new wxPalette(palette); @@ -614,7 +614,7 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, if ( !MGL_getBitmapSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) return false; bitmap->Create(width, height, -1); - if ( !bitmap->Ok() ) return false; + if ( !bitmap->IsOk() ) return false; dc.SelectObject(*bitmap); if ( !dc.GetMGLDC()->loadBitmapIntoDC(fullname.mb_str(), 0, 0, TRUE) ) return false; @@ -625,7 +625,7 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, if ( !MGL_getJPEGSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) return false; bitmap->Create(width, height, -1); - if ( !bitmap->Ok() ) return false; + if ( !bitmap->IsOk() ) return false; dc.SelectObject(*bitmap); if ( !dc.GetMGLDC()->loadJPEGIntoDC(fullname.mb_str(), 0, 0, TRUE) ) return false; @@ -636,7 +636,7 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) return false; bitmap->Create(width, height, -1); - if ( !bitmap->Ok() ) return false; + if ( !bitmap->IsOk() ) return false; dc.SelectObject(*bitmap); if ( !dc.GetMGLDC()->loadPNGIntoDC(fullname.mb_str(), 0, 0, TRUE) ) return false; @@ -647,7 +647,7 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, if ( !MGL_getPCXSize(fullname.mb_str(), &width, &height, &bpp) ) return false; bitmap->Create(width, height, -1); - if ( !bitmap->Ok() ) return false; + if ( !bitmap->IsOk() ) return false; dc.SelectObject(*bitmap); if ( !dc.GetMGLDC()->loadPCXIntoDC(fullname.mb_str(), 0, 0, TRUE) ) return false; @@ -732,7 +732,7 @@ bool wxPNGBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, if ( bmp == NULL ) return false; bitmap->Create(bmp->width, bmp->height, -1); - if ( !bitmap->Ok() ) return false; + if ( !bitmap->IsOk() ) return false; // convert bmp to display's depth and write it to *bitmap: wxMemoryDC dc; diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index a03abbfb1c..a00c6ec8b6 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -144,7 +144,7 @@ wxBrush::wxBrush(const wxColour& col, int style) wxBrush::wxBrush(const wxBitmap &stippleBitmap) { - wxCHECK_RET( stippleBitmap.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( stippleBitmap.IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8, wxT("stipple bitmap must be 8x8") ); @@ -177,35 +177,35 @@ bool wxBrush::operator != (const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } void* wxBrush::GetMaskPattern() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return (void*)&(M_BRUSHDATA->m_maskPattern); } void* wxBrush::GetPixPattern() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return (void*)&(M_BRUSHDATA->m_pixPattern); } @@ -232,7 +232,7 @@ void wxBrush::SetStipple(const wxBitmap& stipple) { AllocExclusive(); - wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, wxT("stipple bitmap must be 8x8") ); diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index 7f99c1e987..8832eff0e7 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -180,7 +180,7 @@ static wxCursor gs_globalCursor = wxNullCursor; void wxSetCursor(const wxCursor& cursor) { - if ( cursor.Ok() ) + if ( cursor.IsOk() ) { if ( g_winMng ) MGL_wmSetGlobalCursor(g_winMng, *cursor.GetMGLCursor()); @@ -225,11 +225,11 @@ void wxBeginBusyCursor(const wxCursor *cursor) { if ( gs_busyCount++ > 0 ) return; - wxASSERT_MSG( !gs_savedCursor.Ok(), + wxASSERT_MSG( !gs_savedCursor.IsOk(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = gs_globalCursor; - if ( cursor->Ok() ) + if ( cursor->IsOk() ) wxSetCursor(*cursor); else wxSetCursor(wxCursor(wxCURSOR_WAIT)); diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index 5af342f8b7..40766b5af5 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -205,7 +205,7 @@ void wxDC::InitializeMGLDC() void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxRect rect(XLOG2DEV(cx), YLOG2DEV(cy), XLOG2DEVREL(cw), YLOG2DEVREL(ch)); @@ -222,7 +222,7 @@ void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch) void wxDC::DoSetDeviceClippingRegion(const wxRegion& region) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( region.IsEmpty() ) { @@ -262,7 +262,7 @@ void wxDC::DoSetDeviceClippingRegion(const wxRegion& region) void wxDC::DestroyClippingRegion() { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( !m_globalClippingRegion.IsNull() ) { @@ -303,7 +303,7 @@ int wxDC::GetDepth() const void wxDC::Clear() { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); m_MGLDC->makeCurrent(); // will go away with MGL6.0 if ( m_backgroundBrush.GetStyle() != wxTRANSPARENT ) @@ -340,7 +340,7 @@ bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const void wxDC::DoCrossHair(wxCoord x, wxCoord y) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( m_pen.GetStyle() != wxTRANSPARENT ) { @@ -361,7 +361,7 @@ void wxDC::DoCrossHair(wxCoord x, wxCoord y) void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( m_pen.GetStyle() != wxTRANSPARENT ) { @@ -381,7 +381,7 @@ void wxDC::DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCoord xx1 = XLOG2DEV(x1); wxCoord yy1 = YLOG2DEV(y1); @@ -440,7 +440,7 @@ void wxDC::DoDrawArc(wxCoord x1, wxCoord y1, void wxDC::DoDrawPoint(wxCoord x, wxCoord y) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( m_pen.GetStyle() != wxTRANSPARENT ) { @@ -454,7 +454,7 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y) void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,wxPolygonFillMode WXUNUSED(fillStyle)) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCoord xxoffset = XLOG2DEVREL(xoffset), yyoffset = YLOG2DEVREL(yoffset); @@ -495,7 +495,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffs void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( m_pen.GetStyle() != wxTRANSPARENT ) { @@ -516,7 +516,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCoord xx = XLOG2DEV(x); wxCoord yy = YLOG2DEV(y); @@ -559,7 +559,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( radius < 0.0 ) radius = -radius * ((width < height) ? width : height); @@ -635,7 +635,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCoord x2 = (x+width); wxCoord y2 = (y+height); @@ -664,7 +664,7 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCoord x2 = (x+w); wxCoord y2 = (y+h); @@ -736,7 +736,7 @@ bool wxDC::SelectMGLFont() void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); SelectMGLFont(); @@ -999,7 +999,7 @@ void wxDC::SelectMGLFatPen(int style, int flag) void wxDC::SelectPen() { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxColour& clr = m_pen.GetColour(); m_MGLDC->makeCurrent(); // will go away with MGL6.0 @@ -1045,7 +1045,7 @@ void wxDC::SelectPen() void wxDC::SelectBrush() { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxColour fg, bg; m_MGLDC->makeCurrent(); // will go away with MGL6.0 @@ -1071,7 +1071,7 @@ void wxDC::SelectBrush() void wxDC::SetPen(const wxPen& pen) { - if ( !pen.Ok() ) return; + if ( !pen.IsOk() ) return; if ( m_pen == pen ) return; m_pen = pen; m_penSelected = false; @@ -1080,7 +1080,7 @@ void wxDC::SetPen(const wxPen& pen) void wxDC::SetBrush(const wxBrush& brush) { - if ( !brush.Ok() ) return; + if ( !brush.IsOk() ) return; if ( m_brush == brush ) return; m_brush = brush; m_brushSelected = false; @@ -1089,11 +1089,11 @@ void wxDC::SetBrush(const wxBrush& brush) void wxDC::SetPalette(const wxPalette& palette) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); - if ( !palette.Ok() ) + if ( !palette.IsOk() ) { - if ( m_oldPalette.Ok() ) + if ( m_oldPalette.IsOk() ) SetPalette(m_oldPalette); return; } @@ -1112,7 +1112,7 @@ void wxDC::SetPalette(const wxPalette& palette) void wxDC::SetFont(const wxFont& font) { - if ( font.Ok() ) + if ( font.IsOk() ) { m_font = font; m_mglFont = NULL; @@ -1121,9 +1121,9 @@ void wxDC::SetFont(const wxFont& font) void wxDC::SetBackground(const wxBrush& brush) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); - if (!brush.Ok()) return; + if (!brush.IsOk()) return; m_backgroundBrush = brush; wxColour &clr = m_backgroundBrush.GetColour(); @@ -1143,7 +1143,7 @@ void wxDC::SetBackgroundMode(int mode) void wxDC::SetLogicalFunction(wxRasterOperationMode function) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); m_logicalFunction = function; @@ -1301,7 +1301,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { - wxCHECK_MSG( Ok(), false, wxT("invalid dc") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid dc") ); wxCHECK_MSG( source, false, wxT("invalid source dc") ); // transform the source DC coords to the device ones @@ -1349,8 +1349,8 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") ); wxCoord w = bmp.GetWidth(); wxCoord h = bmp.GetHeight(); @@ -1392,8 +1392,8 @@ void wxDC::DoDrawSubBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxCoord destx, wxCoord desty, int rop, bool useMask) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") ); CalcBoundingBox(x, y); CalcBoundingBox(x + w, y + h); diff --git a/src/mgl/dcmemory.cpp b/src/mgl/dcmemory.cpp index d09e8080f8..a5a61a33f6 100644 --- a/src/mgl/dcmemory.cpp +++ b/src/mgl/dcmemory.cpp @@ -40,7 +40,7 @@ wxMemoryDC::~wxMemoryDC() void wxMemoryDC::DoSelect(const wxBitmap& bitmap) { - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { m_selected = bitmap; SetMGLDC(m_selected.CreateTmpDC(), TRUE); @@ -49,7 +49,7 @@ void wxMemoryDC::DoSelect(const wxBitmap& bitmap) void wxMemoryDC::SetPen(const wxPen &pen) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( GetDepth() == 1 && *wxTRANSPARENT_PEN != pen ) { @@ -66,7 +66,7 @@ void wxMemoryDC::SetPen(const wxPen &pen) void wxMemoryDC::SetBrush(const wxBrush &brush) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( GetDepth() == 1 && *wxTRANSPARENT_BRUSH != brush ) { @@ -83,7 +83,7 @@ void wxMemoryDC::SetBrush(const wxBrush &brush) void wxMemoryDC::SetTextForeground(const wxColour &col) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( GetDepth() == 1 ) { @@ -100,7 +100,7 @@ void wxMemoryDC::SetTextForeground(const wxColour &col) void wxMemoryDC::SetTextBackground(const wxColour &col) { - wxCHECK_RET( Ok(), wxT("invalid dc") ); + wxCHECK_RET( IsOk(), wxT("invalid dc") ); if ( GetDepth() == 1 ) { diff --git a/src/mgl/font.cpp b/src/mgl/font.cpp index b464e5dc71..117b1d7bdb 100644 --- a/src/mgl/font.cpp +++ b/src/mgl/font.cpp @@ -72,7 +72,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const struct font_t *wxFont::GetMGLfont_t(float scale, bool antialiased) { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); // we don't support DC scaling yet, so use scale=1 wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased); @@ -81,14 +81,14 @@ struct font_t *wxFont::GetMGLfont_t(float scale, bool antialiased) int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); } @@ -100,21 +100,21 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } @@ -122,21 +122,21 @@ bool wxFont::GetUnderlined() const wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); } bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->IsFixedWidth(); } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); return M_FONTDATA->GetNativeFontInfo(); } diff --git a/src/mgl/palette.cpp b/src/mgl/palette.cpp index 92536bb350..fcac1e22ea 100644 --- a/src/mgl/palette.cpp +++ b/src/mgl/palette.cpp @@ -126,12 +126,12 @@ bool wxPalette::GetRGB(int pixel, int wxPalette::GetColoursCount() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid palette") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid palette") ); return M_PALETTEDATA->m_count; } palette_t *wxPalette::GetMGLpalette_t() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid palette") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid palette") ); return M_PALETTEDATA->m_entries; } diff --git a/src/mgl/pen.cpp b/src/mgl/pen.cpp index 3eff4b729c..25572afe19 100644 --- a/src/mgl/pen.cpp +++ b/src/mgl/pen.cpp @@ -122,7 +122,7 @@ wxPen::wxPen(const wxColour& colour, int width, int style) wxPen::wxPen(const wxBitmap& stipple, int width) { - wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, wxT("stipple bitmap must be 8x8") ); @@ -186,7 +186,7 @@ void wxPen::SetStyle(wxPenStyle style) void wxPen::SetStipple(const wxBitmap& stipple) { - wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, wxT("stipple bitmap must be 8x8") ); @@ -203,7 +203,7 @@ void wxPen::SetWidth(int width) int wxPen::GetDashes(wxDash **ptr) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = (wxDash*)M_PENDATA->m_dash; return M_PENDATA->m_countDashes; @@ -211,63 +211,63 @@ int wxPen::GetDashes(wxDash **ptr) const int wxPen::GetDashCount() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return (M_PENDATA->m_countDashes); } wxDash* wxPen::GetDash() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return (wxDash*)M_PENDATA->m_dash; } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_capStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_joinStyle; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; } wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } wxBitmap *wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return &(M_PENDATA->m_stipple); } void* wxPen::GetPixPattern() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return (void*)&(M_PENDATA->m_pixPattern); } diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index aad3ea0e6b..ec655b4ebd 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -659,7 +659,7 @@ void wxWindowMGL::SetMGLwindow_t(struct window_t *wnd) MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0); MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0); - if ( m_cursor.Ok() ) + if ( m_cursor.IsOk() ) MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor()); else MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor()); @@ -822,7 +822,7 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor) return false; } - if ( m_cursor.Ok() ) + if ( m_cursor.IsOk() ) MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor()); else MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor()); diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index 771c50ff85..6a68b1009b 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -138,7 +138,7 @@ void wxCheckBoxCallback (Widget WXUNUSED(w), XtPointer clientData, void wxCheckBox::ChangeBackgroundColour() { - if (!m_backgroundColour.Ok()) + if (!m_backgroundColour.IsOk()) return; wxComputeColours (XtDisplay((Widget) m_mainWidget), & m_backgroundColour, diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index 32ae77bab4..7557887c05 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -205,7 +205,7 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter& items, wxDoChangeBackgroundColour((WXWidget) w, m_backgroundColour); - if( m_font.Ok() ) + if( m_font.IsOk() ) wxDoChangeFont( w, m_font ); m_widgetArray.Insert(w, pos); @@ -429,7 +429,7 @@ void wxChoice::ChangeFont(bool keepOriginalSize) // Note that this causes the widget to be resized back // to its original size! We therefore have to set the size // back again. TODO: a better way in Motif? - if (m_mainWidget && m_font.Ok()) + if (m_mainWidget && m_font.IsOk()) { Display* dpy = XtDisplay((Widget) m_mainWidget); int width, height, width1, height1; diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 91f7f3d16c..9fbb5241a2 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -327,7 +327,7 @@ void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, void wxComboBox::ChangeFont(bool keepOriginalSize) { - if( m_font.Ok() && m_mainWidget != NULL ) + if( m_font.IsOk() && m_mainWidget != NULL ) { wxDoChangeFont( GetXmText(this), m_font ); wxDoChangeFont( GetXmList(this), m_font ); diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp index 22646e641a..56b1b840ca 100644 --- a/src/motif/cursor.cpp +++ b/src/motif/cursor.cpp @@ -466,7 +466,7 @@ wxXSetBusyCursor (wxWindow * win, const wxCursor * cursor) else { // Restore old cursor - if (win->GetCursor().Ok()) + if (win->GetCursor().IsOk()) attrs.cursor = (Cursor) win->GetCursor().GetXCursor(display); else attrs.cursor = None; diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index c96ec26e15..0fd6bf384b 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -160,7 +160,7 @@ size_t wxBitmapDataObject::GetDataSize() const bool wxBitmapDataObject::GetDataHere(void* buf) const { - if( !GetBitmap().Ok() ) + if( !GetBitmap().IsOk() ) return false; (*(Pixmap*)buf) = (Pixmap)GetBitmap().GetDrawable(); diff --git a/src/motif/dc.cpp b/src/motif/dc.cpp index 6ce44a8df1..4e83cd78e6 100644 --- a/src/motif/dc.cpp +++ b/src/motif/dc.cpp @@ -36,14 +36,14 @@ wxMotifDCImpl::wxMotifDCImpl(wxDC *owner) void wxMotifDCImpl::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y) { wxCHECK_RET( IsOk(), "invalid dc" ); - wxCHECK_RET( icon.Ok(), "invalid icon" ); + wxCHECK_RET( icon.IsOk(), "invalid icon" ); DoDrawBitmap(icon, x, y, true); } void wxMotifDCImpl::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask ) { - wxCHECK_RET( bitmap.Ok(), "invalid bitmap" ); + wxCHECK_RET( bitmap.IsOk(), "invalid bitmap" ); wxMemoryDC memDC; memDC.SelectObjectAsSource(bitmap); diff --git a/src/motif/dcmemory.cpp b/src/motif/dcmemory.cpp index 79b11e38e6..72c64deea8 100644 --- a/src/motif/dcmemory.cpp +++ b/src/motif/dcmemory.cpp @@ -99,7 +99,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) XFreeGC((Display*) m_display, (GC) m_gc); m_gc = (WXGC) NULL; - if (m_bitmap.Ok() && (bitmap.GetDisplay() == m_display)) + if (m_bitmap.IsOk() && (bitmap.GetDisplay() == m_display)) { m_pixmap = m_bitmap.GetDrawable(); Display* display = (Display*) m_display; @@ -129,7 +129,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { if (width) (*width) = m_bitmap.GetWidth(); if (height) (*height) = m_bitmap.GetHeight(); diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index e2da28904a..cf105fe9be 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -165,7 +165,7 @@ int wxFileDialog::ShowModal() Arg args[10]; int ac = 0; - if (m_backgroundColour.Ok()) + if (m_backgroundColour.IsOk()) { wxComputeColours (dpy, & m_backgroundColour, NULL); diff --git a/src/motif/font.cpp b/src/motif/font.cpp index 5707d14729..a07b6fa920 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -441,14 +441,14 @@ void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info) int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName ; } @@ -460,35 +460,35 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->m_style; } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->m_encoding; } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty()) GetInternalFont(); @@ -505,7 +505,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const // font to list in the private data for future reference. wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { - if ( !Ok() ) + if ( !IsOk() ) return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont @@ -617,18 +617,18 @@ WXRenderTable wxFont::GetRenderTable(WXDisplay* display) const WXFontType wxFont::GetFontType(WXDisplay* display) const { #if wxMOTIF_USE_RENDER_TABLE - return Ok() ? GetRenderTable(display) : NULL; + return IsOk() ? GetRenderTable(display) : NULL; #else - return Ok() ? GetFontList(1.0, display) : NULL; + return IsOk() ? GetFontList(1.0, display) : NULL; #endif } WXFontType wxFont::GetFontTypeC(WXDisplay* display) const { #if wxMOTIF_USE_RENDER_TABLE - return Ok() ? GetRenderTable(display) : NULL; + return IsOk() ? GetRenderTable(display) : NULL; #else - return Ok() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL; + return IsOk() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL; #endif } diff --git a/src/motif/frame.cpp b/src/motif/frame.cpp index 51755c4a1e..c4c3d3c952 100644 --- a/src/motif/frame.cpp +++ b/src/motif/frame.cpp @@ -449,7 +449,7 @@ void wxFrame::DoSetIcon(const wxIcon& icon) if (!m_frameShell) return; - if (!icon.Ok() || !icon.GetDrawable()) + if (!icon.IsOk() || !icon.GetDrawable()) return; XtVaSetValues((Widget) m_frameShell, diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index b0ab1011ab..da952a3627 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -101,7 +101,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, ( m_windowStyle & wxLB_EXTENDED ) ? XmEXTENDED_SELECT : XmBROWSE_SELECT ); ++count; - if( m_font.Ok() ) + if( m_font.IsOk() ) { XtSetArg( args[count], (String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy) ); diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 3312c052ad..02ada167a3 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -454,7 +454,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, XtSetArg (args[0], XmNnumColumns, m_numColumns); XtSetArg (args[1], XmNpacking, (m_numColumns > 1) ? XmPACK_COLUMN : XmPACK_TIGHT); - if ( !m_font.Ok() ) + if ( !m_font.IsOk() ) { if ( menuBar ) m_font = menuBar->GetFont(); @@ -586,7 +586,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const void wxMenu::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; - if (!col.Ok()) + if (!col.IsOk()) return; if (m_menuWidget) wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col); @@ -611,7 +611,7 @@ void wxMenu::SetBackgroundColour(const wxColour& col) void wxMenu::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; - if (!col.Ok()) + if (!col.IsOk()) return; if (m_menuWidget) wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col); @@ -637,7 +637,7 @@ void wxMenu::ChangeFont(bool keepOriginalSize) { // Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does #if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 ) - if (!m_font.Ok() || !m_menuWidget) + if (!m_font.IsOk() || !m_menuWidget) return; Display* dpy = XtDisplay((Widget) m_menuWidget); @@ -657,7 +657,7 @@ void wxMenu::ChangeFont(bool keepOriginalSize) node = node->GetNext() ) { wxMenuItem* item = node->GetData(); - if (m_menuWidget && item->GetButtonWidget() && m_font.Ok()) + if (m_menuWidget && item->GetButtonWidget() && m_font.IsOk()) { XtVaSetValues ((Widget) item->GetButtonWidget(), wxFont::GetFontTag(), m_font.GetFontTypeC(dpy), @@ -681,7 +681,7 @@ bool wxMenuBar::SetBackgroundColour(const wxColour& col) { if (!wxWindowBase::SetBackgroundColour(col)) return false; - if (!col.Ok()) + if (!col.IsOk()) return false; if (m_mainWidget) wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col); @@ -697,7 +697,7 @@ bool wxMenuBar::SetForegroundColour(const wxColour& col) { if (!wxWindowBase::SetForegroundColour(col)) return false; - if (!col.Ok()) + if (!col.IsOk()) return false; if (m_mainWidget) wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col); diff --git a/src/motif/msgdlg.cpp b/src/motif/msgdlg.cpp index 5a7a63b83a..d648c0e78c 100644 --- a/src/motif/msgdlg.cpp +++ b/src/motif/msgdlg.cpp @@ -154,7 +154,7 @@ int wxMessageDialog::ShowModal() Display* dpy = XtDisplay(wParent); - if (m_backgroundColour.Ok()) + if (m_backgroundColour.IsOk()) { wxComputeColours (dpy, & m_backgroundColour, NULL); diff --git a/src/motif/statbmp.cpp b/src/motif/statbmp.cpp index 548ae9777a..eea9bd71b9 100644 --- a/src/motif/statbmp.cpp +++ b/src/motif/statbmp.cpp @@ -59,9 +59,9 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, wxSize actualSize(size); // work around the cases where the bitmap is a wxNull(Icon/Bitmap) if (actualSize.x == -1) - actualSize.x = bitmap.Ok() ? bitmap.GetWidth() : 1; + actualSize.x = bitmap.IsOk() ? bitmap.GetWidth() : 1; if (actualSize.y == -1) - actualSize.y = bitmap.Ok() ? bitmap.GetHeight() : 1; + actualSize.y = bitmap.IsOk() ? bitmap.GetHeight() : 1; PostCreation(); DoSetBitmap(); @@ -81,7 +81,7 @@ void wxStaticBitmap::DoSetBitmap() Widget widget = (Widget) m_mainWidget; int w2, h2; - if (m_messageBitmapOriginal.Ok()) + if (m_messageBitmapOriginal.IsOk()) { w2 = m_messageBitmapOriginal.GetWidth(); h2 = m_messageBitmapOriginal.GetHeight(); diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 77d27351ec..c8ae30e002 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -380,13 +380,13 @@ bool wxToolBar::Realize() wxColour col; col.SetPixel(backgroundPixel); - if( bmp.Ok() && bmp.GetMask() ) + if( bmp.IsOk() && bmp.GetMask() ) { bmp = wxCreateMaskedBitmap(bmp, col); tool->SetNormalBitmap(bmp); } - if( insensBmp.Ok() && insensBmp.GetMask() ) + if( insensBmp.IsOk() && insensBmp.GetMask() ) { insensBmp = wxCreateMaskedBitmap(insensBmp, col); tool->SetDisabledBitmap(insensBmp); @@ -410,7 +410,7 @@ bool wxToolBar::Realize() { wxBitmap tmp = tool->GetDisabledBitmap(); - insensPixmap = tmp.Ok() ? + insensPixmap = tmp.IsOk() ? (Pixmap)tmp.GetDrawable() : tool->GetInsensPixmap(); } diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 6b34406327..5fd3aeefb8 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -517,7 +517,7 @@ XmString wxFindAcceleratorText (const char *s) // Change a widget's foreground and background colours. void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour) { - if (!foregroundColour.Ok()) + if (!foregroundColour.IsOk()) return; // When should we specify the foreground, if it's calculated @@ -536,7 +536,7 @@ void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour) void wxDoChangeBackgroundColour(WXWidget widget, const wxColour& backgroundColour, bool changeArmColour) { - if (!backgroundColour.Ok()) + if (!backgroundColour.IsOk()) return; wxComputeColours (XtDisplay((Widget) widget), & backgroundColour, diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 6078beb09c..01bac12813 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -687,10 +687,10 @@ bool wxWindow::SetCursor(const wxCursor& cursor) return false; } - // wxASSERT_MSG( m_cursor.Ok(), + // wxASSERT_MSG( m_cursor.IsOk(), // wxT("cursor must be valid after call to the base version")); const wxCursor* cursor2 = NULL; - if (m_cursor.Ok()) + if (m_cursor.IsOk()) cursor2 = & m_cursor; else cursor2 = wxSTANDARD_CURSOR; @@ -1454,7 +1454,7 @@ int wxWindow::GetCharHeight() const { int height; - if (m_font.Ok()) + if (m_font.IsOk()) wxGetTextExtent (GetXDisplay(), m_font, 1.0, "x", NULL, &height, NULL, NULL); else @@ -1467,7 +1467,7 @@ int wxWindow::GetCharWidth() const { int width; - if (m_font.Ok()) + if (m_font.IsOk()) wxGetTextExtent (GetXDisplay(), m_font, 1.0, "x", &width, NULL, NULL, NULL); else @@ -1486,7 +1486,7 @@ void wxWindow::DoGetTextExtent(const wxString& string, if (externalLeading) *externalLeading = 0; - if (fontToUse->Ok()) + if (fontToUse->IsOk()) wxGetTextExtent (GetXDisplay(), *fontToUse, 1.0, string, x, y, NULL, descent); else @@ -1659,7 +1659,7 @@ void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event) bool wxWindow::ProcessAccelerator(wxKeyEvent& event) { #if wxUSE_ACCEL - if (!m_acceleratorTable.Ok()) + if (!m_acceleratorTable.IsOk()) return false; int count = m_acceleratorTable.GetCount(); @@ -2489,7 +2489,7 @@ void wxWindow::ChangeFont(bool keepOriginalSize) // to its original size! We therefore have to set the size // back again. TODO: a better way in Motif? Widget w = (Widget) GetLabelWidget(); // Usually the main widget - if (w && m_font.Ok()) + if (w && m_font.IsOk()) { int width, height, width1, height1; GetSize(& width, & height); diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 1da9cb7597..434df30367 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -148,7 +148,7 @@ WXHACCEL wxAcceleratorTable::GetHACCEL() const bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const { MSG *msg = (MSG *)wxmsg; - return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); + return IsOk() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg); } #endif // wxUSE_ACCEL diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 00df612886..10756fee7c 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -387,7 +387,7 @@ bool wxBitmap::CopyFromCursor(const wxCursor& cursor, wxBitmapTransparency trans { UnRef(); - if ( !cursor.Ok() ) + if ( !cursor.IsOk() ) return false; return CopyFromIconOrCursor(cursor, transp); @@ -397,7 +397,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon, wxBitmapTransparency transp) { UnRef(); - if ( !icon.Ok() ) + if ( !icon.IsOk() ) return false; return CopyFromIconOrCursor(icon, transp); @@ -605,7 +605,7 @@ bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc) SetHBITMAP((WXHBITMAP)hbmp); - return Ok(); + return IsOk(); } #if wxUSE_IMAGE @@ -739,7 +739,7 @@ wxImage wxBitmap::ConvertToImage() const // so the 'depth' argument is ignored. // TODO: transparency (create a mask image) - if (!Ok()) + if (!IsOk()) { wxFAIL_MSG( wxT("bitmap is invalid") ); return wxNullImage; @@ -747,7 +747,7 @@ wxImage wxBitmap::ConvertToImage() const wxImage image; - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); // create an wxImage object int width = GetWidth(); @@ -823,7 +823,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc) bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc) { - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") ); UnRef(); @@ -929,7 +929,7 @@ wxImage wxBitmap::ConvertToImage() const // and then DIB to our wxImage wxImage image = dib.ConvertToImage(); - if ( !image.Ok() ) + if ( !image.IsOk() ) { return wxNullImage; } @@ -1039,7 +1039,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) else // no bitmap handler found { wxImage image; - if ( image.LoadFile( filename, type ) && image.Ok() ) + if ( image.LoadFile( filename, type ) && image.IsOk() ) { *this = wxBitmap(image); @@ -1084,7 +1084,7 @@ bool wxBitmap::SaveFile(const wxString& filename, { // FIXME what about palette? shouldn't we use it? wxImage image = ConvertToImage(); - if ( image.Ok() ) + if ( image.IsOk() ) { return image.SaveFile(filename, type); } @@ -1106,14 +1106,14 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect ) const wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rect.x >= 0) && (rect.y >= 0) && (rect.x+rect.width <= GetWidth()) && (rect.y+rect.height <= GetHeight()), wxNullBitmap, wxT("Invalid bitmap or bitmap region") ); wxBitmap ret( rect.width, rect.height, GetDepth() ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); #ifndef __WXMICROWIN__ // handle alpha channel, if any @@ -1248,7 +1248,7 @@ void wxBitmap::SetMask(wxMask *mask) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) { #if wxUSE_WXDIB - if ( !Ok() ) + if ( !IsOk() ) { // no bitmap, no data (raw or otherwise) return NULL; @@ -1326,7 +1326,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) { #if wxUSE_WXDIB - if ( !Ok() ) + if ( !IsOk() ) return; if ( !&dataBase ) @@ -1427,7 +1427,7 @@ wxMask::~wxMask() bool wxMask::Create(const wxBitmap& bitmap) { #ifndef __WXMICROWIN__ - wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, false, + wxCHECK_MSG( bitmap.IsOk() && bitmap.GetDepth() == 1, false, wxT("can't create mask from invalid or not monochrome bitmap") ); if ( m_maskBitmap ) @@ -1468,7 +1468,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) } #if wxUSE_PALETTE - if (bitmap.Ok() && bitmap.GetPalette()->Ok()) + if (bitmap.IsOk() && bitmap.GetPalette()->IsOk()) { unsigned char red, green, blue; if (bitmap.GetPalette()->GetRGB(paletteIndex, &red, &green, &blue)) @@ -1487,7 +1487,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) { #ifndef __WXMICROWIN__ - wxCHECK_MSG( bitmap.Ok(), false, wxT("invalid bitmap in wxMask::Create") ); + wxCHECK_MSG( bitmap.IsOk(), false, wxT("invalid bitmap in wxMask::Create") ); if ( m_maskBitmap ) { @@ -1625,7 +1625,7 @@ HICON wxBitmapToIconOrCursor(const wxBitmap& bmp, int hotSpotX, int hotSpotY) { - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { // we can't create an icon/cursor form nothing return 0; diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index 09f346bcdd..2d266918b7 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -277,28 +277,28 @@ wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } WXHANDLE wxBrush::GetResourceHandle() const { - wxCHECK_MSG( Ok(), FALSE, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), FALSE, wxT("invalid brush") ); return (WXHANDLE)M_BRUSHDATA->GetHBRUSH(); } diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index a4e49c8ccb..3e4c964624 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -260,7 +260,7 @@ bool wxCheckBox::SetForegroundColour(const wxColour& colour) // the only way to change the checkbox foreground colour under Windows XP // is to owner draw it if ( wxUxThemeEngine::GetIfActive() ) - MakeOwnerDrawn(colour.Ok()); + MakeOwnerDrawn(colour.IsOk()); return true; } diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 594610275d..da105ae254 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -214,7 +214,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, { wxBitmap *bitmap = (wxBitmap *)data; - if ( bitmap && bitmap->Ok() ) + if ( bitmap && bitmap->IsOk() ) { wxDIB dib(*bitmap); if ( dib.IsOk() ) diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 056794b517..0d937c9016 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -365,7 +365,7 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) HDC hdc = (HDC)pDC; WXHBRUSH hbr = 0; - if ( !colBg.Ok() ) + if ( !colBg.IsOk() ) { if ( wxWindow *win = wxFindWinFromHandle(hWnd) ) hbr = win->MSWGetBgBrush(pDC); @@ -380,7 +380,7 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) // use the background colour override if a valid colour is given: this is // used when the control is disabled to grey it out and also if colBg was // set just above - if ( colBg.Ok() ) + if ( colBg.IsOk() ) { wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg); hbr = (WXHBRUSH)brush->GetResourceHandle(); diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index bfa5771d24..74f57dcf52 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -391,7 +391,7 @@ const wxCursor *wxGetGlobalCursor() void wxSetCursor(const wxCursor& cursor) { - if ( cursor.Ok() ) + if ( cursor.IsOk() ) { ::SetCursor(GetHcursorOf(cursor)); diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index c84983ad85..b419feb715 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -104,7 +104,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) if ( m_oldBitmap ) { ::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap); - if ( m_selectedBitmap.Ok() ) + if ( m_selectedBitmap.IsOk() ) { m_selectedBitmap.SetSelectedInto(NULL); m_selectedBitmap = wxNullBitmap; @@ -138,7 +138,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize(int *width, int *height) const { - if ( m_selectedBitmap.Ok() ) + if ( m_selectedBitmap.IsOk() ) { *width = m_selectedBitmap.GetWidth(); *height = m_selectedBitmap.GetHeight(); @@ -163,7 +163,7 @@ static void wxDrawRectangle(wxDC& dc, wxCoord x, wxCoord y, wxCoord width, wxCoo { wxBrush brush(dc.GetBrush()); wxPen pen(dc.GetPen()); - if (brush.Ok() && brush.GetStyle() != wxTRANSPARENT) + if (brush.IsOk() && brush.GetStyle() != wxTRANSPARENT) { HBRUSH hBrush = (HBRUSH) brush.GetResourceHandle() ; if (hBrush) @@ -176,7 +176,7 @@ static void wxDrawRectangle(wxDC& dc, wxCoord x, wxCoord y, wxCoord width, wxCoo } } width --; height --; - if (pen.Ok() && pen.GetStyle() != wxTRANSPARENT) + if (pen.IsOk() && pen.GetStyle() != wxTRANSPARENT) { dc.DrawLine(x, y, x + width, y); dc.DrawLine(x, y, x, y + height); @@ -192,7 +192,7 @@ void wxMemoryDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoor // Set this to 1 to work around an apparent video driver bug // (visible with e.g. 70x70 rectangle on a memory DC; see Drawing sample) #if wxUSE_MEMORY_DC_DRAW_RECTANGLE - if (m_brush.Ok() && m_pen.Ok() && + if (m_brush.IsOk() && m_pen.IsOk() && (m_brush.GetStyle() == wxSOLID || m_brush.GetStyle() == wxTRANSPARENT) && (m_pen.GetStyle() == wxSOLID || m_pen.GetStyle() == wxTRANSPARENT) && (GetLogicalFunction() == wxCOPY)) diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 9ca81119cb..150232ed19 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -401,7 +401,7 @@ void wxPrinterDCImpl::DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y, bool useMask) { - wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); int width = bmp.GetWidth(), height = bmp.GetHeight(); diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index b04985d6c2..3e54725e3a 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -443,7 +443,7 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar { // set our cursor for all windows (but see below) wxCursor cursor = m_cursor; - if ( !cursor.Ok() ) + if ( !cursor.IsOk() ) cursor = wxCURSOR_ARROW; ::SetCursor(GetHcursorOf(cursor)); diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 14a44e2339..4eff321612 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -660,7 +660,7 @@ wxPalette *wxDIB::CreatePalette() const bool wxDIB::Create(const wxImage& image, PixelFormat pf) { - wxCHECK_MSG( image.Ok(), false, wxT("invalid wxImage in wxDIB ctor") ); + wxCHECK_MSG( image.IsOk(), false, wxT("invalid wxImage in wxDIB ctor") ); const int h = image.GetHeight(); const int w = image.GetWidth(); @@ -753,7 +753,7 @@ wxImage wxDIB::ConvertToImage() const const int w = GetWidth(); const int h = GetHeight(); wxImage image(w, h, false /* don't bother clearing memory */); - if ( !image.Ok() ) + if ( !image.IsOk() ) { wxFAIL_MSG( wxT("could not allocate data for image") ); return wxNullImage; diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 27e5c366c2..7e06613e36 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -301,7 +301,7 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS return false; } - if (m_cursor.Ok()) + if (m_cursor.IsOk()) { #if wxUSE_SIMPLER_DRAGIMAGE m_oldCursor = window->GetCursor(); @@ -352,7 +352,7 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS } #if !wxUSE_SIMPLER_DRAGIMAGE - if (m_cursor.Ok()) + if (m_cursor.IsOk()) ::ShowCursor(FALSE); #endif @@ -397,7 +397,7 @@ bool wxDragImage::EndDrag() } #if wxUSE_SIMPLER_DRAGIMAGE - if (m_cursor.Ok() && m_oldCursor.Ok()) + if (m_cursor.IsOk() && m_oldCursor.IsOk()) m_window->SetCursor(m_oldCursor); #else ::ShowCursor(TRUE); diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index 97850755ea..5249f46ff4 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -134,7 +134,7 @@ void wxEnhMetaFile::Free() bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound) { - wxCHECK_MSG( Ok(), false, wxT("can't play invalid enhanced metafile") ); + wxCHECK_MSG( IsOk(), false, wxT("can't play invalid enhanced metafile") ); wxCHECK_MSG( dc, false, wxT("invalid wxDC in wxEnhMetaFile::Play") ); RECT rect; @@ -174,7 +174,7 @@ wxSize wxEnhMetaFile::GetSize() const { wxSize size = wxDefaultSize; - if ( Ok() ) + if ( IsOk() ) { ENHMETAHEADER hdr; if ( !::GetEnhMetaFileHeader(GetEMF(), sizeof(hdr), &hdr) ) @@ -408,7 +408,7 @@ size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat& format) const bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.IsOk(), false, wxT("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); @@ -536,7 +536,7 @@ size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.IsOk(), false, wxT("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); diff --git a/src/msw/fontdlg.cpp b/src/msw/fontdlg.cpp index bc0ecc8a38..96c3289a6d 100644 --- a/src/msw/fontdlg.cpp +++ b/src/msw/fontdlg.cpp @@ -68,13 +68,13 @@ int wxFontDialog::ShowModal() chooseFontStruct.hwndOwner = GetHwndOf(m_parent); chooseFontStruct.lpLogFont = &logFont; - if ( m_fontData.m_initialFont.Ok() ) + if ( m_fontData.m_initialFont.IsOk() ) { flags |= CF_INITTOLOGFONTSTRUCT; wxFillLogFont(&logFont, &m_fontData.m_initialFont); } - if ( m_fontData.m_fontColour.Ok() ) + if ( m_fontData.m_fontColour.IsOk() ) { chooseFontStruct.rgbColors = wxColourToRGB(m_fontData.m_fontColour); } diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 25cfa7eb30..9126afb4d9 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -938,7 +938,7 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara case WM_QUERYDRAGICON: { const wxIcon& icon = GetIcon(); - HICON hIcon = icon.Ok() ? GetHiconOf(icon) + HICON hIcon = icon.IsOk() ? GetHiconOf(icon) : (HICON)GetDefaultIcon(); rc = (WXLRESULT)hIcon; processed = rc != 0; diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 5b4c3d6b13..818b18f7bf 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -325,7 +325,7 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, // TODO: load colourmap. bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.wx_str())); - if ( !bitmap->Ok() ) + if ( !bitmap->IsOk() ) { // it's probably not found wxLogError(wxT("Can't load bitmap '%s' from resources! Check .rc file."), @@ -494,7 +494,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, icon->SetHICON((WXHICON)hicon); icon->SetSize(size.x, size.y); - return icon->Ok(); + return icon->IsOk(); } bool wxICOResourceHandler::LoadIcon(wxIcon *icon, @@ -559,7 +559,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, icon->SetHICON((WXHICON)hicon); - return icon->Ok(); + return icon->IsOk(); } // ---------------------------------------------------------------------------- diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index 0dff02b534..a16f03e7b8 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -734,10 +734,10 @@ bool wxGLCanvas::SetupPalette(const wxPalette& palette) m_palette = palette; - if ( !m_palette.Ok() ) + if ( !m_palette.IsOk() ) { m_palette = CreateDefaultPalette(); - if ( !m_palette.Ok() ) + if ( !m_palette.IsOk() ) return false; } @@ -799,7 +799,7 @@ wxPalette wxGLCanvas::CreateDefaultPalette() void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event) { /* realize palette if this is the current window */ - if ( GetPalette()->Ok() ) { + if ( GetPalette()->IsOk() ) { ::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE()); ::SelectPalette(GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE); ::RealizePalette(GetHDC()); @@ -814,7 +814,7 @@ void wxGLCanvas::OnPaletteChanged(wxPaletteChangedEvent& event) { /* realize palette if this is *not* the current window */ if ( GetPalette() && - GetPalette()->Ok() && (this != event.GetChangedWindow()) ) + GetPalette()->IsOk() && (this != event.GetChangedWindow()) ) { ::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE()); ::SelectPalette(GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE); diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index a5ba892d0c..0aede6aaca 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -634,7 +634,7 @@ wxGDIPlusPenData::wxGDIPlusPenData( wxGraphicsRenderer* renderer, const wxPen &p case wxPENSTYLE_STIPPLE : { wxBitmap* bmp = pen.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(), #if wxUSE_PALETTE @@ -745,7 +745,7 @@ wxGDIPlusBrushData::wxGDIPlusBrushData( wxGraphicsRenderer* renderer , const wxB else { wxBitmap* bmp = brush.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { wxDELETE( m_brushImage ); m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(), @@ -1988,7 +1988,7 @@ wxGraphicsMatrix wxGDIPlusRenderer::CreateMatrix( wxDouble a, wxDouble b, wxDoub wxGraphicsPen wxGDIPlusRenderer::CreatePen(const wxPen& pen) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsPen); - if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxTRANSPARENT ) return wxNullGraphicsPen; else { @@ -2001,7 +2001,7 @@ wxGraphicsPen wxGDIPlusRenderer::CreatePen(const wxPen& pen) wxGraphicsBrush wxGDIPlusRenderer::CreateBrush(const wxBrush& brush ) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsBrush); - if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxTRANSPARENT ) return wxNullGraphicsBrush; else { @@ -2044,7 +2044,7 @@ wxGDIPlusRenderer::CreateGDIPlusFont( const wxGDIPlusContext* gc, const wxColour &col ) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsFont); - if ( font.Ok() ) + if ( font.IsOk() ) { wxGraphicsFont p; p.SetRefData(new wxGDIPlusFontData( this, gc, font, col )); @@ -2057,7 +2057,7 @@ wxGDIPlusRenderer::CreateGDIPlusFont( const wxGDIPlusContext* gc, wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmap( const wxBitmap &bitmap ) { ENSURE_LOADED_OR_RETURN(wxNullGraphicsBitmap); - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { wxGraphicsBitmap p; p.SetRefData(new wxGDIPlusBitmapData( this , bitmap )); diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 366e635f9e..266af3feb0 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -299,7 +299,7 @@ bool wxImageList::Draw(int index, if ( solidBackground ) { const wxBrush& brush = dc.GetBackground(); - if ( brush.Ok() ) + if ( brush.IsOk() ) { clr = wxColourToRGB(brush.GetColour()); } @@ -399,7 +399,7 @@ static HBITMAP GetMaskForImage(const wxBitmap& bitmap, const wxBitmap& mask) wxMask *pMask; bool deleteMask = false; - if ( mask.Ok() ) + if ( mask.IsOk() ) { hbmpMask = GetHbitmapOf(mask); pMask = NULL; diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4769e1b00b..3901d885fe 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -424,17 +424,17 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // them in any case if the item has custom colours or font static const wxWinVersion winver = wxGetWinVersion(); bool mustUseOwnerDrawn = winver < wxWinVersion_98 || - pItem->GetTextColour().Ok() || - pItem->GetBackgroundColour().Ok() || - pItem->GetFont().Ok(); + pItem->GetTextColour().IsOk() || + pItem->GetBackgroundColour().IsOk() || + pItem->GetFont().IsOk(); if ( !mustUseOwnerDrawn ) { const wxBitmap& bmpUnchecked = pItem->GetBitmap(false), bmpChecked = pItem->GetBitmap(true); - if ( (bmpUnchecked.Ok() && IsGreaterThanStdSize(bmpUnchecked)) || - (bmpChecked.Ok() && IsGreaterThanStdSize(bmpChecked)) ) + if ( (bmpUnchecked.IsOk() && IsGreaterThanStdSize(bmpUnchecked)) || + (bmpChecked.IsOk() && IsGreaterThanStdSize(bmpChecked)) ) { mustUseOwnerDrawn = true; } diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index c7d5b48820..f4f61e1321 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -1063,7 +1063,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, - data->CheckBgMargin.cyBottomHeight - data->CheckMargin.cyBottomHeight); - if ( IsCheckable() && !m_bmpChecked.Ok() ) + if ( IsCheckable() && !m_bmpChecked.IsOk() ) { if ( stat & wxODChecked ) { @@ -1079,25 +1079,25 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc, bmp = GetDisabledBitmap(); } - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { // for not checkable bitmaps we should always use unchecked one // because their checked bitmap is not set bmp = GetBitmap(!IsCheckable() || (stat & wxODChecked)); #if wxUSE_IMAGE - if ( bmp.Ok() && stat & wxODDisabled ) + if ( bmp.IsOk() && stat & wxODDisabled ) { // we need to grey out the bitmap as we don't have any specific // disabled bitmap wxImage imgGrey = bmp.ConvertToImage().ConvertToGreyscale(); - if ( imgGrey.Ok() ) + if ( imgGrey.IsOk() ) bmp = wxBitmap(imgGrey); } #endif // wxUSE_IMAGE } - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxMemoryDC dcMem(&dc); dcMem.SelectObjectAsSource(bmp); diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 71bbed0450..8a08625124 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -354,7 +354,7 @@ public: HRESULT STDMETHODCALLTYPE TranslateAccelerator(LPMSG lpmsg, WORD) { // TODO: send an event with this id - if (m_window->m_oleInPlaceActiveObject.Ok()) + if (m_window->m_oleInPlaceActiveObject.IsOk()) m_window->m_oleInPlaceActiveObject->TranslateAccelerator(lpmsg); return S_FALSE; } @@ -425,7 +425,7 @@ public: HRESULT STDMETHODCALLTYPE DeactivateAndUndo(){return S_OK; } HRESULT STDMETHODCALLTYPE OnPosRectChange(LPCRECT lprcPosRect) { - if (m_window->m_oleInPlaceObject.Ok() && lprcPosRect) + if (m_window->m_oleInPlaceObject.IsOk() && lprcPosRect) { // // Result of several hours and days of bug hunting - @@ -606,7 +606,7 @@ public: { wxAutoIOleInPlaceSite inPlaceSite( IID_IOleInPlaceSite, (IDispatch *) this); - if (!inPlaceSite.Ok()) + if (!inPlaceSite.IsOk()) return E_FAIL; if (pViewToActivate) @@ -618,7 +618,7 @@ public: { wxAutoIOleDocument oleDoc( IID_IOleDocument, m_window->m_oleObject); - if (! oleDoc.Ok()) + if (! oleDoc.IsOk()) return E_FAIL; HRESULT hr = oleDoc->CreateView(inPlaceSite, NULL, @@ -878,13 +878,13 @@ wxActiveXContainer::wxActiveXContainer(wxWindow * parent, wxActiveXContainer::~wxActiveXContainer() { // disconnect connection points - if (m_oleInPlaceObject.Ok()) + if (m_oleInPlaceObject.IsOk()) { m_oleInPlaceObject->InPlaceDeactivate(); m_oleInPlaceObject->UIDeactivate(); } - if (m_oleObject.Ok()) + if (m_oleObject.IsOk()) { if (m_docAdviseCookie != 0) m_oleObject->Unadvise(m_docAdviseCookie); @@ -934,7 +934,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) CHECK_HR(hret); // adviseSink wxAutoIAdviseSink adviseSink(IID_IAdviseSink, (IDispatch *) m_frameSite); - wxASSERT(adviseSink.Ok()); + wxASSERT(adviseSink.IsOk()); // Get Dispatch interface hret = m_Dispatch.QueryInterface(IID_IDispatch, m_ActiveX); @@ -946,13 +946,13 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) // get type info via class info wxAutoIProvideClassInfo classInfo(IID_IProvideClassInfo, m_ActiveX); - wxASSERT(classInfo.Ok()); + wxASSERT(classInfo.IsOk()); // type info wxAutoITypeInfo typeInfo; hret = classInfo->GetClassInfo(typeInfo.GetRef()); CHECK_HR(hret); - wxASSERT(typeInfo.Ok()); + wxASSERT(typeInfo.IsOk()); // TYPEATTR TYPEATTR *ta = NULL; @@ -975,7 +975,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) // get dispatch type info interface wxAutoITypeInfo ti; hret = typeInfo->GetRefTypeInfo(rt, ti.GetRef()); - if (! ti.Ok()) + if (! ti.IsOk()) continue; CHECK_HR(hret); @@ -1016,7 +1016,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) DWORD adviseCookie = 0; wxAutoIConnectionPointContainer cpContainer(IID_IConnectionPointContainer, m_ActiveX); - wxASSERT( cpContainer.Ok()); + wxASSERT( cpContainer.IsOk()); HRESULT hret = cpContainer->FindConnectionPoint(ta->guid, cp.GetRef()); @@ -1093,7 +1093,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) wxAutoIPersistStreamInit pPersistStreamInit(IID_IPersistStreamInit, m_oleObject); - if (pPersistStreamInit.Ok()) + if (pPersistStreamInit.IsOk()) { hret = pPersistStreamInit->InitNew(); CHECK_HR(hret); @@ -1105,7 +1105,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) m_oleObjectHWND = 0; - if (m_oleInPlaceObject.Ok()) + if (m_oleInPlaceObject.IsOk()) { hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND); if (SUCCEEDED(hret)) @@ -1119,7 +1119,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) wxCopyRectToRECT(m_realparent->GetClientSize(), posRect); if (posRect.right > 0 && posRect.bottom > 0 && - m_oleInPlaceObject.Ok()) + m_oleInPlaceObject.IsOk()) { m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); } @@ -1133,7 +1133,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) CHECK_HR(hret); } - if (! m_oleObjectHWND && m_oleInPlaceObject.Ok()) + if (! m_oleObjectHWND && m_oleInPlaceObject.IsOk()) { hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND); CHECK_HR(hret); @@ -1182,7 +1182,7 @@ void wxActiveXContainer::OnSize(wxSizeEvent& event) return; // extents are in HIMETRIC units - if (m_oleObject.Ok()) + if (m_oleObject.IsOk()) { m_oleObject->DoVerb(OLEIVERB_HIDE, 0, m_clientSite, 0, (HWND)m_realparent->GetHWND(), &posRect); @@ -1200,7 +1200,7 @@ void wxActiveXContainer::OnSize(wxSizeEvent& event) (HWND)m_realparent->GetHWND(), &posRect); } - if (m_oleInPlaceObject.Ok()) + if (m_oleInPlaceObject.IsOk()) m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); event.Skip(); @@ -1244,7 +1244,7 @@ void wxActiveXContainer::OnPaint(wxPaintEvent& WXUNUSED(event)) //--------------------------------------------------------------------------- void wxActiveXContainer::OnSetFocus(wxFocusEvent& event) { - if (m_oleInPlaceActiveObject.Ok()) + if (m_oleInPlaceActiveObject.IsOk()) m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE); event.Skip(); @@ -1258,7 +1258,7 @@ void wxActiveXContainer::OnSetFocus(wxFocusEvent& event) //--------------------------------------------------------------------------- void wxActiveXContainer::OnKillFocus(wxFocusEvent& event) { - if (m_oleInPlaceActiveObject.Ok()) + if (m_oleInPlaceActiveObject.IsOk()) m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE); event.Skip(); diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index eadb8b1bfd..156605e408 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -852,7 +852,7 @@ bool wxBitmapDataObject2::SetData(size_t WXUNUSED(len), const void *pBuf) wxBitmap bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes); bitmap.SetHBITMAP((WXHBITMAP)hbmp); - if ( !bitmap.Ok() ) { + if ( !bitmap.IsOk() ) { wxFAIL_MSG(wxT("pasting/dropping invalid bitmap")); return false; @@ -898,7 +898,7 @@ size_t wxBitmapDataObject::GetDataSize(const wxDataFormat& format) const bool wxBitmapDataObject::GetDataHere(const wxDataFormat& format, void *pBuf) const { - wxASSERT_MSG( m_bitmap.Ok(), wxT("copying invalid bitmap") ); + wxASSERT_MSG( m_bitmap.IsOk(), wxT("copying invalid bitmap") ); HBITMAP hbmp = (HBITMAP)m_bitmap.GetHBITMAP(); if ( format.GetFormatId() == CF_DIB ) @@ -977,7 +977,7 @@ bool wxBitmapDataObject::SetData(const wxDataFormat& format, m_bitmap.SetHBITMAP((WXHBITMAP)hbmp); - wxASSERT_MSG( m_bitmap.Ok(), wxT("pasting invalid bitmap") ); + wxASSERT_MSG( m_bitmap.IsOk(), wxT("pasting invalid bitmap") ); return true; } diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index fad7caec37..9118eecef8 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -233,7 +233,7 @@ wxDragResult wxDropSource::DoDragDrop(int flags) bool wxDropSource::GiveFeedback(wxDragResult effect) { const wxCursor& cursor = GetCursor(effect); - if ( cursor.Ok() ) + if ( cursor.IsOk() ) { ::SetCursor((HCURSOR)cursor.GetHCURSOR()); diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index fd0e4c622e..518e4d91e0 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -540,42 +540,42 @@ void wxPen::SetCap(wxPenCap cap) wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->GetColour(); } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->GetWidth(); } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->GetStyle(); } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->GetJoin(); } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->GetCap(); } int wxPen::GetDashes(wxDash** ptr) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = M_PENDATA->GetDash(); return M_PENDATA->GetDashCount(); @@ -583,21 +583,21 @@ int wxPen::GetDashes(wxDash** ptr) const wxDash* wxPen::GetDash() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return m_refData ? M_PENDATA->GetDash() : NULL; } int wxPen::GetDashCount() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return m_refData ? M_PENDATA->GetDashCount() : 0; } wxBitmap* wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return m_refData ? M_PENDATA->GetStipple() : NULL; } diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index ab1629ca2a..83d11c2769 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1235,7 +1235,7 @@ bool wxRegKey::Export(const wxString& filename) const wxFFileOutputStream ostr(filename, wxT("w")); - return ostr.Ok() && Export(ostr); + return ostr.IsOk() && Export(ostr); #else wxUnusedVar(filename); return false; diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 0b2a52706e..31c46938b8 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -153,7 +153,7 @@ WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const bool wxStaticBitmap::ImageIsOk() const { - return m_image && m_image->Ok(); + return m_image && m_image->IsOk(); } wxIcon wxStaticBitmap::GetIcon() const diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 0a08d82b9d..f7ced7f939 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -98,7 +98,7 @@ wxSize wxStaticText::DoGetBestClientSize() const { wxClientDC dc(const_cast(this)); wxFont font(GetFont()); - if (!font.Ok()) + if (!font.IsOk()) font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); dc.SetFont(font); diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 91bd88cfaa..26db204d41 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -215,7 +215,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) NotifyIconData notifyData(GetHwndOf(m_win)); - if (icon.Ok()) + if (icon.IsOk()) { notifyData.uFlags |= NIF_ICON; notifyData.hIcon = GetHiconOf(icon); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index dee0498db6..b4b0cff8f3 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -734,10 +734,10 @@ wxString wxTextCtrl::GetRange(long from, long to) const wxFontEncoding encoding = wxFONTENCODING_SYSTEM; wxFont font = m_defaultStyle.GetFont(); - if ( !font.Ok() ) + if ( !font.IsOk() ) font = GetFont(); - if ( font.Ok() ) + if ( font.IsOk() ) { encoding = font.GetEncoding(); } @@ -1072,10 +1072,10 @@ void wxTextCtrl::DoWriteText(const wxString& value, int flags) if ( GetRichVersion() > 1 ) { wxFont font = m_defaultStyle.GetFont(); - if ( !font.Ok() ) + if ( !font.IsOk() ) font = GetFont(); - if ( font.Ok() ) + if ( font.IsOk() ) { wxFontEncoding encoding = font.GetEncoding(); if ( encoding != wxFONTENCODING_SYSTEM ) @@ -2657,7 +2657,7 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) lf.lfWeight = FW_NORMAL; wxFont font = wxCreateFontFromLogFont(& lf); - if (font.Ok()) + if (font.IsOk()) { style.SetFont(font); } diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 7e17a1828d..6ad75a3cd1 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -618,7 +618,7 @@ void wxToolBar::CreateDisabledImageList() { wxToolBarToolBase *tool = node->GetData(); wxBitmap bmpDisabled = tool->GetDisabledBitmap(); - if ( bmpDisabled.Ok() ) + if ( bmpDisabled.IsOk() ) { const wxSize sizeBitmap = bmpDisabled.GetSize(); m_disabledImgList = new wxImageList @@ -744,7 +744,7 @@ bool wxToolBar::Realize() const int w = bmp.GetWidth(); const int h = bmp.GetHeight(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { int xOffset = wxMax(0, (m_defaultWidth - w)/2); int yOffset = wxMax(0, (m_defaultHeight - h)/2); @@ -762,7 +762,7 @@ bool wxToolBar::Realize() { wxBitmap bmpDisabled = tool->GetDisabledBitmap(); #if wxUSE_IMAGE && wxUSE_WXDIB - if ( !bmpDisabled.Ok() ) + if ( !bmpDisabled.IsOk() ) { // no disabled bitmap specified but we still need to // fill the space in the image list with something, so diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 7ece1c72c9..5b271f01a2 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -403,7 +403,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, if ( winTop ) { wxIcon icon = winTop->GetIcon(); - if ( icon.Ok() ) + if ( icon.IsOk() ) { ::SendMessage(GetHwnd(), WM_SETICON, (WPARAM)TRUE, diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 90da7a1ebd..e8a3119150 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -429,7 +429,7 @@ bool wxToolMenuBar::Realize() } int n = 0; - if ( bmpToUse.Ok() ) + if ( bmpToUse.IsOk() ) { n = ::CommandBar_AddBitmap( (HWND) GetHWND(), NULL, (int) (HBITMAP) bmpToUse.GetHBITMAP(), 1, 16, 16 ); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 0b1f0d3a3a..8a34b50fa9 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -838,7 +838,7 @@ bool wxWindowMSW::SetCursor(const wxCursor& cursor) } // don't "overwrite" busy cursor - if ( m_cursor.Ok() && !wxIsBusy() ) + if ( m_cursor.IsOk() && !wxIsBusy() ) { // normally we should change the cursor only if it's over this window // but we should do it always if we capture the mouse currently @@ -2140,7 +2140,7 @@ void wxWindowMSW::DoGetTextExtent(const wxString& string, int *externalLeading, const wxFont *fontToUse) const { - wxASSERT_MSG( !fontToUse || fontToUse->Ok(), + wxASSERT_MSG( !fontToUse || fontToUse->IsOk(), wxT("invalid font in GetTextExtent()") ); HFONT hfontToUse; @@ -4181,7 +4181,7 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd), // m_cursor if the user code caught EVT_SET_CURSOR() and returned // nothing from it - this is a way to say that our cursor shouldn't // be used for this point - if ( !processedEvtSetCursor && m_cursor.Ok() ) + if ( !processedEvtSetCursor && m_cursor.IsOk() ) { hcursor = GetHcursorOf(m_cursor); } @@ -4189,7 +4189,7 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd), if ( !hcursor && !GetParent() ) { const wxCursor *cursor = wxGetGlobalCursor(); - if ( cursor && cursor->Ok() ) + if ( cursor && cursor->IsOk() ) { hcursor = GetHcursorOf(*cursor); } @@ -4626,7 +4626,7 @@ extern wxCOLORMAP *wxGetStdColourMap() // to. wxLogNull logNo; // suppress error if we couldn't load the bitmap wxBitmap stdColourBitmap(wxT("wxBITMAP_STD_COLOURS")); - if ( stdColourBitmap.Ok() ) + if ( stdColourBitmap.IsOk() ) { // the pixels in the bitmap must correspond to wxSTD_COL_XXX! wxASSERT_MSG( stdColourBitmap.GetWidth() == wxSTD_COL_MAX, diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index fc5f2a319b..c65092363e 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -199,7 +199,7 @@ bool wxAcceleratorTable::Translate( WXHWND hWnd, ,GetHaccel() ,pMsg ); - return (Ok() && rc); + return (IsOk() && rc); } // end of wxAcceleratorTable::Translate // --------------------------------------------------------------------------- diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 74c400fccc..16373e6f32 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -142,7 +142,7 @@ bool wxBitmap::CopyFromCursor( { UnRef(); - if (!rCursor.Ok()) + if (!rCursor.IsOk()) return(false); return(CopyFromIconOrCursor(rCursor)); } // end of wxBitmap::CopyFromCursor @@ -153,7 +153,7 @@ bool wxBitmap::CopyFromIcon( { UnRef(); - if (!rIcon.Ok()) + if (!rIcon.IsOk()) return(false); return CopyFromIconOrCursor(rIcon); @@ -379,7 +379,7 @@ bool wxBitmap::Create( } SetHBITMAP((WXHBITMAP)hBmp); - return Ok(); + return IsOk(); } // end of wxBitmap::Create bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) @@ -398,7 +398,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) else // no bitmap handler found { wxImage image; - if ( image.LoadFile( filename, type ) && image.Ok() ) + if ( image.LoadFile( filename, type ) && image.IsOk() ) { *this = wxBitmap(image); @@ -493,7 +493,7 @@ bool wxBitmap::SaveFile( // FIXME what about palette? shouldn't we use it? wxImage vImage = ConvertToImage(); - if (!vImage.Ok()) + if (!vImage.IsOk()) return false; return(vImage.SaveFile( rFilename @@ -512,7 +512,7 @@ bool wxBitmap::CreateFromImage ( , int nDepth ) { - wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image")); + wxCHECK_MSG(rImage.IsOk(), false, wxT("invalid image")); m_refData = new wxBitmapRefData(); int nSizeLimit = 1024 * 768 * 3; @@ -549,7 +549,7 @@ bool wxBitmap::CreateFromImage ( // // Set bitmap parameters // - wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image")); + wxCHECK_MSG(rImage.IsOk(), false, wxT("invalid image")); SetWidth(nWidth); SetHeight(nBmpHeight); if (nDepth == 1) @@ -624,7 +624,7 @@ bool wxBitmap::CreateFromImage ( ); #if wxUSE_PALETTE HPAL hOldPalette = NULLHANDLE; - if (rImage.GetPalette().Ok()) + if (rImage.GetPalette().IsOk()) { hOldPalette = ::GpiSelectPalette(hPS, (HPAL)rImage.GetPalette().GetHPALETTE()); } @@ -840,7 +840,7 @@ wxImage wxBitmap::ConvertToImage() const wxImage vImage; wxDC* pDC; - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); // // Create an wxImage object @@ -1072,7 +1072,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rRect ) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rRect.x >= 0) && (rRect.y >= 0) && (rRect.x + rRect.width <= GetWidth()) && (rRect.y + rRect.height <= GetHeight()), @@ -1082,7 +1082,7 @@ wxBitmap wxBitmap::GetSubBitmap( ,rRect.height ,GetDepth() ); - wxASSERT_MSG( vRet.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( vRet.IsOk(), wxT("GetSubBitmap error") ); // @@ -1268,7 +1268,7 @@ bool wxMask::Create( ::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap); m_hMaskBitmap = 0; } - if (!rBitmap.Ok() || rBitmap.GetDepth() != 1) + if (!rBitmap.IsOk() || rBitmap.GetDepth() != 1) { return false; } @@ -1316,7 +1316,7 @@ bool wxMask::Create( ::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap); m_hMaskBitmap = 0; } - if (rBitmap.Ok() && rBitmap.GetPalette()->Ok()) + if (rBitmap.IsOk() && rBitmap.GetPalette()->IsOk()) { unsigned char cRed; unsigned char cGreen; @@ -1366,7 +1366,7 @@ bool wxMask::Create( ::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap); m_hMaskBitmap = 0; } - if (!rBitmap.Ok()) + if (!rBitmap.IsOk()) { return false; } diff --git a/src/os2/brush.cpp b/src/os2/brush.cpp index c5f951fff7..fdb3f53502 100644 --- a/src/os2/brush.cpp +++ b/src/os2/brush.cpp @@ -215,7 +215,7 @@ bool wxBrush::RealizeResource() break; case wxSTIPPLE: - if (M_BRUSHDATA->m_vStipple.Ok()) + if (M_BRUSHDATA->m_vStipple.IsOk()) { ::GpiSetBitmapId( M_BRUSHDATA->m_hBrush ,(USHORT)M_BRUSHDATA->m_vStipple.GetHBITMAP() @@ -266,35 +266,35 @@ bool wxBrush::RealizeResource() wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_vColour; } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_nStyle; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &(M_BRUSHDATA->m_vStipple); } int wxBrush::GetPS() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") ); return M_BRUSHDATA->m_hBrush; } WXHANDLE wxBrush::GetResourceHandle() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") ); return (WXHANDLE)M_BRUSHDATA->m_hBrush; } // end of wxBrush::GetResourceHandle diff --git a/src/os2/cursor.cpp b/src/os2/cursor.cpp index 1f14052c8c..756677c1ca 100644 --- a/src/os2/cursor.cpp +++ b/src/os2/cursor.cpp @@ -302,7 +302,7 @@ void wxSetCursor(const wxCursor& cursor) { extern wxCursor *g_globalCursor; - if ( cursor.Ok() && cursor.GetHCURSOR() ) + if ( cursor.IsOk() && cursor.GetHCURSOR() ) { // ::SetCursor((HCURSOR) cursor.GetHCURSOR()); diff --git a/src/os2/dataobj.cpp b/src/os2/dataobj.cpp index 81939cf429..be55a32aef 100644 --- a/src/os2/dataobj.cpp +++ b/src/os2/dataobj.cpp @@ -329,12 +329,12 @@ bool wxBitmapDataObject::SetData( size_t nSize, const void* pBuf) m_bitmap = wxBitmap(vImage); #endif //wxUSE_STREAMS - return m_bitmap.Ok(); + return m_bitmap.IsOk(); } void wxBitmapDataObject::DoConvertToPng() { - if (!m_bitmap.Ok()) + if (!m_bitmap.IsOk()) return; #if wxUSE_STREAMS diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index ab1b0ad718..14d766ba38 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -386,7 +386,7 @@ void wxPMDCImpl::SelectOldObjects( if (m_hOldBitmap) { ::GpiSetBitmap(hPS, (HBITMAP) m_hOldBitmap); - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vSelectedBitmap.SetSelectedInto(NULL); } @@ -644,7 +644,7 @@ void wxPMDCImpl::DoDrawLine( } else { - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -656,7 +656,7 @@ void wxPMDCImpl::DoDrawLine( vPoint[0].y = vY1; vPoint[1].x = vX2; vPoint[1].y = vY2; - if (m_pen.Ok()) + if (m_pen.IsOk()) { vColor = m_pen.GetColour().GetPixel(); } @@ -822,7 +822,7 @@ void wxPMDCImpl::DoDrawPoint( POINTL vPoint; COLORREF vColor = 0x00ffffff; - if (m_pen.Ok()) + if (m_pen.IsOk()) { vColor = m_pen.GetColour().GetPixel(); } @@ -974,7 +974,7 @@ void wxPMDCImpl::DoDrawRectangle( vY = OS2Y(vY,vHeight); else { - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1064,7 +1064,7 @@ void wxPMDCImpl::DoDrawRoundedRectangle( vY = OS2Y(vY,vHeight); else { - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1359,7 +1359,7 @@ void wxPMDCImpl::DoDrawBitmap( lColor = pWindowDC->m_pCanvas->GetBackgroundColour().GetPixel(); } - else if (GetBrush().Ok()) + else if (GetBrush().IsOk()) lColor = GetBrush().GetColour().GetPixel(); else lColor = m_textBackgroundColour.GetPixel(); @@ -1526,13 +1526,13 @@ void wxPMDCImpl::DoDrawBitmap( ULONG lOldForeGround = ::GpiQueryColor((HPS)GetHPS()); ULONG lOldBackGround = ::GpiQueryBackColor((HPS)GetHPS()); - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { ::GpiSetColor( (HPS)GetHPS() ,m_textForegroundColour.GetPixel() ); } - if (m_textBackgroundColour.Ok()) + if (m_textBackgroundColour.IsOk()) { ::GpiSetBackColor( (HPS)GetHPS() ,m_textBackgroundColour.GetPixel() @@ -1703,14 +1703,14 @@ void wxPMDCImpl::DrawAnyText( const wxString& rsText, // // Set text color attributes // - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { SetTextColor( m_hPS ,(int)m_textForegroundColour.GetPixel() ); } - if (m_textBackgroundColour.Ok()) + if (m_textBackgroundColour.IsOk()) { nOldBackground = SetTextBkColor( m_hPS ,(int)m_textBackgroundColour.GetPixel() @@ -1733,7 +1733,7 @@ void wxPMDCImpl::DrawAnyText( const wxString& rsText, } else { - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1758,7 +1758,7 @@ void wxPMDCImpl::DrawAnyText( const wxString& rsText, // it never is set to anything else, but background should remain // transparent even if we just drew an opaque string) // - if (m_textBackgroundColour.Ok()) + if (m_textBackgroundColour.IsOk()) SetTextBkColor( m_hPS ,nOldBackground ); @@ -1849,7 +1849,7 @@ void wxPMDCImpl::DoSelectPalette( bool WXUNUSED(bRealize) ) m_hOldPalette = 0; } - if (m_palette.Ok()) + if (m_palette.IsOk()) { HPALETTE hOldPal; @@ -1891,7 +1891,7 @@ void wxPMDCImpl::SetPalette( m_hOldFont = 0; } m_palette = rPalette; - if (!rPalette.Ok()) + if (!rPalette.IsOk()) { if (m_hOldFont) { @@ -1916,14 +1916,14 @@ void wxPMDCImpl::SetFont( m_hOldFont = 0; } m_font = rFont; - if (!rFont.Ok()) + if (!rFont.IsOk()) { m_hOldFont = 0; } m_font.SetPS(m_hPS); // this will realize the font - if (m_font.Ok()) + if (m_font.IsOk()) { HFONT hFont = m_font.GetResourceHandle(); if (hFont == (HFONT) NULL) @@ -1942,14 +1942,14 @@ void wxPMDCImpl::SetPen( if (m_pen == rPen) return; m_pen = rPen; - if (!m_pen.Ok()) + if (!m_pen.IsOk()) return; if (m_hOldPen) m_hOldPen = 0L; m_pen = rPen; - if (!m_pen.Ok()) + if (!m_pen.IsOk()) { if (m_hOldPen) { @@ -1958,7 +1958,7 @@ void wxPMDCImpl::SetPen( m_hOldPen = 0L; } - if (m_pen.Ok()) + if (m_pen.IsOk()) { if (m_pen.GetResourceHandle()) { @@ -1977,14 +1977,14 @@ void wxPMDCImpl::SetBrush( if (m_hOldBrush) m_hOldBrush = 0L; m_brush = rBrush; - if (!m_brush.Ok()) + if (!m_brush.IsOk()) if (m_brush == rBrush) return; - if (!m_brush.Ok()) + if (!m_brush.IsOk()) if (m_hOldBrush) m_hOldBrush = 0L; - if (!m_brush.Ok()) + if (!m_brush.IsOk()) { if (m_hOldBrush) { @@ -1993,7 +1993,7 @@ void wxPMDCImpl::SetBrush( m_hOldBrush = 0L; } - if (m_brush.Ok()) + if (m_brush.IsOk()) { if (m_brush.GetResourceHandle()) { @@ -2008,7 +2008,7 @@ void wxPMDCImpl::SetBackground(const wxBrush& rBrush) { m_backgroundBrush = rBrush; - if (m_backgroundBrush.Ok()) + if (m_backgroundBrush.IsOk()) { (void)::GpiSetBackColor((HPS)m_hPS, m_backgroundBrush.GetColour().GetPixel()); } @@ -2383,7 +2383,7 @@ bool wxPMDCImpl::DoBlit( wxCoord vXdest, const wxBitmap& rBmp = pm_impl->GetSelectedBitmap(); pMask = rBmp.GetMask(); - if (!(rBmp.Ok() && pMask && pMask->GetMaskBitmap())) + if (!(rBmp.IsOk() && pMask && pMask->GetMaskBitmap())) { bUseMask = false; } @@ -2396,7 +2396,7 @@ bool wxPMDCImpl::DoBlit( wxCoord vXdest, ); vOldTextColor = (COLORREF)vCbnd.lColor; - if (m_textForegroundColour.Ok()) + if (m_textForegroundColour.IsOk()) { vCbnd.lColor = (LONG)m_textForegroundColour.GetPixel(); ::GpiSetAttrs( m_hPS // presentation-space handle @@ -2406,7 +2406,7 @@ bool wxPMDCImpl::DoBlit( wxCoord vXdest, ,&vCbnd // buffer for attributes. ); } - if (m_textBackgroundColour.Ok()) + if (m_textBackgroundColour.IsOk()) { ::GpiSetBackColor(m_hPS, (LONG)m_textBackgroundColour.GetPixel()); } diff --git a/src/os2/dcmemory.cpp b/src/os2/dcmemory.cpp index ccddc30e76..64acc9f90d 100644 --- a/src/os2/dcmemory.cpp +++ b/src/os2/dcmemory.cpp @@ -139,7 +139,7 @@ void wxMemoryDCImpl::DoSelect( if (m_hOldBitmap) { ::GpiSetBitmap(m_hPS, NULLHANDLE); - if (m_vSelectedBitmap.Ok()) + if (m_vSelectedBitmap.IsOk()) { m_vSelectedBitmap.SetSelectedInto(NULL); m_vSelectedBitmap = wxNullBitmap; @@ -201,7 +201,7 @@ void wxMemoryDCImpl::DoGetSize( , int* pHeight ) const { - if (!m_vSelectedBitmap.Ok()) + if (!m_vSelectedBitmap.IsOk()) { *pWidth = 0; *pHeight = 0; diff --git a/src/os2/dcprint.cpp b/src/os2/dcprint.cpp index 918ff77c9c..9f3bd395cc 100644 --- a/src/os2/dcprint.cpp +++ b/src/os2/dcprint.cpp @@ -261,7 +261,7 @@ void wxPrinterDCImpl::DoDrawBitmap( const wxBitmap& rBmp, wxCoord WXUNUSED(vY), bool WXUNUSED(bUseMask)) { - wxCHECK_RET( rBmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); + wxCHECK_RET( rBmp.IsOk(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); // int nWidth = rBmp.GetWidth(); // int nHeight = rBmp.GetHeight(); diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 636484e397..3afb3474f5 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -499,7 +499,7 @@ bool wxDropSource::GiveFeedback ( { const wxCursor& rCursor = GetCursor(eEffect); - if (rCursor.Ok()) + if (rCursor.IsOk()) { ::WinSetPointer(HWND_DESKTOP, (HPOINTER)rCursor.GetHCURSOR()); m_vDragImage.hImage = (LHANDLE)rCursor.GetHCURSOR(); diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 37f3bc3bfb..80ebeb2682 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -1075,7 +1075,7 @@ void wxFont::DoSetNativeFontInfo( int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->GetPointSize(); } // end of wxFont::GetPointSize @@ -1087,35 +1087,35 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->GetStyle(); } // end of wxFont::GetStyle wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->GetWeight(); } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->GetUnderlined(); } // end of wxFont::GetUnderlined wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->GetFaceName(); } // end of wxFont::GetFaceName wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->GetEncoding(); } // end of wxFont::GetEncoding diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index dfccb2ccad..6f200c9dde 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -852,7 +852,7 @@ bool wxFrame::HandlePaint() const wxIcon& vIcon = GetIcon(); HPOINTER hIcon; - if (vIcon.Ok()) + if (vIcon.IsOk()) hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L); else hIcon = (HPOINTER)m_hDefaultIcon; @@ -1302,7 +1302,7 @@ MRESULT wxFrame::OS2WindowProc( WXUINT uMessage, const wxIcon& vIcon = GetIcon(); HPOINTER hIcon; - if (vIcon.Ok()) + if (vIcon.IsOk()) hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L); else hIcon = (HPOINTER)m_hDefaultIcon; diff --git a/src/os2/gdiimage.cpp b/src/os2/gdiimage.cpp index c149132d88..405d2221f3 100644 --- a/src/os2/gdiimage.cpp +++ b/src/os2/gdiimage.cpp @@ -376,7 +376,7 @@ bool wxBMPResourceHandler::LoadFile( wxBitmap* pBitmap, wxBitmapRefData* pData = pBitmap->GetBitmapData(); - if ( pBitmap->Ok() ) + if ( pBitmap->IsOk() ) { BITMAPINFOHEADER vBmph; @@ -385,7 +385,7 @@ bool wxBMPResourceHandler::LoadFile( wxBitmap* pBitmap, pData->m_nHeight = vBmph.cy; pData->m_nDepth = vBmph.cBitCount; } - return(pBitmap->Ok()); + return(pBitmap->IsOk()); } // end of wxBMPResourceHandler::LoadFile bool wxBMPFileHandler::LoadFile( wxBitmap* pBitmap, @@ -477,5 +477,5 @@ bool wxICOResourceHandler::LoadIcon( wxIcon* pIcon, pIcon->SetHICON((WXHICON)hIcon); - return pIcon->Ok(); + return pIcon->IsOk(); } // end of wxICOResourceHandler::LoadIcon diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index 3eccd6eb75..59d72daced 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -489,7 +489,7 @@ bool wxMenuItem::OnMeasureItem( size_t* pWidth, size_t* pHeight ) // resize the space so the BMP will fit. Without this, BMPs // must be no larger or smaller than 16x16. // - if (m_bmpChecked.Ok()) + if (m_bmpChecked.IsOk()) { // // Is BMP height larger than text height? @@ -695,7 +695,7 @@ bool wxMenuItem::OnDrawItem( wxDC& rDC, // Draw the bitmap // --------------- // - if (IsCheckable() && !m_bmpChecked.Ok()) + if (IsCheckable() && !m_bmpChecked.IsOk()) { if (eStatus & wxODChecked) { @@ -724,7 +724,7 @@ bool wxMenuItem::OnDrawItem( wxDC& rDC, // wxBitmap vBmp(GetBitmap(IsCheckable() ? ((eStatus & wxODChecked) != 0) : TRUE)); - if (vBmp.Ok()) + if (vBmp.IsOk()) { wxMemoryDC vDCMem(&rDC); diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index 5c35af15c8..c1c9f7253c 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -490,49 +490,49 @@ void wxPen::SetCap( wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_vColour; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_nWidth; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_nStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_nJoin; } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_nCap; } int wxPen::GetPS() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid pen") ); return M_PENDATA->m_hPen; } int wxPen::GetDashes(wxDash** ptr) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = M_PENDATA->m_dash; return M_PENDATA->m_nbDash; @@ -540,21 +540,21 @@ int wxPen::GetDashes(wxDash** ptr) const wxDash* wxPen::GetDash() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return M_PENDATA->m_dash; } int wxPen::GetDashCount() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_nbDash; } wxBitmap* wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return &(M_PENDATA->m_vStipple); } diff --git a/src/os2/slider.cpp b/src/os2/slider.cpp index c55d438bb2..b15c673c1e 100644 --- a/src/os2/slider.cpp +++ b/src/os2/slider.cpp @@ -368,7 +368,7 @@ bool wxSlider::Create( ,NULL // no control data ,NULL // no Presentation parameters ); - if (GetFont().Ok()) + if (GetFont().IsOk()) { if (GetFont().GetResourceHandle()) { diff --git a/src/os2/statbmp.cpp b/src/os2/statbmp.cpp index 5874763573..9a7f0985a3 100644 --- a/src/os2/statbmp.cpp +++ b/src/os2/statbmp.cpp @@ -134,7 +134,7 @@ bool wxStaticBitmap::Create( wxWindow* pParent, bool wxStaticBitmap::ImageIsOk() const { - return(m_pImage && m_pImage->Ok()); + return(m_pImage && m_pImage->IsOk()); } void wxStaticBitmap::Free() diff --git a/src/os2/toolbar.cpp b/src/os2/toolbar.cpp index 9a802aa710..b2fa1e4840 100644 --- a/src/os2/toolbar.cpp +++ b/src/os2/toolbar.cpp @@ -821,7 +821,7 @@ void wxToolBar::DrawTool( wxDC& rDc, wxToolBarToolBase* pToolBase ) PrepareDC(rDc); - if (!vBitmap.Ok()) + if (!vBitmap.IsOk()) return; if ((pMask = vBitmap.GetMask()) != NULL) if (pMask->GetMaskBitmap() != NULLHANDLE) @@ -835,7 +835,7 @@ void wxToolBar::DrawTool( wxDC& rDc, wxToolBarToolBase* pToolBase ) wxColour vColor(wxT("GREY")); rDc.SetTextForeground(vColor); - if (!pTool->GetDisabledBitmap().Ok()) + if (!pTool->GetDisabledBitmap().IsOk()) pTool->SetDisabledBitmap(wxDisableBitmap( vBitmap ,(long)GetBackgroundColour().GetPixel() )); @@ -894,7 +894,7 @@ void wxToolBar::DrawTool( wxDC& rDc, wxToolBarToolBase* pToolBase ) LowerTool(pTool); rDc.SetTextForeground(vColor); - if (!pTool->GetDisabledBitmap().Ok()) + if (!pTool->GetDisabledBitmap().IsOk()) pTool->SetDisabledBitmap(wxDisableBitmap( vBitmap ,(long)GetBackgroundColour().GetPixel() )); diff --git a/src/os2/toplevel.cpp b/src/os2/toplevel.cpp index b605488501..b7df26740e 100644 --- a/src/os2/toplevel.cpp +++ b/src/os2/toplevel.cpp @@ -1015,7 +1015,7 @@ void wxTopLevelWindowOS2::SetIcons( const wxIcon& vIcon = rIcons.GetIconOfExactSize(32); - if (vIcon.Ok()) + if (vIcon.IsOk()) { ::WinSendMsg( m_hFrame ,WM_SETICON diff --git a/src/os2/utilsgui.cpp b/src/os2/utilsgui.cpp index 9ab06acf96..eca34900b8 100644 --- a/src/os2/utilsgui.cpp +++ b/src/os2/utilsgui.cpp @@ -859,7 +859,7 @@ wxBitmap wxDisableBitmap( ::GpiSetBitmap(hPS, NULLHANDLE); ::GpiDestroyPS(hPS); ::DevCloseDC(hDC); - if (vNewBmp.Ok()) + if (vNewBmp.IsOk()) return(vNewBmp); return(wxNullBitmap); } // end of wxDisableBitmap diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 0c0bbef6b2..b0aa9ea547 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -571,7 +571,7 @@ bool wxWindowOS2::SetCursor( const wxCursor& rCursor) return false; } - if ( m_cursor.Ok() ) { + if ( m_cursor.IsOk() ) { HWND hWnd = GetHwnd(); POINTL vPoint; RECTL vRect; diff --git a/src/osx/accel.cpp b/src/osx/accel.cpp index 163fcf4107..14f0b1887a 100644 --- a/src/osx/accel.cpp +++ b/src/osx/accel.cpp @@ -86,7 +86,7 @@ bool wxAcceleratorTable::IsOk() const int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) { - if (!Ok()) return -1; + if (!IsOk()) return -1; wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst(); while (node) diff --git a/src/osx/brush.cpp b/src/osx/brush.cpp index 4d14ee0eec..8cd833dd46 100644 --- a/src/osx/brush.cpp +++ b/src/osx/brush.cpp @@ -140,21 +140,21 @@ wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index 995e08b846..fba9efb8f5 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -527,7 +527,7 @@ wxCursor::wxCursor(const wxString& cursor_file, wxBitmapType flags, int hotSpotX #if wxUSE_IMAGE wxImage image ; image.LoadFile( cursor_file, flags ) ; - if ( image.Ok() ) + if ( image.IsOk() ) { image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX ) ; image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY ) ; diff --git a/src/osx/carbon/dataobj.cpp b/src/osx/carbon/dataobj.cpp index b330edff1c..971def9d93 100644 --- a/src/osx/carbon/dataobj.cpp +++ b/src/osx/carbon/dataobj.cpp @@ -636,7 +636,7 @@ wxBitmapDataObject::wxBitmapDataObject( const wxBitmap& rBitmap ) { Init(); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { SetBitmap( rBitmap ); } @@ -651,7 +651,7 @@ void wxBitmapDataObject::SetBitmap( const wxBitmap& rBitmap ) { Clear(); wxBitmapDataObjectBase::SetBitmap( rBitmap ); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { CGImageRef cgImageRef = (CGImageRef) m_bitmap.CreateCGImage(); @@ -756,7 +756,7 @@ bool wxBitmapDataObject::SetData( size_t nSize, const void *pBuf ) cgImageRef = NULL; } - return m_bitmap.Ok(); + return m_bitmap.IsOk(); } #endif diff --git a/src/osx/carbon/dataview.cpp b/src/osx/carbon/dataview.cpp index 4975013a64..ee91559350 100644 --- a/src/osx/carbon/dataview.cpp +++ b/src/osx/carbon/dataview.cpp @@ -889,7 +889,7 @@ bool wxMacDataViewDataBrowserListViewControl::InsertColumn(unsigned int pos, wxD UInt32 noOfColumns; - wxCFStringRef title(columnPtr->GetTitle(),m_font.Ok() ? dynamic_cast(GetWXPeer())->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()); + wxCFStringRef title(columnPtr->GetTitle(),m_font.IsOk() ? dynamic_cast(GetWXPeer())->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()); // try to get new ID for the column: @@ -2339,7 +2339,7 @@ bool wxDataViewTextRenderer::MacRender() { wxCHECK_MSG(GetValue().GetType() == GetVariantType(),false,wxString(_("Text renderer cannot render value; value type: ")) << GetValue().GetType()); - wxCFStringRef cfString(GetValue().GetString(),(GetView()->GetFont().Ok() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); + wxCFStringRef cfString(GetValue().GetString(),(GetView()->GetFont().IsOk() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); return (::SetDataBrowserItemDataText(GetNativeData()->GetItemDataRef(),cfString) == noErr); } @@ -2365,7 +2365,7 @@ bool wxDataViewBitmapRenderer::MacRender() wxBitmap bitmap; bitmap << GetValue(); - return (!(bitmap.Ok()) || (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),bitmap.GetIconRef()) == noErr)); + return (!(bitmap.IsOk()) || (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),bitmap.GetIconRef()) == noErr)); } IMPLEMENT_CLASS(wxDataViewBitmapRenderer,wxDataViewRenderer) @@ -2390,7 +2390,7 @@ bool wxDataViewIconTextRenderer::MacRender() iconText << GetValue(); - wxCFStringRef cfString(iconText.GetText(),(GetView()->GetFont().Ok() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); + wxCFStringRef cfString(iconText.GetText(),(GetView()->GetFont().IsOk() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); if (iconText.GetIcon().IsOk()) if (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),MAC_WXHICON(iconText.GetIcon().GetHICON())) != noErr) @@ -2556,7 +2556,7 @@ void wxDataViewColumn::SetBitmap(wxBitmap const& bitmap) DataBrowserListViewHeaderDesc headerDescription; wxCHECK_RET(macDataViewListCtrlPtr->GetHeaderDesc(GetNativeData()->GetPropertyID(),&headerDescription) == noErr,_("Could not get header description.")); - if (GetBitmap().Ok()) + if (GetBitmap().IsOk()) headerDescription.btnContentInfo.u.iconRef = GetBitmap().GetIconRef(); else headerDescription.btnContentInfo.u.iconRef = NULL; @@ -2735,7 +2735,7 @@ void wxDataViewColumn::SetTitle(wxString const& title) if (macDataViewListCtrlPtr != NULL) { DataBrowserListViewHeaderDesc headerDescription; - wxCFStringRef cfTitle(title,(dataViewCtrlPtr->GetFont().Ok() ? dataViewCtrlPtr->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); + wxCFStringRef cfTitle(title,(dataViewCtrlPtr->GetFont().IsOk() ? dataViewCtrlPtr->GetFont().GetEncoding() : wxLocale::GetSystemEncoding())); wxCHECK_RET(macDataViewListCtrlPtr->GetHeaderDesc(GetNativeData()->GetPropertyID(),&headerDescription) == noErr,_("Could not get header description.")); headerDescription.titleString = cfTitle; diff --git a/src/osx/carbon/dcprint.cpp b/src/osx/carbon/dcprint.cpp index 70dd928a39..4f80534f6b 100644 --- a/src/osx/carbon/dcprint.cpp +++ b/src/osx/carbon/dcprint.cpp @@ -46,7 +46,7 @@ public : // returns 0 in case of no Error, otherwise platform specific error codes virtual wxUint32 GetStatus() const = 0 ; - bool Ok() { return GetStatus() == 0 ; } + bool IsOk() { return GetStatus() == 0 ; } static wxNativePrinterDC* Create(wxPrintData* data) ; } ; @@ -288,7 +288,7 @@ wxPrinterDCImpl::wxPrinterDCImpl( wxPrinterDC *owner, const wxPrintData& printda m_nativePrinterDC = wxNativePrinterDC::Create( &m_printData ) ; if ( m_nativePrinterDC ) { - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { wxString message ; @@ -329,7 +329,7 @@ bool wxPrinterDCImpl::StartDoc( const wxString& message ) { // in case we have to do additional things when successful } - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { wxString message ; @@ -347,7 +347,7 @@ void wxPrinterDCImpl::EndDoc(void) return ; m_nativePrinterDC->EndDoc( (wxPrinterDC*) GetOwner() ) ; - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; if ( !m_ok ) { @@ -397,7 +397,7 @@ void wxPrinterDCImpl::StartPage() m_backgroundBrush = *wxWHITE_BRUSH; m_nativePrinterDC->StartPage( (wxPrinterDC*) GetOwner() ) ; - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; } @@ -407,7 +407,7 @@ void wxPrinterDCImpl::EndPage() return ; m_nativePrinterDC->EndPage( (wxPrinterDC*) GetOwner() ); - m_ok = m_nativePrinterDC->Ok() ; + m_ok = m_nativePrinterDC->IsOk() ; } void wxPrinterDCImpl::DoGetSize(int *width, int *height) const diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 5a1b9bae8b..643903040d 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -893,7 +893,7 @@ UIFont* wxFont::OSXGetUIFont() const const wxNativeFontInfo * wxFont::GetNativeFontInfo() const { wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") ); - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); // cast away constness otherwise lazy font resolution is not possible const_cast(this)->RealizeResource(); diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index cf0aed1759..80c103c46f 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -223,7 +223,7 @@ int wxFontDialog::ShowModal() OSStatus err ; wxFont font = *wxNORMAL_FONT ; - if ( m_fontData.m_initialFont.Ok() ) + if ( m_fontData.m_initialFont.IsOk() ) { font = m_fontData.m_initialFont ; } @@ -316,7 +316,7 @@ void wxFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) wxSize size = GetSize(); wxFont font = GetFont(); - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); // Calculate vertical centre @@ -604,7 +604,7 @@ void wxFontDialog::CreateControls() InitializeControls(); m_previewCtrl->SetFont(m_dialogFont); - if (m_fontData.GetColour().Ok()) + if (m_fontData.GetColour().IsOk()) { m_previewCtrl->SetForegroundColour(m_fontData.GetColour()); } @@ -700,7 +700,7 @@ void wxFontDialog::InitializeFont() bool fontUnderline = false; wxString fontName; - if (m_fontData.m_initialFont.Ok()) + if (m_fontData.m_initialFont.IsOk()) { fontFamily = m_fontData.m_initialFont.GetFamily(); fontWeight = m_fontData.m_initialFont.GetWeight(); @@ -738,7 +738,7 @@ void wxFontDialog::InitializeControls() } m_facenameCtrl->SetStringSelection(facename); - if (m_colourCtrl && m_fontData.GetColour().Ok()) + if (m_colourCtrl && m_fontData.GetColour().IsOk()) { m_colourCtrl->SetColour(m_fontData.GetColour()); m_colourCtrl->Refresh(); diff --git a/src/osx/carbon/fontdlgosx.mm b/src/osx/carbon/fontdlgosx.mm index c5863ad7e3..7c21271320 100644 --- a/src/osx/carbon/fontdlgosx.mm +++ b/src/osx/carbon/fontdlgosx.mm @@ -174,14 +174,14 @@ int RunMixedFontDialog(wxFontDialog* dialog) [accessoryView resetFlags]; #if wxOSX_USE_COCOA wxFont font = *wxNORMAL_FONT ; - if ( fontdata.m_initialFont.Ok() ) + if ( fontdata.m_initialFont.IsOk() ) { font = fontdata.m_initialFont ; } [[NSFontPanel sharedFontPanel] setPanelFont: font.OSXGetNSFont() isMultiple:NO]; - if(fontdata.m_fontColour.Ok()) + if(fontdata.m_fontColour.IsOk()) [[NSColorPanel sharedColorPanel] setColor: [NSColor colorWithCalibratedRed:fontdata.m_fontColour.Red() / 255.0 green:fontdata.m_fontColour.Green() / 255.0 @@ -373,7 +373,7 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) //if the font is valid set the default (selected) font of the //NSFontDialog to that font - if (thewxfont.Ok()) + if (thewxfont.IsOk()) { NSFontTraitMask theMask = 0; @@ -401,7 +401,7 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) } - if(m_fontData.m_fontColour.Ok()) + if(m_fontData.m_fontColour.IsOk()) [[NSColorPanel sharedColorPanel] setColor: [NSColor colorWithCalibratedRed:m_fontData.m_fontColour.Red() / 255.0 green:m_fontData.m_fontColour.Green() / 255.0 diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 2a3bf12a40..cab2c06212 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -225,7 +225,7 @@ class ImagePattern : public wxMacCoreGraphicsPattern public : ImagePattern( const wxBitmap* bmp , const CGAffineTransform& transform ) { - wxASSERT( bmp && bmp->Ok() ); + wxASSERT( bmp && bmp->IsOk() ); #ifdef __WXMAC__ Init( (CGImageRef) bmp->CreateCGImage() , transform ); #endif @@ -500,7 +500,7 @@ wxMacCoreGraphicsPenData::wxMacCoreGraphicsPenData( wxGraphicsRenderer* renderer case wxPENSTYLE_STIPPLE: { wxBitmap* bmp = pen.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { m_colorSpace.reset( CGColorSpaceCreatePattern( NULL ) ); m_pattern.reset( (CGPatternRef) *( new ImagePattern( bmp , CGAffineTransformMakeScale( 1,-1 ) ) ) ); @@ -647,7 +647,7 @@ wxMacCoreGraphicsColour::wxMacCoreGraphicsColour( const wxBrush &brush ) { // now brush is a bitmap wxBitmap* bmp = brush.GetStipple(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) { m_isPattern = true; m_patternColorComponents = new CGFloat[1] ; @@ -2842,7 +2842,7 @@ wxGraphicsMatrix wxMacCoreGraphicsRenderer::CreateMatrix( wxDouble a, wxDouble b wxGraphicsPen wxMacCoreGraphicsRenderer::CreatePen(const wxPen& pen) { - if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT ) + if ( !pen.IsOk() || pen.GetStyle() == wxTRANSPARENT ) return wxNullGraphicsPen; else { @@ -2854,7 +2854,7 @@ wxGraphicsPen wxMacCoreGraphicsRenderer::CreatePen(const wxPen& pen) wxGraphicsBrush wxMacCoreGraphicsRenderer::CreateBrush(const wxBrush& brush ) { - if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) + if ( !brush.IsOk() || brush.GetStyle() == wxTRANSPARENT ) return wxNullGraphicsBrush; else { @@ -2866,7 +2866,7 @@ wxGraphicsBrush wxMacCoreGraphicsRenderer::CreateBrush(const wxBrush& brush ) wxGraphicsBitmap wxMacCoreGraphicsRenderer::CreateBitmap( const wxBitmap& bmp ) { - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxGraphicsBitmap p; p.SetRefData(new wxMacCoreGraphicsBitmapData( this , bmp.CreateCGImage(), bmp.GetDepth() == 1 ) ); @@ -2931,7 +2931,7 @@ wxMacCoreGraphicsRenderer::CreateRadialGradientBrush(wxDouble xo, wxDouble yo, // sets the font wxGraphicsFont wxMacCoreGraphicsRenderer::CreateFont( const wxFont &font , const wxColour &col ) { - if ( font.Ok() ) + if ( font.IsOk() ) { wxGraphicsFont p; p.SetRefData(new wxMacCoreGraphicsFontData( this , font, col )); diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index d99c5a1e64..5afbf3c67b 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -137,21 +137,21 @@ wxIcon::CloneGDIRefData(const wxGDIRefData * WXUNUSED(data)) const WXHICON wxIcon::GetHICON() const { - wxASSERT( Ok() ) ; + wxASSERT( IsOk() ) ; return (WXHICON) ((wxIconRefData*)m_refData)->GetHICON() ; } int wxIcon::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid icon") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid icon") ); return M_ICONDATA->GetWidth(); } int wxIcon::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid icon") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid icon") ); return M_ICONDATA->GetHeight(); } @@ -414,7 +414,7 @@ bool wxIcon::LoadIconAsBitmap(const wxString& filename, wxBitmapType type, int d else { wxImage loadimage( filename, type ); - if (loadimage.Ok()) + if (loadimage.IsOk()) { if ( desiredWidth == -1 ) desiredWidth = loadimage.GetWidth() ; @@ -467,7 +467,7 @@ bool wxICONResourceHandler::LoadFile( if ( icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) ) { bitmap->CopyFromIcon( icon ) ; - return bitmap->Ok() ; + return bitmap->IsOk() ; } return false; } diff --git a/src/osx/carbon/listbox.cpp b/src/osx/carbon/listbox.cpp index 4301982e51..441f9aa930 100644 --- a/src/osx/carbon/listbox.cpp +++ b/src/osx/carbon/listbox.cpp @@ -406,7 +406,7 @@ wxMacDataBrowserColumn* wxMacDataBrowserListControl::DoInsertColumn( unsigned in // TODO: Why is m_font not defined when we enter wxLC_LIST mode, but is // defined for other modes? wxFontEncoding enc; - if ( m_font.Ok() ) + if ( m_font.IsOk() ) enc = m_font.GetEncoding(); else enc = wxLocale::GetSystemEncoding(); diff --git a/src/osx/carbon/listctrl_mac.cpp b/src/osx/carbon/listctrl_mac.cpp index c37094dc70..fcb9796ec0 100644 --- a/src/osx/carbon/listctrl_mac.cpp +++ b/src/osx/carbon/listctrl_mac.cpp @@ -943,7 +943,7 @@ bool wxListCtrl::SetColumn(int col, wxListItem& item) if (item.GetMask() & wxLIST_MASK_TEXT) { wxFontEncoding enc; - if ( m_font.Ok() ) + if ( m_font.IsOk() ) enc = GetFont().GetEncoding(); else enc = wxLocale::GetSystemEncoding(); @@ -2177,7 +2177,7 @@ long wxListCtrl::InsertColumn(long col, wxListItem& item) if (imageList && imageList->GetImageCount() > 0) { wxBitmap bmp = imageList->GetBitmap(0); - //if (bmp.Ok()) + //if (bmp.IsOk()) // type = kDataBrowserIconAndTextType; } @@ -2786,7 +2786,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( if (bgColor == wxNullColour) bgColor = listBgColor; - if (!font.Ok()) + if (!font.IsOk()) font = list->GetFont(); wxCFStringRef cfString( text, wxLocale::GetSystemEncoding() ); @@ -2850,12 +2850,12 @@ void wxMacDataBrowserListCtrlControl::DrawItem( else { - if (color.Ok()) + if (color.IsOk()) color.GetRGBColor(&labelColor); - else if (list->GetTextColour().Ok()) + else if (list->GetTextColour().IsOk()) list->GetTextColour().GetRGBColor(&labelColor); - if (bgColor.Ok()) + if (bgColor.IsOk()) { bgColor.GetRGBColor(&backgroundColor); CGContextSaveGState(context); @@ -2897,7 +2897,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( { info.version = kHIThemeTextInfoVersionOne; info.fontID = kThemeViewsFont; - if (font.Ok()) + if (font.IsOk()) { info.fontID = kThemeSpecifiedFont; info.font = (CTFontRef) font.OSXGetCTFont(); @@ -2911,7 +2911,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( info.version = kHIThemeTextInfoVersionZero; info.fontID = kThemeViewsFont; - if (font.Ok()) + if (font.IsOk()) { info.fontID = font.MacGetThemeFontID(); diff --git a/src/osx/carbon/menu.cpp b/src/osx/carbon/menu.cpp index ab442f635f..5a9f62156f 100644 --- a/src/osx/carbon/menu.cpp +++ b/src/osx/carbon/menu.cpp @@ -56,7 +56,7 @@ public : MenuItemIndex i = FindMenuItemIndex() ; if ( i > 0 ) { - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { #if wxUSE_BMPBUTTON ControlButtonContentInfo info ; diff --git a/src/osx/carbon/metafile.cpp b/src/osx/carbon/metafile.cpp index 6e8905e6b4..dde3a496b9 100644 --- a/src/osx/carbon/metafile.cpp +++ b/src/osx/carbon/metafile.cpp @@ -274,7 +274,7 @@ wxSize wxMetaFile::GetSize() const { wxSize dataSize = wxDefaultSize; - if (Ok()) + if (IsOk()) { dataSize.x = M_METAFILEDATA->GetWidth(); dataSize.y = M_METAFILEDATA->GetHeight(); diff --git a/src/osx/carbon/notebmac.cpp b/src/osx/carbon/notebmac.cpp index 189b31c2a3..710aadbcb0 100644 --- a/src/osx/carbon/notebmac.cpp +++ b/src/osx/carbon/notebmac.cpp @@ -169,7 +169,7 @@ void wxMacControl::SetupTabs( const wxNotebook& notebook) if ( notebook.GetImageList() && notebook.GetPageImage(ii) >= 0 ) { const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( ii ) ) ; - if ( bmap.Ok() ) + if ( bmap.IsOk() ) { ControlButtonContentInfo info ; diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index 36e322147a..7362c13aac 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -200,7 +200,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) //! Union /e region with this. bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid wxRegion") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid wxRegion") ); // Don't change shared data if (!m_refData) diff --git a/src/osx/carbon/statbmp.cpp b/src/osx/carbon/statbmp.cpp index 1034298f46..51c59cb55c 100644 --- a/src/osx/carbon/statbmp.cpp +++ b/src/osx/carbon/statbmp.cpp @@ -66,7 +66,7 @@ void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) ) wxPaintDC dc(this); PrepareDC(dc); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ; } @@ -74,7 +74,7 @@ void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) ) wxSize wxStaticBitmap::DoGetBestSize() const { - if ( m_bitmap.Ok() ) + if ( m_bitmap.IsOk() ) return DoGetSizeFromClientSize( wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) ); // this is completely arbitrary diff --git a/src/osx/carbon/taskbar.cpp b/src/osx/carbon/taskbar.cpp index 49b11122b2..ca38276fd2 100644 --- a/src/osx/carbon/taskbar.cpp +++ b/src/osx/carbon/taskbar.cpp @@ -381,7 +381,7 @@ bool wxDockTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& WXUNUSED(too // convert the wxIcon into a wxBitmap so we can perform some // wxBitmap operations with it wxBitmap bmp( icon ); - wxASSERT( bmp.Ok() ); + wxASSERT( bmp.IsOk() ); // get the CGImageRef for the wxBitmap: // OSX builds only, but then the dock only exists in OSX diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index c6275209fc..e95ceaa8ff 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -855,7 +855,7 @@ void wxMacDataItemBrowserControl::InsertColumn(int col, DataBrowserPropertyType // TODO: Why is m_font not defined when we enter wxLC_LIST mode, but is // defined for other modes? wxFontEncoding enc; - if ( m_font.Ok() ) + if ( m_font.IsOk() ) enc = m_font.GetEncoding(); else enc = wxLocale::GetSystemEncoding(); diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index 3829d7c8cb..09f1f192dd 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -289,7 +289,7 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, SetBezelStyleFromBorderFlags(v, style); - if (bitmap.Ok()) + if (bitmap.IsOk()) [v setImage:bitmap.GetNSImage() ]; [v setButtonType:NSMomentaryPushInButton]; diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index 398d3798fa..2adea3cbbc 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -175,7 +175,7 @@ public: if ( notebook.GetImageList() && notebook.GetPageImage(i) >= 0 ) { const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( i ) ) ; - if ( bmap.Ok() ) + if ( bmap.IsOk() ) { // TODO how to set an image on a tab } diff --git a/src/osx/cocoa/taskbar.mm b/src/osx/cocoa/taskbar.mm index f055449a4d..9b0d796a5b 100644 --- a/src/osx/cocoa/taskbar.mm +++ b/src/osx/cocoa/taskbar.mm @@ -62,7 +62,7 @@ public: virtual bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString) = 0; virtual bool RemoveIcon() = 0; - bool IsIconInstalled() const { return m_icon.Ok(); } + bool IsIconInstalled() const { return m_icon.IsOk(); } virtual bool PopupMenu(wxMenu *menu) = 0; virtual ~wxTaskBarIconImpl(); diff --git a/src/osx/cocoa/tglbtn.mm b/src/osx/cocoa/tglbtn.mm index af184af177..9066edca9f 100644 --- a/src/osx/cocoa/tglbtn.mm +++ b/src/osx/cocoa/tglbtn.mm @@ -60,7 +60,7 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer, NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; - if (label.Ok()) + if (label.IsOk()) [v setImage:label.GetNSImage() ]; SetBezelStyleFromBorderFlags(v, style); diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 8ef77049d1..5b0b5fa63a 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -149,7 +149,7 @@ static int GetBestBytesPerRow( int rawBytes ) void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType ) { memset( info , 0 , sizeof(ControlButtonContentInfo) ) ; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { wxBitmapRefData * bmap = bitmap.GetBitmapData() ; if ( bmap == NULL ) @@ -1031,28 +1031,28 @@ wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const void * wxBitmap::GetRawAccess() const { - wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ; + wxCHECK_MSG( IsOk() , NULL , wxT("invalid bitmap") ) ; return M_BITMAPDATA->GetRawAccess() ; } void * wxBitmap::BeginRawAccess() { - wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ; + wxCHECK_MSG( IsOk() , NULL , wxT("invalid bitmap") ) ; return M_BITMAPDATA->BeginRawAccess() ; } void wxBitmap::EndRawAccess() { - wxCHECK_RET( Ok() , wxT("invalid bitmap") ) ; + wxCHECK_RET( IsOk() , wxT("invalid bitmap") ) ; M_BITMAPDATA->EndRawAccess() ; } CGImageRef wxBitmap::CreateCGImage() const { - wxCHECK_MSG( Ok(), NULL , wxT("invalid bitmap") ) ; + wxCHECK_MSG( IsOk(), NULL , wxT("invalid bitmap") ) ; return M_BITMAPDATA->CreateCGImage() ; } @@ -1060,7 +1060,7 @@ CGImageRef wxBitmap::CreateCGImage() const #ifndef __WXOSX_IPHONE__ IconRef wxBitmap::GetIconRef() const { - wxCHECK_MSG( Ok(), NULL , wxT("invalid bitmap") ) ; + wxCHECK_MSG( IsOk(), NULL , wxT("invalid bitmap") ) ; return M_BITMAPDATA->GetIconRef() ; } @@ -1094,14 +1094,14 @@ WX_UIImage wxBitmap::GetUIImage() const #endif wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rect.x >= 0) && (rect.y >= 0) && (rect.x+rect.width <= GetWidth()) && (rect.y+rect.height <= GetHeight()), wxNullBitmap, wxT("invalid bitmap or bitmap region") ); wxBitmap ret( rect.width, rect.height, GetDepth() ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); int destwidth = rect.width ; int destheight = rect.height ; @@ -1192,7 +1192,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type) { #if wxUSE_IMAGE wxImage loadimage(filename, type); - if (loadimage.Ok()) + if (loadimage.IsOk()) { *this = loadimage; @@ -1228,7 +1228,7 @@ bool wxBitmap::Create(const void* data, wxBitmapType type, int width, int height wxBitmap::wxBitmap(const wxImage& image, int depth) { - wxCHECK_RET( image.Ok(), wxT("invalid image") ); + wxCHECK_RET( image.IsOk(), wxT("invalid image") ); // width and height of the device-dependent bitmap int width = image.GetWidth(); @@ -1302,7 +1302,7 @@ wxImage wxBitmap::ConvertToImage() const { wxImage image; - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); // create an wxImage object int width = GetWidth(); @@ -1434,35 +1434,35 @@ bool wxBitmap::SaveFile( const wxString& filename, int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BITMAPDATA->GetHeight(); } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BITMAPDATA->GetWidth() ; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BITMAPDATA->GetDepth(); } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BITMAPDATA->m_bitmapMask; } bool wxBitmap::HasAlpha() const { - wxCHECK_MSG( Ok(), false , wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false , wxT("invalid bitmap") ); return M_BITMAPDATA->HasAlpha() ; } @@ -1494,7 +1494,7 @@ void wxBitmap::SetOk(bool isOk) #if wxUSE_PALETTE wxPalette *wxBitmap::GetPalette() const { - wxCHECK_MSG( Ok(), NULL, wxT("Invalid bitmap GetPalette()") ); + wxCHECK_MSG( IsOk(), NULL, wxT("Invalid bitmap GetPalette()") ); return &M_BITMAPDATA->m_bitmapPalette; } @@ -1872,7 +1872,7 @@ void wxBitmap::InitStandardHandlers() void *wxBitmap::GetRawData(wxPixelDataBase& data, int WXUNUSED(bpp)) { - if ( !Ok() ) + if ( !IsOk() ) // no bitmap, no data (raw or otherwise) return NULL; diff --git a/src/osx/core/dcmemory.cpp b/src/osx/core/dcmemory.cpp index 9610395377..eabdc34f98 100644 --- a/src/osx/core/dcmemory.cpp +++ b/src/osx/core/dcmemory.cpp @@ -55,7 +55,7 @@ void wxMemoryDCImpl::Init() wxMemoryDCImpl::~wxMemoryDCImpl() { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; wxDELETE(m_graphicContext); @@ -64,14 +64,14 @@ wxMemoryDCImpl::~wxMemoryDCImpl() void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) { - if ( m_selected.Ok() ) + if ( m_selected.IsOk() ) { m_selected.EndRawAccess() ; wxDELETE(m_graphicContext); } m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { if ( m_selected.GetDepth() != 1 ) m_selected.UseAlpha() ; @@ -97,7 +97,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) (*width) = m_selected.GetWidth(); diff --git a/src/osx/dnd_osx.cpp b/src/osx/dnd_osx.cpp index fc2e684f2d..46c93cf148 100644 --- a/src/osx/dnd_osx.cpp +++ b/src/osx/dnd_osx.cpp @@ -164,7 +164,7 @@ wxDropSource::~wxDropSource() bool wxDropSource::MacInstallDefaultCursor(wxDragResult effect) { const wxCursor& cursor = GetCursor(effect); - bool result = cursor.Ok(); + bool result = cursor.IsOk(); if ( result ) cursor.MacInstall(); diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp index e2191ca179..2f9346ac52 100644 --- a/src/osx/imaglist.cpp +++ b/src/osx/imaglist.cpp @@ -108,7 +108,7 @@ int wxImageList::Add( const wxBitmap &bitmap ) int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) { wxBitmap bmp( bitmap ); - if (mask.Ok()) + if (mask.IsOk()) bmp.SetMask( new wxMask( mask ) ); return Add( bmp ); @@ -231,7 +231,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &ma m_images.Insert( next, newBitmap ); } - if (mask.Ok()) + if (mask.IsOk()) newBitmap->SetMask(new wxMask(mask)); return true; diff --git a/src/osx/iphone/toolbar.mm b/src/osx/iphone/toolbar.mm index 449a92e572..659fb243f2 100644 --- a/src/osx/iphone/toolbar.mm +++ b/src/osx/iphone/toolbar.mm @@ -126,7 +126,7 @@ wxToolBarToolBase( [bui initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; bui.width = 25.0f; } - else if ( bmpNormal.Ok() ) + else if ( bmpNormal.IsOk() ) { [bui initWithImage:bmpNormal.GetUIImage() style:UIBarButtonItemStylePlain target:toolbar action:@selector(clickedAction:)]; diff --git a/src/osx/menuitem_osx.cpp b/src/osx/menuitem_osx.cpp index 3b516a6414..93ef505286 100644 --- a/src/osx/menuitem_osx.cpp +++ b/src/osx/menuitem_osx.cpp @@ -176,7 +176,7 @@ void wxMenuItem::UpdateItemBitmap() if ( !m_parentMenu ) return; - if ( m_bitmap.Ok() ) + if ( m_bitmap.IsOk() ) { GetPeer()->SetBitmap( m_bitmap ); } diff --git a/src/osx/pen.cpp b/src/osx/pen.cpp index a40bdfcf9f..ec49069ed8 100644 --- a/src/osx/pen.cpp +++ b/src/osx/pen.cpp @@ -164,42 +164,42 @@ bool wxPen::operator==(const wxPen& pen) const wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_join; } wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_cap; } int wxPen::GetDashes(wxDash **ptr) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = M_PENDATA->m_dash; return M_PENDATA->m_nbDash; @@ -212,7 +212,7 @@ int wxPen::GetDashCount() const wxBitmap *wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") ); return &M_PENDATA->m_stipple; } diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 3adbc2c67e..628f51c44d 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -475,7 +475,7 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) { // Don't assert, in case we set the window variant before // the window is created - // wxASSERT( GetPeer()->Ok() ) ; + // wxASSERT( GetPeer()->IsOk() ) ; m_windowVariant = variant ; @@ -588,7 +588,7 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col ) { if (m_growBox) { - if ( m_backgroundColour.Ok() ) + if ( m_backgroundColour.IsOk() ) m_growBox->SetBackgroundColour(m_backgroundColour); else m_growBox->SetBackgroundColour(*wxWHITE); @@ -897,7 +897,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor) return false ; } - wxASSERT_MSG( m_cursor.Ok(), + wxASSERT_MSG( m_cursor.IsOk(), wxT("cursor must be valid after call to the base version")); if ( GetPeer() != NULL ) @@ -1560,7 +1560,7 @@ void wxWindowMac::MacPaintGrowBox() CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ; CGContextSaveGState( cgContext ); - if ( m_backgroundColour.Ok() ) + if ( m_backgroundColour.IsOk() ) { CGContextSetFillColorWithColor( cgContext, m_backgroundColour.GetCGColor() ); } @@ -1573,7 +1573,7 @@ void wxWindowMac::MacPaintGrowBox() #else if (m_growBox) { - if ( m_backgroundColour.Ok() ) + if ( m_backgroundColour.IsOk() ) m_growBox->SetBackgroundColour(m_backgroundColour); else m_growBox->SetBackgroundColour(*wxWHITE); @@ -1831,18 +1831,18 @@ bool wxWindowMac::MacSetupCursor( const wxPoint& pt ) // if the user code caught EVT_SET_CURSOR() and returned nothing from // it - this is a way to say that our cursor shouldn't be used for this // point - if ( !processedEvtSetCursor && m_cursor.Ok() ) + if ( !processedEvtSetCursor && m_cursor.IsOk() ) cursor = m_cursor ; if ( !wxIsBusy() && !GetParent() ) cursor = *wxSTANDARD_CURSOR ; } - if ( cursor.Ok() ) + if ( cursor.IsOk() ) cursor.MacInstall() ; } - return cursor.Ok() ; + return cursor.IsOk() ; } wxString wxWindowMac::MacGetToolTipString( wxPoint &WXUNUSED(pt) ) diff --git a/src/palmos/font.cpp b/src/palmos/font.cpp index 3a0cd03728..4329848379 100644 --- a/src/palmos/font.cpp +++ b/src/palmos/font.cpp @@ -479,7 +479,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const wxString wxFont::GetNativeFontInfoDesc() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); // be sure we have an HFONT associated... wxConstCast(this, wxFont)->RealizeResource(); @@ -488,7 +488,7 @@ wxString wxFont::GetNativeFontInfoDesc() const wxString wxFont::GetNativeFontInfoUserDesc() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); // be sure we have an HFONT associated... wxConstCast(this, wxFont)->RealizeResource(); diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 907eceec53..d0187762de 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -668,7 +668,7 @@ void wxFontProperty::OnSetValue() wxFont font; font << m_value; - if ( !font.Ok() ) + if ( !font.IsOk() ) { m_value << *wxNORMAL_FONT; } @@ -906,7 +906,7 @@ void wxSystemColourProperty::Init( int type, const wxColour& colour ) { wxColourPropertyValue cpv; - if ( colour.Ok() ) + if ( colour.IsOk() ) cpv.Init( type, colour ); else cpv.Init( type, *wxWHITE ); @@ -1097,7 +1097,7 @@ void wxSystemColourProperty::OnSetValue() cpv << m_value; wxColour col = cpv.m_colour; - if ( !col.Ok() ) + if ( !col.IsOk() ) { SetValueToUnspecified(); SetIndex(wxNOT_FOUND); @@ -1120,7 +1120,7 @@ void wxSystemColourProperty::OnSetValue() wxColour col; col << m_value; - if ( !col.Ok() ) + if ( !col.IsOk() ) { SetValueToUnspecified(); SetIndex(wxNOT_FOUND); @@ -1383,7 +1383,7 @@ void wxSystemColourProperty::OnCustomPaint( wxDC& dc, const wxRect& rect, col = GetVal().m_colour; } - if ( col.Ok() ) + if ( col.IsOk() ) { dc.SetBrush(col); dc.DrawRectangle(rect); @@ -1585,7 +1585,7 @@ wxColourProperty::~wxColourProperty() void wxColourProperty::Init( wxColour colour ) { - if ( !colour.Ok() ) + if ( !colour.IsOk() ) colour = *wxWHITE; wxVariant variant; variant << colour; @@ -1864,7 +1864,7 @@ void wxImageFileProperty::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& ) { - if ( m_pBitmap || (m_pImage && m_pImage->Ok() ) ) + if ( m_pBitmap || (m_pImage && m_pImage->IsOk() ) ) { // Draw the thumbnail diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 0ca85a9877..97647f7e30 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -774,7 +774,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, const wxBitmap* itemBitmap = NULL; - if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().Ok() && comValIndex == -1 ) + if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 ) itemBitmap = &choices.Item(item).GetBitmap(); // diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index fa81f9e898..6a35823d03 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -158,7 +158,7 @@ int wxPGCellRenderer::PreDrawCell( wxDC& dc, const wxRect& rect, const wxPGCell& dc.SetFont(font); const wxBitmap& bmp = cell.GetBitmap(); - if ( bmp.Ok() && + if ( bmp.IsOk() && // Do not draw oversized bitmap outside choice popup ((flags & ChoicePopup) || bmp.GetHeight() < rect.height ) ) @@ -327,7 +327,7 @@ wxSize wxPGDefaultRenderer::GetImageSize( const wxPGProperty* property, { wxBitmap* bmp = property->GetValueImage(); - if ( bmp && bmp->Ok() ) + if ( bmp && bmp->IsOk() ) return wxSize(bmp->GetWidth(),bmp->GetHeight()); } } @@ -1297,7 +1297,7 @@ void wxPGProperty::OnCustomPaint( wxDC& dc, { wxBitmap* bmp = m_valueBitmap; - wxCHECK_RET( bmp && bmp->Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( bmp && bmp->IsOk(), wxT("invalid bitmap") ); wxCHECK_RET( rect.x >= 0, wxT("unexpected measure call") ); @@ -2091,7 +2091,7 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) { delete m_valueBitmap; - if ( &bmp && bmp.Ok() ) + if ( &bmp && bmp.IsOk() ) { // Resize the image wxSize maxSz = GetGrid()->GetImageSize(); diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index c095af9c78..946c96c1a7 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -4338,7 +4338,7 @@ bool wxRichTextParagraph::Layout(wxDC& dc, const wxRect& rect, int style) int lineSpacing = 0; // Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc. - if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().Ok()) + if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().IsOk()) { wxCheckSetFont(dc, attr.GetFont()); lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0)); @@ -5949,7 +5949,7 @@ bool wxRichTextPlainText::Draw(wxDC& dc, const wxRichTextRange& range, const wxR int charHeight = dc.GetCharHeight(); int x, y; - if ( textFont.Ok() ) + if ( textFont.IsOk() ) { if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) ) { @@ -6248,7 +6248,7 @@ bool wxRichTextPlainText::GetRangeSize(const wxRichTextRange& range, wxSize& siz bool bScript(false); wxFont font(GetBuffer()->GetFontTable().FindFont(textAttr)); - if (font.Ok()) + if (font.IsOk()) { if ( textAttr.HasTextEffects() && ( (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) || (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) ) @@ -7792,7 +7792,7 @@ int wxRichTextBuffer::HitTest(wxDC& dc, const wxPoint& pt, long& textPosition, w bool wxRichTextStdRenderer::DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& bulletAttr, const wxRect& rect) { - if (bulletAttr.GetTextColour().Ok()) + if (bulletAttr.GetTextColour().IsOk()) { wxCheckSetPen(dc, wxPen(bulletAttr.GetTextColour())); wxCheckSetBrush(dc, wxBrush(bulletAttr.GetTextColour())); @@ -7892,7 +7892,7 @@ bool wxRichTextStdRenderer::DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& wxCheckSetFont(dc, font); - if (attr.GetTextColour().Ok()) + if (attr.GetTextColour().IsOk()) dc.SetTextForeground(attr.GetTextColour()); dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); @@ -10153,7 +10153,7 @@ IMPLEMENT_CLASS(wxRichTextFileHandler, wxObject) bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& filename) { wxFFileInputStream stream(filename); - if (stream.Ok()) + if (stream.IsOk()) return LoadFile(buffer, stream); return false; @@ -10162,7 +10162,7 @@ bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& f bool wxRichTextFileHandler::SaveFile(wxRichTextBuffer *buffer, const wxString& filename) { wxFFileOutputStream stream(filename); - if (stream.Ok()) + if (stream.IsOk()) return SaveFile(buffer, stream); return false; @@ -10496,7 +10496,7 @@ unsigned char* wxRichTextImageBlock::ReadBlock(wxInputStream& stream, size_t siz unsigned char* wxRichTextImageBlock::ReadBlock(const wxString& filename, size_t size) { wxFileInputStream stream(filename); - if (!stream.Ok()) + if (!stream.IsOk()) return NULL; return ReadBlock(stream, size); @@ -10514,7 +10514,7 @@ bool wxRichTextImageBlock::WriteBlock(wxOutputStream& stream, unsigned char* blo bool wxRichTextImageBlock::WriteBlock(const wxString& filename, unsigned char* block, size_t size) { wxFileOutputStream outStream(filename); - if (!outStream.Ok()) + if (!outStream.IsOk()) return false; return WriteBlock(outStream, block, size); diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index c95805f58a..34face1aa8 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -230,7 +230,7 @@ bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& va validator, name)) return false; - if (!GetFont().Ok()) + if (!GetFont().IsOk()) { SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); } @@ -2323,7 +2323,7 @@ void wxRichTextCtrl::SetupScrollbars(bool atTop) void wxRichTextCtrl::PaintBackground(wxDC& dc) { wxColour backgroundColour = GetBackgroundColour(); - if (!backgroundColour.Ok()) + if (!backgroundColour.IsOk()) backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); // Clear the background @@ -2350,9 +2350,9 @@ bool wxRichTextCtrl::RecreateBuffer(const wxSize& size) if (sz.x < 1 || sz.y < 1) return false; - if (!m_bufferBitmap.Ok() || m_bufferBitmap.GetWidth() < sz.x || m_bufferBitmap.GetHeight() < sz.y) + if (!m_bufferBitmap.IsOk() || m_bufferBitmap.GetWidth() < sz.x || m_bufferBitmap.GetHeight() < sz.y) m_bufferBitmap = wxBitmap(sz.x, sz.y); - return m_bufferBitmap.Ok(); + return m_bufferBitmap.IsOk(); } #endif @@ -2664,12 +2664,12 @@ bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock, const wx bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType, const wxRichTextAttr& textAttr) { - if (bitmap.Ok()) + if (bitmap.IsOk()) { wxRichTextImageBlock imageBlock; wxImage image = bitmap.ConvertToImage(); - if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType)) + if (image.IsOk() && imageBlock.MakeImageBlock(image, bitmapType)) return WriteImage(imageBlock, textAttr); } diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index d85249f47f..768ef405b0 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -516,7 +516,7 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) font.SetPointSize( static_cast(size) ); } - if ( font.Ok() ) + if ( font.IsOk() ) { dc.SetFont(font); // Calculate vertical and horizontal centre @@ -828,7 +828,7 @@ wxString wxRichTextFontListBox::CreateHTML(const wxString& facename) const if (!facename.IsEmpty() && facename != _("(none)")) str << wxT(" face=\"") << facename << wxT("\""); /* - if (def->GetStyle().GetTextColour().Ok()) + if (def->GetStyle().GetTextColour().IsOk()) str << wxT(" color=\"#") << ColourToHexString(def->GetStyle().GetTextColour()) << wxT("\""); */ diff --git a/src/richtext/richtexthtml.cpp b/src/richtext/richtexthtml.cpp index 7576075bc8..06670cb486 100644 --- a/src/richtext/richtexthtml.cpp +++ b/src/richtext/richtexthtml.cpp @@ -488,9 +488,9 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY) { #if 0 - if (!image->GetImage().Ok() && image->GetImageBlock().GetData()) + if (!image->GetImage().IsOk() && image->GetImageBlock().GetData()) image->LoadFromBlock(); - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) + if (image->GetImage().IsOk() && !image->GetImageBlock().GetData()) image->MakeBlock(); #endif @@ -517,13 +517,13 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s else if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES) { #if 0 - if (!image->GetImage().Ok() && image->GetImageBlock().GetData()) + if (!image->GetImage().IsOk() && image->GetImageBlock().GetData()) image->LoadFromBlock(); - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) + if (image->GetImage().IsOk() && !image->GetImageBlock().GetData()) image->MakeBlock(); #endif - if (image->GetImageBlock().Ok()) + if (image->GetImageBlock().IsOk()) { wxString tempDir(GetTempDir()); if (tempDir.IsEmpty()) @@ -549,10 +549,10 @@ void wxRichTextHTMLHandler::WriteImage(wxRichTextImage* image, wxOutputStream& s str << GetMimeType(image->GetImageBlock().GetImageType()); str << wxT(";base64,"); #if 0 - if (image->GetImage().Ok() && !image->GetImageBlock().GetData()) + if (image->GetImage().IsOk() && !image->GetImageBlock().GetData()) image->MakeBlock(); #endif - if (image->GetImageBlock().Ok()) + if (image->GetImageBlock().IsOk()) { wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() ); str << data; diff --git a/src/richtext/richtextprint.cpp b/src/richtext/richtextprint.cpp index 9855d57966..0bdbb0b031 100644 --- a/src/richtext/richtextprint.cpp +++ b/src/richtext/richtextprint.cpp @@ -194,11 +194,11 @@ void wxRichTextPrintout::RenderPage(wxDC *dc, int page) if (page > 1 || m_headerFooterData.GetShowOnFirstPage()) { - if (m_headerFooterData.GetFont().Ok()) + if (m_headerFooterData.GetFont().IsOk()) dc->SetFont(m_headerFooterData.GetFont()); else dc->SetFont(*wxNORMAL_FONT); - if (m_headerFooterData.GetTextColour().Ok()) + if (m_headerFooterData.GetTextColour().IsOk()) dc->SetTextForeground(m_headerFooterData.GetTextColour()); else dc->SetTextForeground(*wxBLACK); @@ -371,7 +371,7 @@ void wxRichTextPrintout::CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& he !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || !m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty()) { - if (m_headerFooterData.GetFont().Ok()) + if (m_headerFooterData.GetFont().IsOk()) dc->SetFont(m_headerFooterData.GetFont()); else dc->SetFont(*wxNORMAL_FONT); @@ -396,7 +396,7 @@ void wxRichTextPrintout::CalculateScaling(wxDC* dc, wxRect& textRect, wxRect& he !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() || !m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty()) { - if (m_headerFooterData.GetFont().Ok()) + if (m_headerFooterData.GetFont().IsOk()) dc->SetFont(m_headerFooterData.GetFont()); else dc->SetFont(*wxNORMAL_FONT); @@ -570,7 +570,7 @@ bool wxRichTextPrinting::DoPreview(wxRichTextPrintout *printout1, wxRichTextPrin // Pass two printout objects: for preview, and possible printing. wxPrintDialogData printDialogData(*GetPrintData()); wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData); - if (!preview->Ok()) + if (!preview->IsOk()) { delete preview; return false; @@ -601,7 +601,7 @@ bool wxRichTextPrinting::DoPrint(wxRichTextPrintout *printout) void wxRichTextPrinting::PageSetup() { - if (!GetPrintData()->Ok()) + if (!GetPrintData()->IsOk()) { wxLogError(_("There was a problem during page setup: you may need to set a default printer.")); return; diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 12a4ba29a3..c0cc55761f 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -821,7 +821,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (!attr.GetFontFaceName().IsEmpty()) str << wxT(" face=\"") << attr.GetFontFaceName() << wxT("\""); - if (attr.GetTextColour().Ok()) + if (attr.GetTextColour().IsOk()) str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\""); str << wxT(">"); diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index ac02424bf7..9a34fd8894 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -1076,10 +1076,10 @@ bool wxRichTextXMLHandler::ExportStyleDefinition(wxOutputStream& stream, wxRichT wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool isPara) { wxString str; - if (attr.HasTextColour() && attr.GetTextColour().Ok()) + if (attr.HasTextColour() && attr.GetTextColour().IsOk()) AddAttribute(str, wxT("textcolor"), attr.GetTextColour()); - if (attr.HasBackgroundColour() && attr.GetBackgroundColour().Ok()) + if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk()) AddAttribute(str, wxT("bgcolor"), attr.GetBackgroundColour()); if (attr.HasFontSize()) @@ -1371,9 +1371,9 @@ bool wxRichTextXMLHandler::ExportStyleDefinition(wxXmlNode* parent, wxRichTextSt bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr, bool isPara) { - if (attr.HasTextColour() && attr.GetTextColour().Ok()) + if (attr.HasTextColour() && attr.GetTextColour().IsOk()) node->AddAttribute(wxT("textcolor"), MakeString(attr.GetTextColour())); - if (attr.HasBackgroundColour() && attr.GetBackgroundColour().Ok()) + if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk()) node->AddAttribute(wxT("bgcolor"), MakeString(attr.GetBackgroundColour())); if (attr.HasFontSize()) @@ -2381,7 +2381,7 @@ bool wxRichTextImage::ExportXML(wxOutputStream& stream, int indent, wxRichTextXM ::OutputIndentation(stream, indent); ::OutputString(stream, wxT("GetConvMem(), handler->GetConvFile()); - if (!GetImageBlock().Ok()) + if (!GetImageBlock().IsOk()) { // No data ::OutputString(stream, style + wxT(">"), handler->GetConvMem(), handler->GetConvFile()); @@ -2419,7 +2419,7 @@ bool wxRichTextImage::ExportXML(wxXmlNode* parent, wxRichTextXMLHandler* handler wxXmlNode* elementNode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("image")); parent->AddChild(elementNode); - if (GetImageBlock().Ok()) + if (GetImageBlock().IsOk()) elementNode->AddAttribute(wxT("imagetype"), MakeString((int) GetImageBlock().GetImageType())); handler->AddAttributes(elementNode, GetAttributes(), false); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index ca1231db4d..b9f6da5e3e 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -527,9 +527,9 @@ void wxStyledTextCtrl::MarkerDefine(int markerNumber, int markerSymbol, const wxColour& background) { SendMsg(2040, markerNumber, markerSymbol); - if (foreground.Ok()) + if (foreground.IsOk()) MarkerSetForeground(markerNumber, foreground); - if (background.Ok()) + if (background.IsOk()) MarkerSetBackground(markerNumber, background); } diff --git a/src/univ/button.cpp b/src/univ/button.cpp index b26b313082..7f4c253d14 100644 --- a/src/univ/button.cpp +++ b/src/univ/button.cpp @@ -125,7 +125,7 @@ bool wxButton::Create(wxWindow *parent, SetLabel(label); - if (bitmap.Ok()) + if (bitmap.IsOk()) SetBitmap(bitmap); // SetInitialSize called by SetBitmap() else SetInitialSize(size); @@ -170,7 +170,7 @@ wxSize wxButton::DoGetBestClientSize() const wxCoord width, height; dc.GetMultiLineTextExtent(GetLabel(), &width, &height); - if ( m_bitmap.Ok() ) + if ( m_bitmap.IsOk() ) { // allocate extra space for the bitmap wxCoord heightBmp = m_bitmap.GetHeight() + 2*m_marginBmpY; @@ -221,7 +221,7 @@ bool wxButton::DoDrawBackground(wxDC& dc) rect.width = size.x; rect.height = size.y; - if ( GetBackgroundBitmap().Ok() ) + if ( GetBackgroundBitmap().IsOk() ) { // get the bitmap and the flags int alignment; diff --git a/src/univ/checkbox.cpp b/src/univ/checkbox.cpp index d07f1ad561..2c070024f6 100644 --- a/src/univ/checkbox.cpp +++ b/src/univ/checkbox.cpp @@ -116,7 +116,7 @@ void wxCheckBox::OnCheck() wxBitmap wxCheckBox::GetBitmap(State state, Status status) const { wxBitmap bmp = m_bitmaps[state][status]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) bmp = m_bitmaps[State_Normal][status]; return bmp; @@ -178,7 +178,7 @@ void wxCheckBox::DoDraw(wxControlRenderer *renderer) wxSize wxCheckBox::GetBitmapSize() const { wxBitmap bmp = GetBitmap(State_Normal, Status_Checked); - return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) + return bmp.IsOk() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) : GetRenderer()->GetCheckBitmapSize(); } diff --git a/src/univ/ctrlrend.cpp b/src/univ/ctrlrend.cpp index 1a55bb9576..27d9b1e809 100644 --- a/src/univ/ctrlrend.cpp +++ b/src/univ/ctrlrend.cpp @@ -95,10 +95,10 @@ void wxControlRenderer::DrawButtonLabel(const wxBitmap& bitmap, m_dc.SetTextForeground(m_window->GetForegroundColour()); wxString label = m_window->GetLabel(); - if ( !label.empty() || bitmap.Ok() ) + if ( !label.empty() || bitmap.IsOk() ) { wxRect rectLabel = m_rect; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { rectLabel.Inflate(-marginX, -marginY); } @@ -158,7 +158,7 @@ void wxControlRenderer::DrawBitmap(wxDC &dc, { // we may change the bitmap if we stretch it wxBitmap bmp = bitmap; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) return; int width = bmp.GetWidth(), diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 5bc9e4ae72..15a7adb837 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -602,7 +602,7 @@ void wxPopupMenuWindow::DoDraw(wxControlRenderer *renderer) bmp = item->GetDisabledBitmap(); } - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { // strangely enough, for unchecked item we use the // "checked" bitmap because this is the default one - this diff --git a/src/univ/radiobut.cpp b/src/univ/radiobut.cpp index cf209a4397..d047af7f97 100644 --- a/src/univ/radiobut.cpp +++ b/src/univ/radiobut.cpp @@ -148,7 +148,7 @@ void wxRadioButton::SendEvent() wxSize wxRadioButton::GetBitmapSize() const { wxBitmap bmp = GetBitmap(State_Normal, Status_Checked); - return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) + return bmp.IsOk() ? wxSize(bmp.GetWidth(), bmp.GetHeight()) : GetRenderer()->GetRadioBitmapSize(); } diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index d9253ac5e3..64e7903504 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -169,7 +169,7 @@ void wxStdRenderer::DrawBackground(wxDC& dc, { wxColour colBg; - if (col.Ok()) + if (col.IsOk()) { colBg = col; } @@ -678,7 +678,7 @@ void wxStdRenderer::DrawCheckButton(wxDC& dc, wxAlignment align, int indexAccel) { - if (bitmap.Ok()) + if (bitmap.IsOk()) DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel); else DrawCheckOrRadioButton(dc, label, GetCheckBitmap(flags), rect, flags, align, indexAccel); @@ -692,7 +692,7 @@ void wxStdRenderer::DrawRadioButton(wxDC& dc, wxAlignment align, int indexAccel) { - if (bitmap.Ok()) + if (bitmap.IsOk()) DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel); else DrawCheckOrRadioButton(dc, label, GetRadioBitmap(flags), rect, flags, align, indexAccel); @@ -1148,7 +1148,7 @@ void wxStdRenderer::DrawFrameIcon(wxDC& dc, const wxIcon& icon, int flags) { - if ( icon.Ok() ) + if ( icon.IsOk() ) { wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR); dc.DrawIcon(icon, r.x, r.y); @@ -1174,7 +1174,7 @@ void wxStdRenderer::DrawFrameButton(wxDC& dc, } wxBitmap bmp = GetFrameButtonBitmap(idx); - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) return; wxRect rectBtn(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT); diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index 35d3924f79..2f383b594c 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -646,7 +646,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const if ( !win->ShouldInheritColours() ) { // doesn't depend on the state - if ( !col.Ok() ) + if ( !col.IsOk() ) { col = Get(WINDOW); } @@ -657,7 +657,7 @@ wxColour wxGTKColourScheme::GetBackground(wxWindow *win) const // the colour set by the user should be used for the normal state // and for the states for which we don't have any specific colours - if ( !col.Ok() || (flags != 0) ) + if ( !col.IsOk() || (flags != 0) ) { #if wxUSE_SCROLLBAR if ( wxDynamicCast(win, wxScrollBar) ) @@ -1069,7 +1069,7 @@ void wxGTKRenderer::DrawDownZag(wxDC& dc, wxBitmap wxGTKRenderer::GetCheckBitmap(int flags) { - if ( !m_bitmapsCheckbox[0][0].Ok() ) + if ( !m_bitmapsCheckbox[0][0].IsOk() ) { // init the bitmaps once only wxRect rect; @@ -1126,7 +1126,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags) GetIndicatorsFromFlags(flags, state, status); wxBitmap& bmp = m_bitmapsRadiobtn[state][status]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { const wxSize size = GetRadioBitmapSize(); @@ -1142,7 +1142,7 @@ wxBitmap wxGTKRenderer::GetRadioBitmap(int flags) wxBitmap wxGTKRenderer::GetLineWrapBitmap() const { - if ( !m_bmpLineWrap.Ok() ) + if ( !m_bmpLineWrap.IsOk() ) { // the line wrap bitmap as used by GTK+ #define line_wrap_width 6 @@ -1153,7 +1153,7 @@ wxBitmap wxGTKRenderer::GetLineWrapBitmap() const }; wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height); - if ( !bmpLineWrap.Ok() ) + if ( !bmpLineWrap.IsOk() ) { wxFAIL_MSG( wxT("Failed to create line wrap XBM") ); } @@ -1176,7 +1176,7 @@ void wxGTKRenderer::DrawToolBarButton(wxDC& dc, int tbarStyle) { // we don't draw the separators at all - if ( !label.empty() || bitmap.Ok() ) + if ( !label.empty() || bitmap.IsOk() ) { wxRect rect = rectOrig; rect.Deflate(BORDER_THICKNESS); @@ -1260,7 +1260,7 @@ void wxGTKRenderer::DrawLineWrapMark(wxDC& dc, const wxRect& rect) dc.DrawBitmap(bmpLineWrap, rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2); - if ( colFgOld.Ok() ) + if ( colFgOld.IsOk() ) { // restore old colour dc.SetTextForeground(colFgOld); @@ -1677,12 +1677,12 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc, if ( geometryInfo ) { wxBitmap bmp = bitmap; - if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) ) + if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKABLE) ) { bmp = GetCheckBitmap(flags); } - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { rect.SetRight(geometryInfo->GetLabelOffset()); wxControlRenderer::DrawBitmap(dc, bmp, rect); @@ -1796,7 +1796,7 @@ wxMenuGeometryInfo *wxGTKRenderer::GetMenuGeometry(wxWindow *win, } const wxBitmap& bmp = item->GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxCoord widthBmp = bmp.GetWidth(); if ( widthBmp > widthBmpMax ) @@ -1878,7 +1878,7 @@ void wxGTKRenderer::GetComboBitmaps(wxBitmap *bmpNormal, wxBitmap *bmpPressed, wxBitmap *bmpDisabled) { - if ( !m_bitmapsCombo[ComboState_Normal].Ok() ) + if ( !m_bitmapsCombo[ComboState_Normal].IsOk() ) { InitComboBitmaps(); } @@ -2097,7 +2097,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, case wxUP: dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[3].Ok() ) + if ( penShadow[3].IsOk() ) { dc.SetPen(penShadow[3]); dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y, @@ -2109,7 +2109,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, dc.DrawPoint(ptArrow[Point_Third]); dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y, ptArrow[Point_First].x + 1, ptArrow[Point_First].y); - if ( penShadow[2].Ok() ) + if ( penShadow[2].IsOk() ) { dc.SetPen(penShadow[2]); dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, @@ -2123,7 +2123,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]); dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y, ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y); - if ( penShadow[2].Ok() ) + if ( penShadow[2].IsOk() ) { dc.SetPen(penShadow[2]); dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1, @@ -2137,7 +2137,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, case wxLEFT: dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]); dc.DrawPoint(ptArrow[Point_First]); - if ( penShadow[2].Ok() ) + if ( penShadow[2].IsOk() ) { dc.SetPen(penShadow[2]); dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y, diff --git a/src/univ/themes/mono.cpp b/src/univ/themes/mono.cpp index 13c5107e96..7719bfa186 100644 --- a/src/univ/themes/mono.cpp +++ b/src/univ/themes/mono.cpp @@ -585,7 +585,7 @@ wxColour wxMonoColourScheme::GetBackground(wxWindow *win) const } // doesn't depend on the state - if ( !col.Ok() ) + if ( !col.IsOk() ) { col = GetBg(); } @@ -770,7 +770,7 @@ wxBitmap wxMonoRenderer::GetIndicator(IndicatorType indType, int flags) GetIndicatorsFromFlags(flags, indState, indStatus); wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; if ( xpm ) @@ -787,7 +787,7 @@ wxBitmap wxMonoRenderer::GetFrameButtonBitmap(FrameButtonType type) { if ( type == FrameButton_Close ) { - if ( !m_bmpFrameClose.Ok() ) + if ( !m_bmpFrameClose.IsOk() ) { static const char *xpmFrameClose[] = { /* columns rows colors chars-per-pixel */ @@ -1045,7 +1045,7 @@ void wxMonoRenderer::DrawArrow(wxDC& dc, wxCHECK_RET( arrowDir != Arrow_Max, wxT("invalid arrow direction") ); wxBitmap& bmp = m_bmpArrows[arrowDir]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { bmp = wxBitmap(ms_xpmArrows[arrowDir]); } diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index 37943fb3ef..0738111495 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -1253,7 +1253,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const col = Get(CONTROL); else { - if ( !col.Ok() ) + if ( !col.IsOk() ) { // doesn't depend on the state col = Get(WINDOW); @@ -1262,7 +1262,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const } #endif // wxUSE_TEXTCTRL - if (!col.Ok()) + if (!col.IsOk()) col = Get(CONTROL); // Most controls should be this colour, not WINDOW } else @@ -1271,7 +1271,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const // the colour set by the user should be used for the normal state // and for the states for which we don't have any specific colours - if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 ) + if ( !col.IsOk() || (flags & wxCONTROL_PRESSED) != 0 ) { #if wxUSE_SCROLLBAR if ( wxDynamicCast(win, wxScrollBar) ) @@ -1681,7 +1681,7 @@ void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc, int flags) { wxBitmap bmp; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { bmp = bitmap; } @@ -1691,7 +1691,7 @@ void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc, ? IndicatorStatus_Checked : IndicatorStatus_Unchecked; - if ( !m_bmpCheckBitmaps[i].Ok() ) + if ( !m_bmpCheckBitmaps[i].IsOk() ) { m_bmpCheckBitmaps[i] = wxBitmap(ms_xpmChecked[i]); } @@ -1714,7 +1714,7 @@ wxBitmap wxWin32Renderer::GetIndicator(IndicatorType indType, int flags) GetIndicatorsFromFlags(flags, indState, indStatus); wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; if ( xpm ) @@ -2442,12 +2442,12 @@ void wxWin32Renderer::DrawMenuItem(wxDC& dc, // draw the bitmap: use the bitmap provided or the standard checkmark for // the checkable items wxBitmap bmp = bitmap; - if ( !bmp.Ok() && (flags & wxCONTROL_CHECKED) ) + if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKED) ) { bmp = GetIndicator(IndicatorType_Menu, flags); } - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { rect.SetRight(geometryInfo.GetLabelOffset()); wxControlRenderer::DrawBitmap(dc, bmp, rect); @@ -2557,7 +2557,7 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win, } const wxBitmap& bmp = item->GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxCoord widthBmp = bmp.GetWidth(); if ( widthBmp > widthBmpMax ) @@ -3205,7 +3205,7 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window) wxBitmap wxWin32Renderer::GetFrameButtonBitmap(FrameButtonType type) { wxBitmap& bmp = m_bmpFrameButtons[type]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { bmp = wxBitmap(ms_xpmFrameButtons[type]); } diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index 44c188fba3..da03781e9c 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -292,7 +292,7 @@ void wxToolBar::DoEnableTool(wxToolBarToolBase *tool, bool enable) { #if wxUSE_IMAGE // created disabled-state bitmap on demand - if ( !enable && !tool->GetDisabledBitmap().Ok() ) + if ( !enable && !tool->GetDisabledBitmap().IsOk() ) { wxImage image(tool->GetNormalBitmap().ConvertToImage()); diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp index cc90efba41..06afa0f303 100644 --- a/src/univ/topluniv.cpp +++ b/src/univ/topluniv.cpp @@ -208,7 +208,7 @@ long wxTopLevelWindow::GetDecorationsStyle() const if ( IsMaximized() ) style |= wxTOPLEVEL_MAXIMIZED; - if ( GetIcon().Ok() ) + if ( GetIcon().IsOk() ) style |= wxTOPLEVEL_ICON; if ( m_isActive ) style |= wxTOPLEVEL_ACTIVE; @@ -329,13 +329,13 @@ void wxTopLevelWindow::SetIcons(const wxIconBundle& icons) wxSize size = m_renderer->GetFrameIconSize(); const wxIcon& icon = icons.GetIcon( size ); - if ( !icon.Ok() || size.x == wxDefaultCoord ) + if ( !icon.IsOk() || size.x == wxDefaultCoord ) m_titlebarIcon = icon; else { wxBitmap bmp1; bmp1.CopyFromIcon(icon); - if ( !bmp1.Ok() ) + if ( !bmp1.IsOk() ) m_titlebarIcon = wxNullIcon; else if ( bmp1.GetWidth() == size.x && bmp1.GetHeight() == size.y ) m_titlebarIcon = icon; diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 2cfba82d83..1e6ab4bb99 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -258,7 +258,7 @@ void wxWindow::SetBackground(const wxBitmap& bitmap, const wxBitmap& wxWindow::GetBackgroundBitmap(int *alignment, wxStretch *stretch) const { - if ( m_bitmapBg.Ok() ) + if ( m_bitmapBg.IsOk() ) { if ( alignment ) *alignment = m_alignBgBitmap; @@ -408,7 +408,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc) void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect) { - if ( GetBackgroundBitmap().Ok() ) + if ( GetBackgroundBitmap().IsOk() ) { // Get the bitmap and the flags int alignment; diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index cded72e272..b35d0861ac 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -116,7 +116,7 @@ bool wxMask::Create( const wxBitmap& bitmap, m_display = bitmap.GetDisplay(); wxImage image = bitmap.ConvertToImage(); - if (!image.Ok()) return false; + if (!image.IsOk()) return false; m_display = bitmap.GetDisplay(); @@ -220,7 +220,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) m_bitmap = NULL; } - if (!bitmap.Ok()) return false; + if (!bitmap.IsOk()) return false; wxCHECK_MSG( bitmap.GetBitmap(), false, wxT("Cannot create mask from colour bitmap") ); @@ -465,9 +465,9 @@ wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) { #if wxUSE_NANOX - if (!image.Ok()) + if (!image.IsOk()) { - wxASSERT_MSG(image.Ok(), wxT("Invalid wxImage passed to wxBitmap::CreateFromImage.")); + wxASSERT_MSG(image.IsOk(), wxT("Invalid wxImage passed to wxBitmap::CreateFromImage.")); return false; } @@ -573,7 +573,7 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) UnRef(); - wxCHECK_MSG( image.Ok(), false, wxT("invalid image") ); + wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") ); wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") ); m_refData = new wxBitmapRefData(); @@ -793,7 +793,7 @@ wxImage wxBitmap::ConvertToImage() const { wxImage image; - wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") ); Display *xdisplay = (Display*) M_BMPDATA->m_display; wxASSERT_MSG( xdisplay, wxT("No display") ); @@ -958,35 +958,35 @@ wxBitmap::~wxBitmap() int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), wxT("invalid bitmap") ); + wxCHECK_RET( IsOk(), wxT("invalid bitmap") ); AllocExclusive(); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -1002,14 +1002,14 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon) wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const { - wxCHECK_MSG( Ok() && + wxCHECK_MSG( IsOk() && (rect.x >= 0) && (rect.y >= 0) && (rect.x+rect.width <= M_BMPDATA->m_width ) && (rect.y+rect.height <= M_BMPDATA->m_height), wxNullBitmap, wxT("invalid bitmap or bitmap region") ); wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp ); - wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") ); + wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); if( GetMask() ) { @@ -1048,7 +1048,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalette *palette ) const { - wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") ); wxBitmapHandler *handler = FindHandler(type); @@ -1056,7 +1056,7 @@ bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, if (handler == NULL) { wxImage image(this->ConvertToImage()); - if (image.Ok()) return image.SaveFile( name, type ); + if (image.IsOk()) return image.SaveFile( name, type ); return false; } @@ -1078,7 +1078,7 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type ) if (!image.LoadFile( name, type )) return false; - if (image.Ok()) + if (image.IsOk()) { *this = wxBitmap(image); return true; @@ -1091,21 +1091,21 @@ bool wxBitmap::LoadFile( const wxString &name, wxBitmapType type ) void wxBitmap::SetPalette(const wxPalette& palette) { - wxCHECK_RET(Ok(), wxT("invalid bitmap")); + wxCHECK_RET(IsOk(), wxT("invalid bitmap")); wxCHECK_RET(GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth")); AllocExclusive(); wxDELETE(M_BMPDATA->m_palette); - if (!palette.Ok()) return; + if (!palette.IsOk()) return; M_BMPDATA->m_palette = new wxPalette(palette); } wxPalette *wxBitmap::GetPalette() const { - if (!Ok()) return NULL; + if (!IsOk()) return NULL; return M_BMPDATA->m_palette; } @@ -1147,21 +1147,21 @@ void wxBitmap::SetBitmap( WXPixmap bitmap ) WXPixmap wxBitmap::GetPixmap() const { - wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") ); return (WXPixmap)M_BMPDATA->m_pixmap; } WXPixmap wxBitmap::GetBitmap() const { - wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") ); return (WXPixmap)M_BMPDATA->m_bitmap; } WXPixmap wxBitmap::GetDrawable() const { - wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") ); return (WXPixmap)(M_BMPDATA->m_bpp == 1 ? M_BMPDATA->m_bitmap : M_BMPDATA->m_pixmap); @@ -1169,7 +1169,7 @@ WXPixmap wxBitmap::GetDrawable() const WXDisplay *wxBitmap::GetDisplay() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") ); return M_BMPDATA->m_display; } @@ -1432,7 +1432,7 @@ bool wxXPMFileHandler::SaveFile(const wxBitmap *bitmap, const wxPalette *WXUNUSED(palette)) const { wxImage image(bitmap->ConvertToImage()); - if (image.Ok()) + if (image.IsOk()) return image.SaveFile( name, type ); return false; @@ -1540,7 +1540,7 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, const void* bits, #else // !wxHAVE_LIB_XPM wxXPMDecoder decoder; wxImage image(decoder.ReadData((const char **)bits)); - return image.Ok() && bitmap->CreateFromImage(image); + return image.IsOk() && bitmap->CreateFromImage(image); #endif // wxHAVE_LIB_XPM/!wxHAVE_LIB_XPM } diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp index 25192ebb53..80275b7fc5 100644 --- a/src/x11/brush.cpp +++ b/src/x11/brush.cpp @@ -112,21 +112,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/x11/colour.cpp b/src/x11/colour.cpp index 671c3b010f..bd3b94f578 100644 --- a/src/x11/colour.cpp +++ b/src/x11/colour.cpp @@ -189,7 +189,7 @@ void wxColour::InitRGBA(unsigned char red, unsigned char green, unsigned char bl unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); #if wxUSE_NANOX return (unsigned char) M_COLDATA->m_color.red ; @@ -200,7 +200,7 @@ unsigned char wxColour::Red() const unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); #if wxUSE_NANOX return (unsigned char) M_COLDATA->m_color.green ; @@ -211,7 +211,7 @@ unsigned char wxColour::Green() const unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); #if wxUSE_NANOX return (unsigned char) M_COLDATA->m_color.blue ; @@ -222,7 +222,7 @@ unsigned char wxColour::Blue() const void wxColour::CalcPixel( WXColormap cmap ) { - wxCHECK_RET( Ok(), wxT("invalid colour") ); + wxCHECK_RET( IsOk(), wxT("invalid colour") ); wxCHECK_RET( cmap, wxT("invalid colormap") ); @@ -231,14 +231,14 @@ void wxColour::CalcPixel( WXColormap cmap ) unsigned long wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") ); return M_COLDATA->m_color.pixel; } WXColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") ); return (WXColor*) &M_COLDATA->m_color; } diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index d89db5b450..c314e4f387 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -201,7 +201,7 @@ void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) ) if (gs_busyCount++ > 0) return; - wxASSERT_MSG( !gs_savedCursor.Ok(), + wxASSERT_MSG( !gs_savedCursor.IsOk(), wxT("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index 88de745710..01e5cd9ed0 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -349,7 +349,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) m_bitmap = image; - return m_bitmap.Ok(); + return m_bitmap.IsOk(); #else return false; #endif @@ -358,7 +358,7 @@ bool wxBitmapDataObject::SetData(size_t size, const void *buf) void wxBitmapDataObject::DoConvertToPng() { #if wxUSE_LIBPNG - if (!m_bitmap.Ok()) + if (!m_bitmap.IsOk()) return; wxImage image = m_bitmap.ConvertToImage(); diff --git a/src/x11/dcmemory.cpp b/src/x11/dcmemory.cpp index e8124afc84..bdafb7aaf9 100644 --- a/src/x11/dcmemory.cpp +++ b/src/x11/dcmemory.cpp @@ -62,7 +62,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) Destroy(); m_selected = bitmap; - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (m_selected.GetPixmap()) { @@ -86,7 +86,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const { - if (m_selected.Ok()) + if (m_selected.IsOk()) { if (width) (*width) = m_selected.GetWidth(); if (height) (*height) = m_selected.GetHeight(); diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 97592a54c8..aa89f60ffd 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -711,14 +711,14 @@ void wxFont::Unshare() int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), 0, wxT("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") ); return M_FONTDATA->m_faceName; } @@ -730,35 +730,35 @@ wxFontFamily wxFont::DoGetFamily() const wxFontStyle wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") ); return M_FONTDATA->m_style; } wxFontWeight wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); return M_FONTDATA->m_underlined; } wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") ); return M_FONTDATA->m_encoding; } const wxNativeFontInfo *wxFont::GetNativeFontInfo() const { - wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") ); #if wxUSE_UNICODE #else @@ -771,7 +771,7 @@ const wxNativeFontInfo *wxFont::GetNativeFontInfo() const bool wxFont::IsFixedWidth() const { - wxCHECK_MSG( Ok(), false, wxT("invalid font") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid font") ); #if wxUSE_UNICODE return wxFontBase::IsFixedWidth(); @@ -864,7 +864,7 @@ void wxFont::DoSetNativeFontInfo( const wxNativeFontInfo& info ) // font to list in the private data for future reference. wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const { - if ( !Ok() ) + if ( !IsOk() ) return NULL; long intScale = long(scale * 100.0 + 0.5); // key for wxXFont diff --git a/src/x11/pen.cpp b/src/x11/pen.cpp index 7142bed347..c17740e4d9 100644 --- a/src/x11/pen.cpp +++ b/src/x11/pen.cpp @@ -179,7 +179,7 @@ void wxPen::SetWidth( int width ) int wxPen::GetDashes( wxDash **ptr ) const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); *ptr = (wxDash*)M_PENDATA->m_dash; return M_PENDATA->m_countDashes; @@ -197,42 +197,42 @@ wxDash* wxPen::GetDash() const wxPenCap wxPen::GetCap() const { - wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") ); return M_PENDATA->m_capStyle; } wxPenJoin wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") ); return M_PENDATA->m_joinStyle; } wxPenStyle wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") ); return M_PENDATA->m_width; } wxColour wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") ); return M_PENDATA->m_colour; } wxBitmap *wxPen::GetStipple() const { - wxCHECK_MSG( Ok(), &wxNullBitmap, wxT("invalid pen") ); + wxCHECK_MSG( IsOk(), &wxNullBitmap, wxT("invalid pen") ); return &M_PENDATA->m_stipple; } diff --git a/src/x11/region.cpp b/src/x11/region.cpp index 2abcca5e45..ad635c28da 100644 --- a/src/x11/region.cpp +++ b/src/x11/region.cpp @@ -175,7 +175,7 @@ bool wxRegion::DoUnionWithRect(const wxRect& r) bool wxRegion::DoUnionWithRegion( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -196,7 +196,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -220,7 +220,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { @@ -241,7 +241,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); + wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") ); if (!m_refData) { diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 0cf59dd5dc..5da3d5b3b7 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -377,7 +377,7 @@ bool wxTopLevelWindowX11::ShowFullScreen(bool show, long style) void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon) { - if (icon.Ok() && X11GetMainWindow()) + if (icon.IsOk() && X11GetMainWindow()) { #if !wxUSE_NANOX XWMHints *wmHints = XAllocWMHints(); diff --git a/src/x11/window.cpp b/src/x11/window.cpp index c52af30a53..1f004c99b4 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -582,7 +582,7 @@ bool wxWindowX11::SetCursor(const wxCursor& cursor) wxCHECK_MSG( xwindow, false, wxT("invalid window") ); wxCursor cursorToUse; - if (m_cursor.Ok()) + if (m_cursor.IsOk()) cursorToUse = m_cursor; else cursorToUse = *wxSTANDARD_CURSOR; @@ -1031,7 +1031,7 @@ void wxWindowX11::DoSetSizeHints(int minW, int minH, int maxW, int maxH, int inc int wxWindowX11::GetCharHeight() const { wxFont font(GetFont()); - wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") ); + wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") ); #if wxUSE_UNICODE // There should be an easier way. @@ -1059,7 +1059,7 @@ int wxWindowX11::GetCharHeight() const int wxWindowX11::GetCharWidth() const { wxFont font(GetFont()); - wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") ); + wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") ); #if wxUSE_UNICODE // There should be an easier way. @@ -1092,7 +1092,7 @@ void wxWindowX11::DoGetTextExtent(const wxString& string, wxFont fontToUse = GetFont(); if (theFont) fontToUse = *theFont; - wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") ); + wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") ); if (string.empty()) { diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index f9209d0fff..252331cae0 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -451,7 +451,7 @@ void wxXmlDocument::DoCopy(const wxXmlDocument& doc) bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding, int flags) { wxFileInputStream stream(filename); - if (!stream.Ok()) + if (!stream.IsOk()) return false; return Load(stream, encoding, flags); } @@ -459,7 +459,7 @@ bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding, int bool wxXmlDocument::Save(const wxString& filename, int indentstep) const { wxFileOutputStream stream(filename); - if (!stream.Ok()) + if (!stream.IsOk()) return false; return Save(stream, indentstep); } diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 96650224bb..6e393adc42 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1745,7 +1745,7 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param, const wxColour& // the colour doesn't use #RRGGBB format, check if it is symbolic // colour name: clr = GetSystemColour(v); - if (clr.Ok()) + if (clr.IsOk()) return clr; ReportParamError @@ -1823,7 +1823,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxXmlNode* node, art_id, art_client) ) { wxBitmap stockArt(wxArtProvider::GetBitmap(art_id, art_client, size)); - if ( stockArt.Ok() ) + if ( stockArt.IsOk() ) return stockArt; } @@ -1847,7 +1847,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxXmlNode* node, wxImage img(name); #endif - if (!img.Ok()) + if (!img.IsOk()) { ReportParamError ( @@ -2277,7 +2277,7 @@ wxFont wxXmlResourceHandler::GetFont(const wxString& param) // is this font based on a system font? wxFont font = GetSystemFont(GetParamValue(wxT("sysfont"))); - if (font.Ok()) + if (font.IsOk()) { if (hasSize && isize != -1) font.SetPointSize(isize); diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index 04fdb902a2..b56777059f 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -680,7 +680,7 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out, // then load the archive file { wxFFileInputStream in(tmparc); - if (in.Ok()) + if (in.IsOk()) out.Write(in); } @@ -690,7 +690,7 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out, // for the non-seekable test, have the archiver output to "-" // and read the archive via a pipe PFileInputStream in(wxString::Format(archiver, wxT("-"))); - if (in.Ok()) + if (in.IsOk()) out.Write(in); } } @@ -893,7 +893,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in, // write the archive to a temporary file { wxFFileOutputStream out(tmparc); - if (out.Ok()) + if (out.IsOk()) out.Write(in); } @@ -905,7 +905,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in, // for the non-seekable test, have the archiver extract "-" and // feed it the archive via a pipe PFileOutputStream out(wxString::Format(unarchiver, wxT("-"))); - if (out.Ok()) + if (out.IsOk()) out.Write(in); } @@ -958,7 +958,7 @@ void ArchiveTestCase::VerifyDir(wxString& path, if (!isDir) { wxFFileInputStream in(path); CPPUNIT_ASSERT_MESSAGE( - "entry not found in archive" + error_entry, in.Ok()); + "entry not found in archive" + error_entry, in.IsOk()); size_t size = (size_t)in.GetLength(); wxCharBuffer buf(size); diff --git a/tests/archive/ziptest.cpp b/tests/archive/ziptest.cpp index 6976b083bb..e78786a742 100644 --- a/tests/archive/ziptest.cpp +++ b/tests/archive/ziptest.cpp @@ -180,7 +180,7 @@ void ZipPipeTestCase::runTest() { PFileInputStream in(cmd); - if (in.Ok()) + if (in.IsOk()) out.Write(in); } diff --git a/tests/streams/datastreamtest.cpp b/tests/streams/datastreamtest.cpp index 55fdf12871..d42dc381c9 100644 --- a/tests/streams/datastreamtest.cpp +++ b/tests/streams/datastreamtest.cpp @@ -153,7 +153,8 @@ public: ProcessData(&*Values.begin(), Values.size(), pfnWriter, pfnReader); } - bool Ok(void) const { + bool IsOk() const + { return m_ok; } }; @@ -214,8 +215,8 @@ void DataStreamTestCase::LongLongRW() CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l)) == wxLongLong(0x12345678l) ); CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l, 0xabcdef01l)) == wxLongLong(0x12345678l, 0xabcdef01l) ); - CPPUNIT_ASSERT( TestMultiRW(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() ); - CPPUNIT_ASSERT( TestMultiRW(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() ); } #endif @@ -238,8 +239,8 @@ void DataStreamTestCase::Int64RW() CPPUNIT_ASSERT( TestRW(wxUint64(0x12345678l)) == wxUint64(0x12345678l) ); CPPUNIT_ASSERT( TestRW((wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l)) == (wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l) ); - CPPUNIT_ASSERT( TestMultiRW(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() ); - CPPUNIT_ASSERT( TestMultiRW(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() ); + CPPUNIT_ASSERT( TestMultiRW(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() ); } #endif diff --git a/tests/streams/largefile.cpp b/tests/streams/largefile.cpp index 5533edb664..da11ccaeca 100644 --- a/tests/streams/largefile.cpp +++ b/tests/streams/largefile.cpp @@ -220,7 +220,7 @@ protected: wxInputStream *LargeFileTest_wxFile::MakeInStream(const wxString& name) const { auto_ptr in(new wxFileInputStream(name)); - CPPUNIT_ASSERT(in->Ok()); + CPPUNIT_ASSERT(in->IsOk()); return in.release(); } @@ -252,7 +252,7 @@ protected: wxInputStream *LargeFileTest_wxFFile::MakeInStream(const wxString& name) const { auto_ptr in(new wxFFileInputStream(name)); - CPPUNIT_ASSERT(in->Ok()); + CPPUNIT_ASSERT(in->IsOk()); return in.release(); } diff --git a/tests/streams/textstreamtest.cpp b/tests/streams/textstreamtest.cpp index a05686ed0c..1d1ec0375b 100644 --- a/tests/streams/textstreamtest.cpp +++ b/tests/streams/textstreamtest.cpp @@ -129,7 +129,7 @@ void TextStreamTestCase::MiscTests() { wxString filename = wxT("testdata.fc"); wxFileInputStream fsIn(filename); - if ( !fsIn.Ok() ) + if ( !fsIn.IsOk() ) { return; } diff --git a/utils/emulator/src/emulator.cpp b/utils/emulator/src/emulator.cpp index 09cc8b6d07..e7f1545b17 100644 --- a/utils/emulator/src/emulator.cpp +++ b/utils/emulator/src/emulator.cpp @@ -372,7 +372,7 @@ void wxEmulatorContainer::OnPaint(wxPaintEvent& WXUNUSED(event)) wxPaintDC dc(this); wxSize sz = GetClientSize(); - if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.Ok()) + if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.IsOk()) { int deviceWidth = wxGetApp().m_emulatorInfo.m_emulatorDeviceSize.x; int deviceHeight = wxGetApp().m_emulatorInfo.m_emulatorDeviceSize.y;