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

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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