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:
parent
ddd7e4307b
commit
a1b806b982
@ -60,7 +60,7 @@ Card::Card(int value, WayUp way_up) :
|
||||
if (!m_symbolBmap)
|
||||
{
|
||||
m_symbolBmap = new wxBitmap(symbols_xpm);
|
||||
if (!m_symbolBmap->Ok())
|
||||
if (!m_symbolBmap->IsOk())
|
||||
{
|
||||
::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error"));
|
||||
}
|
||||
@ -68,7 +68,7 @@ Card::Card(int value, WayUp way_up) :
|
||||
if (!m_pictureBmap)
|
||||
{
|
||||
m_pictureBmap = new wxBitmap(Pictures);
|
||||
if (!m_pictureBmap->Ok())
|
||||
if (!m_pictureBmap->IsOk())
|
||||
{
|
||||
::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error"));
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
|
||||
// icon to be shown in the dialog, defaults to the main frame icon
|
||||
void SetIcon(const wxIcon& icon) { m_icon = icon; }
|
||||
bool HasIcon() const { return m_icon.Ok(); }
|
||||
bool HasIcon() const { return m_icon.IsOk(); }
|
||||
wxIcon GetIcon() const;
|
||||
|
||||
// web site for the program and its description (defaults to URL itself if
|
||||
|
@ -112,10 +112,10 @@ public:
|
||||
void SetHoliday(bool holiday) { m_holiday = holiday; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||
bool HasBorderColour() const { return m_colBorder.Ok(); }
|
||||
bool HasFont() const { return m_font.Ok(); }
|
||||
bool HasTextColour() const { return m_colText.IsOk(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasBorderColour() const { return m_colBorder.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; }
|
||||
|
||||
bool IsHoliday() const { return m_holiday; }
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
|
||||
// Is this data OK for showing the print dialog?
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const { return m_printData.Ok() ; }
|
||||
bool IsOk() const { return m_printData.IsOk() ; }
|
||||
|
||||
wxPrintData& GetPrintData() { return m_printData; }
|
||||
void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
|
||||
@ -249,7 +249,7 @@ public:
|
||||
|
||||
// Is this data OK for showing the page setup dialog?
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const { return m_printData.Ok() ; }
|
||||
bool IsOk() const { return m_printData.IsOk() ; }
|
||||
|
||||
// If a corresponding paper type is found in the paper database, will set the m_printData
|
||||
// paper size id member as well.
|
||||
|
@ -163,7 +163,7 @@ public:
|
||||
void SetItalic( bool set ) { m_italic = set; }
|
||||
|
||||
// accessors
|
||||
bool HasColour() const { return m_colour.Ok(); }
|
||||
bool HasColour() const { return m_colour.IsOk(); }
|
||||
const wxColour& GetColour() const { return m_colour; }
|
||||
|
||||
bool HasFont() const { return m_bold || m_italic; }
|
||||
|
@ -1344,13 +1344,13 @@ public:
|
||||
|
||||
~wxDCTextColourChanger()
|
||||
{
|
||||
if ( m_colFgOld.Ok() )
|
||||
if ( m_colFgOld.IsOk() )
|
||||
m_dc.SetTextForeground(m_colFgOld);
|
||||
}
|
||||
|
||||
void Set(const wxColour& col)
|
||||
{
|
||||
if ( !m_colFgOld.Ok() )
|
||||
if ( !m_colFgOld.IsOk() )
|
||||
m_colFgOld = m_dc.GetTextForeground();
|
||||
m_dc.SetTextForeground(col);
|
||||
}
|
||||
@ -1378,7 +1378,7 @@ public:
|
||||
|
||||
~wxDCPenChanger()
|
||||
{
|
||||
if ( m_penOld.Ok() )
|
||||
if ( m_penOld.IsOk() )
|
||||
m_dc.SetPen(m_penOld);
|
||||
}
|
||||
|
||||
@ -1405,7 +1405,7 @@ public:
|
||||
|
||||
~wxDCBrushChanger()
|
||||
{
|
||||
if ( m_brushOld.Ok() )
|
||||
if ( m_brushOld.IsOk() )
|
||||
m_dc.SetBrush(m_brushOld);
|
||||
}
|
||||
|
||||
@ -1461,14 +1461,14 @@ public:
|
||||
|
||||
void Set(const wxFont& font)
|
||||
{
|
||||
if ( !m_fontOld.Ok() )
|
||||
if ( !m_fontOld.IsOk() )
|
||||
m_fontOld = m_dc.GetFont();
|
||||
m_dc.SetFont(font);
|
||||
}
|
||||
|
||||
~wxDCFontChanger()
|
||||
{
|
||||
if ( m_fontOld.Ok() )
|
||||
if ( m_fontOld.IsOk() )
|
||||
m_dc.SetFont(m_fontOld);
|
||||
}
|
||||
|
||||
|
@ -1528,7 +1528,7 @@ public:
|
||||
|
||||
void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
|
||||
const wxCursor& GetCursor() const { return m_cursor; }
|
||||
bool HasCursor() const { return m_cursor.Ok(); }
|
||||
bool HasCursor() const { return m_cursor.IsOk(); }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxSetCursorEvent(*this); }
|
||||
|
||||
|
@ -432,9 +432,9 @@ public:
|
||||
void SetKind(wxAttrKind kind) { m_attrkind = kind; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||
bool HasFont() const { return m_font.Ok(); }
|
||||
bool HasTextColour() const { return m_colText.IsOk(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
bool HasAlignment() const
|
||||
{
|
||||
return m_hAlign != wxALIGN_INVALID || m_vAlign != wxALIGN_INVALID;
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
private:
|
||||
wxSize GetBitmapSize()
|
||||
{
|
||||
return m_bitmap.Ok() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
|
||||
return m_bitmap.IsOk() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
|
||||
: wxSize(16, 16); // this is completely arbitrary
|
||||
}
|
||||
|
||||
|
@ -52,13 +52,13 @@ extern const gchar *wx_pango_version_check(int major, int minor, int micro);
|
||||
// helper: use the encoding of the given font if it's valid
|
||||
inline wxCharBuffer wxConvertToGTK(const wxString& s, const wxFont& font)
|
||||
{
|
||||
return wxConvertToGTK(s, font.Ok() ? font.GetEncoding()
|
||||
return wxConvertToGTK(s, font.IsOk() ? font.GetEncoding()
|
||||
: wxFONTENCODING_SYSTEM);
|
||||
}
|
||||
|
||||
inline wxCharBuffer wxConvertFromGTK(const wxString& s, const wxFont& font)
|
||||
{
|
||||
return wxConvertFromGTK(s, font.Ok() ? font.GetEncoding()
|
||||
return wxConvertFromGTK(s, font.IsOk() ? font.GetEncoding()
|
||||
: wxFONTENCODING_SYSTEM);
|
||||
}
|
||||
|
||||
|
@ -183,9 +183,9 @@ public:
|
||||
void SetFont(const wxFont& font) { m_font = font; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||
bool HasFont() const { return m_font.Ok(); }
|
||||
bool HasTextColour() const { return m_colText.IsOk(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
|
||||
const wxColour& GetTextColour() const { return m_colText; }
|
||||
const wxColour& GetBackgroundColour() const { return m_colBack; }
|
||||
|
@ -3644,7 +3644,7 @@ public:
|
||||
/// image size.
|
||||
virtual wxTextAttrSize GetNaturalSize() const;
|
||||
|
||||
virtual bool IsEmpty() const { return false; /* !m_imageBlock.Ok(); */ }
|
||||
virtual bool IsEmpty() const { return false; /* !m_imageBlock.IsOk(); */ }
|
||||
|
||||
virtual bool CanEditProperties() const { return true; }
|
||||
|
||||
|
@ -379,8 +379,8 @@ public:
|
||||
int GetOutlineLevel() const { return m_outlineLevel; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; }
|
||||
bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; }
|
||||
bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; }
|
||||
bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; }
|
||||
bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); }
|
||||
|
@ -252,9 +252,9 @@ public:
|
||||
void SetFont(const wxFont& font) { m_font = font; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||
bool HasFont() const { return m_font.Ok(); }
|
||||
bool HasTextColour() const { return m_colText.IsOk(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
|
||||
const wxColour& GetTextColour() const { return m_colText; }
|
||||
const wxColour& GetBackgroundColour() const { return m_colBack; }
|
||||
|
@ -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;
|
||||
|
@ -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; \
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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 )
|
||||
|
@ -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.
|
||||
|
@ -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();
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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"))
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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?"),
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -166,7 +166,7 @@ WX_NSBitmapImageRep wxBitmap::GetNSBitmapImageRep()
|
||||
|
||||
WX_NSImage wxBitmap::GetNSImage(bool useMask) const
|
||||
{
|
||||
if(!Ok())
|
||||
if(!IsOk())
|
||||
return nil;
|
||||
NSImage *nsimage = [[[NSImage alloc]
|
||||
initWithSize:NSMakeSize(GetWidth(), GetHeight())] autorelease];
|
||||
@ -351,7 +351,7 @@ bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
|
||||
wxImage image;
|
||||
if(!image.LoadFile(filename,type))
|
||||
return false;
|
||||
if(!image.Ok())
|
||||
if(!image.IsOk())
|
||||
return false;
|
||||
*this = wxBitmap(image);
|
||||
return true;
|
||||
@ -428,7 +428,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(!Ok())
|
||||
if(!IsOk())
|
||||
return wxNullBitmap;
|
||||
NSImage *nsimage = GetNSImage(false);
|
||||
|
||||
@ -450,7 +450,7 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
|
||||
wxImage wxBitmap::ConvertToImage() const
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(!Ok())
|
||||
if(!IsOk())
|
||||
return /*wxImage(5,5)*/wxNullImage;
|
||||
NSImage *nsimage = GetNSImage(false /* don't use mask */);
|
||||
wxImage newImage(M_BITMAPDATA->m_width,M_BITMAPDATA->m_height);
|
||||
@ -476,7 +476,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
UnRef();
|
||||
|
||||
wxCHECK_MSG(image.Ok(), false, wxT("invalid image"));
|
||||
wxCHECK_MSG(image.IsOk(), false, wxT("invalid image"));
|
||||
wxCHECK_MSG(depth == -1 || depth == 1, false, wxT("invalid bitmap depth"));
|
||||
|
||||
m_refData = new wxBitmapRefData();
|
||||
@ -511,7 +511,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
|
||||
|
||||
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
|
||||
{
|
||||
if(!Ok())
|
||||
if(!IsOk())
|
||||
return NULL;
|
||||
|
||||
NSBitmapImageRep *bitmapRep = M_BITMAPDATA->m_cocoaNSBitmapImageRep;
|
||||
@ -657,7 +657,7 @@ static bool wxMask_CreateFromBitmapData(PixelData srcData, const wxColour& colou
|
||||
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(!bitmap.Ok())
|
||||
if(!bitmap.IsOk())
|
||||
return false;
|
||||
int bmpWidth = bitmap.GetWidth();
|
||||
int bmpHeight = bitmap.GetHeight();
|
||||
|
@ -202,19 +202,19 @@ void wxBrush::SetStipple(const wxBitmap& stipple)
|
||||
|
||||
wxColour wxBrush::GetColour() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
|
||||
wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
|
||||
return M_BRUSHDATA->GetColour();
|
||||
}
|
||||
|
||||
wxBrushStyle wxBrush::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
|
||||
wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
|
||||
return M_BRUSHDATA->GetStyle();
|
||||
}
|
||||
|
||||
wxBitmap *wxBrush::GetStipple() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") );
|
||||
return M_BRUSHDATA->GetStipple();
|
||||
}
|
||||
|
||||
|
@ -456,7 +456,7 @@ void wxCocoaDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(!CocoaTakeFocus()) return;
|
||||
if(!bmp.Ok())
|
||||
if(!bmp.IsOk())
|
||||
return;
|
||||
|
||||
#if 0
|
||||
@ -540,13 +540,13 @@ void wxCocoaDCImpl::DoGetSizeMM( int* width, int* height ) const
|
||||
|
||||
void wxCocoaDCImpl::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
// if (!Ok()) return;
|
||||
// if (!IsOk()) return;
|
||||
m_textForegroundColour = col;
|
||||
};
|
||||
|
||||
void wxCocoaDCImpl::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
// if (!Ok()) return;
|
||||
// if (!IsOk()) return;
|
||||
m_textBackgroundColour = col;
|
||||
};
|
||||
|
||||
|
@ -75,7 +75,7 @@ bool wxMemoryDCImpl::CocoaUnlockFocus()
|
||||
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
||||
{
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
if(m_selectedBitmap.Ok())
|
||||
if(m_selectedBitmap.IsOk())
|
||||
{
|
||||
CocoaTakeFocus();
|
||||
wxASSERT(m_cocoaNSImage);
|
||||
@ -95,7 +95,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
||||
[m_cocoaNSImage release];
|
||||
m_cocoaNSImage = nil;
|
||||
m_selectedBitmap = bitmap;
|
||||
if(m_selectedBitmap.Ok())
|
||||
if(m_selectedBitmap.IsOk())
|
||||
{
|
||||
// Create an offscreen window of the same size
|
||||
m_cocoaNSImage = [[NSImage alloc]
|
||||
@ -137,7 +137,7 @@ bool wxMemoryDCImpl::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc,
|
||||
int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask)
|
||||
{
|
||||
if(!m_selectedBitmap.Ok())
|
||||
if(!m_selectedBitmap.IsOk())
|
||||
return false;
|
||||
|
||||
NSAffineTransform *transform = [NSAffineTransform transform];
|
||||
|
@ -350,7 +350,7 @@ wxFontEncoding wxFont::GetEncoding() const
|
||||
|
||||
int wxFont::GetPointSize() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||
return M_FONTDATA->m_info.pointSize;
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ bool wxFont::GetUnderlined() const
|
||||
|
||||
wxFontStyle wxFont::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||
return M_FONTDATA->m_info.style;
|
||||
}
|
||||
|
||||
@ -375,13 +375,13 @@ wxFontFamily wxFont::DoGetFamily() const
|
||||
|
||||
wxFontWeight wxFont::GetWeight() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||
return M_FONTDATA->m_info.weight;
|
||||
}
|
||||
|
||||
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||
return &M_FONTDATA->m_info;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ bool wxIcon::CreateFromXpm(const char* const* xpm)
|
||||
{
|
||||
wxBitmap bitmap(xpm);
|
||||
CopyFromBitmap(bitmap);
|
||||
return Ok();
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
|
||||
@ -122,7 +122,7 @@ bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
|
||||
{
|
||||
wxBitmap bitmap(filename, type);
|
||||
CopyFromBitmap(bitmap);
|
||||
return bitmap.Ok();
|
||||
return bitmap.IsOk();
|
||||
}
|
||||
|
||||
void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
|
||||
@ -133,7 +133,7 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bitmap)
|
||||
M_ICONDATA->m_height = bitmap.GetHeight();
|
||||
wxAutoNSAutoreleasePool pool;
|
||||
M_ICONDATA->m_cocoaNSImage = [bitmap.GetNSImage(true) retain];
|
||||
M_ICONDATA->m_ok = bitmap.Ok();
|
||||
M_ICONDATA->m_ok = bitmap.IsOk();
|
||||
M_ICONDATA->m_numColors = 0;
|
||||
M_ICONDATA->m_quality = 0;
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ void wxMenuItem::SetBitmaps(const wxBitmap& bmpChecked,
|
||||
}
|
||||
else
|
||||
{
|
||||
wxASSERT_MSG(!bmpUnchecked.Ok(),wxT("Normal menu items should only have one bitmap"));
|
||||
wxASSERT_MSG(!bmpUnchecked.IsOk(),wxT("Normal menu items should only have one bitmap"));
|
||||
[m_cocoaNSMenuItem setImage: bmpChecked.GetNSImage(true)];
|
||||
}
|
||||
}
|
||||
|
@ -231,12 +231,12 @@ wxArtProvider::~wxArtProvider()
|
||||
node; node = node->GetNext())
|
||||
{
|
||||
bmp = node->GetData()->CreateBitmap(id, client, size);
|
||||
if ( bmp.Ok() )
|
||||
if ( bmp.IsOk() )
|
||||
break;
|
||||
}
|
||||
|
||||
wxSize sizeNeeded = size;
|
||||
if ( !bmp.Ok() )
|
||||
if ( !bmp.IsOk() )
|
||||
{
|
||||
// no bitmap created -- as a fallback, try if we can find desired
|
||||
// icon in a bundle
|
||||
|
@ -207,7 +207,7 @@ wxBitmap wxDefaultArtProvider::CreateBitmap(const wxArtID& id,
|
||||
wxBitmap bmp = wxDefaultArtProvider_CreateBitmap(id);
|
||||
|
||||
#if wxUSE_IMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB)
|
||||
if (bmp.Ok())
|
||||
if (bmp.IsOk())
|
||||
{
|
||||
// fit into transparent image with desired size hint from the client
|
||||
if (reqSize == wxDefaultSize)
|
||||
|
@ -156,7 +156,7 @@ wxBitmap::wxBitmap(const char* const* bits)
|
||||
|
||||
#if wxUSE_IMAGE && wxUSE_XPM
|
||||
wxImage image(bits);
|
||||
wxCHECK2_MSG(image.Ok(), return, wxT("invalid bitmap data"));
|
||||
wxCHECK2_MSG(image.IsOk(), return, wxT("invalid bitmap data"));
|
||||
|
||||
*this = wxBitmap(image);
|
||||
#else
|
||||
|
@ -84,7 +84,7 @@ void wxColourPickerCtrl::SetColour(const wxColour &col)
|
||||
bool wxColourPickerCtrl::SetColour(const wxString &text)
|
||||
{
|
||||
wxColour col(text); // smart wxString->wxColour conversion
|
||||
if ( !col.Ok() )
|
||||
if ( !col.IsOk() )
|
||||
return false;
|
||||
M_PICKER->SetColour(col);
|
||||
UpdateTextCtrlFromPicker();
|
||||
@ -105,7 +105,7 @@ void wxColourPickerCtrl::UpdatePickerFromTextCtrl()
|
||||
|
||||
// wxString -> wxColour conversion
|
||||
wxColour col(m_text->GetValue());
|
||||
if ( !col.Ok() )
|
||||
if ( !col.IsOk() )
|
||||
return; // invalid user input
|
||||
|
||||
if (M_PICKER->GetColour() != col)
|
||||
|
@ -170,7 +170,7 @@ bool wxPrintData::IsOk() const
|
||||
{
|
||||
m_nativeData->TransferFrom( *this );
|
||||
|
||||
return m_nativeData->Ok();
|
||||
return m_nativeData->IsOk();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -177,13 +177,13 @@ bool wxColourBase::FromString(const wxString& str)
|
||||
// because this place can be called from constructor
|
||||
// and 'this' could not be available yet
|
||||
wxColour clr = wxTheColourDatabase->Find(str);
|
||||
if (clr.Ok())
|
||||
if (clr.IsOk())
|
||||
Set((unsigned char)clr.Red(),
|
||||
(unsigned char)clr.Green(),
|
||||
(unsigned char)clr.Blue());
|
||||
}
|
||||
|
||||
if (Ok())
|
||||
if (IsOk())
|
||||
return true;
|
||||
|
||||
wxLogDebug(wxT("wxColour::Set - couldn't set to colour string '%s'"), str);
|
||||
|
@ -1172,7 +1172,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
|
||||
// its platform default or bitmap+pushbutton background is used, but not if
|
||||
// there is vertical size adjustment or horizontal spacing.
|
||||
if ( ( (m_iFlags & wxCC_BUTTON_OUTSIDE_BORDER) ||
|
||||
(m_bmpNormal.Ok() && m_blankButtonBg) ) &&
|
||||
(m_bmpNormal.IsOk() && m_blankButtonBg) ) &&
|
||||
m_btnSpacingX == 0 &&
|
||||
m_btnHei <= 0 )
|
||||
{
|
||||
@ -1180,7 +1180,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
|
||||
btnBorder = 0;
|
||||
}
|
||||
else if ( (m_iFlags & wxCC_BUTTON_COVERS_BORDER) &&
|
||||
m_btnSpacingX == 0 && !m_bmpNormal.Ok() )
|
||||
m_btnSpacingX == 0 && !m_bmpNormal.IsOk() )
|
||||
{
|
||||
m_iFlags &= ~(wxCC_IFLAG_BUTTON_OUTSIDE);
|
||||
btnBorder = 0;
|
||||
@ -1237,7 +1237,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
|
||||
// It is larger
|
||||
// OR
|
||||
// button width is set to default and blank button bg is not drawn
|
||||
if ( m_bmpNormal.Ok() )
|
||||
if ( m_bmpNormal.IsOk() )
|
||||
{
|
||||
int bmpReqWidth = m_bmpNormal.GetWidth();
|
||||
int bmpReqHeight = m_bmpNormal.GetHeight();
|
||||
@ -1259,7 +1259,7 @@ void wxComboCtrlBase::CalculateAreas( int btnWidth )
|
||||
{
|
||||
int newY = butHeight+(customBorder*2);
|
||||
SetClientSize(wxDefaultCoord,newY);
|
||||
if ( m_bmpNormal.Ok() || m_btnArea.width != butWidth || m_btnArea.height != butHeight )
|
||||
if ( m_bmpNormal.IsOk() || m_btnArea.width != butWidth || m_btnArea.height != butHeight )
|
||||
m_iFlags |= wxCC_IFLAG_HAS_NONSTANDARD_BUTTON;
|
||||
else
|
||||
m_iFlags &= ~wxCC_IFLAG_HAS_NONSTANDARD_BUTTON;
|
||||
@ -1368,16 +1368,16 @@ wxSize wxComboCtrlBase::DoGetBestSize() const
|
||||
// TODO: Better method to calculate close-to-native control height.
|
||||
|
||||
int fhei;
|
||||
if ( m_font.Ok() )
|
||||
if ( m_font.IsOk() )
|
||||
fhei = (m_font.GetPointSize()*2) + 5;
|
||||
else if ( wxNORMAL_FONT->Ok() )
|
||||
else if ( wxNORMAL_FONT->IsOk() )
|
||||
fhei = (wxNORMAL_FONT->GetPointSize()*2) + 5;
|
||||
else
|
||||
fhei = sizeText.y + 4;
|
||||
|
||||
// Need to force height to accomodate bitmap?
|
||||
int btnSizeY = m_btnSize.y;
|
||||
if ( m_bmpNormal.Ok() && fhei < btnSizeY )
|
||||
if ( m_bmpNormal.IsOk() && fhei < btnSizeY )
|
||||
fhei = btnSizeY;
|
||||
|
||||
// Control height doesn't depend on border
|
||||
@ -1702,7 +1702,7 @@ void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int flags )
|
||||
dc.DrawRectangle(rect);
|
||||
}
|
||||
|
||||
if ( !m_bmpNormal.Ok() )
|
||||
if ( !m_bmpNormal.IsOk() )
|
||||
{
|
||||
if ( flags & Button_BitmapOnly )
|
||||
return;
|
||||
@ -2564,17 +2564,17 @@ void wxComboCtrlBase::SetButtonBitmaps( const wxBitmap& bmpNormal,
|
||||
m_bmpNormal = bmpNormal;
|
||||
m_blankButtonBg = blankButtonBg;
|
||||
|
||||
if ( bmpPressed.Ok() )
|
||||
if ( bmpPressed.IsOk() )
|
||||
m_bmpPressed = bmpPressed;
|
||||
else
|
||||
m_bmpPressed = bmpNormal;
|
||||
|
||||
if ( bmpHover.Ok() )
|
||||
if ( bmpHover.IsOk() )
|
||||
m_bmpHover = bmpHover;
|
||||
else
|
||||
m_bmpHover = bmpNormal;
|
||||
|
||||
if ( bmpDisabled.Ok() )
|
||||
if ( bmpDisabled.IsOk() )
|
||||
m_bmpDisabled = bmpDisabled;
|
||||
else
|
||||
m_bmpDisabled = bmpNormal;
|
||||
|
@ -588,7 +588,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const
|
||||
{
|
||||
wxSize best;
|
||||
wxBitmap bmp = GetBitmap();
|
||||
if ( bmp.Ok() )
|
||||
if ( bmp.IsOk() )
|
||||
best = wxSize(bmp.GetWidth(), bmp.GetHeight());
|
||||
else
|
||||
// this is completely arbitrary
|
||||
|
@ -1182,7 +1182,7 @@ void wxDC::DrawLabel(const wxString& text,
|
||||
GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine);
|
||||
|
||||
wxCoord width, height;
|
||||
if ( bitmap.Ok() )
|
||||
if ( bitmap.IsOk() )
|
||||
{
|
||||
width = widthText + bitmap.GetWidth();
|
||||
height = bitmap.GetHeight();
|
||||
@ -1224,7 +1224,7 @@ void wxDC::DrawLabel(const wxString& text,
|
||||
wxCoord x0 = x,
|
||||
y0 = y,
|
||||
width0 = width;
|
||||
if ( bitmap.Ok() )
|
||||
if ( bitmap.IsOk() )
|
||||
{
|
||||
DrawBitmap(bitmap, x, y, true /* use mask */);
|
||||
|
||||
|
@ -139,7 +139,7 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou
|
||||
////////////////////code here
|
||||
|
||||
m_outfile = new wxFileOutputStream(filename);
|
||||
m_OK = m_outfile->Ok();
|
||||
m_OK = m_outfile->IsOk();
|
||||
if (m_OK)
|
||||
{
|
||||
m_filename = filename;
|
||||
@ -643,14 +643,14 @@ void wxSVGFileDCImpl::DoDrawBitmap(const class wxBitmap & bmp, wxCoord x, wxCoor
|
||||
{
|
||||
write(s);
|
||||
}
|
||||
m_OK = m_outfile->Ok() && bPNG_OK;
|
||||
m_OK = m_outfile->IsOk() && bPNG_OK;
|
||||
}
|
||||
|
||||
void wxSVGFileDCImpl::write(const wxString &s)
|
||||
{
|
||||
const wxCharBuffer buf = s.utf8_str();
|
||||
m_outfile->Write(buf, strlen((const char *)buf));
|
||||
m_OK = m_outfile->Ok();
|
||||
m_OK = m_outfile->IsOk();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1181,7 +1181,7 @@ void wxDocManager::OnPreview(wxCommandEvent& WXUNUSED(event))
|
||||
preview = new wxPrintPreview(printout,
|
||||
view->OnCreatePrintout(),
|
||||
&printDialogData);
|
||||
if ( !preview->Ok() )
|
||||
if ( !preview->IsOk() )
|
||||
{
|
||||
delete preview;
|
||||
wxLogError(_("Print preview creation failed."));
|
||||
|
@ -255,7 +255,7 @@ wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString&
|
||||
#else
|
||||
#error One of wxUSE_FILE or wxUSE_FFILE must be set to 1 for wxFSHandler to work
|
||||
#endif
|
||||
if ( !is->Ok() )
|
||||
if ( !is->IsOk() )
|
||||
{
|
||||
delete is;
|
||||
return NULL;
|
||||
|
@ -137,7 +137,7 @@ void wxFontPickerCtrl::UpdatePickerFromTextCtrl()
|
||||
// string returned by wxFont::GetNativeFontInfoDesc() and not
|
||||
// the user-friendly one returned by wxFont::GetNativeFontInfoUserDesc()
|
||||
wxFont f = String2Font(m_text->GetValue());
|
||||
if (!f.Ok())
|
||||
if (!f.IsOk())
|
||||
return; // invalid user input
|
||||
|
||||
if (M_PICKER->GetSelectedFont() != f)
|
||||
|
@ -253,7 +253,7 @@ wxMemoryFSHandler::AddFile(const wxString& filename,
|
||||
return;
|
||||
|
||||
wxMemoryOutputStream mems;
|
||||
if ( image.Ok() && image.SaveFile(mems, type) )
|
||||
if ( image.IsOk() && image.SaveFile(mems, type) )
|
||||
{
|
||||
m_Hash[filename] = new wxMemoryFSFile
|
||||
(
|
||||
|
@ -587,9 +587,9 @@ wxSocketBase *wxFTP::GetActivePort()
|
||||
addrNew.Service(0); // pick an open port number.
|
||||
|
||||
wxSocketServer *sockSrv = new wxSocketServer(addrNew);
|
||||
if (!sockSrv->Ok())
|
||||
if (!sockSrv->IsOk())
|
||||
{
|
||||
// We use Ok() here to see if everything is ok
|
||||
// We use IsOk() here to see if everything is ok
|
||||
m_lastError = wxPROTO_PROTERR;
|
||||
delete sockSrv;
|
||||
return NULL;
|
||||
|
@ -499,7 +499,7 @@ wxColour *wxColourDatabase::FindColour(const wxString& name)
|
||||
static wxColour s_col;
|
||||
|
||||
s_col = Find(name);
|
||||
if ( !s_col.Ok() )
|
||||
if ( !s_col.IsOk() )
|
||||
return NULL;
|
||||
|
||||
return new wxColour(s_col);
|
||||
@ -780,7 +780,7 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, wxPenStyle
|
||||
|
||||
wxPen* pen = NULL;
|
||||
wxPen penTmp(colour, width, style);
|
||||
if (penTmp.Ok())
|
||||
if (penTmp.IsOk())
|
||||
{
|
||||
pen = new wxPen(penTmp);
|
||||
list.Append(pen);
|
||||
@ -802,7 +802,7 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, wxBrushStyle st
|
||||
|
||||
wxBrush* brush = NULL;
|
||||
wxBrush brushTmp(colour, style);
|
||||
if (brushTmp.Ok())
|
||||
if (brushTmp.IsOk())
|
||||
{
|
||||
brush = new wxBrush(brushTmp);
|
||||
list.Append(brush);
|
||||
@ -872,7 +872,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
|
||||
// font not found, create the new one
|
||||
font = NULL;
|
||||
wxFont fontTmp(pointSize, family, style, weight, underline, facename, encoding);
|
||||
if (fontTmp.Ok())
|
||||
if (fontTmp.IsOk())
|
||||
{
|
||||
font = new wxFont(fontTmp);
|
||||
list.Append(font);
|
||||
|
@ -138,7 +138,7 @@ bool wxGIFDecoder::ConvertToImage(unsigned int frame, wxImage *image) const
|
||||
image->Create(sz.GetWidth(), sz.GetHeight());
|
||||
image->SetType(wxBITMAP_TYPE_GIF);
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
return false;
|
||||
|
||||
pal = GetPalette(frame);
|
||||
|
@ -66,7 +66,7 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const
|
||||
bool wxGLCanvasBase::SetColour(const wxString& colour)
|
||||
{
|
||||
wxColour col = wxTheColourDatabase->Find(colour);
|
||||
if ( !col.Ok() )
|
||||
if ( !col.IsOk() )
|
||||
return false;
|
||||
|
||||
#ifdef wxHAS_OPENGL_ES
|
||||
|
@ -595,7 +595,7 @@ void wxGraphicsContext::SetPen( const wxGraphicsPen& pen )
|
||||
|
||||
void wxGraphicsContext::SetPen( const wxPen& pen )
|
||||
{
|
||||
if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
|
||||
if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
|
||||
SetPen( wxNullGraphicsPen );
|
||||
else
|
||||
SetPen( CreatePen( pen ) );
|
||||
@ -609,7 +609,7 @@ void wxGraphicsContext::SetBrush( const wxGraphicsBrush& brush )
|
||||
|
||||
void wxGraphicsContext::SetBrush( const wxBrush& brush )
|
||||
{
|
||||
if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
|
||||
if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
|
||||
SetBrush( wxNullGraphicsBrush );
|
||||
else
|
||||
SetBrush( CreateBrush( brush ) );
|
||||
@ -623,7 +623,7 @@ void wxGraphicsContext::SetFont( const wxGraphicsFont& font )
|
||||
|
||||
void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour )
|
||||
{
|
||||
if ( font.Ok() )
|
||||
if ( font.IsOk() )
|
||||
SetFont( CreateFont( font, colour ) );
|
||||
else
|
||||
SetFont( wxNullGraphicsFont );
|
||||
|
@ -163,7 +163,7 @@ void wxIconBundle::AddIcon(const wxString& file, wxBitmapType type)
|
||||
if ( type == wxBITMAP_TYPE_ICON_RESOURCE )
|
||||
{
|
||||
wxIcon tmp(file, type);
|
||||
if (tmp.Ok())
|
||||
if (tmp.IsOk())
|
||||
{
|
||||
AddIcon(tmp);
|
||||
return;
|
||||
@ -245,7 +245,7 @@ wxIcon wxIconBundle::GetIcon(const wxSize& size) const
|
||||
wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const
|
||||
{
|
||||
wxIcon icon = GetIcon(size);
|
||||
if ( icon.Ok() &&
|
||||
if ( icon.IsOk() &&
|
||||
(icon.GetWidth() != size.x || icon.GetHeight() != size.y) )
|
||||
{
|
||||
icon = wxNullIcon;
|
||||
@ -267,7 +267,7 @@ void wxIconBundle::AddIcon(const wxIcon& icon)
|
||||
for ( size_t i = 0; i < count; ++i )
|
||||
{
|
||||
wxIcon& tmp = iconArray[i];
|
||||
if ( tmp.Ok() &&
|
||||
if ( tmp.IsOk() &&
|
||||
tmp.GetWidth() == icon.GetWidth() &&
|
||||
tmp.GetHeight() == icon.GetHeight() )
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
||||
{
|
||||
wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") );
|
||||
|
||||
if ( !image->Ok() )
|
||||
if ( !image->IsOk() )
|
||||
{
|
||||
if ( verbose )
|
||||
{
|
||||
@ -351,7 +351,7 @@ bool wxBMPHandler::SaveDib(wxImage *image,
|
||||
|
||||
// pointer to the image data, use quantized if available
|
||||
wxUint8 *data = (wxUint8*) image->GetData();
|
||||
if (q_image) if (q_image->Ok()) data = (wxUint8*) q_image->GetData();
|
||||
if (q_image) if (q_image->IsOk()) data = (wxUint8*) q_image->GetData();
|
||||
|
||||
wxUint8 *buffer = new wxUint8[row_width];
|
||||
memset(buffer, 0, row_width);
|
||||
@ -1249,7 +1249,7 @@ bool wxICOHandler::SaveFile(wxImage *image,
|
||||
// wxCountingOutputStream::IsOk() always returns true for now and this
|
||||
// "if" provokes VC++ warnings in optimized build
|
||||
#if 0
|
||||
if ( !cStream.Ok() )
|
||||
if ( !cStream.IsOk() )
|
||||
{
|
||||
if ( verbose )
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ bool wxImage::Create(const char* const* xpmData)
|
||||
|
||||
wxXPMDecoder decoder;
|
||||
(*this) = decoder.ReadData(xpmData);
|
||||
return Ok();
|
||||
return IsOk();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@ -258,7 +258,7 @@ wxImage wxImage::MakeEmptyClone(int flags) const
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxS("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxS("invalid image") );
|
||||
|
||||
long height = M_IMGDATA->m_height;
|
||||
long width = M_IMGDATA->m_width;
|
||||
@ -293,7 +293,7 @@ wxImage wxImage::Copy() const
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
|
||||
image.m_refData = CloneRefData(m_refData);
|
||||
|
||||
@ -307,7 +307,7 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
|
||||
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
|
||||
// can't scale to/from 0 size
|
||||
wxCHECK_MSG( (xFactor > 0) && (yFactor > 0), image,
|
||||
@ -426,7 +426,7 @@ wxImage::Scale( int width, int height, wxImageResizeQuality quality ) const
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
|
||||
// can't scale to/from 0 size
|
||||
wxCHECK_MSG( (width > 0) && (height > 0), image,
|
||||
@ -856,7 +856,7 @@ wxImage wxImage::BlurHorizontal(int blurRadius) const
|
||||
{
|
||||
wxImage ret_image(MakeEmptyClone());
|
||||
|
||||
wxCHECK( ret_image.Ok(), ret_image );
|
||||
wxCHECK( ret_image.IsOk(), ret_image );
|
||||
|
||||
const unsigned char* src_data = M_IMGDATA->m_data;
|
||||
unsigned char* dst_data = ret_image.GetData();
|
||||
@ -959,7 +959,7 @@ wxImage wxImage::BlurVertical(int blurRadius) const
|
||||
{
|
||||
wxImage ret_image(MakeEmptyClone());
|
||||
|
||||
wxCHECK( ret_image.Ok(), ret_image );
|
||||
wxCHECK( ret_image.IsOk(), ret_image );
|
||||
|
||||
const unsigned char* src_data = M_IMGDATA->m_data;
|
||||
unsigned char* dst_data = ret_image.GetData();
|
||||
@ -1074,7 +1074,7 @@ wxImage wxImage::Rotate90( bool clockwise ) const
|
||||
{
|
||||
wxImage image(MakeEmptyClone(Clone_SwapOrientation));
|
||||
|
||||
wxCHECK( image.Ok(), image );
|
||||
wxCHECK( image.IsOk(), image );
|
||||
|
||||
long height = M_IMGDATA->m_height;
|
||||
long width = M_IMGDATA->m_width;
|
||||
@ -1168,7 +1168,7 @@ wxImage wxImage::Rotate180() const
|
||||
{
|
||||
wxImage image(MakeEmptyClone());
|
||||
|
||||
wxCHECK( image.Ok(), image );
|
||||
wxCHECK( image.IsOk(), image );
|
||||
|
||||
long height = M_IMGDATA->m_height;
|
||||
long width = M_IMGDATA->m_width;
|
||||
@ -1221,7 +1221,7 @@ wxImage wxImage::Mirror( bool horizontally ) const
|
||||
{
|
||||
wxImage image(MakeEmptyClone());
|
||||
|
||||
wxCHECK( image.Ok(), image );
|
||||
wxCHECK( image.IsOk(), image );
|
||||
|
||||
long height = M_IMGDATA->m_height;
|
||||
long width = M_IMGDATA->m_width;
|
||||
@ -1298,7 +1298,7 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
|
||||
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) &&
|
||||
(rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()),
|
||||
@ -1351,7 +1351,7 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos,
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( (size.GetWidth() > 0) && (size.GetHeight() > 0), image, wxT("invalid size") );
|
||||
|
||||
int width = GetWidth(), height = GetHeight();
|
||||
@ -1399,8 +1399,8 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos,
|
||||
|
||||
void wxImage::Paste( const wxImage &image, int x, int y )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( image.Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
wxCHECK_RET( image.IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -1503,7 +1503,7 @@ void wxImage::Paste( const wxImage &image, int x, int y )
|
||||
void wxImage::Replace( unsigned char r1, unsigned char g1, unsigned char b1,
|
||||
unsigned char r2, unsigned char g2, unsigned char b2 )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -1534,7 +1534,7 @@ wxImage wxImage::ConvertToGreyscale(double weight_r, double weight_g, double wei
|
||||
{
|
||||
wxImage image(MakeEmptyClone());
|
||||
|
||||
wxCHECK( image.Ok(), image );
|
||||
wxCHECK( image.IsOk(), image );
|
||||
|
||||
const unsigned char *src = M_IMGDATA->m_data;
|
||||
unsigned char *dest = image.GetData();
|
||||
@ -1568,7 +1568,7 @@ wxImage wxImage::ConvertToMono( unsigned char r, unsigned char g, unsigned char
|
||||
{
|
||||
wxImage image;
|
||||
|
||||
wxCHECK_MSG( Ok(), image, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
|
||||
|
||||
image.Create( M_IMGDATA->m_width, M_IMGDATA->m_height, false );
|
||||
|
||||
@ -1631,14 +1631,14 @@ wxImage wxImage::ConvertToDisabled(unsigned char brightness) const
|
||||
|
||||
int wxImage::GetWidth() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_width;
|
||||
}
|
||||
|
||||
int wxImage::GetHeight() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_height;
|
||||
}
|
||||
@ -1662,7 +1662,7 @@ void wxImage::SetType(wxBitmapType type)
|
||||
|
||||
long wxImage::XYToIndex(int x, int y) const
|
||||
{
|
||||
if ( Ok() &&
|
||||
if ( IsOk() &&
|
||||
x >= 0 && y >= 0 &&
|
||||
x < M_IMGDATA->m_width && y < M_IMGDATA->m_height )
|
||||
{
|
||||
@ -1688,7 +1688,7 @@ void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned c
|
||||
|
||||
void wxImage::SetRGB( const wxRect& rect_, unsigned char r, unsigned char g, unsigned char b )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -1764,14 +1764,14 @@ bool wxImage::IsOk() const
|
||||
|
||||
unsigned char *wxImage::GetData() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), (unsigned char *)NULL, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_data;
|
||||
}
|
||||
|
||||
void wxImage::SetData( unsigned char *data, bool static_data )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
wxImageRefData *newRefData = new wxImageRefData();
|
||||
|
||||
@ -1872,7 +1872,7 @@ wxImage::ConvertColourToAlpha(unsigned char r, unsigned char g, unsigned char b)
|
||||
|
||||
void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -1890,7 +1890,7 @@ void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
|
||||
|
||||
unsigned char *wxImage::GetAlpha() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), (unsigned char *)NULL, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), (unsigned char *)NULL, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_alpha;
|
||||
}
|
||||
@ -1948,7 +1948,7 @@ void wxImage::ClearAlpha()
|
||||
|
||||
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -1960,7 +1960,7 @@ void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
|
||||
|
||||
bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
if (M_IMGDATA->m_hasMask)
|
||||
{
|
||||
@ -1978,28 +1978,28 @@ bool wxImage::GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned
|
||||
|
||||
unsigned char wxImage::GetMaskRed() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_maskRed;
|
||||
}
|
||||
|
||||
unsigned char wxImage::GetMaskGreen() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_maskGreen;
|
||||
}
|
||||
|
||||
unsigned char wxImage::GetMaskBlue() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_maskBlue;
|
||||
}
|
||||
|
||||
void wxImage::SetMask( bool mask )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -2008,7 +2008,7 @@ void wxImage::SetMask( bool mask )
|
||||
|
||||
bool wxImage::HasMask() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_hasMask;
|
||||
}
|
||||
@ -2155,22 +2155,22 @@ bool wxImage::ConvertAlphaToMask(unsigned char mr,
|
||||
|
||||
bool wxImage::HasPalette() const
|
||||
{
|
||||
if (!Ok())
|
||||
if (!IsOk())
|
||||
return false;
|
||||
|
||||
return M_IMGDATA->m_palette.Ok();
|
||||
return M_IMGDATA->m_palette.IsOk();
|
||||
}
|
||||
|
||||
const wxPalette& wxImage::GetPalette() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxNullPalette, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), wxNullPalette, wxT("invalid image") );
|
||||
|
||||
return M_IMGDATA->m_palette;
|
||||
}
|
||||
|
||||
void wxImage::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -2292,7 +2292,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename),
|
||||
wxBitmapType WXUNUSED_UNLESS_STREAMS(type) ) const
|
||||
{
|
||||
#if HAS_FILE_STREAMS
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
|
||||
@ -2312,7 +2312,7 @@ bool wxImage::SaveFile( const wxString& WXUNUSED_UNLESS_STREAMS(filename),
|
||||
const wxString& WXUNUSED_UNLESS_STREAMS(mimetype) ) const
|
||||
{
|
||||
#if HAS_FILE_STREAMS
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
((wxImage*)this)->SetOption(wxIMAGE_OPTION_FILENAME, filename);
|
||||
|
||||
@ -2343,7 +2343,7 @@ int wxImage::GetImageCount( const wxString& WXUNUSED_UNLESS_STREAMS(name),
|
||||
{
|
||||
#if HAS_FILE_STREAMS
|
||||
wxImageFileInputStream stream(name);
|
||||
if (stream.Ok())
|
||||
if (stream.IsOk())
|
||||
return GetImageCount(stream, type);
|
||||
#endif
|
||||
|
||||
@ -2545,7 +2545,7 @@ bool wxImage::DoSave(wxImageHandler& handler, wxOutputStream& stream) const
|
||||
|
||||
bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
wxImageHandler *handler = FindHandler(type);
|
||||
if ( !handler )
|
||||
@ -2559,7 +2559,7 @@ bool wxImage::SaveFile( wxOutputStream& stream, wxBitmapType type ) const
|
||||
|
||||
bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid image") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
|
||||
|
||||
wxImageHandler *handler = FindHandlerMime(mimetype);
|
||||
if ( !handler )
|
||||
|
@ -140,7 +140,7 @@ bool wxIFFDecoder::ConvertToImage(wxImage *image) const
|
||||
// create the image
|
||||
image->Create(GetWidth(), GetHeight());
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
return false;
|
||||
|
||||
unsigned char *pal = GetPalette();
|
||||
|
@ -257,7 +257,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
}
|
||||
(cinfo.src->term_source)(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
if (image->Ok()) image->Destroy();
|
||||
if (image->IsOk()) image->Destroy();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ bool wxJPEGHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
jpeg_start_decompress( &cinfo );
|
||||
|
||||
image->Create( cinfo.output_width, cinfo.output_height );
|
||||
if (!image->Ok()) {
|
||||
if (!image->IsOk()) {
|
||||
jpeg_finish_decompress( &cinfo );
|
||||
jpeg_destroy_decompress( &cinfo );
|
||||
return false;
|
||||
|
@ -214,7 +214,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
|
||||
|
||||
image->Create(width, height);
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
return wxPCX_MEMERR;
|
||||
|
||||
if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL)
|
||||
@ -331,7 +331,7 @@ int SavePCX(wxImage *image, wxOutputStream& stream)
|
||||
// according to PCX specs) and allocate space for one complete
|
||||
// scanline.
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
return wxPCX_INVFORMAT;
|
||||
|
||||
width = image->GetWidth();
|
||||
|
@ -558,7 +558,7 @@ wxPNGHandler::LoadFile(wxImage *image,
|
||||
|
||||
image->Create((int)width, (int)height, (bool) false /* no need to init pixels */);
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
goto error;
|
||||
|
||||
// initialize all line pointers to NULL to ensure that they can be safely
|
||||
@ -660,7 +660,7 @@ error:
|
||||
wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory."));
|
||||
}
|
||||
|
||||
if ( image->Ok() )
|
||||
if ( image->IsOk() )
|
||||
{
|
||||
image->Destroy();
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ int ReadTGA(wxImage* image, wxInputStream& stream)
|
||||
|
||||
image->Create(width, height);
|
||||
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
{
|
||||
return wxTGA_MEMERR;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
|
||||
}
|
||||
|
||||
image->Create( (int)w, (int)h );
|
||||
if (!image->Ok())
|
||||
if (!image->IsOk())
|
||||
{
|
||||
if (verbose)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ bool wxXPMHandler::LoadFile(wxImage *image,
|
||||
wxXPMDecoder decoder;
|
||||
|
||||
wxImage img = decoder.ReadFile(stream);
|
||||
if ( !img.Ok() )
|
||||
if ( !img.IsOk() )
|
||||
return false;
|
||||
*image = img;
|
||||
return true;
|
||||
|
@ -139,7 +139,7 @@ wxOverlayImpl::~wxOverlayImpl()
|
||||
|
||||
bool wxOverlayImpl::IsOk()
|
||||
{
|
||||
return m_bmpSaved.Ok() ;
|
||||
return m_bmpSaved.IsOk() ;
|
||||
}
|
||||
|
||||
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )
|
||||
|
@ -93,11 +93,11 @@ void wxOwnerDrawnBase::GetColourToUse(wxODStatus stat, wxColour& colText, wxColo
|
||||
}
|
||||
else
|
||||
{
|
||||
colText = m_colText.Ok() ? m_colText
|
||||
colText = m_colText.IsOk() ? m_colText
|
||||
: wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT);
|
||||
}
|
||||
|
||||
colBack = m_colBack.Ok() ? m_colBack
|
||||
colBack = m_colBack.IsOk() ? m_colBack
|
||||
: wxSystemSettings::GetColour(wxSYS_COLOUR_MENU);
|
||||
}
|
||||
}
|
||||
|
@ -1989,7 +1989,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum)
|
||||
{
|
||||
m_previewBitmap = new wxBitmap(pageRect.width, pageRect.height);
|
||||
|
||||
if (!m_previewBitmap || !m_previewBitmap->Ok())
|
||||
if (!m_previewBitmap || !m_previewBitmap->IsOk())
|
||||
{
|
||||
InvalidatePreviewBitmap();
|
||||
wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK);
|
||||
@ -2210,7 +2210,7 @@ int wxPrintPreview::GetMinPage() const
|
||||
|
||||
bool wxPrintPreview::IsOk() const
|
||||
{
|
||||
return m_pimpl->Ok();
|
||||
return m_pimpl->IsOk();
|
||||
}
|
||||
|
||||
void wxPrintPreview::SetOk(bool ok)
|
||||
|
@ -1546,7 +1546,7 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
|
||||
|
||||
if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE)
|
||||
{
|
||||
if (!dest.Ok())
|
||||
if (!dest.IsOk())
|
||||
dest.Create(w, h);
|
||||
|
||||
imgdt = dest.GetData();
|
||||
|
@ -45,7 +45,7 @@ wxFileProto::~wxFileProto()
|
||||
wxInputStream *wxFileProto::GetInputStream(const wxString& path)
|
||||
{
|
||||
wxFileInputStream *retval = new wxFileInputStream(wxURI::Unescape(path));
|
||||
if ( retval->Ok() )
|
||||
if ( retval->IsOk() )
|
||||
{
|
||||
m_lastError = wxPROTO_NOERR;
|
||||
return retval;
|
||||
|
@ -498,7 +498,7 @@ bool wxTCPServer::Create(const wxString& serverName)
|
||||
|
||||
delete addr;
|
||||
|
||||
if (!m_server->Ok())
|
||||
if (!m_server->IsOk())
|
||||
{
|
||||
m_server->Destroy();
|
||||
m_server = NULL;
|
||||
@ -877,7 +877,7 @@ void wxTCPEventHandler::Server_OnRequest(wxSocketEvent &event)
|
||||
wxSocketBase *sock = server->Accept();
|
||||
if (!sock)
|
||||
return;
|
||||
if (!sock->Ok())
|
||||
if (!sock->IsOk())
|
||||
{
|
||||
sock->Destroy();
|
||||
return;
|
||||
|
@ -757,7 +757,7 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out)
|
||||
{
|
||||
#if wxUSE_IMAGE
|
||||
out = in.ConvertToGreyscale();
|
||||
if ( out.Ok() )
|
||||
if ( out.IsOk() )
|
||||
return true;
|
||||
#endif // wxUSE_IMAGE
|
||||
return false;
|
||||
|
@ -143,8 +143,8 @@ wxTextAttr::wxTextAttr(const wxColour& colText,
|
||||
{
|
||||
Init();
|
||||
|
||||
if (m_colText.Ok()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR;
|
||||
if (m_colBack.Ok()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR;
|
||||
if (m_colText.IsOk()) m_flags |= wxTEXT_ATTR_TEXT_COLOUR;
|
||||
if (m_colBack.IsOk()) m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR;
|
||||
if (alignment != wxTEXT_ALIGNMENT_DEFAULT)
|
||||
m_flags |= wxTEXT_ATTR_ALIGNMENT;
|
||||
|
||||
@ -422,7 +422,7 @@ wxFont wxTextAttr::GetFont() const
|
||||
// Get attributes from font.
|
||||
bool wxTextAttr::GetFontAttributes(const wxFont& font, int flags)
|
||||
{
|
||||
if (!font.Ok())
|
||||
if (!font.IsOk())
|
||||
return false;
|
||||
|
||||
if (flags & wxTEXT_ATTR_FONT_SIZE)
|
||||
@ -518,13 +518,13 @@ bool wxTextAttr::Apply(const wxTextAttr& style, const wxTextAttr* compareWith)
|
||||
destStyle.SetFontFamily(style.GetFontFamily());
|
||||
}
|
||||
|
||||
if (style.GetTextColour().Ok() && style.HasTextColour())
|
||||
if (style.GetTextColour().IsOk() && style.HasTextColour())
|
||||
{
|
||||
if (!(compareWith && compareWith->HasTextColour() && compareWith->GetTextColour() == style.GetTextColour()))
|
||||
destStyle.SetTextColour(style.GetTextColour());
|
||||
}
|
||||
|
||||
if (style.GetBackgroundColour().Ok() && style.HasBackgroundColour())
|
||||
if (style.GetBackgroundColour().IsOk() && style.HasBackgroundColour())
|
||||
{
|
||||
if (!(compareWith && compareWith->HasBackgroundColour() && compareWith->GetBackgroundColour() == style.GetBackgroundColour()))
|
||||
destStyle.SetBackgroundColour(style.GetBackgroundColour());
|
||||
@ -670,30 +670,30 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr,
|
||||
if (attr.HasFont())
|
||||
font = attr.GetFont();
|
||||
|
||||
if ( !font.Ok() )
|
||||
if ( !font.IsOk() )
|
||||
{
|
||||
if (attrDef.HasFont())
|
||||
font = attrDef.GetFont();
|
||||
|
||||
if ( text && !font.Ok() )
|
||||
if ( text && !font.IsOk() )
|
||||
font = text->GetFont();
|
||||
}
|
||||
|
||||
wxColour colFg = attr.GetTextColour();
|
||||
if ( !colFg.Ok() )
|
||||
if ( !colFg.IsOk() )
|
||||
{
|
||||
colFg = attrDef.GetTextColour();
|
||||
|
||||
if ( text && !colFg.Ok() )
|
||||
if ( text && !colFg.IsOk() )
|
||||
colFg = text->GetForegroundColour();
|
||||
}
|
||||
|
||||
wxColour colBg = attr.GetBackgroundColour();
|
||||
if ( !colBg.Ok() )
|
||||
if ( !colBg.IsOk() )
|
||||
{
|
||||
colBg = attrDef.GetBackgroundColour();
|
||||
|
||||
if ( text && !colBg.Ok() )
|
||||
if ( text && !colBg.IsOk() )
|
||||
colBg = text->GetBackgroundColour();
|
||||
}
|
||||
|
||||
|
@ -352,7 +352,7 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon)
|
||||
// passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
|
||||
// have any icon), but adding an invalid icon to wxIconBundle is not
|
||||
wxIconBundle icons;
|
||||
if ( icon.Ok() )
|
||||
if ( icon.IsOk() )
|
||||
icons.AddIcon(icon);
|
||||
|
||||
SetIcons(icons);
|
||||
|
@ -1536,7 +1536,7 @@ wxColour wxGetColourFromUser(wxWindow *parent,
|
||||
wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption)
|
||||
{
|
||||
wxFontData data;
|
||||
if ( fontInit.Ok() )
|
||||
if ( fontInit.IsOk() )
|
||||
{
|
||||
data.SetInitialFont(fontInit);
|
||||
}
|
||||
|
@ -1528,7 +1528,7 @@ wxColour wxWindowBase::GetBackgroundColour() const
|
||||
// wxWidgets versions where GetBackgroundColour() always returned
|
||||
// something -- so give them something even if it doesn't make sense
|
||||
// for this window (e.g. it has a themed background)
|
||||
if ( !colBg.Ok() )
|
||||
if ( !colBg.IsOk() )
|
||||
colBg = GetClassDefaultAttributes().colBg;
|
||||
|
||||
return colBg;
|
||||
@ -1540,7 +1540,7 @@ wxColour wxWindowBase::GetBackgroundColour() const
|
||||
wxColour wxWindowBase::GetForegroundColour() const
|
||||
{
|
||||
// logic is the same as above
|
||||
if ( !m_hasFgCol && !m_foregroundColour.Ok() )
|
||||
if ( !m_hasFgCol && !m_foregroundColour.IsOk() )
|
||||
{
|
||||
wxColour colFg = GetDefaultAttributes().colFg;
|
||||
|
||||
@ -1562,7 +1562,7 @@ bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
|
||||
|
||||
m_inheritBgCol = m_hasBgCol;
|
||||
m_backgroundColour = colour;
|
||||
SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() );
|
||||
SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.IsOk() );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1574,7 +1574,7 @@ bool wxWindowBase::SetForegroundColour( const wxColour &colour )
|
||||
m_hasFgCol = colour.IsOk();
|
||||
m_inheritFgCol = m_hasFgCol;
|
||||
m_foregroundColour = colour;
|
||||
SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.Ok() );
|
||||
SetThemeEnabled( !m_hasFgCol && !m_backgroundColour.IsOk() );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ void wxZipInputStream::Init(const wxString& file)
|
||||
ffile = static_cast<wxFFileInputStream*>(m_parent_i_stream);
|
||||
wxZipEntryPtr_ entry;
|
||||
|
||||
if (ffile->Ok()) {
|
||||
if (ffile->IsOk()) {
|
||||
do {
|
||||
entry.reset(GetNextEntry());
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ CreateSurfaceWithFormat(int w, int h, DFBSurfacePixelFormat format)
|
||||
// Creates a surface that will use wxImage's pixel data (RGB only)
|
||||
wxIDirectFBSurfacePtr CreateSurfaceForImage(const wxImage& image)
|
||||
{
|
||||
wxCHECK_MSG( image.Ok(), NULL, "invalid image" );
|
||||
wxCHECK_MSG( image.IsOk(), NULL, "invalid image" );
|
||||
// FIXME_DFB: implement alpha handling by merging alpha buffer with RGB
|
||||
// into a temporary RGBA surface
|
||||
wxCHECK_MSG( !image.HasAlpha(), NULL, "alpha channel not supported" );
|
||||
@ -423,7 +423,7 @@ bool wxBitmap::CreateWithFormat(int width, int height, int dfbFormat)
|
||||
#if wxUSE_IMAGE
|
||||
wxBitmap::wxBitmap(const wxImage& imageOrig, int depth)
|
||||
{
|
||||
wxCHECK_RET( imageOrig.Ok(), wxT("invalid image") );
|
||||
wxCHECK_RET( imageOrig.IsOk(), wxT("invalid image") );
|
||||
|
||||
wxImage image(imageOrig);
|
||||
|
||||
@ -469,7 +469,7 @@ wxBitmap::wxBitmap(const wxImage& imageOrig, int depth)
|
||||
|
||||
wxImage wxBitmap::ConvertToImage() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
|
||||
|
||||
wxImage img(GetWidth(), GetHeight());
|
||||
wxIDirectFBSurfacePtr src = M_BITMAP->m_surface;
|
||||
@ -505,7 +505,7 @@ wxImage wxBitmap::ConvertToImage() const
|
||||
|
||||
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, "invalid bitmap" );
|
||||
wxCHECK_MSG( IsOk(), NULL, "invalid bitmap" );
|
||||
|
||||
AllocExclusive();
|
||||
|
||||
@ -543,7 +543,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
|
||||
|
||||
bool wxBitmap::HasAlpha() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, "invalid bitmap" );
|
||||
wxCHECK_MSG( IsOk(), false, "invalid bitmap" );
|
||||
|
||||
return M_BITMAP->m_surface->GetPixelFormat() == DSPF_ARGB;
|
||||
}
|
||||
@ -568,7 +568,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
||||
|
||||
int wxBitmap::GetHeight() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
|
||||
|
||||
int h = -1;
|
||||
M_BITMAP->m_surface->GetSize(NULL, &h);
|
||||
@ -577,7 +577,7 @@ int wxBitmap::GetHeight() const
|
||||
|
||||
int wxBitmap::GetWidth() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
|
||||
|
||||
int w = -1;
|
||||
M_BITMAP->m_surface->GetSize(&w, NULL);
|
||||
@ -586,21 +586,21 @@ int wxBitmap::GetWidth() const
|
||||
|
||||
int wxBitmap::GetDepth() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
|
||||
|
||||
return M_BITMAP->m_surface->GetDepth();
|
||||
}
|
||||
|
||||
wxMask *wxBitmap::GetMask() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
|
||||
|
||||
return M_BITMAP->m_mask;
|
||||
}
|
||||
|
||||
void wxBitmap::SetMask(wxMask *mask)
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid bitmap") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
|
||||
|
||||
AllocExclusive();
|
||||
delete M_BITMAP->m_mask;
|
||||
@ -615,7 +615,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( Ok() &&
|
||||
wxCHECK_MSG( IsOk() &&
|
||||
rect.x >= 0 && rect.y >= 0 &&
|
||||
rect.x+rect.width <= GetWidth() &&
|
||||
rect.y+rect.height <= GetHeight(),
|
||||
@ -638,7 +638,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
|
||||
if ( handler == NULL )
|
||||
{
|
||||
wxImage image;
|
||||
if ( !image.LoadFile(name, type) || !image.Ok() )
|
||||
if ( !image.LoadFile(name, type) || !image.IsOk() )
|
||||
{
|
||||
wxLogError(_("No bitmap handler for type %d defined."), type);
|
||||
return false;
|
||||
@ -658,7 +658,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
|
||||
#warning "to common code"
|
||||
bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") );
|
||||
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
@ -670,7 +670,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
|
||||
image.SetPalette(*palette);
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
if ( image.Ok() )
|
||||
if ( image.IsOk() )
|
||||
return image.SaveFile(filename, type);
|
||||
else
|
||||
{
|
||||
@ -685,20 +685,20 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette *wxBitmap::GetPalette() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
|
||||
|
||||
return M_BITMAP->m_palette;
|
||||
}
|
||||
|
||||
void wxBitmap::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid bitmap") );
|
||||
wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
|
||||
wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
|
||||
|
||||
AllocExclusive();
|
||||
wxDELETE(M_BITMAP->m_palette);
|
||||
|
||||
if ( !palette.Ok() ) return;
|
||||
if ( !palette.IsOk() ) return;
|
||||
|
||||
M_BITMAP->m_palette = new wxPalette(palette);
|
||||
}
|
||||
@ -741,7 +741,7 @@ void wxBitmap::SetDepth(int depth)
|
||||
|
||||
wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
|
||||
|
||||
return M_BITMAP->m_surface;
|
||||
}
|
||||
|
@ -91,14 +91,14 @@ bool wxBrush::operator==(const wxBrush& brush) const
|
||||
|
||||
wxBrushStyle wxBrush::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
|
||||
wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
|
||||
|
||||
return M_BRUSHDATA->m_style;
|
||||
}
|
||||
|
||||
wxColour wxBrush::GetColour() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
|
||||
wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
|
||||
|
||||
return M_BRUSHDATA->m_colour;
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
// if background mode is solid, DrawText must paint text's background:
|
||||
if ( m_backgroundMode == wxSOLID )
|
||||
{
|
||||
wxCHECK_RET( m_textBackgroundColour.Ok(),
|
||||
wxCHECK_RET( m_textBackgroundColour.IsOk(),
|
||||
wxT("invalid background color") );
|
||||
|
||||
SelectColour(m_textBackgroundColour);
|
||||
@ -354,7 +354,7 @@ void wxDFBDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
}
|
||||
|
||||
// finally draw the text itself:
|
||||
wxCHECK_RET( m_textForegroundColour.Ok(),
|
||||
wxCHECK_RET( m_textForegroundColour.IsOk(),
|
||||
wxT("invalid foreground color") );
|
||||
SelectColour(m_textForegroundColour);
|
||||
m_surface->DrawString(text.utf8_str(), -1, xx, yy, DSTF_LEFT | DSTF_TOP);
|
||||
@ -379,14 +379,14 @@ void wxDFBDCImpl::DoDrawRotatedText(const wxString& WXUNUSED(text),
|
||||
|
||||
void wxDFBDCImpl::SetPen(const wxPen& pen)
|
||||
{
|
||||
m_pen = pen.Ok() ? pen : DEFAULT_PEN;
|
||||
m_pen = pen.IsOk() ? pen : DEFAULT_PEN;
|
||||
|
||||
SelectColour(m_pen.GetColour());
|
||||
}
|
||||
|
||||
void wxDFBDCImpl::SetBrush(const wxBrush& brush)
|
||||
{
|
||||
m_brush = brush.Ok() ? brush : DEFAULT_BRUSH;
|
||||
m_brush = brush.IsOk() ? brush : DEFAULT_BRUSH;
|
||||
}
|
||||
|
||||
void wxDFBDCImpl::SelectColour(const wxColour& clr)
|
||||
@ -408,7 +408,7 @@ void wxDFBDCImpl::SetFont(const wxFont& font)
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||
|
||||
wxFont f(font.Ok() ? font : DEFAULT_FONT);
|
||||
wxFont f(font.IsOk() ? font : DEFAULT_FONT);
|
||||
|
||||
wxFont oldfont(m_font);
|
||||
|
||||
@ -431,7 +431,7 @@ void wxDFBDCImpl::SetBackground(const wxBrush& brush)
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||
|
||||
if (!brush.Ok()) return;
|
||||
if (!brush.IsOk()) return;
|
||||
|
||||
m_backgroundBrush = brush;
|
||||
}
|
||||
@ -478,7 +478,7 @@ void wxDFBDCImpl::EndPage()
|
||||
wxCoord wxDFBDCImpl::GetCharHeight() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") );
|
||||
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
||||
wxCHECK_MSG( m_font.IsOk(), -1, wxT("no font selected") );
|
||||
|
||||
int h = -1;
|
||||
GetCurrentFont()->GetHeight(&h);
|
||||
@ -488,7 +488,7 @@ wxCoord wxDFBDCImpl::GetCharHeight() const
|
||||
wxCoord wxDFBDCImpl::GetCharWidth() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid dc") );
|
||||
wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
|
||||
wxCHECK_MSG( m_font.IsOk(), -1, wxT("no font selected") );
|
||||
|
||||
int w = -1;
|
||||
GetCurrentFont()->GetStringWidth("H", 1, &w);
|
||||
@ -502,8 +502,8 @@ void wxDFBDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
|
||||
const wxFont *theFont) const
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||
wxCHECK_RET( m_font.Ok(), wxT("no font selected") );
|
||||
wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") );
|
||||
wxCHECK_RET( m_font.IsOk(), wxT("no font selected") );
|
||||
wxCHECK_RET( !theFont || theFont->IsOk(), wxT("invalid font") );
|
||||
|
||||
wxFont oldFont;
|
||||
if ( theFont != NULL )
|
||||
@ -640,7 +640,7 @@ bool wxDFBDCImpl::DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
void wxDFBDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
||||
wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") );
|
||||
|
||||
DoDrawSubBitmap(bmp,
|
||||
0, 0, bmp.GetWidth(), bmp.GetHeight(),
|
||||
@ -659,7 +659,7 @@ void wxDFBDCImpl::DoDrawSubBitmap(const wxBitmap &bmp,
|
||||
wxCoord destx, wxCoord desty, int rop, bool useMask)
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||
wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
|
||||
wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") );
|
||||
|
||||
// NB: we could also support XOR here (via DSBLIT_XOR)
|
||||
// and possibly others via SetSrc/DstBlendFunction()
|
||||
|
@ -65,7 +65,7 @@ void wxMemoryDCImpl::DoSelect(const wxBitmap& bitmap)
|
||||
{
|
||||
m_bmp = bitmap;
|
||||
|
||||
if ( !bitmap.Ok() )
|
||||
if ( !bitmap.IsOk() )
|
||||
{
|
||||
// select the bitmap out of the DC
|
||||
m_surface = NULL;
|
||||
|
@ -75,7 +75,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const
|
||||
|
||||
wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
|
||||
|
||||
// we don't support DC scaling yet, so use scale=1
|
||||
wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased);
|
||||
@ -84,14 +84,14 @@ wxIDirectFBFontPtr wxFont::GetDirectFBFont(bool antialiased) const
|
||||
|
||||
int wxFont::GetPointSize() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetPointSize();
|
||||
}
|
||||
|
||||
wxString wxFont::GetFaceName() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetFaceName();
|
||||
}
|
||||
@ -103,21 +103,21 @@ wxFontFamily wxFont::DoGetFamily() const
|
||||
|
||||
wxFontStyle wxFont::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetStyle();
|
||||
}
|
||||
|
||||
wxFontWeight wxFont::GetWeight() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetWeight();
|
||||
}
|
||||
|
||||
bool wxFont::GetUnderlined() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetUnderlined();
|
||||
}
|
||||
@ -125,21 +125,21 @@ bool wxFont::GetUnderlined() const
|
||||
|
||||
wxFontEncoding wxFont::GetEncoding() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetEncoding();
|
||||
}
|
||||
|
||||
bool wxFont::IsFixedWidth() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->IsFixedWidth();
|
||||
}
|
||||
|
||||
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
|
||||
|
||||
return M_FONTDATA->GetNativeFontInfo();
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ wxDash* wxPen::GetDash() const
|
||||
|
||||
wxPenCap wxPen::GetCap() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
|
||||
|
||||
wxFAIL_MSG( "GetCap not implemented" );
|
||||
return wxCAP_INVALID;
|
||||
@ -163,7 +163,7 @@ wxPenCap wxPen::GetCap() const
|
||||
|
||||
wxPenJoin wxPen::GetJoin() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
|
||||
|
||||
wxFAIL_MSG( "GetJoin not implemented" );
|
||||
return wxJOIN_INVALID;
|
||||
@ -171,28 +171,28 @@ wxPenJoin wxPen::GetJoin() const
|
||||
|
||||
wxPenStyle wxPen::GetStyle() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
|
||||
|
||||
return M_PENDATA->m_style;
|
||||
}
|
||||
|
||||
int wxPen::GetWidth() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
wxColour wxPen::GetColour() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
|
||||
|
||||
return M_PENDATA->m_colour;
|
||||
}
|
||||
|
||||
wxBitmap *wxPen::GetStipple() const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
|
||||
wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
|
||||
|
||||
wxFAIL_MSG( "GetStipple not implemented" );
|
||||
return NULL;
|
||||
|
@ -149,13 +149,13 @@ bool wxRegion::DoUnionWithRect(const wxRect& rect)
|
||||
|
||||
bool wxRegion::DoUnionWithRegion(const wxRegion& region)
|
||||
{
|
||||
wxCHECK_MSG( region.Ok(), false, "invalid region" );
|
||||
wxCHECK_MSG( region.IsOk(), false, "invalid region" );
|
||||
return DoUnionWithRect(M_REGION_OF(region)->m_rect);
|
||||
}
|
||||
|
||||
bool wxRegion::DoIntersect(const wxRegion& region)
|
||||
{
|
||||
wxCHECK_MSG( region.Ok(), false, "invalid region" );
|
||||
wxCHECK_MSG( region.IsOk(), false, "invalid region" );
|
||||
|
||||
AllocExclusive();
|
||||
M_REGION->m_rect.Intersect(M_REGION_OF(region)->m_rect);
|
||||
@ -164,8 +164,8 @@ bool wxRegion::DoIntersect(const wxRegion& region)
|
||||
|
||||
bool wxRegion::DoSubtract(const wxRegion& region)
|
||||
{
|
||||
wxCHECK_MSG( region.Ok(), false, "invalid region" );
|
||||
wxCHECK_MSG( Ok(), false, "invalid region" );
|
||||
wxCHECK_MSG( region.IsOk(), false, "invalid region" );
|
||||
wxCHECK_MSG( IsOk(), false, "invalid region" );
|
||||
|
||||
const wxRect& rect = M_REGION_OF(region)->m_rect;
|
||||
|
||||
@ -190,7 +190,7 @@ bool wxRegion::DoSubtract(const wxRegion& region)
|
||||
|
||||
bool wxRegion::DoXor(const wxRegion& region)
|
||||
{
|
||||
wxCHECK_MSG( region.Ok(), false, "invalid region" );
|
||||
wxCHECK_MSG( region.IsOk(), false, "invalid region" );
|
||||
wxFAIL_MSG( "Xor not implemented" );
|
||||
return false;
|
||||
}
|
||||
@ -202,7 +202,7 @@ bool wxRegion::DoXor(const wxRegion& region)
|
||||
|
||||
wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxOutRegion, "invalid region" );
|
||||
wxCHECK_MSG( IsOk(), wxOutRegion, "invalid region" );
|
||||
|
||||
if (M_REGION->m_rect.Contains(x, y))
|
||||
return wxInRegion;
|
||||
@ -212,7 +212,7 @@ wxRegionContain wxRegion::DoContainsPoint(wxCoord x, wxCoord y) const
|
||||
|
||||
wxRegionContain wxRegion::DoContainsRect(const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), wxOutRegion, "invalid region" );
|
||||
wxCHECK_MSG( IsOk(), wxOutRegion, "invalid region" );
|
||||
|
||||
// 1) is the rectangle entirely covered by the region?
|
||||
if (M_REGION->m_rect.Contains(rect))
|
||||
|
@ -323,7 +323,7 @@ bool wxWindowDFB::SetCursor(const wxCursor& cursor)
|
||||
|
||||
#warning "implement this"
|
||||
#if 0
|
||||
if ( m_cursor.Ok() )
|
||||
if ( m_cursor.IsOk() )
|
||||
DFB_wmSetWindowCursor(m_wnd, *m_cursor.GetDFBCursor());
|
||||
else
|
||||
DFB_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetDFBCursor());
|
||||
|
@ -85,7 +85,7 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const
|
||||
wxIcon wxAboutDialogInfo::GetIcon() const
|
||||
{
|
||||
wxIcon icon = m_icon;
|
||||
if ( !icon.Ok() && wxTheApp )
|
||||
if ( !icon.IsOk() && wxTheApp )
|
||||
{
|
||||
const wxTopLevelWindow * const
|
||||
tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow);
|
||||
@ -196,7 +196,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren
|
||||
wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL);
|
||||
#if wxUSE_STATBMP
|
||||
wxIcon icon = info.GetIcon();
|
||||
if ( icon.Ok() )
|
||||
if ( icon.IsOk() )
|
||||
{
|
||||
sizerIconAndText->Add(new wxStaticBitmap(this, wxID_ANY, icon),
|
||||
wxSizerFlags().Border(wxRIGHT));
|
||||
|
@ -162,7 +162,7 @@ void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry)
|
||||
const wxAcceleratorEntry *
|
||||
wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const
|
||||
{
|
||||
if ( !Ok() )
|
||||
if ( !IsOk() )
|
||||
{
|
||||
// not an error, the accel table is just empty
|
||||
return NULL;
|
||||
|
@ -308,7 +308,7 @@ wxAnimationCtrl::~wxAnimationCtrl()
|
||||
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
|
||||
{
|
||||
wxFileInputStream fis(filename);
|
||||
if (!fis.Ok())
|
||||
if (!fis.IsOk())
|
||||
return false;
|
||||
return Load(fis, type);
|
||||
}
|
||||
|
@ -1002,13 +1002,13 @@ void wxGenericCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
colBg = attr->GetBackgroundColour();
|
||||
}
|
||||
|
||||
if ( colFg.Ok() )
|
||||
if ( colFg.IsOk() )
|
||||
{
|
||||
dc.SetTextForeground(colFg);
|
||||
changedColours = true;
|
||||
}
|
||||
|
||||
if ( colBg.Ok() )
|
||||
if ( colBg.IsOk() )
|
||||
{
|
||||
dc.SetTextBackground(colBg);
|
||||
changedColours = true;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user