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
This commit is contained in:
Dimitri Schoolwerth
2011-05-03 16:29:04 +00:00
parent ddd7e4307b
commit a1b806b982
322 changed files with 1261 additions and 1260 deletions

View File

@@ -60,7 +60,7 @@ Card::Card(int value, WayUp way_up) :
if (!m_symbolBmap) if (!m_symbolBmap)
{ {
m_symbolBmap = new wxBitmap(symbols_xpm); m_symbolBmap = new wxBitmap(symbols_xpm);
if (!m_symbolBmap->Ok()) if (!m_symbolBmap->IsOk())
{ {
::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error")); ::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error"));
} }
@@ -68,7 +68,7 @@ Card::Card(int value, WayUp way_up) :
if (!m_pictureBmap) if (!m_pictureBmap)
{ {
m_pictureBmap = new wxBitmap(Pictures); m_pictureBmap = new wxBitmap(Pictures);
if (!m_pictureBmap->Ok()) if (!m_pictureBmap->IsOk())
{ {
::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error")); ::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error"));
} }

View File

@@ -69,7 +69,7 @@ public:
// icon to be shown in the dialog, defaults to the main frame icon // icon to be shown in the dialog, defaults to the main frame icon
void SetIcon(const wxIcon& icon) { m_icon = 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; wxIcon GetIcon() const;
// web site for the program and its description (defaults to URL itself if // web site for the program and its description (defaults to URL itself if

View File

@@ -112,10 +112,10 @@ public:
void SetHoliday(bool holiday) { m_holiday = holiday; } void SetHoliday(bool holiday) { m_holiday = holiday; }
// accessors // accessors
bool HasTextColour() const { return m_colText.Ok(); } bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasBorderColour() const { return m_colBorder.Ok(); } bool HasBorderColour() const { return m_colBorder.IsOk(); }
bool HasFont() const { return m_font.Ok(); } bool HasFont() const { return m_font.IsOk(); }
bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; } bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; }
bool IsHoliday() const { return m_holiday; } bool IsHoliday() const { return m_holiday; }

View File

@@ -189,7 +189,7 @@ public:
// Is this data OK for showing the print dialog? // Is this data OK for showing the print dialog?
bool Ok() const { return IsOk(); } bool Ok() const { return IsOk(); }
bool IsOk() const { return m_printData.Ok() ; } bool IsOk() const { return m_printData.IsOk() ; }
wxPrintData& GetPrintData() { return m_printData; } wxPrintData& GetPrintData() { return m_printData; }
void SetPrintData(const wxPrintData& printData) { m_printData = printData; } void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
@@ -249,7 +249,7 @@ public:
// Is this data OK for showing the page setup dialog? // Is this data OK for showing the page setup dialog?
bool Ok() const { return IsOk(); } 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 // If a corresponding paper type is found in the paper database, will set the m_printData
// paper size id member as well. // paper size id member as well.

View File

@@ -163,7 +163,7 @@ public:
void SetItalic( bool set ) { m_italic = set; } void SetItalic( bool set ) { m_italic = set; }
// accessors // accessors
bool HasColour() const { return m_colour.Ok(); } bool HasColour() const { return m_colour.IsOk(); }
const wxColour& GetColour() const { return m_colour; } const wxColour& GetColour() const { return m_colour; }
bool HasFont() const { return m_bold || m_italic; } bool HasFont() const { return m_bold || m_italic; }

View File

@@ -1344,13 +1344,13 @@ public:
~wxDCTextColourChanger() ~wxDCTextColourChanger()
{ {
if ( m_colFgOld.Ok() ) if ( m_colFgOld.IsOk() )
m_dc.SetTextForeground(m_colFgOld); m_dc.SetTextForeground(m_colFgOld);
} }
void Set(const wxColour& col) void Set(const wxColour& col)
{ {
if ( !m_colFgOld.Ok() ) if ( !m_colFgOld.IsOk() )
m_colFgOld = m_dc.GetTextForeground(); m_colFgOld = m_dc.GetTextForeground();
m_dc.SetTextForeground(col); m_dc.SetTextForeground(col);
} }
@@ -1378,7 +1378,7 @@ public:
~wxDCPenChanger() ~wxDCPenChanger()
{ {
if ( m_penOld.Ok() ) if ( m_penOld.IsOk() )
m_dc.SetPen(m_penOld); m_dc.SetPen(m_penOld);
} }
@@ -1405,7 +1405,7 @@ public:
~wxDCBrushChanger() ~wxDCBrushChanger()
{ {
if ( m_brushOld.Ok() ) if ( m_brushOld.IsOk() )
m_dc.SetBrush(m_brushOld); m_dc.SetBrush(m_brushOld);
} }
@@ -1461,14 +1461,14 @@ public:
void Set(const wxFont& font) void Set(const wxFont& font)
{ {
if ( !m_fontOld.Ok() ) if ( !m_fontOld.IsOk() )
m_fontOld = m_dc.GetFont(); m_fontOld = m_dc.GetFont();
m_dc.SetFont(font); m_dc.SetFont(font);
} }
~wxDCFontChanger() ~wxDCFontChanger()
{ {
if ( m_fontOld.Ok() ) if ( m_fontOld.IsOk() )
m_dc.SetFont(m_fontOld); m_dc.SetFont(m_fontOld);
} }

View File

@@ -1528,7 +1528,7 @@ public:
void SetCursor(const wxCursor& cursor) { m_cursor = cursor; } void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
const wxCursor& GetCursor() const { return m_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); } virtual wxEvent *Clone() const { return new wxSetCursorEvent(*this); }

View File

@@ -432,9 +432,9 @@ public:
void SetKind(wxAttrKind kind) { m_attrkind = kind; } void SetKind(wxAttrKind kind) { m_attrkind = kind; }
// accessors // accessors
bool HasTextColour() const { return m_colText.Ok(); } bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasFont() const { return m_font.Ok(); } bool HasFont() const { return m_font.IsOk(); }
bool HasAlignment() const bool HasAlignment() const
{ {
return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID; return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;

View File

@@ -61,7 +61,7 @@ public:
private: private:
wxSize GetBitmapSize() 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 : wxSize(16, 16); // this is completely arbitrary
} }

View File

@@ -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 // helper: use the encoding of the given font if it's valid
inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font) 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); : wxFONTENCODING_SYSTEM);
} }
inline wxCharBuffer wxConvertFromGTK(const wxString& s, const wxFont& font) 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); : wxFONTENCODING_SYSTEM);
} }

View File

@@ -183,9 +183,9 @@ public:
void SetFont(const wxFont& font) { m_font = font; } void SetFont(const wxFont& font) { m_font = font; }
// accessors // accessors
bool HasTextColour() const { return m_colText.Ok(); } bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasFont() const { return m_font.Ok(); } bool HasFont() const { return m_font.IsOk(); }
const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; } const wxColour& GetBackgroundColour() const { return m_colBack; }

View File

@@ -3644,7 +3644,7 @@ public:
/// image size. /// image size.
virtual wxTextAttrSize GetNaturalSize() const; 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; } virtual bool CanEditProperties() const { return true; }

View File

@@ -379,8 +379,8 @@ public:
int GetOutlineLevel() const { return m_outlineLevel; } int GetOutlineLevel() const { return m_outlineLevel; }
// accessors // accessors
bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_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 HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; }
bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; } bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; }
bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); } bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); }

View File

@@ -252,9 +252,9 @@ public:
void SetFont(const wxFont& font) { m_font = font; } void SetFont(const wxFont& font) { m_font = font; }
// accessors // accessors
bool HasTextColour() const { return m_colText.Ok(); } bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.Ok(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasFont() const { return m_font.Ok(); } bool HasFont() const { return m_font.IsOk(); }
const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; } const wxColour& GetBackgroundColour() const { return m_colBack; }

View File

@@ -293,7 +293,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
m_animationCtrl->Play(); m_animationCtrl->Play();
#else #else
wxFileInputStream stream(filename); wxFileInputStream stream(filename);
if (!stream.Ok()) if (!stream.IsOk())
{ {
wxLogError(wxT("Sorry, this animation is not a valid format for wxAnimation.")); wxLogError(wxT("Sorry, this animation is not a valid format for wxAnimation."));
return; return;

View File

@@ -34,7 +34,7 @@
{ \ { \
int ind; \ int ind; \
wxIcon icon = wxArtProvider::GetIcon(id, client, size); \ wxIcon icon = wxArtProvider::GetIcon(id, client, size); \
if ( icon.Ok() ) \ if ( icon.IsOk() ) \
ind = images->Add(icon); \ ind = images->Add(icon); \
else \ else \
ind = 0; \ ind = 0; \

View File

@@ -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++ ) for ( size_t n = 0; n < Image_Max; n++ )
{ {
wxBitmap bmp(s_iconNames[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."), wxLogWarning(wxT("Couldn't load the image '%s' for the book control page %d."),
s_iconNames[n], n); 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__) #if defined(__WXMSW__) || defined(__WXMOTIF__)
// test for masked bitmap display // test for masked bitmap display
bitmap = wxBitmap(wxT("test2.bmp"), wxBITMAP_TYPE_BMP); bitmap = wxBitmap(wxT("test2.bmp"), wxBITMAP_TYPE_BMP);
if (bitmap.Ok()) if (bitmap.IsOk())
{ {
bitmap.SetMask(new wxMask(bitmap, *wxBLUE)); bitmap.SetMask(new wxMask(bitmap, *wxBLUE));
@@ -1183,7 +1183,7 @@ void MyPanel::OnChangeColour(wxCommandEvent& WXUNUSED(event))
SetThemeEnabled(false); SetThemeEnabled(false);
// test panel colour changing and propagation to the subcontrols // test panel colour changing and propagation to the subcontrols
if ( s_colOld.Ok() ) if ( s_colOld.IsOk() )
{ {
SetBackgroundColour(s_colOld); SetBackgroundColour(s_colOld);
s_colOld = wxNullColour; s_colOld = wxNullColour;

View File

@@ -141,7 +141,7 @@ public:
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
if ( m_bitmap.Ok() ) if ( m_bitmap.IsOk() )
{ {
PrepareDC(dc); PrepareDC(dc);
@@ -177,7 +177,7 @@ public:
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
if ( m_metafile.Ok() ) if ( m_metafile.IsOk() )
{ {
PrepareDC(dc); PrepareDC(dc);
@@ -1327,7 +1327,7 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event))
wxBITMAP_TYPE_BMP wxBITMAP_TYPE_BMP
#endif #endif
); );
if (!image.Ok()) if (!image.IsOk())
{ {
wxLogError( wxT("Invalid image file...") ); wxLogError( wxT("Invalid image file...") );
return; return;

View File

@@ -87,7 +87,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
void MyCanvas::OnEraseBackground(wxEraseEvent& event) void MyCanvas::OnEraseBackground(wxEraseEvent& event)
{ {
if (wxGetApp().GetBackgroundBitmap().Ok()) if (wxGetApp().GetBackgroundBitmap().IsOk())
{ {
wxSize sz = GetClientSize(); wxSize sz = GetClientSize();
wxRect rect(0, 0, sz.x, sz.y); 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) bool DragShape::Draw(wxDC& dc, bool highlight)
{ {
if (m_bitmap.Ok()) if (m_bitmap.IsOk())
{ {
wxMemoryDC memDC; wxMemoryDC memDC;
memDC.SelectObject(m_bitmap); memDC.SelectObject(m_bitmap);
@@ -498,7 +498,7 @@ bool MyDragImage::UpdateBackingFromWindow(wxDC& WXUNUSED(windowDC), wxMemoryDC&
{ {
destDC.SetClippingRegion(destRect); destDC.SetClippingRegion(destRect);
if (wxGetApp().GetBackgroundBitmap().Ok()) if (wxGetApp().GetBackgroundBitmap().IsOk())
wxGetApp().TileBitmap(destRect, destDC, wxGetApp().GetBackgroundBitmap()); wxGetApp().TileBitmap(destRect, destDC, wxGetApp().GetBackgroundBitmap());
m_canvas->DrawShapes(destDC); m_canvas->DrawShapes(destDC);

View File

@@ -580,7 +580,7 @@ void MyCanvas::DrawDefault(wxDC& dc)
// rectangle above) // rectangle above)
//dc.SetBrush( *wxTRANSPARENT_BRUSH ); //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.DrawBitmap(m_smile_bmp, x + rectSize - 20, rectSize - 10, true);
dc.SetBrush( *wxBLACK_BRUSH ); dc.SetBrush( *wxBLACK_BRUSH );
@@ -1468,7 +1468,7 @@ void MyCanvas::DrawRegionsHelper(wxDC& dc, wxCoord x, bool firstTime)
dc.SetBrush( *wxGREY_BRUSH ); dc.SetBrush( *wxGREY_BRUSH );
dc.DrawRectangle( x, y, 310, 310 ); 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 + 150, y + 150, true );
dc.DrawBitmap( m_smile_bmp, x + 130, y + 10, 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); m_owner->PrepareDC(dc);
dc.SetBackgroundMode( m_owner->m_backgroundMode ); dc.SetBackgroundMode( m_owner->m_backgroundMode );
if ( m_owner->m_backgroundBrush.Ok() ) if ( m_owner->m_backgroundBrush.IsOk() )
dc.SetBackground( m_owner->m_backgroundBrush ); dc.SetBackground( m_owner->m_backgroundBrush );
if ( m_owner->m_colourForeground.Ok() ) if ( m_owner->m_colourForeground.IsOk() )
dc.SetTextForeground( m_owner->m_colourForeground ); dc.SetTextForeground( m_owner->m_colourForeground );
if ( m_owner->m_colourBackground.Ok() ) if ( m_owner->m_colourBackground.IsOk() )
dc.SetTextBackground( m_owner->m_colourBackground ); dc.SetTextBackground( m_owner->m_colourBackground );
if ( m_owner->m_textureBackground) { if ( m_owner->m_textureBackground) {
if ( ! m_owner->m_backgroundBrush.Ok() ) { if ( ! m_owner->m_backgroundBrush.IsOk() ) {
wxColour clr(0,128,0); wxColour clr(0,128,0);
wxBrush b(clr, wxSOLID); wxBrush b(clr, wxSOLID);
dc.SetBackground(b); dc.SetBackground(b);
@@ -1916,7 +1916,7 @@ void MyFrame::OnOption(wxCommandEvent& event)
case Colour_Background: case Colour_Background:
{ {
wxColour col = SelectColour(); wxColour col = SelectColour();
if ( col.Ok() ) if ( col.IsOk() )
{ {
m_backgroundBrush.SetColour(col); m_backgroundBrush.SetColour(col);
} }

View File

@@ -503,7 +503,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
m_lbox = new wxListBox(this, wxID_ANY); m_lbox = new wxListBox(this, wxID_ANY);
wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL); wxFONTWEIGHT_NORMAL);
if ( font.Ok() ) if ( font.IsOk() )
m_lbox->SetFont(font); m_lbox->SetFont(font);
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR

View File

@@ -553,7 +553,7 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event))
wxFont font; wxFont font;
font.SetNativeFontInfo(fontInfo); font.SetNativeFontInfo(fontInfo);
if ( !font.Ok() ) if ( !font.IsOk() )
{ {
wxLogError(wxT("Font info string \"%s\" is invalid."), wxLogError(wxT("Font info string \"%s\" is invalid."),
fontInfo.c_str()); fontInfo.c_str());
@@ -576,12 +576,12 @@ void MyFrame::OnSetNativeUserDesc(wxCommandEvent& WXUNUSED(event))
wxFont font; wxFont font;
if (font.SetNativeFontInfoUserDesc(fontUserInfo)) 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); DoChangeFont(font);
} }
else 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...")); 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()); wxFont font(GetCanvas()->GetTextFont());
if (font.SetFaceName(newFaceName)) // change facename only 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); DoChangeFont(font);
} }
else 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..."), wxMessageBox(wxT("There is no font with such face name..."),
wxT("Invalid face name"), wxOK|wxICON_ERROR, this); 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) void MyFrame::DoChangeFont(const wxFont& font, const wxColour& col)
{ {
m_canvas->SetTextFont(font); m_canvas->SetTextFont(font);
if ( col.Ok() ) if ( col.IsOk() )
m_canvas->SetColour(col); m_canvas->SetColour(col);
m_canvas->Refresh(); m_canvas->Refresh();
m_textctrl->SetFont(font); m_textctrl->SetFont(font);
if ( col.Ok() ) if ( col.IsOk() )
m_textctrl->SetForegroundColour(col); m_textctrl->SetForegroundColour(col);
// update the state of the bold/italic/underlined menu items // update the state of the bold/italic/underlined menu items
@@ -968,7 +968,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, false /* !underlined */, wxFONTWEIGHT_NORMAL, false /* !underlined */,
wxEmptyString /* facename */, fontenc); wxEmptyString /* facename */, fontenc);
if ( font.Ok() ) if ( font.IsOk() )
{ {
DoChangeFont(font); DoChangeFont(font);
} }
@@ -1047,7 +1047,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawText(fontInfo, x, y); dc.DrawText(fontInfo, x, y);
y += hLine; y += hLine;
if ( m_font.Ok() ) if ( m_font.IsOk() )
{ {
const wxNativeFontInfo *info = m_font.GetNativeFontInfo(); const wxNativeFontInfo *info = m_font.GetNativeFontInfo();
if ( info ) if ( info )

View File

@@ -702,7 +702,7 @@ void GridFrame::SetLabelTextColour( wxCommandEvent& WXUNUSED(ev) )
void GridFrame::SetLabelFont( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetLabelFont( wxCommandEvent& WXUNUSED(ev) )
{ {
wxFont font = wxGetFontFromUser(this); wxFont font = wxGetFontFromUser(this);
if ( font.Ok() ) if ( font.IsOk() )
{ {
grid->SetLabelFont(font); grid->SetLabelFont(font);
} }
@@ -945,7 +945,7 @@ void GridFrame::SelectRowsOrCols( wxCommandEvent& WXUNUSED(ev) )
void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) )
{ {
wxColour col = wxGetColourFromUser(this); wxColour col = wxGetColourFromUser(this);
if ( col.Ok() ) if ( col.IsOk() )
{ {
grid->SetDefaultCellTextColour(col); grid->SetDefaultCellTextColour(col);
grid->Refresh(); grid->Refresh();
@@ -955,7 +955,7 @@ void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) )
void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) )
{ {
wxColour col = wxGetColourFromUser(this); wxColour col = wxGetColourFromUser(this);
if ( col.Ok() ) if ( col.IsOk() )
{ {
// Check the new Refresh function by passing it a rectangle // Check the new Refresh function by passing it a rectangle
// which exactly fits the grid. // which exactly fits the grid.

View File

@@ -449,7 +449,7 @@ void MyFrame::OnGetItemRect(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
{ {
wxColour col = wxGetColourFromUser(this, m_hlbox->GetBackgroundColour()); wxColour col = wxGetColourFromUser(this, m_hlbox->GetBackgroundColour());
if ( col.Ok() ) if ( col.IsOk() )
{ {
m_hlbox->SetBackgroundColour(col); m_hlbox->SetBackgroundColour(col);
m_hlbox->Refresh(); m_hlbox->Refresh();
@@ -463,7 +463,7 @@ void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event))
{ {
wxColour col = wxGetColourFromUser(this, m_hlbox->GetSelectionBackground()); wxColour col = wxGetColourFromUser(this, m_hlbox->GetSelectionBackground());
if ( col.Ok() ) if ( col.IsOk() )
{ {
m_hlbox->SetSelectionBackground(col); m_hlbox->SetSelectionBackground(col);
m_hlbox->Refresh(); m_hlbox->Refresh();

View File

@@ -272,7 +272,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
smile_height, 1 ); smile_height, 1 );
// demonstrates XPM automatically using the mask when saving // 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); m_bmpSmileXpm.SaveFile(wxT("saved.xpm"), wxBITMAP_TYPE_XPM);
#if wxUSE_ICO_CUR #if wxUSE_ICO_CUR
@@ -389,7 +389,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
PrepareDC( dc ); PrepareDC( dc );
dc.DrawText( wxT("Loaded image"), 30, 10 ); dc.DrawText( wxT("Loaded image"), 30, 10 );
if (my_square.Ok()) if (my_square.IsOk())
dc.DrawBitmap( my_square, 30, 30 ); dc.DrawBitmap( my_square, 30, 30 );
dc.DrawText( wxT("Drawn directly"), 150, 10 ); dc.DrawText( wxT("Drawn directly"), 150, 10 );
@@ -399,11 +399,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetBrush( *wxWHITE_BRUSH ); dc.SetBrush( *wxWHITE_BRUSH );
dc.DrawRectangle( 170, 50, 60, 60 ); dc.DrawRectangle( 170, 50, 60, 60 );
if (my_anti.Ok()) if (my_anti.IsOk())
dc.DrawBitmap( my_anti, 280, 30 ); dc.DrawBitmap( my_anti, 280, 30 );
dc.DrawText( wxT("PNG handler"), 30, 135 ); dc.DrawText( wxT("PNG handler"), 30, 135 );
if (my_horse_png.Ok()) if (my_horse_png.IsOk())
{ {
dc.DrawBitmap( my_horse_png, 30, 150 ); dc.DrawBitmap( my_horse_png, 30, 150 );
wxRect rect(0,0,100,100); wxRect rect(0,0,100,100);
@@ -413,55 +413,55 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
} }
dc.DrawText( wxT("JPEG handler"), 30, 365 ); 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.DrawBitmap( my_horse_jpeg, 30, 380 );
dc.DrawText( wxT("Green rotated to red"), 280, 365 ); 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.DrawBitmap( colorized_horse_jpeg, 280, 380 );
dc.DrawText( wxT("CMYK JPEG image"), 530, 365 ); 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.DrawBitmap( my_cmyk_jpeg, 530, 380 );
dc.DrawText( wxT("GIF handler"), 30, 595 ); 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.DrawBitmap( my_horse_gif, 30, 610 );
dc.DrawText( wxT("PCX handler"), 30, 825 ); 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.DrawBitmap( my_horse_pcx, 30, 840 );
dc.DrawText( wxT("BMP handler"), 30, 1055 ); 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.DrawBitmap( my_horse_bmp, 30, 1070 );
dc.DrawText( wxT("BMP read from memory"), 280, 1055 ); 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.DrawBitmap( my_horse_bmp2, 280, 1070 );
dc.DrawText( wxT("PNM handler"), 30, 1285 ); 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.DrawBitmap( my_horse_pnm, 30, 1300 );
dc.DrawText( wxT("PNM handler (ascii grey)"), 280, 1285 ); 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.DrawBitmap( my_horse_asciigrey_pnm, 280, 1300 );
dc.DrawText( wxT("PNM handler (raw grey)"), 530, 1285 ); 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.DrawBitmap( my_horse_rawgrey_pnm, 530, 1300 );
dc.DrawText( wxT("TIFF handler"), 30, 1515 ); 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.DrawBitmap( my_horse_tiff, 30, 1530 );
dc.DrawText( wxT("TGA handler"), 30, 1745 ); 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.DrawBitmap( my_horse_tga, 30, 1760 );
dc.DrawText( wxT("XPM handler"), 30, 1975 ); dc.DrawText( wxT("XPM handler"), 30, 1975 );
if (my_horse_xpm.Ok()) if (my_horse_xpm.IsOk())
dc.DrawBitmap( my_horse_xpm, 30, 2000 ); dc.DrawBitmap( my_horse_xpm, 30, 2000 );
// toucans // toucans
@@ -501,7 +501,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawBitmap(my_toucan_blur, x, y+15, true); dc.DrawBitmap(my_toucan_blur, x, y+15, true);
} }
if (my_smile_xbm.Ok()) if (my_smile_xbm.IsOk())
{ {
int x = 300, y = 1800; int x = 300, y = 1800;
@@ -543,7 +543,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
memdc.DrawLine( 5, 42, 50, 42 ); memdc.DrawLine( 5, 42, 50, 42 );
memdc.SelectObject( wxNullBitmap ); memdc.SelectObject( wxNullBitmap );
if (mono.Ok()) if (mono.IsOk())
{ {
int x = 300, y = 1900; int x = 300, y = 1900;
@@ -572,20 +572,20 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawRectangle( 20, 2220, 560, 68 ); dc.DrawRectangle( 20, 2220, 560, 68 );
dc.DrawText(wxT("XPM bitmap"), 30, 2230 ); dc.DrawText(wxT("XPM bitmap"), 30, 2230 );
if ( m_bmpSmileXpm.Ok() ) if ( m_bmpSmileXpm.IsOk() )
dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true); dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true);
dc.DrawText(wxT("XPM icon"), 110, 2230 ); dc.DrawText(wxT("XPM icon"), 110, 2230 );
if ( m_iconSmileXpm.Ok() ) if ( m_iconSmileXpm.IsOk() )
dc.DrawIcon(m_iconSmileXpm, 110, 2250); dc.DrawIcon(m_iconSmileXpm, 110, 2250);
// testing icon -> bitmap conversion // testing icon -> bitmap conversion
wxBitmap to_blit( m_iconSmileXpm ); wxBitmap to_blit( m_iconSmileXpm );
if (to_blit.Ok()) if (to_blit.IsOk())
{ {
dc.DrawText( wxT("SubBitmap"), 170, 2230 ); dc.DrawText( wxT("SubBitmap"), 170, 2230 );
wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) ); wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) );
if (sub.Ok()) if (sub.IsOk())
dc.DrawBitmap( sub, 170, 2250, true ); dc.DrawBitmap( sub, 170, 2250, true );
dc.DrawText( wxT("Enlarged"), 250, 2230 ); 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 ); 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.DrawBitmap( my_horse_ico32, 30, 2330, true );
dc.DrawText( wxT("ICO handler (2nd image)"), 230, 2290 ); 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.DrawBitmap( my_horse_ico16, 230, 2330, true );
dc.DrawText( wxT("ICO handler (best image)"), 430, 2290 ); 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.DrawBitmap( my_horse_ico, 430, 2330, true );
dc.DrawText( wxT("CUR handler"), 30, 2390 ); 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.DrawBitmap( my_horse_cur, 30, 2420, true );
dc.SetPen (*wxRED_PEN); dc.SetPen (*wxRED_PEN);
@@ -630,7 +630,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawText( wxT("ANI handler"), 230, 2390 ); dc.DrawText( wxT("ANI handler"), 230, 2390 );
for ( int i=0; i < m_ani_images; i++ ) 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 ); dc.DrawBitmap( my_horse_ani[i], 230 + i * 2 * my_horse_ani[i].GetWidth() , 2420, true );
} }

View File

@@ -407,7 +407,7 @@ private:
wxImage img(m_bitmap.ConvertToImage()); wxImage img(m_bitmap.ConvertToImage());
img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2)); img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2));
if ( !img.Ok() ) if ( !img.IsOk() )
{ {
wxLogWarning(wxT("Rotation failed")); wxLogWarning(wxT("Rotation failed"));
return; return;

View File

@@ -223,7 +223,7 @@ void TestGLCanvas::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
void TestGLCanvas::LoadDXF(const wxString& filename) void TestGLCanvas::LoadDXF(const wxString& filename)
{ {
wxFileInputStream stream(filename); wxFileInputStream stream(filename);
if (stream.Ok()) if (stream.IsOk())
#if wxUSE_ZLIB #if wxUSE_ZLIB
{ {
if (filename.Right(3).Lower() == wxT(".gz")) if (filename.Right(3).Lower() == wxT(".gz"))

View File

@@ -711,7 +711,7 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event )
if ( name == wxT("Font") ) if ( name == wxT("Font") )
{ {
wxFont font = wxANY_AS(value, wxFont); wxFont font = wxANY_AS(value, wxFont);
wxASSERT( font.Ok() ); wxASSERT( font.IsOk() );
m_pPropGridManager->SetFont( font ); m_pPropGridManager->SetFont( font );
} }

View File

@@ -60,7 +60,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n
// Fix value. // Fix value.
fontData.SetChosenFont(value.GetInitialFont()); fontData.SetChosenFont(value.GetInitialFont());
if ( !fontData.GetColour().Ok() ) if ( !fontData.GetColour().IsOk() )
fontData.SetColour(*wxBLACK); fontData.SetColour(*wxBLACK);
// Set initial value - should be done in a simpler way like this // Set initial value - should be done in a simpler way like this
@@ -113,7 +113,7 @@ void wxFontDataProperty::OnSetValue()
fontData << m_value_wxFontData; fontData << m_value_wxFontData;
wxFont font = fontData.GetChosenFont(); wxFont font = fontData.GetChosenFont();
if ( !font.Ok() ) if ( !font.IsOk() )
font = wxFont(10,wxSWISS,wxNORMAL,wxNORMAL); font = wxFont(10,wxSWISS,wxNORMAL,wxNORMAL);
m_value = WXVARIANT(font); m_value = WXVARIANT(font);

View File

@@ -1248,7 +1248,7 @@ void MyFrame::OnFont(wxCommandEvent& WXUNUSED(event))
fontData = dialog.GetFontData(); fontData = dialog.GetFontData();
attr.SetFlags(wxTEXT_ATTR_FONT); attr.SetFlags(wxTEXT_ATTR_FONT);
attr.SetFont(fontData.GetChosenFont()); attr.SetFont(fontData.GetChosenFont());
if (attr.GetFont().Ok()) if (attr.GetFont().IsOk())
{ {
m_richTextCtrl->SetStyle(range, attr); m_richTextCtrl->SetStyle(range, attr);
} }
@@ -1589,7 +1589,7 @@ void MyFrame::OnInsertSymbol(wxCommandEvent& WXUNUSED(event))
m_richTextCtrl->GetStyle(m_richTextCtrl->GetInsertionPoint(), attr); m_richTextCtrl->GetStyle(m_richTextCtrl->GetInsertionPoint(), attr);
wxString currentFontName; wxString currentFontName;
if (attr.HasFont() && attr.GetFont().Ok()) if (attr.HasFont() && attr.GetFont().IsOk())
currentFontName = attr.GetFont().GetFaceName(); currentFontName = attr.GetFont().GetFaceName();
// Don't set the initial font in the dialog (so the user is choosing // Don't set the initial font in the dialog (so the user is choosing

View File

@@ -315,7 +315,7 @@ bool Server::OnInit()
m_listeningSocket->SetEventHandler(*this); m_listeningSocket->SetEventHandler(*this);
m_listeningSocket->SetNotify(wxSOCKET_CONNECTION_FLAG); m_listeningSocket->SetNotify(wxSOCKET_CONNECTION_FLAG);
m_listeningSocket->Notify(true); m_listeningSocket->Notify(true);
if (!m_listeningSocket->Ok()) if (!m_listeningSocket->IsOk())
{ {
wxLogError("Cannot bind listening socket"); wxLogError("Cannot bind listening socket");
return false; return false;

View File

@@ -217,8 +217,8 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY,
// Create the socket // Create the socket
m_server = new wxSocketServer(addr); m_server = new wxSocketServer(addr);
// We use Ok() here to see if the server is really listening // We use IsOk() here to see if the server is really listening
if (! m_server->Ok()) if (! m_server->IsOk())
{ {
wxLogMessage("Could not listen at the specified port !"); wxLogMessage("Could not listen at the specified port !");
return; return;

View File

@@ -137,7 +137,7 @@ bool MyApp::OnInit()
bitmap = wxBitmap(mobile_xpm); bitmap = wxBitmap(mobile_xpm);
bool ok = frame->m_isPda bool ok = frame->m_isPda
? bitmap.Ok() ? bitmap.IsOk()
: bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG);
if (ok) if (ok)
@@ -218,7 +218,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
if (m_isPda) bitmap = wxBitmap(mobile_xpm); if (m_isPda) bitmap = wxBitmap(mobile_xpm);
bool ok = m_isPda bool ok = m_isPda
? bitmap.Ok() ? bitmap.IsOk()
: bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG);
if (ok) if (ok)

View File

@@ -430,7 +430,7 @@ void AppFrame::OnPrintPreview (wxCommandEvent &WXUNUSED(event)) {
new wxPrintPreview (new EditPrint (m_edit), new wxPrintPreview (new EditPrint (m_edit),
new EditPrint (m_edit), new EditPrint (m_edit),
&printDialogData); &printDialogData);
if (!preview->Ok()) { if (!preview->IsOk()) {
delete preview; delete preview;
wxMessageBox (_("There was a problem with previewing.\n\ wxMessageBox (_("There was a problem with previewing.\n\
Perhaps your current printer is not correctly?"), Perhaps your current printer is not correctly?"),

View File

@@ -1848,7 +1848,7 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event))
{ {
wxString msg; wxString msg;
wxString facename(wxT("unknown")); wxString facename(wxT("unknown"));
if (attr.GetFont().Ok()) if (attr.GetFont().IsOk())
{ {
facename = attr.GetFont().GetFaceName(); facename = attr.GetFont().GetFaceName();
} }

View File

@@ -494,7 +494,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar)
{ {
// create a tool with a custom bitmap for testing // create a tool with a custom bitmap for testing
wxImage img(m_pathBmp); wxImage img(m_pathBmp);
if ( img.Ok() ) if ( img.IsOk() )
{ {
if ( img.GetWidth() > w && img.GetHeight() > h ) if ( img.GetWidth() > w && img.GetHeight() > h )
img = img.GetSubImage(wxRect(0, 0, w, h)); img = img.GetSubImage(wxRect(0, 0, w, h));

View File

@@ -901,14 +901,14 @@ void MyFrame::OnSelectLast(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnSetFgColour(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetFgColour(wxCommandEvent& WXUNUSED(event))
{ {
wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetForegroundColour()); wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetForegroundColour());
if ( col.Ok() ) if ( col.IsOk() )
m_treeCtrl->SetForegroundColour(col); m_treeCtrl->SetForegroundColour(col);
} }
void MyFrame::OnSetBgColour(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSetBgColour(wxCommandEvent& WXUNUSED(event))
{ {
wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetBackgroundColour()); wxColour col = wxGetColourFromUser(this, m_treeCtrl->GetBackgroundColour());
if ( col.Ok() ) if ( col.IsOk() )
m_treeCtrl->SetBackgroundColour(col); m_treeCtrl->SetBackgroundColour(col);
} }

View File

@@ -712,10 +712,10 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag
#if wxUSE_IMAGE #if wxUSE_IMAGE
wxASSERT(fn.FileExists()); wxASSERT(fn.FileExists());
wxImage image(fn.GetFullPath()); wxImage image(fn.GetFullPath());
wxASSERT(image.Ok()); wxASSERT(image.IsOk());
RescaleImage(image, foundSize.x, foundSize.y); RescaleImage(image, foundSize.x, foundSize.y);
wxBitmap bmp(image); wxBitmap bmp(image);
wxASSERT( bmp.Ok() ); wxASSERT( bmp.IsOk() );
#else #else
wxBitmap bmp(wxNullBitmap); wxBitmap bmp(wxNullBitmap);
#endif #endif
@@ -842,7 +842,7 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& filepath)
} }
wxImage image(filepath); wxImage image(filepath);
if ( image.Ok() ) if ( image.IsOk() )
{ {
// Rescale very large images // Rescale very large images
int ow = image.GetWidth(); int ow = image.GetWidth();

View File

@@ -122,7 +122,7 @@ void StatBmpWidgetsPage::RecreateWidget()
return; return;
wxImage image(filepath); wxImage image(filepath);
if (! image.Ok() ) if (! image.IsOk() )
{ {
wxLogMessage("Reading image from file '%s' failed.", filepath.c_str()); wxLogMessage("Reading image from file '%s' failed.", filepath.c_str());
return; return;

View File

@@ -800,11 +800,11 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event))
// allow for debugging the default colour the first time this is called // allow for debugging the default colour the first time this is called
WidgetsPage *page = CurrentPage(); WidgetsPage *page = CurrentPage();
if (!m_colFg.Ok()) if (!m_colFg.IsOk())
m_colFg = page->GetForegroundColour(); m_colFg = page->GetForegroundColour();
wxColour col = GetColourFromUser(this, m_colFg); wxColour col = GetColourFromUser(this, m_colFg);
if ( !col.Ok() ) if ( !col.IsOk() )
return; return;
m_colFg = col; m_colFg = col;
@@ -823,11 +823,11 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
{ {
WidgetsPage *page = CurrentPage(); WidgetsPage *page = CurrentPage();
if ( !m_colBg.Ok() ) if ( !m_colBg.IsOk() )
m_colBg = page->GetBackgroundColour(); m_colBg = page->GetBackgroundColour();
wxColour col = GetColourFromUser(this, m_colBg); wxColour col = GetColourFromUser(this, m_colBg);
if ( !col.Ok() ) if ( !col.IsOk() )
return; return;
m_colBg = col; m_colBg = col;
@@ -845,7 +845,7 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
void WidgetsFrame::OnSetPageBg(wxCommandEvent& WXUNUSED(event)) void WidgetsFrame::OnSetPageBg(wxCommandEvent& WXUNUSED(event))
{ {
wxColour col = GetColourFromUser(this, GetBackgroundColour()); wxColour col = GetColourFromUser(this, GetBackgroundColour());
if ( !col.Ok() ) if ( !col.IsOk() )
return; return;
CurrentPage()->SetBackgroundColour(col); CurrentPage()->SetBackgroundColour(col);
@@ -857,11 +857,11 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event))
#if wxUSE_FONTDLG #if wxUSE_FONTDLG
WidgetsPage *page = CurrentPage(); WidgetsPage *page = CurrentPage();
if (!m_font.Ok()) if (!m_font.IsOk())
m_font = page->GetFont(); m_font = page->GetFont();
wxFont font = wxGetFontFromUser(this, m_font); wxFont font = wxGetFontFromUser(this, m_font);
if ( !font.Ok() ) if ( !font.IsOk() )
return; return;
m_font = font; m_font = font;

View File

@@ -166,7 +166,7 @@ WX_NSBitmapImageRep wxBitmap::GetNSBitmapImageRep()
WX_NSImage wxBitmap::GetNSImage(bool useMask) const WX_NSImage wxBitmap::GetNSImage(bool useMask) const
{ {
if(!Ok()) if(!IsOk())
return nil; return nil;
NSImage *nsimage = [[[NSImage alloc] NSImage *nsimage = [[[NSImage alloc]
initWithSize:NSMakeSize(GetWidth(), GetHeight())] autorelease]; initWithSize:NSMakeSize(GetWidth(), GetHeight())] autorelease];
@@ -351,7 +351,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
wxImage image; wxImage image;
if(!image.LoadFile(filename,type)) if(!image.LoadFile(filename,type))
return false; return false;
if(!image.Ok()) if(!image.IsOk())
return false; return false;
*this = wxBitmap(image); *this = wxBitmap(image);
return true; return true;
@@ -428,7 +428,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
{ {
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
if(!Ok()) if(!IsOk())
return wxNullBitmap; return wxNullBitmap;
NSImage *nsimage = GetNSImage(false); NSImage *nsimage = GetNSImage(false);
@@ -450,7 +450,7 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
wxImage wxBitmap::ConvertToImage() const wxImage wxBitmap::ConvertToImage() const
{ {
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
if(!Ok()) if(!IsOk())
return /*wxImage(5,5)*/wxNullImage; return /*wxImage(5,5)*/wxNullImage;
NSImage *nsimage = GetNSImage(false /* don't use mask */); NSImage *nsimage = GetNSImage(false /* don't use mask */);
wxImage newImage(M_BITMAPDATA->m_width,M_BITMAPDATA->m_height); wxImage newImage(M_BITMAPDATA->m_width,M_BITMAPDATA->m_height);
@@ -476,7 +476,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
UnRef(); 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")); wxCHECK_MSG(depth == -1 || depth == 1, false, wxT("invalid bitmap depth"));
m_refData = new wxBitmapRefData(); m_refData = new wxBitmapRefData();
@@ -511,7 +511,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{ {
if(!Ok()) if(!IsOk())
return NULL; return NULL;
NSBitmapImageRep *bitmapRep = M_BITMAPDATA->m_cocoaNSBitmapImageRep; 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) bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{ {
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
if(!bitmap.Ok()) if(!bitmap.IsOk())
return false; return false;
int bmpWidth = bitmap.GetWidth(); int bmpWidth = bitmap.GetWidth();
int bmpHeight = bitmap.GetHeight(); int bmpHeight = bitmap.GetHeight();

View File

@@ -202,19 +202,19 @@ void wxBrush::SetStipple(const wxBitmap& stipple)
wxColour wxBrush::GetColour() const wxColour wxBrush::GetColour() const
{ {
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour(); return M_BRUSHDATA->GetColour();
} }
wxBrushStyle wxBrush::GetStyle() const wxBrushStyle wxBrush::GetStyle() const
{ {
wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle(); return M_BRUSHDATA->GetStyle();
} }
wxBitmap *wxBrush::GetStipple() const wxBitmap *wxBrush::GetStipple() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple(); return M_BRUSHDATA->GetStipple();
} }

View File

@@ -456,7 +456,7 @@ void wxCocoaDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool
{ {
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return; if(!CocoaTakeFocus()) return;
if(!bmp.Ok()) if(!bmp.IsOk())
return; return;
#if 0 #if 0
@@ -540,13 +540,13 @@ void wxCocoaDCImpl::DoGetSizeMM( int* width, int* height ) const
void wxCocoaDCImpl::SetTextForeground( const wxColour &col ) void wxCocoaDCImpl::SetTextForeground( const wxColour &col )
{ {
// if (!Ok()) return; // if (!IsOk()) return;
m_textForegroundColour = col; m_textForegroundColour = col;
}; };
void wxCocoaDCImpl::SetTextBackground( const wxColour &col ) void wxCocoaDCImpl::SetTextBackground( const wxColour &col )
{ {
// if (!Ok()) return; // if (!IsOk()) return;
m_textBackgroundColour = col; m_textBackgroundColour = col;
}; };

View File

@@ -75,7 +75,7 @@ bool wxMemoryDCImpl::CocoaUnlockFocus()
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{ {
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
if(m_selectedBitmap.Ok()) if(m_selectedBitmap.IsOk())
{ {
CocoaTakeFocus(); CocoaTakeFocus();
wxASSERT(m_cocoaNSImage); wxASSERT(m_cocoaNSImage);
@@ -95,7 +95,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
[m_cocoaNSImage release]; [m_cocoaNSImage release];
m_cocoaNSImage = nil; m_cocoaNSImage = nil;
m_selectedBitmap = bitmap; m_selectedBitmap = bitmap;
if(m_selectedBitmap.Ok()) if(m_selectedBitmap.IsOk())
{ {
// Create an offscreen window of the same size // Create an offscreen window of the same size
m_cocoaNSImage = [[NSImage alloc] m_cocoaNSImage = [[NSImage alloc]
@@ -137,7 +137,7 @@ bool wxMemoryDCImpl::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc,
int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask)
{ {
if(!m_selectedBitmap.Ok()) if(!m_selectedBitmap.IsOk())
return false; return false;
NSAffineTransform *transform = [NSAffineTransform transform]; NSAffineTransform *transform = [NSAffineTransform transform];

View File

@@ -350,7 +350,7 @@ wxFontEncoding wxFont::GetEncoding() const
int wxFont::GetPointSize() 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; return M_FONTDATA->m_info.pointSize;
} }
@@ -364,7 +364,7 @@ bool wxFont::GetUnderlined() const
wxFontStyle wxFont::GetStyle() 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; return M_FONTDATA->m_info.style;
} }
@@ -375,13 +375,13 @@ wxFontFamily wxFont::DoGetFamily() const
wxFontWeight wxFont::GetWeight() 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; return M_FONTDATA->m_info.weight;
} }
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return &M_FONTDATA->m_info; return &M_FONTDATA->m_info;
} }

View File

@@ -114,7 +114,7 @@ bool wxIcon::CreateFromXpm(const char* const* xpm)
{ {
wxBitmap bitmap(xpm); wxBitmap bitmap(xpm);
CopyFromBitmap(bitmap); CopyFromBitmap(bitmap);
return Ok(); return IsOk();
} }
bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type, bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
@@ -122,7 +122,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
{ {
wxBitmap bitmap(filename, type); wxBitmap bitmap(filename, type);
CopyFromBitmap(bitmap); CopyFromBitmap(bitmap);
return bitmap.Ok(); return bitmap.IsOk();
} }
void wxIcon::CopyFromBitmap(const wxBitmap& bitmap) void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
@@ -133,7 +133,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
M_ICONDATA->m_height = bitmap.GetHeight(); M_ICONDATA->m_height = bitmap.GetHeight();
wxAutoNSAutoreleasePool pool; wxAutoNSAutoreleasePool pool;
M_ICONDATA->m_cocoaNSImage = [bitmap.GetNSImage(true) retain]; 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_numColors = 0;
M_ICONDATA->m_quality = 0; M_ICONDATA->m_quality = 0;
} }

View File

@@ -225,7 +225,7 @@ void wxMenuItem::SetBitmaps(const wxBitmap& bmpChecked,
} }
else 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)]; [m_cocoaNSMenuItem setImage: bmpChecked.GetNSImage(true)];
} }
} }

View File

@@ -231,12 +231,12 @@ wxArtProvider::~wxArtProvider()
node; node = node->GetNext()) node; node = node->GetNext())
{ {
bmp = node->GetData()->CreateBitmap(id, client, size); bmp = node->GetData()->CreateBitmap(id, client, size);
if ( bmp.Ok() ) if ( bmp.IsOk() )
break; break;
} }
wxSize sizeNeeded = size; wxSize sizeNeeded = size;
if ( !bmp.Ok() ) if ( !bmp.IsOk() )
{ {
// no bitmap created -- as a fallback, try if we can find desired // no bitmap created -- as a fallback, try if we can find desired
// icon in a bundle // icon in a bundle

View File

@@ -207,7 +207,7 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id); wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id);
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) #if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
if (bmp.Ok()) if (bmp.IsOk())
{ {
// fit into transparent image with desired size hint from the client // fit into transparent image with desired size hint from the client
if (reqSize == wxDefaultSize) if (reqSize == wxDefaultSize)

View File

@@ -156,7 +156,7 @@ wxBitmap::wxBitmap(const char* const* bits)
#if wxUSE_IMAGE && wxUSE_XPM #if wxUSE_IMAGE && wxUSE_XPM
wxImage image(bits); wxImage image(bits);
wxCHECK2_MSG(image.Ok(), return, wxT("invalid bitmap data")); wxCHECK2_MSG(image.IsOk(), return, wxT("invalid bitmap data"));
*this = wxBitmap(image); *this = wxBitmap(image);
#else #else

View File

@@ -84,7 +84,7 @@ void wxColourPickerCtrl::SetColour(const wxColour &col)
bool wxColourPickerCtrl::SetColour(const wxString &text) bool wxColourPickerCtrl::SetColour(const wxString &text)
{ {
wxColour col(text); // smart wxString->wxColour conversion wxColour col(text); // smart wxString->wxColour conversion
if ( !col.Ok() ) if ( !col.IsOk() )
return false; return false;
M_PICKER->SetColour(col); M_PICKER->SetColour(col);
UpdateTextCtrlFromPicker(); UpdateTextCtrlFromPicker();
@@ -105,7 +105,7 @@ void wxColourPickerCtrl::UpdatePickerFromTextCtrl()
// wxString -> wxColour conversion // wxString -> wxColour conversion
wxColour col(m_text->GetValue()); wxColour col(m_text->GetValue());
if ( !col.Ok() ) if ( !col.IsOk() )
return; // invalid user input return; // invalid user input
if (M_PICKER->GetColour() != col) if (M_PICKER->GetColour() != col)

View File

@@ -170,7 +170,7 @@ bool wxPrintData::IsOk() const
{ {
m_nativeData->TransferFrom( *this ); m_nativeData->TransferFrom( *this );
return m_nativeData->Ok(); return m_nativeData->IsOk();
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -177,13 +177,13 @@ bool wxColourBase::FromString(const wxString& str)
// because this place can be called from constructor // because this place can be called from constructor
// and 'this' could not be available yet // and 'this' could not be available yet
wxColour clr = wxTheColourDatabase->Find(str); wxColour clr = wxTheColourDatabase->Find(str);
if (clr.Ok()) if (clr.IsOk())
Set((unsigned char)clr.Red(), Set((unsigned char)clr.Red(),
(unsigned char)clr.Green(), (unsigned char)clr.Green(),
(unsigned char)clr.Blue()); (unsigned char)clr.Blue());
} }
if (Ok()) if (IsOk())
return true; return true;
wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str); wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str);

View File

@@ -1172,7 +1172,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
// its platform default or bitmap+pushbutton background is used, but not if // its platform default or bitmap+pushbutton background is used, but not if
// there is vertical size adjustment or horizontal spacing. // there is vertical size adjustment or horizontal spacing.
if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) || if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) ||
(m_bmpNormal.Ok() && m_blankButtonBg) ) && (m_bmpNormal.IsOk() && m_blankButtonBg) ) &&
m_btnSpacingX == 0 && m_btnSpacingX == 0 &&
m_btnHei <= 0 ) m_btnHei <= 0 )
{ {
@@ -1180,7 +1180,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
btnBorder = 0; btnBorder = 0;
} }
else if ( (m_iFlags & wxCC_BUTTON_COVERS_BORDER) && 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); m_iFlags &= ~(wxCC_IFLAG_BUTTON_OUTSIDE);
btnBorder = 0; btnBorder = 0;
@@ -1237,7 +1237,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
// It is larger // It is larger
// OR // OR
// button width is set to default and blank button bg is not drawn // 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 bmpReqWidth = m_bmpNormal.GetWidth();
int bmpReqHeight = m_bmpNormal.GetHeight(); int bmpReqHeight = m_bmpNormal.GetHeight();
@@ -1259,7 +1259,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
{ {
int newY = butHeight+(customBorder*2); int newY = butHeight+(customBorder*2);
SetClientSize(wxDefaultCoord,newY); 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; m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON;
else else
m_iFlags &= ~wxCC_IFLAG_HAS_NONSTANDARD_BUTTON; 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. // TODO: Better method to calculate close-to-native control height.
int fhei; int fhei;
if ( m_font.Ok() ) if ( m_font.IsOk() )
fhei = (m_font.GetPointSize()*2) + 5; fhei = (m_font.GetPointSize()*2) + 5;
else if ( wxNORMAL_FONT->Ok() ) else if ( wxNORMAL_FONT->IsOk() )
fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5; fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5;
else else
fhei = sizeText.y + 4; fhei = sizeText.y + 4;
// Need to force height to accomodate bitmap? // Need to force height to accomodate bitmap?
int btnSizeY = m_btnSize.y; int btnSizeY = m_btnSize.y;
if ( m_bmpNormal.Ok() && fhei < btnSizeY ) if ( m_bmpNormal.IsOk() && fhei < btnSizeY )
fhei = btnSizeY; fhei = btnSizeY;
// Control height doesn't depend on border // Control height doesn't depend on border
@@ -1702,7 +1702,7 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int flags )
dc.DrawRectangle(rect); dc.DrawRectangle(rect);
} }
if ( !m_bmpNormal.Ok() ) if ( !m_bmpNormal.IsOk() )
{ {
if ( flags & Button_BitmapOnly ) if ( flags & Button_BitmapOnly )
return; return;
@@ -2564,17 +2564,17 @@ void wxComboCtrlBase::SetButtonBitmaps( const wxBitmap& bmpNormal,
m_bmpNormal = bmpNormal; m_bmpNormal = bmpNormal;
m_blankButtonBg = blankButtonBg; m_blankButtonBg = blankButtonBg;
if ( bmpPressed.Ok() ) if ( bmpPressed.IsOk() )
m_bmpPressed = bmpPressed; m_bmpPressed = bmpPressed;
else else
m_bmpPressed = bmpNormal; m_bmpPressed = bmpNormal;
if ( bmpHover.Ok() ) if ( bmpHover.IsOk() )
m_bmpHover = bmpHover; m_bmpHover = bmpHover;
else else
m_bmpHover = bmpNormal; m_bmpHover = bmpNormal;
if ( bmpDisabled.Ok() ) if ( bmpDisabled.IsOk() )
m_bmpDisabled = bmpDisabled; m_bmpDisabled = bmpDisabled;
else else
m_bmpDisabled = bmpNormal; m_bmpDisabled = bmpNormal;

View File

@@ -588,7 +588,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const
{ {
wxSize best; wxSize best;
wxBitmap bmp = GetBitmap(); wxBitmap bmp = GetBitmap();
if ( bmp.Ok() ) if ( bmp.IsOk() )
best = wxSize(bmp.GetWidth(), bmp.GetHeight()); best = wxSize(bmp.GetWidth(), bmp.GetHeight());
else else
// this is completely arbitrary // this is completely arbitrary

View File

@@ -1182,7 +1182,7 @@ void wxDC::DrawLabel(const wxString& text,
GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine); GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine);
wxCoord width, height; wxCoord width, height;
if ( bitmap.Ok() ) if ( bitmap.IsOk() )
{ {
width = widthText + bitmap.GetWidth(); width = widthText + bitmap.GetWidth();
height = bitmap.GetHeight(); height = bitmap.GetHeight();
@@ -1224,7 +1224,7 @@ void wxDC::DrawLabel(const wxString& text,
wxCoord x0 = x, wxCoord x0 = x,
y0 = y, y0 = y,
width0 = width; width0 = width;
if ( bitmap.Ok() ) if ( bitmap.IsOk() )
{ {
DrawBitmap(bitmap, x, y, true /* use mask */); DrawBitmap(bitmap, x, y, true /* use mask */);

View File

@@ -139,7 +139,7 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou
////////////////////code here ////////////////////code here
m_outfile = new wxFileOutputStream(filename); m_outfile = new wxFileOutputStream(filename);
m_OK = m_outfile->Ok(); m_OK = m_outfile->IsOk();
if (m_OK) if (m_OK)
{ {
m_filename = filename; m_filename = filename;
@@ -643,14 +643,14 @@ void wxSVGFileDCImpl::DoDrawBitmap(const class wxBitmap & bmp, wxCoord x, wxCoor
{ {
write(s); write(s);
} }
m_OK = m_outfile->Ok() && bPNG_OK; m_OK = m_outfile->IsOk() && bPNG_OK;
} }
void wxSVGFileDCImpl::write(const wxString &s) void wxSVGFileDCImpl::write(const wxString &s)
{ {
const wxCharBuffer buf = s.utf8_str(); const wxCharBuffer buf = s.utf8_str();
m_outfile->Write(buf, strlen((const char *)buf)); m_outfile->Write(buf, strlen((const char *)buf));
m_OK = m_outfile->Ok(); m_OK = m_outfile->IsOk();
} }

View File

@@ -1181,7 +1181,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
preview = new wxPrintPreview(printout, preview = new wxPrintPreview(printout,
view->OnCreatePrintout(), view->OnCreatePrintout(),
&printDialogData); &printDialogData);
if ( !preview->Ok() ) if ( !preview->IsOk() )
{ {
delete preview; delete preview;
wxLogError(_("Print preview creation failed.")); wxLogError(_("Print preview creation failed."));

View File

@@ -255,7 +255,7 @@ wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString&
#else #else
#error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work #error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work
#endif #endif
if ( !is->Ok() ) if ( !is->IsOk() )
{ {
delete is; delete is;
return NULL; return NULL;

View File

@@ -137,7 +137,7 @@ void wxFontPickerCtrl::UpdatePickerFromTextCtrl()
// string returned by wxFont::GetNativeFontInfoDesc() and not // string returned by wxFont::GetNativeFontInfoDesc() and not
// the user-friendly one returned by wxFont::GetNativeFontInfoUserDesc() // the user-friendly one returned by wxFont::GetNativeFontInfoUserDesc()
wxFont f = String2Font(m_text->GetValue()); wxFont f = String2Font(m_text->GetValue());
if (!f.Ok()) if (!f.IsOk())
return; // invalid user input return; // invalid user input
if (M_PICKER->GetSelectedFont() != f) if (M_PICKER->GetSelectedFont() != f)

View File

@@ -253,7 +253,7 @@ wxMemoryFSHandler::AddFile(const wxString& filename,
return; return;
wxMemoryOutputStream mems; wxMemoryOutputStream mems;
if ( image.Ok() && image.SaveFile(mems, type) ) if ( image.IsOk() && image.SaveFile(mems, type) )
{ {
m_Hash[filename] = new wxMemoryFSFile m_Hash[filename] = new wxMemoryFSFile
( (

View File

@@ -587,9 +587,9 @@ wxSocketBase *wxFTP::GetActivePort()
addrNew.Service(0); // pick an open port number. addrNew.Service(0); // pick an open port number.
wxSocketServer *sockSrv = new wxSocketServer(addrNew); 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; m_lastError = wxPROTO_PROTERR;
delete sockSrv; delete sockSrv;
return NULL; return NULL;

View File

@@ -499,7 +499,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& name)
static wxColour s_col; static wxColour s_col;
s_col = Find(name); s_col = Find(name);
if ( !s_col.Ok() ) if ( !s_col.IsOk() )
return NULL; return NULL;
return new wxColour(s_col); return new wxColour(s_col);
@@ -780,7 +780,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, wxPenStyle
wxPen* pen = NULL; wxPen* pen = NULL;
wxPen penTmp(colour, width, style); wxPen penTmp(colour, width, style);
if (penTmp.Ok()) if (penTmp.IsOk())
{ {
pen = new wxPen(penTmp); pen = new wxPen(penTmp);
list.Append(pen); list.Append(pen);
@@ -802,7 +802,7 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, wxBrushStyle st
wxBrush* brush = NULL; wxBrush* brush = NULL;
wxBrush brushTmp(colour, style); wxBrush brushTmp(colour, style);
if (brushTmp.Ok()) if (brushTmp.IsOk())
{ {
brush = new wxBrush(brushTmp); brush = new wxBrush(brushTmp);
list.Append(brush); list.Append(brush);
@@ -872,7 +872,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
// font not found, create the new one // font not found, create the new one
font = NULL; font = NULL;
wxFont fontTmp(pointSize, family, style, weight, underline, facename, encoding); wxFont fontTmp(pointSize, family, style, weight, underline, facename, encoding);
if (fontTmp.Ok()) if (fontTmp.IsOk())
{ {
font = new wxFont(fontTmp); font = new wxFont(fontTmp);
list.Append(font); list.Append(font);

View File

@@ -138,7 +138,7 @@ bool wxGIFDecoder::ConvertToImage(unsigned int frame, wxImage *image) const
image->Create(sz.GetWidth(), sz.GetHeight()); image->Create(sz.GetWidth(), sz.GetHeight());
image->SetType(wxBITMAP_TYPE_GIF); image->SetType(wxBITMAP_TYPE_GIF);
if (!image->Ok()) if (!image->IsOk())
return false; return false;
pal = GetPalette(frame); pal = GetPalette(frame);

View File

@@ -66,7 +66,7 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const
bool wxGLCanvasBase::SetColour(const wxString& colour) bool wxGLCanvasBase::SetColour(const wxString& colour)
{ {
wxColour col = wxTheColourDatabase->Find(colour); wxColour col = wxTheColourDatabase->Find(colour);
if ( !col.Ok() ) if ( !col.IsOk() )
return false; return false;
#ifdef wxHAS_OPENGL_ES #ifdef wxHAS_OPENGL_ES

View File

@@ -595,7 +595,7 @@ void wxGraphicsContext::SetPen( const wxGraphicsPen& pen )
void wxGraphicsContext::SetPen( const wxPen& pen ) void wxGraphicsContext::SetPen( const wxPen& pen )
{ {
if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
SetPen( wxNullGraphicsPen ); SetPen( wxNullGraphicsPen );
else else
SetPen( CreatePen( pen ) ); SetPen( CreatePen( pen ) );
@@ -609,7 +609,7 @@ void wxGraphicsContext::SetBrush( const wxGraphicsBrush& brush )
void wxGraphicsContext::SetBrush( const wxBrush& brush ) void wxGraphicsContext::SetBrush( const wxBrush& brush )
{ {
if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT ) if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
SetBrush( wxNullGraphicsBrush ); SetBrush( wxNullGraphicsBrush );
else else
SetBrush( CreateBrush( brush ) ); SetBrush( CreateBrush( brush ) );
@@ -623,7 +623,7 @@ void wxGraphicsContext::SetFont( const wxGraphicsFont& font )
void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour ) void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour )
{ {
if ( font.Ok() ) if ( font.IsOk() )
SetFont( CreateFont( font, colour ) ); SetFont( CreateFont( font, colour ) );
else else
SetFont( wxNullGraphicsFont ); SetFont( wxNullGraphicsFont );

View File

@@ -163,7 +163,7 @@ void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type)
if ( type == wxBITMAP_TYPE_ICON_RESOURCE ) if ( type == wxBITMAP_TYPE_ICON_RESOURCE )
{ {
wxIcon tmp(file, type); wxIcon tmp(file, type);
if (tmp.Ok()) if (tmp.IsOk())
{ {
AddIcon(tmp); AddIcon(tmp);
return; return;
@@ -245,7 +245,7 @@ wxIcon wxIconBundle::GetIcon(const wxSize& size) const
wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const
{ {
wxIcon icon = GetIcon(size); wxIcon icon = GetIcon(size);
if ( icon.Ok() && if ( icon.IsOk() &&
(icon.GetWidth() != size.x || icon.GetHeight() != size.y) ) (icon.GetWidth() != size.x || icon.GetHeight() != size.y) )
{ {
icon = wxNullIcon; icon = wxNullIcon;
@@ -267,7 +267,7 @@ void wxIconBundle::AddIcon(const wxIcon& icon)
for ( size_t i = 0; i < count; ++i ) for ( size_t i = 0; i < count; ++i )
{ {
wxIcon& tmp = iconArray[i]; wxIcon& tmp = iconArray[i];
if ( tmp.Ok() && if ( tmp.IsOk() &&
tmp.GetWidth() == icon.GetWidth() && tmp.GetWidth() == icon.GetWidth() &&
tmp.GetHeight() == icon.GetHeight() ) tmp.GetHeight() == icon.GetHeight() )
{ {

View File

@@ -91,7 +91,7 @@ bool wxBMPHandler::SaveDib(wxImage *image,
{ {
wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") ); wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") );
if ( !image->Ok() ) if ( !image->IsOk() )
{ {
if ( verbose ) if ( verbose )
{ {
@@ -351,7 +351,7 @@ bool wxBMPHandler::SaveDib(wxImage *image,
// pointer to the image data, use quantized if available // pointer to the image data, use quantized if available
wxUint8 *data = (wxUint8*) image->GetData(); 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]; wxUint8 *buffer = new wxUint8[row_width];
memset(buffer, 0, 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 // wxCountingOutputStream::IsOk() always returns true for now and this
// "if" provokes VC++ warnings in optimized build // "if" provokes VC++ warnings in optimized build
#if 0 #if 0
if ( !cStream.Ok() ) if ( !cStream.IsOk() )
{ {
if ( verbose ) if ( verbose )
{ {

View File

@@ -140,7 +140,7 @@ bool wxImage::Create(const char* const* xpmData)
wxXPMDecoder decoder; wxXPMDecoder decoder;
(*this) = decoder.ReadData(xpmData); (*this) = decoder.ReadData(xpmData);
return Ok(); return IsOk();
#else #else
return false; return false;
#endif #endif
@@ -258,7 +258,7 @@ wxImage wxImage::MakeEmptyClone(int flags) const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, wxS("invalid image") ); wxCHECK_MSG( IsOk(), image, wxS("invalid image") );
long height = M_IMGDATA->m_height; long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width; long width = M_IMGDATA->m_width;
@@ -293,7 +293,7 @@ wxImage wxImage::Copy() const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, wxT("invalid image") ); wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
image.m_refData = CloneRefData(m_refData); image.m_refData = CloneRefData(m_refData);
@@ -307,7 +307,7 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, wxT("invalid image") ); wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
// can't scale to/from 0 size // can't scale to/from 0 size
wxCHECK_MSG( (xFactor > 0) && (yFactor > 0), image, wxCHECK_MSG( (xFactor > 0) && (yFactor > 0), image,
@@ -426,7 +426,7 @@ wxImage::Scale( int width, int height, wxImageResizeQuality quality ) const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, wxT("invalid image") ); wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
// can't scale to/from 0 size // can't scale to/from 0 size
wxCHECK_MSG( (width > 0) && (height > 0), image, wxCHECK_MSG( (width > 0) && (height > 0), image,
@@ -856,7 +856,7 @@ wxImage wxImage::BlurHorizontal(int blurRadius) const
{ {
wxImage ret_image(MakeEmptyClone()); 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; const unsigned char* src_data = M_IMGDATA->m_data;
unsigned char* dst_data = ret_image.GetData(); unsigned char* dst_data = ret_image.GetData();
@@ -959,7 +959,7 @@ wxImage wxImage::BlurVertical(int blurRadius) const
{ {
wxImage ret_image(MakeEmptyClone()); 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; const unsigned char* src_data = M_IMGDATA->m_data;
unsigned char* dst_data = ret_image.GetData(); unsigned char* dst_data = ret_image.GetData();
@@ -1074,7 +1074,7 @@ wxImage wxImage::Rotate90( bool clockwise ) const
{ {
wxImage image(MakeEmptyClone(Clone_SwapOrientation)); wxImage image(MakeEmptyClone(Clone_SwapOrientation));
wxCHECK( image.Ok(), image ); wxCHECK( image.IsOk(), image );
long height = M_IMGDATA->m_height; long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width; long width = M_IMGDATA->m_width;
@@ -1168,7 +1168,7 @@ wxImage wxImage::Rotate180() const
{ {
wxImage image(MakeEmptyClone()); wxImage image(MakeEmptyClone());
wxCHECK( image.Ok(), image ); wxCHECK( image.IsOk(), image );
long height = M_IMGDATA->m_height; long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width; long width = M_IMGDATA->m_width;
@@ -1221,7 +1221,7 @@ wxImage wxImage::Mirror( bool horizontally ) const
{ {
wxImage image(MakeEmptyClone()); wxImage image(MakeEmptyClone());
wxCHECK( image.Ok(), image ); wxCHECK( image.IsOk(), image );
long height = M_IMGDATA->m_height; long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width; long width = M_IMGDATA->m_width;
@@ -1298,7 +1298,7 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
{ {
wxImage image; wxImage image;
wxCHECK_MSG( Ok(), image, wxT("invalid image") ); wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) &&
(rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()), (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()),
@@ -1351,7 +1351,7 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos,
{ {
wxImage image; 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") ); wxCHECK_MSG( (size.GetWidth() > 0) && (size.GetHeight() > 0), image, wxT("invalid size") );
int width = GetWidth(), height = GetHeight(); 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 ) void wxImage::Paste( const wxImage &image, int x, int y )
{ {
wxCHECK_RET( Ok(), wxT("invalid image") ); wxCHECK_RET( IsOk(), wxT("invalid image") );
wxCHECK_RET( image.Ok(), wxT("invalid image") ); wxCHECK_RET( image.IsOk(), wxT("invalid image") );
AllocExclusive(); 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, void wxImage::Replace( unsigned char r1, unsigned char g1, unsigned char b1,
unsigned char r2, unsigned char g2, unsigned char b2 ) unsigned char r2, unsigned char g2, unsigned char b2 )
{ {
wxCHECK_RET( Ok(), wxT("invalid image") ); wxCHECK_RET( IsOk(), wxT("invalid image") );
AllocExclusive(); AllocExclusive();
@@ -1534,7 +1534,7 @@ wxImage wxImage::ConvertToGreyscale(double weight_r, double weight_g, double wei
{ {
wxImage image(MakeEmptyClone()); wxImage image(MakeEmptyClone());
wxCHECK( image.Ok(), image ); wxCHECK( image.IsOk(), image );
const unsigned char *src = M_IMGDATA->m_data; const unsigned char *src = M_IMGDATA->m_data;
unsigned char *dest = image.GetData(); unsigned char *dest = image.GetData();
@@ -1568,7 +1568,7 @@ wxImage wxImage::ConvertToMono( unsigned char r, unsigned char g, unsigned char
{ {
wxImage image; 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 ); 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 int wxImage::GetWidth() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
return M_IMGDATA->m_width; return M_IMGDATA->m_width;
} }
int wxImage::GetHeight() const int wxImage::GetHeight() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
return M_IMGDATA->m_height; return M_IMGDATA->m_height;
} }
@@ -1662,7 +1662,7 @@ void wxImage::SetType(wxBitmapType type)
long wxImage::XYToIndex(int x, int y) const long wxImage::XYToIndex(int x, int y) const
{ {
if ( Ok() && if ( IsOk() &&
x >= 0 && y >= 0 && x >= 0 && y >= 0 &&
x < M_IMGDATA->m_width && y < M_IMGDATA->m_height ) 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 ) 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(); AllocExclusive();
@@ -1764,14 +1764,14 @@ bool wxImage::IsOk() const
unsigned char *wxImage::GetData() 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; return M_IMGDATA->m_data;
} }
void wxImage::SetData( unsigned char *data, bool static_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(); 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 ) void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
{ {
wxCHECK_RET( Ok(), wxT("invalid image") ); wxCHECK_RET( IsOk(), wxT("invalid image") );
AllocExclusive(); AllocExclusive();
@@ -1890,7 +1890,7 @@ void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
unsigned char *wxImage::GetAlpha() const 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; return M_IMGDATA->m_alpha;
} }
@@ -1948,7 +1948,7 @@ void wxImage::ClearAlpha()
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) 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(); 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 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) if (M_IMGDATA->m_hasMask)
{ {
@@ -1978,28 +1978,28 @@ bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned
unsigned char wxImage::GetMaskRed() const unsigned char wxImage::GetMaskRed() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskRed; return M_IMGDATA->m_maskRed;
} }
unsigned char wxImage::GetMaskGreen() const unsigned char wxImage::GetMaskGreen() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskGreen; return M_IMGDATA->m_maskGreen;
} }
unsigned char wxImage::GetMaskBlue() const unsigned char wxImage::GetMaskBlue() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid image") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
return M_IMGDATA->m_maskBlue; return M_IMGDATA->m_maskBlue;
} }
void wxImage::SetMask( bool mask ) void wxImage::SetMask( bool mask )
{ {
wxCHECK_RET( Ok(), wxT("invalid image") ); wxCHECK_RET( IsOk(), wxT("invalid image") );
AllocExclusive(); AllocExclusive();
@@ -2008,7 +2008,7 @@ void wxImage::SetMask( bool mask )
bool wxImage::HasMask() const bool wxImage::HasMask() const
{ {
wxCHECK_MSG( Ok(), false, wxT("invalid image") ); wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
return M_IMGDATA->m_hasMask; return M_IMGDATA->m_hasMask;
} }
@@ -2155,22 +2155,22 @@ bool wxImage::ConvertAlphaToMask(unsigned char mr,
bool wxImage::HasPalette() const bool wxImage::HasPalette() const
{ {
if (!Ok()) if (!IsOk())
return false; return false;
return M_IMGDATA->m_palette.Ok(); return M_IMGDATA->m_palette.IsOk();
} }
const wxPalette& wxImage::GetPalette() const const wxPalette& wxImage::GetPalette() const
{ {
wxCHECK_MSG( Ok(), wxNullPalette, wxT("invalid image") ); wxCHECK_MSG( IsOk(), wxNullPalette, wxT("invalid image") );
return M_IMGDATA->m_palette; return M_IMGDATA->m_palette;
} }
void wxImage::SetPalette(const wxPalette& palette) void wxImage::SetPalette(const wxPalette& palette)
{ {
wxCHECK_RET( Ok(), wxT("invalid image") ); wxCHECK_RET( IsOk(), wxT("invalid image") );
AllocExclusive(); AllocExclusive();
@@ -2292,7 +2292,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename),
wxBitmapType WXUNUSED_UNLESS_STREAMS(type) ) const wxBitmapType WXUNUSED_UNLESS_STREAMS(type) ) const
{ {
#if HAS_FILE_STREAMS #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); ((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 const wxString& WXUNUSED_UNLESS_STREAMS(mimetype) ) const
{ {
#if HAS_FILE_STREAMS #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); ((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
@@ -2343,7 +2343,7 @@ int wxImage::GetImageCount( const wxString& WXUNUSED_UNLESS_STREAMS(name),
{ {
#if HAS_FILE_STREAMS #if HAS_FILE_STREAMS
wxImageFileInputStream stream(name); wxImageFileInputStream stream(name);
if (stream.Ok()) if (stream.IsOk())
return GetImageCount(stream, type); return GetImageCount(stream, type);
#endif #endif
@@ -2545,7 +2545,7 @@ bool wxImage::DoSave(wxImageHandler& handler, wxOutputStream& stream) const
bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) 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); wxImageHandler *handler = FindHandler(type);
if ( !handler ) if ( !handler )
@@ -2559,7 +2559,7 @@ bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) const
bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) 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); wxImageHandler *handler = FindHandlerMime(mimetype);
if ( !handler ) if ( !handler )

View File

@@ -140,7 +140,7 @@ bool wxIFFDecoder::ConvertToImage(wxImage *image) const
// create the image // create the image
image->Create(GetWidth(), GetHeight()); image->Create(GetWidth(), GetHeight());
if (!image->Ok()) if (!image->IsOk())
return false; return false;
unsigned char *pal = GetPalette(); unsigned char *pal = GetPalette();

View File

@@ -257,7 +257,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
} }
(cinfo.src->term_source)(&cinfo); (cinfo.src->term_source)(&cinfo);
jpeg_destroy_decompress(&cinfo); jpeg_destroy_decompress(&cinfo);
if (image->Ok()) image->Destroy(); if (image->IsOk()) image->Destroy();
return false; return false;
} }
@@ -291,7 +291,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
jpeg_start_decompress( &cinfo ); jpeg_start_decompress( &cinfo );
image->Create( cinfo.output_width, cinfo.output_height ); image->Create( cinfo.output_width, cinfo.output_height );
if (!image->Ok()) { if (!image->IsOk()) {
jpeg_finish_decompress( &cinfo ); jpeg_finish_decompress( &cinfo );
jpeg_destroy_decompress( &cinfo ); jpeg_destroy_decompress( &cinfo );
return false; return false;

View File

@@ -214,7 +214,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
image->Create(width, height); image->Create(width, height);
if (!image->Ok()) if (!image->IsOk())
return wxPCX_MEMERR; return wxPCX_MEMERR;
if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL) 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 // according to PCX specs) and allocate space for one complete
// scanline. // scanline.
if (!image->Ok()) if (!image->IsOk())
return wxPCX_INVFORMAT; return wxPCX_INVFORMAT;
width = image->GetWidth(); width = image->GetWidth();

View File

@@ -558,7 +558,7 @@ wxPNGHandler::LoadFile(wxImage *image,
image->Create((int)width, (int)height, (bool) false /* no need to init pixels */); image->Create((int)width, (int)height, (bool) false /* no need to init pixels */);
if (!image->Ok()) if (!image->IsOk())
goto error; goto error;
// initialize all line pointers to NULL to ensure that they can be safely // 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.")); wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory."));
} }
if ( image->Ok() ) if ( image->IsOk() )
{ {
image->Destroy(); image->Destroy();
} }

View File

@@ -227,7 +227,7 @@ int ReadTGA(wxImage* image, wxInputStream& stream)
image->Create(width, height); image->Create(width, height);
if (!image->Ok()) if (!image->IsOk())
{ {
return wxTGA_MEMERR; return wxTGA_MEMERR;
} }

View File

@@ -344,7 +344,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
} }
image->Create( (int)w, (int)h ); image->Create( (int)w, (int)h );
if (!image->Ok()) if (!image->IsOk())
{ {
if (verbose) if (verbose)
{ {

View File

@@ -97,7 +97,7 @@ bool wxXPMHandler::LoadFile(wxImage *image,
wxXPMDecoder decoder; wxXPMDecoder decoder;
wxImage img = decoder.ReadFile(stream); wxImage img = decoder.ReadFile(stream);
if ( !img.Ok() ) if ( !img.IsOk() )
return false; return false;
*image = img; *image = img;
return true; return true;

View File

@@ -139,7 +139,7 @@ wxOverlayImpl::~wxOverlayImpl()
bool wxOverlayImpl::IsOk() bool wxOverlayImpl::IsOk()
{ {
return m_bmpSaved.Ok() ; return m_bmpSaved.IsOk() ;
} }
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height ) void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )

View File

@@ -93,11 +93,11 @@ void wxOwnerDrawnBase::GetColourToUse(wxODStatus stat, wxColour& colText, wxColo
} }
else else
{ {
colText = m_colText.Ok() ? m_colText colText = m_colText.IsOk() ? m_colText
: wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT); : wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT);
} }
colBack = m_colBack.Ok() ? m_colBack colBack = m_colBack.IsOk() ? m_colBack
: wxSystemSettings::GetColour(wxSYS_COLOUR_MENU); : wxSystemSettings::GetColour(wxSYS_COLOUR_MENU);
} }
} }

View File

@@ -1989,7 +1989,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
{ {
m_previewBitmap = new wxBitmap(pageRect.width, pageRect.height); m_previewBitmap = new wxBitmap(pageRect.width, pageRect.height);
if (!m_previewBitmap || !m_previewBitmap->Ok()) if (!m_previewBitmap || !m_previewBitmap->IsOk())
{ {
InvalidatePreviewBitmap(); InvalidatePreviewBitmap();
wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK); 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 bool wxPrintPreview::IsOk() const
{ {
return m_pimpl->Ok(); return m_pimpl->IsOk();
} }
void wxPrintPreview::SetOk(bool ok) void wxPrintPreview::SetOk(bool ok)

View File

@@ -1546,7 +1546,7 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE) if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE)
{ {
if (!dest.Ok()) if (!dest.IsOk())
dest.Create(w, h); dest.Create(w, h);
imgdt = dest.GetData(); imgdt = dest.GetData();

View File

@@ -45,7 +45,7 @@ wxFileProto::~wxFileProto()
wxInputStream *wxFileProto::GetInputStream(const wxString& path) wxInputStream *wxFileProto::GetInputStream(const wxString& path)
{ {
wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path)); wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path));
if ( retval->Ok() ) if ( retval->IsOk() )
{ {
m_lastError = wxPROTO_NOERR; m_lastError = wxPROTO_NOERR;
return retval; return retval;

View File

@@ -498,7 +498,7 @@ bool wxTCPServer::Create(const wxString& serverName)
delete addr; delete addr;
if (!m_server->Ok()) if (!m_server->IsOk())
{ {
m_server->Destroy(); m_server->Destroy();
m_server = NULL; m_server = NULL;
@@ -877,7 +877,7 @@ void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event)
wxSocketBase *sock = server->Accept(); wxSocketBase *sock = server->Accept();
if (!sock) if (!sock)
return; return;
if (!sock->Ok()) if (!sock->IsOk())
{ {
sock->Destroy(); sock->Destroy();
return; return;

View File

@@ -757,7 +757,7 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out)
{ {
#if wxUSE_IMAGE #if wxUSE_IMAGE
out = in.ConvertToGreyscale(); out = in.ConvertToGreyscale();
if ( out.Ok() ) if ( out.IsOk() )
return true; return true;
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
return false; return false;

View File

@@ -143,8 +143,8 @@ wxTextAttr::wxTextAttr(const wxColour& colText,
{ {
Init(); Init();
if (m_colText.Ok()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR; if (m_colText.IsOk()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR;
if (m_colBack.Ok()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; if (m_colBack.IsOk()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR;
if (alignment != wxTEXT_ALIGNMENT_DEFAULT) if (alignment != wxTEXT_ALIGNMENT_DEFAULT)
m_flags |= wxTEXT_ATTR_ALIGNMENT; m_flags |= wxTEXT_ATTR_ALIGNMENT;
@@ -422,7 +422,7 @@ wxFont wxTextAttr::GetFont() const
// Get attributes from font. // Get attributes from font.
bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags) bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags)
{ {
if (!font.Ok()) if (!font.IsOk())
return false; return false;
if (flags & wxTEXT_ATTR_FONT_SIZE) if (flags & wxTEXT_ATTR_FONT_SIZE)
@@ -518,13 +518,13 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith)
destStyle.SetFontFamily(style.GetFontFamily()); destStyle.SetFontFamily(style.GetFontFamily());
} }
if (style.GetTextColour().Ok() && style.HasTextColour()) if (style.GetTextColour().IsOk() && style.HasTextColour())
{ {
if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour())) if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour()))
destStyle.SetTextColour(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())) if (!(compareWith && compareWith->HasBackgroundColour() && compareWith->GetBackgroundColour() == style.GetBackgroundColour()))
destStyle.SetBackgroundColour(style.GetBackgroundColour()); destStyle.SetBackgroundColour(style.GetBackgroundColour());
@@ -670,30 +670,30 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr,
if (attr.HasFont()) if (attr.HasFont())
font = attr.GetFont(); font = attr.GetFont();
if ( !font.Ok() ) if ( !font.IsOk() )
{ {
if (attrDef.HasFont()) if (attrDef.HasFont())
font = attrDef.GetFont(); font = attrDef.GetFont();
if ( text && !font.Ok() ) if ( text && !font.IsOk() )
font = text->GetFont(); font = text->GetFont();
} }
wxColour colFg = attr.GetTextColour(); wxColour colFg = attr.GetTextColour();
if ( !colFg.Ok() ) if ( !colFg.IsOk() )
{ {
colFg = attrDef.GetTextColour(); colFg = attrDef.GetTextColour();
if ( text && !colFg.Ok() ) if ( text && !colFg.IsOk() )
colFg = text->GetForegroundColour(); colFg = text->GetForegroundColour();
} }
wxColour colBg = attr.GetBackgroundColour(); wxColour colBg = attr.GetBackgroundColour();
if ( !colBg.Ok() ) if ( !colBg.IsOk() )
{ {
colBg = attrDef.GetBackgroundColour(); colBg = attrDef.GetBackgroundColour();
if ( text && !colBg.Ok() ) if ( text && !colBg.IsOk() )
colBg = text->GetBackgroundColour(); colBg = text->GetBackgroundColour();
} }

View File

@@ -352,7 +352,7 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon)
// passing wxNullIcon to SetIcon() is possible (it means that we shouldn't // passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
// have any icon), but adding an invalid icon to wxIconBundle is not // have any icon), but adding an invalid icon to wxIconBundle is not
wxIconBundle icons; wxIconBundle icons;
if ( icon.Ok() ) if ( icon.IsOk() )
icons.AddIcon(icon); icons.AddIcon(icon);
SetIcons(icons); SetIcons(icons);

View File

@@ -1536,7 +1536,7 @@ wxColour wxGetColourFromUser(wxWindow *parent,
wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption) wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption)
{ {
wxFontData data; wxFontData data;
if ( fontInit.Ok() ) if ( fontInit.IsOk() )
{ {
data.SetInitialFont(fontInit); data.SetInitialFont(fontInit);
} }

View File

@@ -1528,7 +1528,7 @@ wxColour wxWindowBase::GetBackgroundColour() const
// wxWidgets versions where GetBackgroundColour() always returned // wxWidgets versions where GetBackgroundColour() always returned
// something -- so give them something even if it doesn't make sense // something -- so give them something even if it doesn't make sense
// for this window (e.g. it has a themed background) // for this window (e.g. it has a themed background)
if ( !colBg.Ok() ) if ( !colBg.IsOk() )
colBg = GetClassDefaultAttributes().colBg; colBg = GetClassDefaultAttributes().colBg;
return colBg; return colBg;
@@ -1540,7 +1540,7 @@ wxColour wxWindowBase::GetBackgroundColour() const
wxColour wxWindowBase::GetForegroundColour() const wxColour wxWindowBase::GetForegroundColour() const
{ {
// logic is the same as above // logic is the same as above
if ( !m_hasFgCol && !m_foregroundColour.Ok() ) if ( !m_hasFgCol && !m_foregroundColour.IsOk() )
{ {
wxColour colFg = GetDefaultAttributes().colFg; wxColour colFg = GetDefaultAttributes().colFg;
@@ -1562,7 +1562,7 @@ bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
m_inheritBgCol = m_hasBgCol; m_inheritBgCol = m_hasBgCol;
m_backgroundColour = colour; m_backgroundColour = colour;
SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() ); SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.IsOk() );
return true; return true;
} }
@@ -1574,7 +1574,7 @@ bool wxWindowBase::SetForegroundColour( const wxColour &colour )
m_hasFgCol = colour.IsOk(); m_hasFgCol = colour.IsOk();
m_inheritFgCol = m_hasFgCol; m_inheritFgCol = m_hasFgCol;
m_foregroundColour = colour; m_foregroundColour = colour;
SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.Ok() ); SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.IsOk() );
return true; return true;
} }

View File

@@ -1341,7 +1341,7 @@ void wxZipInputStream::Init(const wxString& file)
ffile = static_cast<wxFFileInputStream*>(m_parent_i_stream); ffile = static_cast<wxFFileInputStream*>(m_parent_i_stream);
wxZipEntryPtr_ entry; wxZipEntryPtr_ entry;
if (ffile->Ok()) { if (ffile->IsOk()) {
do { do {
entry.reset(GetNextEntry()); entry.reset(GetNextEntry());
} }

View File

@@ -193,7 +193,7 @@ CreateSurfaceWithFormat(int w, int h, DFBSurfacePixelFormat format)
// Creates a surface that will use wxImage's pixel data (RGB only) // Creates a surface that will use wxImage's pixel data (RGB only)
wxIDirectFBSurfacePtr CreateSurfaceForImage(const wxImage& image) 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 // FIXME_DFB: implement alpha handling by merging alpha buffer with RGB
// into a temporary RGBA surface // into a temporary RGBA surface
wxCHECK_MSG( !image.HasAlpha(), NULL, "alpha channel not supported" ); 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 #if wxUSE_IMAGE
wxBitmap::wxBitmap(const wxImage& imageOrig, int depth) wxBitmap::wxBitmap(const wxImage& imageOrig, int depth)
{ {
wxCHECK_RET( imageOrig.Ok(), wxT("invalid image") ); wxCHECK_RET( imageOrig.IsOk(), wxT("invalid image") );
wxImage image(imageOrig); wxImage image(imageOrig);
@@ -469,7 +469,7 @@ wxBitmap::wxBitmap(const wxImage& imageOrig, int depth)
wxImage wxBitmap::ConvertToImage() const wxImage wxBitmap::ConvertToImage() const
{ {
wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
wxImage img(GetWidth(), GetHeight()); wxImage img(GetWidth(), GetHeight());
wxIDirectFBSurfacePtr src = M_BITMAP->m_surface; wxIDirectFBSurfacePtr src = M_BITMAP->m_surface;
@@ -505,7 +505,7 @@ wxImage wxBitmap::ConvertToImage() const
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{ {
wxCHECK_MSG( Ok(), NULL, "invalid bitmap" ); wxCHECK_MSG( IsOk(), NULL, "invalid bitmap" );
AllocExclusive(); AllocExclusive();
@@ -543,7 +543,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
bool wxBitmap::HasAlpha() const bool wxBitmap::HasAlpha() const
{ {
wxCHECK_MSG( Ok(), false, "invalid bitmap" ); wxCHECK_MSG( IsOk(), false, "invalid bitmap" );
return M_BITMAP->m_surface->GetPixelFormat() == DSPF_ARGB; 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 int wxBitmap::GetHeight() const
{ {
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
int h = -1; int h = -1;
M_BITMAP->m_surface->GetSize(NULL, &h); M_BITMAP->m_surface->GetSize(NULL, &h);
@@ -577,7 +577,7 @@ int wxBitmap::GetHeight() const
int wxBitmap::GetWidth() const int wxBitmap::GetWidth() const
{ {
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
int w = -1; int w = -1;
M_BITMAP->m_surface->GetSize(&w, NULL); M_BITMAP->m_surface->GetSize(&w, NULL);
@@ -586,21 +586,21 @@ int wxBitmap::GetWidth() const
int wxBitmap::GetDepth() 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(); return M_BITMAP->m_surface->GetDepth();
} }
wxMask *wxBitmap::GetMask() const wxMask *wxBitmap::GetMask() const
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BITMAP->m_mask; return M_BITMAP->m_mask;
} }
void wxBitmap::SetMask(wxMask *mask) void wxBitmap::SetMask(wxMask *mask)
{ {
wxCHECK_RET( Ok(), wxT("invalid bitmap") ); wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
AllocExclusive(); AllocExclusive();
delete M_BITMAP->m_mask; delete M_BITMAP->m_mask;
@@ -615,7 +615,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
{ {
wxCHECK_MSG( Ok() && wxCHECK_MSG( IsOk() &&
rect.x >= 0 && rect.y >= 0 && rect.x >= 0 && rect.y >= 0 &&
rect.x+rect.width <= GetWidth() && rect.x+rect.width <= GetWidth() &&
rect.y+rect.height <= GetHeight(), rect.y+rect.height <= GetHeight(),
@@ -638,7 +638,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
if ( handler == NULL ) if ( handler == NULL )
{ {
wxImage image; 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); wxLogError(_("No bitmap handler for type %d defined."), type);
return false; return false;
@@ -658,7 +658,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
#warning "to common code" #warning "to common code"
bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const 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); wxBitmapHandler *handler = FindHandler(type);
@@ -670,7 +670,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
image.SetPalette(*palette); image.SetPalette(*palette);
#endif // wxUSE_PALETTE #endif // wxUSE_PALETTE
if ( image.Ok() ) if ( image.IsOk() )
return image.SaveFile(filename, type); return image.SaveFile(filename, type);
else else
{ {
@@ -685,20 +685,20 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
#if wxUSE_PALETTE #if wxUSE_PALETTE
wxPalette *wxBitmap::GetPalette() const wxPalette *wxBitmap::GetPalette() const
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BITMAP->m_palette; return M_BITMAP->m_palette;
} }
void wxBitmap::SetPalette(const wxPalette& 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") ); wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
AllocExclusive(); AllocExclusive();
wxDELETE(M_BITMAP->m_palette); wxDELETE(M_BITMAP->m_palette);
if ( !palette.Ok() ) return; if ( !palette.IsOk() ) return;
M_BITMAP->m_palette = new wxPalette(palette); M_BITMAP->m_palette = new wxPalette(palette);
} }
@@ -741,7 +741,7 @@ void wxBitmap::SetDepth(int depth)
wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") ); wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BITMAP->m_surface; return M_BITMAP->m_surface;
} }

View File

@@ -91,14 +91,14 @@ bool wxBrush::operator==(const wxBrush& brush) const
wxBrushStyle wxBrush::GetStyle() 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; return M_BRUSHDATA->m_style;
} }
wxColour wxBrush::GetColour() const wxColour wxBrush::GetColour() const
{ {
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour; return M_BRUSHDATA->m_colour;
} }

View File

@@ -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 background mode is solid, DrawText must paint text's background:
if ( m_backgroundMode == wxSOLID ) if ( m_backgroundMode == wxSOLID )
{ {
wxCHECK_RET( m_textBackgroundColour.Ok(), wxCHECK_RET( m_textBackgroundColour.IsOk(),
wxT("invalid background color") ); wxT("invalid background color") );
SelectColour(m_textBackgroundColour); SelectColour(m_textBackgroundColour);
@@ -354,7 +354,7 @@ void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
} }
// finally draw the text itself: // finally draw the text itself:
wxCHECK_RET( m_textForegroundColour.Ok(), wxCHECK_RET( m_textForegroundColour.IsOk(),
wxT("invalid foreground color") ); wxT("invalid foreground color") );
SelectColour(m_textForegroundColour); SelectColour(m_textForegroundColour);
m_surface->DrawString(text.utf8_str(), -1, xx, yy, DSTF_LEFT | DSTF_TOP); 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) void wxDFBDCImpl::SetPen(const wxPen& pen)
{ {
m_pen = pen.Ok() ? pen : DEFAULT_PEN; m_pen = pen.IsOk() ? pen : DEFAULT_PEN;
SelectColour(m_pen.GetColour()); SelectColour(m_pen.GetColour());
} }
void wxDFBDCImpl::SetBrush(const wxBrush& brush) 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) void wxDFBDCImpl::SelectColour(const wxColour& clr)
@@ -408,7 +408,7 @@ void wxDFBDCImpl::SetFont(const wxFont& font)
{ {
wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxFont f(font.Ok() ? font : DEFAULT_FONT); wxFont f(font.IsOk() ? font : DEFAULT_FONT);
wxFont oldfont(m_font); wxFont oldfont(m_font);
@@ -431,7 +431,7 @@ void wxDFBDCImpl::SetBackground(const wxBrush& brush)
{ {
wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCHECK_RET( IsOk(), wxT("invalid dc") );
if (!brush.Ok()) return; if (!brush.IsOk()) return;
m_backgroundBrush = brush; m_backgroundBrush = brush;
} }
@@ -478,7 +478,7 @@ void wxDFBDCImpl::EndPage()
wxCoord wxDFBDCImpl::GetCharHeight() const wxCoord wxDFBDCImpl::GetCharHeight() const
{ {
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") ); 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; int h = -1;
GetCurrentFont()->GetHeight(&h); GetCurrentFont()->GetHeight(&h);
@@ -488,7 +488,7 @@ wxCoord wxDFBDCImpl::GetCharHeight() const
wxCoord wxDFBDCImpl::GetCharWidth() const wxCoord wxDFBDCImpl::GetCharWidth() const
{ {
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") ); 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; int w = -1;
GetCurrentFont()->GetStringWidth("H", 1, &w); GetCurrentFont()->GetStringWidth("H", 1, &w);
@@ -502,8 +502,8 @@ void wxDFBDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
const wxFont *theFont) const const wxFont *theFont) const
{ {
wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCHECK_RET( m_font.Ok(), wxT("no font selected") ); wxCHECK_RET( m_font.IsOk(), wxT("no font selected") );
wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") ); wxCHECK_RET( !theFont || theFont->IsOk(), wxT("invalid font") );
wxFont oldFont; wxFont oldFont;
if ( theFont != NULL ) 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) void wxDFBDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
{ {
wxCHECK_RET( IsOk(), wxT("invalid dc") ); wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") );
DoDrawSubBitmap(bmp, DoDrawSubBitmap(bmp,
0, 0, bmp.GetWidth(), bmp.GetHeight(), 0, 0, bmp.GetWidth(), bmp.GetHeight(),
@@ -659,7 +659,7 @@ void wxDFBDCImpl::DoDrawSubBitmap(const wxBitmap &bmp,
wxCoord destx, wxCoord desty, int rop, bool useMask) wxCoord destx, wxCoord desty, int rop, bool useMask)
{ {
wxCHECK_RET( IsOk(), wxT("invalid dc") ); 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) // NB: we could also support XOR here (via DSBLIT_XOR)
// and possibly others via SetSrc/DstBlendFunction() // and possibly others via SetSrc/DstBlendFunction()

View File

@@ -65,7 +65,7 @@ void wxMemoryDCImpl::DoSelect(const wxBitmap& bitmap)
{ {
m_bmp = bitmap; m_bmp = bitmap;
if ( !bitmap.Ok() ) if ( !bitmap.IsOk() )
{ {
// select the bitmap out of the DC // select the bitmap out of the DC
m_surface = NULL; m_surface = NULL;

View File

@@ -75,7 +75,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) 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 // we don't support DC scaling yet, so use scale=1
wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased); wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased);
@@ -84,14 +84,14 @@ wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const
int wxFont::GetPointSize() const int wxFont::GetPointSize() const
{ {
wxCHECK_MSG( Ok(), 0, wxT("invalid font") ); wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->GetPointSize(); return M_FONTDATA->GetPointSize();
} }
wxString wxFont::GetFaceName() const wxString wxFont::GetFaceName() const
{ {
wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") ); wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->GetFaceName(); return M_FONTDATA->GetFaceName();
} }
@@ -103,21 +103,21 @@ wxFontFamily wxFont::DoGetFamily() const
wxFontStyle wxFont::GetStyle() 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(); return M_FONTDATA->GetStyle();
} }
wxFontWeight wxFont::GetWeight() const wxFontWeight wxFont::GetWeight() const
{ {
wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") ); wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->GetWeight(); return M_FONTDATA->GetWeight();
} }
bool wxFont::GetUnderlined() const bool wxFont::GetUnderlined() const
{ {
wxCHECK_MSG( Ok(), false, wxT("invalid font") ); wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->GetUnderlined(); return M_FONTDATA->GetUnderlined();
} }
@@ -125,21 +125,21 @@ bool wxFont::GetUnderlined() const
wxFontEncoding wxFont::GetEncoding() 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(); return M_FONTDATA->GetEncoding();
} }
bool wxFont::IsFixedWidth() const bool wxFont::IsFixedWidth() const
{ {
wxCHECK_MSG( Ok(), false, wxT("invalid font") ); wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->IsFixedWidth(); return M_FONTDATA->IsFixedWidth();
} }
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") ); wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
return M_FONTDATA->GetNativeFontInfo(); return M_FONTDATA->GetNativeFontInfo();
} }

View File

@@ -155,7 +155,7 @@ wxDash* wxPen::GetDash() const
wxPenCap wxPen::GetCap() 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" ); wxFAIL_MSG( "GetCap not implemented" );
return wxCAP_INVALID; return wxCAP_INVALID;
@@ -163,7 +163,7 @@ wxPenCap wxPen::GetCap() const
wxPenJoin wxPen::GetJoin() 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" ); wxFAIL_MSG( "GetJoin not implemented" );
return wxJOIN_INVALID; return wxJOIN_INVALID;
@@ -171,28 +171,28 @@ wxPenJoin wxPen::GetJoin() const
wxPenStyle wxPen::GetStyle() 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; return M_PENDATA->m_style;
} }
int wxPen::GetWidth() const int wxPen::GetWidth() const
{ {
wxCHECK_MSG( Ok(), -1, wxT("invalid pen") ); wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return 1; return 1;
} }
wxColour wxPen::GetColour() const wxColour wxPen::GetColour() const
{ {
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") ); wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour; return M_PENDATA->m_colour;
} }
wxBitmap *wxPen::GetStipple() const wxBitmap *wxPen::GetStipple() const
{ {
wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") ); wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
wxFAIL_MSG( "GetStipple not implemented" ); wxFAIL_MSG( "GetStipple not implemented" );
return NULL; return NULL;

View File

@@ -149,13 +149,13 @@ bool wxRegion::DoUnionWithRect(const wxRect& rect)
bool wxRegion::DoUnionWithRegion(const wxRegion& region) 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); return DoUnionWithRect(M_REGION_OF(region)->m_rect);
} }
bool wxRegion::DoIntersect(const wxRegion& region) bool wxRegion::DoIntersect(const wxRegion& region)
{ {
wxCHECK_MSG( region.Ok(), false, "invalid region" ); wxCHECK_MSG( region.IsOk(), false, "invalid region" );
AllocExclusive(); AllocExclusive();
M_REGION->m_rect.Intersect(M_REGION_OF(region)->m_rect); 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) bool wxRegion::DoSubtract(const wxRegion& region)
{ {
wxCHECK_MSG( region.Ok(), false, "invalid region" ); wxCHECK_MSG( region.IsOk(), false, "invalid region" );
wxCHECK_MSG( Ok(), false, "invalid region" ); wxCHECK_MSG( IsOk(), false, "invalid region" );
const wxRect& rect = M_REGION_OF(region)->m_rect; 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) 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" ); wxFAIL_MSG( "Xor not implemented" );
return false; return false;
} }
@@ -202,7 +202,7 @@ bool wxRegion::DoXor(const wxRegion& region)
wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const 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)) if (M_REGION->m_rect.Contains(x, y))
return wxInRegion; return wxInRegion;
@@ -212,7 +212,7 @@ wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const
wxRegionContain wxRegion::DoContainsRect(const wxRect& rect) 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? // 1) is the rectangle entirely covered by the region?
if (M_REGION->m_rect.Contains(rect)) if (M_REGION->m_rect.Contains(rect))

View File

@@ -323,7 +323,7 @@ bool wxWindowDFB::SetCursor(const wxCursor& cursor)
#warning "implement this" #warning "implement this"
#if 0 #if 0
if ( m_cursor.Ok() ) if ( m_cursor.IsOk() )
DFB_wmSetWindowCursor(m_wnd, *m_cursor.GetDFBCursor()); DFB_wmSetWindowCursor(m_wnd, *m_cursor.GetDFBCursor());
else else
DFB_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetDFBCursor()); DFB_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetDFBCursor());

View File

@@ -85,7 +85,7 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const
wxIcon wxAboutDialogInfo::GetIcon() const wxIcon wxAboutDialogInfo::GetIcon() const
{ {
wxIcon icon = m_icon; wxIcon icon = m_icon;
if ( !icon.Ok() && wxTheApp ) if ( !icon.IsOk() && wxTheApp )
{ {
const wxTopLevelWindow * const const wxTopLevelWindow * const
tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow); tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow);
@@ -196,7 +196,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren
wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL); wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL);
#if wxUSE_STATBMP #if wxUSE_STATBMP
wxIcon icon = info.GetIcon(); wxIcon icon = info.GetIcon();
if ( icon.Ok() ) if ( icon.IsOk() )
{ {
sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon), sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon),
wxSizerFlags().Border(wxRIGHT)); wxSizerFlags().Border(wxRIGHT));

View File

@@ -162,7 +162,7 @@ void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry)
const wxAcceleratorEntry * const wxAcceleratorEntry *
wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const
{ {
if ( !Ok() ) if ( !IsOk() )
{ {
// not an error, the accel table is just empty // not an error, the accel table is just empty
return NULL; return NULL;

View File

@@ -308,7 +308,7 @@ wxAnimationCtrl::~wxAnimationCtrl()
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type) bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
{ {
wxFileInputStream fis(filename); wxFileInputStream fis(filename);
if (!fis.Ok()) if (!fis.IsOk())
return false; return false;
return Load(fis, type); return Load(fis, type);
} }

View File

@@ -1002,13 +1002,13 @@ void wxGenericCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
colBg = attr->GetBackgroundColour(); colBg = attr->GetBackgroundColour();
} }
if ( colFg.Ok() ) if ( colFg.IsOk() )
{ {
dc.SetTextForeground(colFg); dc.SetTextForeground(colFg);
changedColours = true; changedColours = true;
} }
if ( colBg.Ok() ) if ( colBg.IsOk() )
{ {
dc.SetTextBackground(colBg); dc.SetTextBackground(colBg);
changedColours = true; changedColours = true;

Some files were not shown because too many files have changed in this diff Show More