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"));
}
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"));
}
// 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
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; }
// 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; }
// 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.
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; }
~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);
}
~wxDCPenChanger()
{
- if ( m_penOld.Ok() )
+ if ( m_penOld.IsOk() )
m_dc.SetPen(m_penOld);
}
~wxDCBrushChanger()
{
- if ( m_brushOld.Ok() )
+ if ( m_brushOld.IsOk() )
m_dc.SetBrush(m_brushOld);
}
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);
}
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); }
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;
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
}
// 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);
}
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; }
/// 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; }
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); }
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; }
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;
{ \
int ind; \
wxIcon icon = wxArtProvider::GetIcon(id, client, size); \
- if ( icon.Ok() ) \
+ if ( icon.IsOk() ) \
ind = images->Add(icon); \
else \
ind = 0; \
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);
#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));
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;
{
wxPaintDC dc(this);
- if ( m_bitmap.Ok() )
+ if ( m_bitmap.IsOk() )
{
PrepareDC(dc);
{
wxPaintDC dc(this);
- if ( m_metafile.Ok() )
+ if ( m_metafile.IsOk() )
{
PrepareDC(dc);
wxBITMAP_TYPE_BMP
#endif
);
- if (!image.Ok())
+ if (!image.IsOk())
{
wxLogError( wxT("Invalid image file...") );
return;
void MyCanvas::OnEraseBackground(wxEraseEvent& event)
{
- if (wxGetApp().GetBackgroundBitmap().Ok())
+ if (wxGetApp().GetBackgroundBitmap().IsOk())
{
wxSize sz = GetClientSize();
wxRect rect(0, 0, sz.x, sz.y);
bool DragShape::Draw(wxDC& dc, bool highlight)
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
wxMemoryDC memDC;
memDC.SelectObject(m_bitmap);
{
destDC.SetClippingRegion(destRect);
- if (wxGetApp().GetBackgroundBitmap().Ok())
+ if (wxGetApp().GetBackgroundBitmap().IsOk())
wxGetApp().TileBitmap(destRect, destDC, wxGetApp().GetBackgroundBitmap());
m_canvas->DrawShapes(destDC);
// 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 );
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 );
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);
case Colour_Background:
{
wxColour col = SelectColour();
- if ( col.Ok() )
+ if ( col.IsOk() )
{
m_backgroundBrush.SetColour(col);
}
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
wxFont font;
font.SetNativeFontInfo(fontInfo);
- if ( !font.Ok() )
+ if ( !font.IsOk() )
{
wxLogError(wxT("Font info string \"%s\" is invalid."),
fontInfo.c_str());
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..."));
}
}
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);
}
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
wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL, false /* !underlined */,
wxEmptyString /* facename */, fontenc);
- if ( font.Ok() )
+ if ( font.IsOk() )
{
DoChangeFont(font);
}
dc.DrawText(fontInfo, x, y);
y += hLine;
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
{
const wxNativeFontInfo *info = m_font.GetNativeFontInfo();
if ( info )
void GridFrame::SetLabelFont( wxCommandEvent& WXUNUSED(ev) )
{
wxFont font = wxGetFontFromUser(this);
- if ( font.Ok() )
+ if ( font.IsOk() )
{
grid->SetLabelFont(font);
}
void GridFrame::SetCellFgColour( wxCommandEvent& WXUNUSED(ev) )
{
wxColour col = wxGetColourFromUser(this);
- if ( col.Ok() )
+ if ( col.IsOk() )
{
grid->SetDefaultCellTextColour(col);
grid->Refresh();
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.
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();
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();
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
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 );
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);
}
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
dc.DrawBitmap(my_toucan_blur, x, y+15, true);
}
- if (my_smile_xbm.Ok())
+ if (my_smile_xbm.IsOk())
{
int x = 300, y = 1800;
memdc.DrawLine( 5, 42, 50, 42 );
memdc.SelectObject( wxNullBitmap );
- if (mono.Ok())
+ if (mono.IsOk())
{
int x = 300, y = 1900;
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 );
}
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);
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 );
}
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;
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"))
if ( name == wxT("Font") )
{
wxFont font = wxANY_AS(value, wxFont);
- wxASSERT( font.Ok() );
+ wxASSERT( font.IsOk() );
m_pPropGridManager->SetFont( font );
}
// 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
fontData << m_value_wxFontData;
wxFont font = fontData.GetChosenFont();
- if ( !font.Ok() )
+ if ( !font.IsOk() )
font = wxFont(10,wxSWISS,wxNORMAL,wxNORMAL);
m_value = WXVARIANT(font);
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);
}
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
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;
// 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;
bitmap = wxBitmap(mobile_xpm);
bool ok = frame->m_isPda
- ? bitmap.Ok()
+ ? bitmap.IsOk()
: bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG);
if (ok)
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)
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?"),
{
wxString msg;
wxString facename(wxT("unknown"));
- if (attr.GetFont().Ok())
+ if (attr.GetFont().IsOk())
{
facename = attr.GetFont().GetFaceName();
}
{
// 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));
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);
}
#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
}
wxImage image(filepath);
- if ( image.Ok() )
+ if ( image.IsOk() )
{
// Rescale very large images
int ow = image.GetWidth();
return;
wxImage image(filepath);
- if (! image.Ok() )
+ if (! image.IsOk() )
{
wxLogMessage("Reading image from file '%s' failed.", filepath.c_str());
return;
// 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;
{
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;
void WidgetsFrame::OnSetPageBg(wxCommandEvent& WXUNUSED(event))
{
wxColour col = GetColourFromUser(this, GetBackgroundColour());
- if ( !col.Ok() )
+ if ( !col.IsOk() )
return;
CurrentPage()->SetBackgroundColour(col);
#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;
WX_NSImage wxBitmap::GetNSImage(bool useMask) const
{
- if(!Ok())
+ if(!IsOk())
return nil;
NSImage *nsimage = [[[NSImage alloc]
initWithSize:NSMakeSize(GetWidth(), GetHeight())] autorelease];
wxImage image;
if(!image.LoadFile(filename,type))
return false;
- if(!image.Ok())
+ if(!image.IsOk())
return false;
*this = wxBitmap(image);
return true;
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
{
wxAutoNSAutoreleasePool pool;
- if(!Ok())
+ if(!IsOk())
return wxNullBitmap;
NSImage *nsimage = GetNSImage(false);
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);
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();
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{
- if(!Ok())
+ if(!IsOk())
return NULL;
NSBitmapImageRep *bitmapRep = M_BITMAPDATA->m_cocoaNSBitmapImageRep;
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();
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();
}
{
wxAutoNSAutoreleasePool pool;
if(!CocoaTakeFocus()) return;
- if(!bmp.Ok())
+ if(!bmp.IsOk())
return;
#if 0
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;
};
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{
wxAutoNSAutoreleasePool pool;
- if(m_selectedBitmap.Ok())
+ if(m_selectedBitmap.IsOk())
{
CocoaTakeFocus();
wxASSERT(m_cocoaNSImage);
[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]
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];
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->m_info.pointSize;
}
wxFontStyle wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->m_info.style;
}
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;
}
{
wxBitmap bitmap(xpm);
CopyFromBitmap(bitmap);
- return Ok();
+ return IsOk();
}
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)
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;
}
}
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)];
}
}
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
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)
#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
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();
// wxString -> wxColour conversion
wxColour col(m_text->GetValue());
- if ( !col.Ok() )
+ if ( !col.IsOk() )
return; // invalid user input
if (M_PICKER->GetColour() != col)
{
m_nativeData->TransferFrom( *this );
- return m_nativeData->Ok();
+ return m_nativeData->IsOk();
}
// ----------------------------------------------------------------------------
// 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);
// 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 )
{
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;
// 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();
{
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;
// 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
dc.DrawRectangle(rect);
}
- if ( !m_bmpNormal.Ok() )
+ if ( !m_bmpNormal.IsOk() )
{
if ( flags & Button_BitmapOnly )
return;
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;
{
wxSize best;
wxBitmap bmp = GetBitmap();
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
best = wxSize(bmp.GetWidth(), bmp.GetHeight());
else
// this is completely arbitrary
GetMultiLineTextExtent(text, &widthText, &heightText, &heightLine);
wxCoord width, height;
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
width = widthText + bitmap.GetWidth();
height = bitmap.GetHeight();
wxCoord x0 = x,
y0 = y,
width0 = width;
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
DrawBitmap(bitmap, x, y, true /* use mask */);
////////////////////code here
m_outfile = new wxFileOutputStream(filename);
- m_OK = m_outfile->Ok();
+ m_OK = m_outfile->IsOk();
if (m_OK)
{
m_filename = filename;
{
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();
}
preview = new wxPrintPreview(printout,
view->OnCreatePrintout(),
&printDialogData);
- if ( !preview->Ok() )
+ if ( !preview->IsOk() )
{
delete preview;
wxLogError(_("Print preview creation failed."));
#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;
// 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)
return;
wxMemoryOutputStream mems;
- if ( image.Ok() && image.SaveFile(mems, type) )
+ if ( image.IsOk() && image.SaveFile(mems, type) )
{
m_Hash[filename] = new wxMemoryFSFile
(
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;
static wxColour s_col;
s_col = Find(name);
- if ( !s_col.Ok() )
+ if ( !s_col.IsOk() )
return NULL;
return new wxColour(s_col);
wxPen* pen = NULL;
wxPen penTmp(colour, width, style);
- if (penTmp.Ok())
+ if (penTmp.IsOk())
{
pen = new wxPen(penTmp);
list.Append(pen);
wxBrush* brush = NULL;
wxBrush brushTmp(colour, style);
- if (brushTmp.Ok())
+ if (brushTmp.IsOk())
{
brush = new wxBrush(brushTmp);
list.Append(brush);
// 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);
image->Create(sz.GetWidth(), sz.GetHeight());
image->SetType(wxBITMAP_TYPE_GIF);
- if (!image->Ok())
+ if (!image->IsOk())
return false;
pal = GetPalette(frame);
bool wxGLCanvasBase::SetColour(const wxString& colour)
{
wxColour col = wxTheColourDatabase->Find(colour);
- if ( !col.Ok() )
+ if ( !col.IsOk() )
return false;
#ifdef wxHAS_OPENGL_ES
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 ) );
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 ) );
void wxGraphicsContext::SetFont( const wxFont& font, const wxColour& colour )
{
- if ( font.Ok() )
+ if ( font.IsOk() )
SetFont( CreateFont( font, colour ) );
else
SetFont( wxNullGraphicsFont );
if ( type == wxBITMAP_TYPE_ICON_RESOURCE )
{
wxIcon tmp(file, type);
- if (tmp.Ok())
+ if (tmp.IsOk())
{
AddIcon(tmp);
return;
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;
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() )
{
{
wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") );
- if ( !image->Ok() )
+ if ( !image->IsOk() )
{
if ( verbose )
{
// 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);
// 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 )
{
wxXPMDecoder decoder;
(*this) = decoder.ReadData(xpmData);
- return Ok();
+ return IsOk();
#else
return false;
#endif
{
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;
{
wxImage image;
- wxCHECK_MSG( Ok(), image, wxT("invalid image") );
+ wxCHECK_MSG( IsOk(), image, wxT("invalid image") );
image.m_refData = CloneRefData(m_refData);
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,
{
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,
{
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();
{
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();
{
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;
{
wxImage image(MakeEmptyClone());
- wxCHECK( image.Ok(), image );
+ wxCHECK( image.IsOk(), image );
long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width;
{
wxImage image(MakeEmptyClone());
- wxCHECK( image.Ok(), image );
+ wxCHECK( image.IsOk(), image );
long height = M_IMGDATA->m_height;
long width = M_IMGDATA->m_width;
{
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()),
{
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();
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();
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();
{
wxImage image(MakeEmptyClone());
- wxCHECK( image.Ok(), image );
+ wxCHECK( image.IsOk(), image );
const unsigned char *src = M_IMGDATA->m_data;
unsigned char *dest = image.GetData();
{
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 );
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;
}
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 )
{
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();
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();
void wxImage::SetAlpha( unsigned char *alpha, bool static_data )
{
- wxCHECK_RET( Ok(), wxT("invalid image") );
+ wxCHECK_RET( IsOk(), wxT("invalid image") );
AllocExclusive();
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;
}
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();
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)
{
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();
bool wxImage::HasMask() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid image") );
return M_IMGDATA->m_hasMask;
}
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();
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);
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);
{
#if HAS_FILE_STREAMS
wxImageFileInputStream stream(name);
- if (stream.Ok())
+ if (stream.IsOk())
return GetImageCount(stream, type);
#endif
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 )
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 )
// create the image
image->Create(GetWidth(), GetHeight());
- if (!image->Ok())
+ if (!image->IsOk())
return false;
unsigned char *pal = GetPalette();
}
(cinfo.src->term_source)(&cinfo);
jpeg_destroy_decompress(&cinfo);
- if (image->Ok()) image->Destroy();
+ if (image->IsOk()) image->Destroy();
return false;
}
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;
image->Create(width, height);
- if (!image->Ok())
+ if (!image->IsOk())
return wxPCX_MEMERR;
if ((p = (unsigned char *) malloc(bytesperline * nplanes)) == NULL)
// according to PCX specs) and allocate space for one complete
// scanline.
- if (!image->Ok())
+ if (!image->IsOk())
return wxPCX_INVFORMAT;
width = image->GetWidth();
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
wxLogError(_("Couldn't load a PNG image - file is corrupted or not enough memory."));
}
- if ( image->Ok() )
+ if ( image->IsOk() )
{
image->Destroy();
}
image->Create(width, height);
- if (!image->Ok())
+ if (!image->IsOk())
{
return wxTGA_MEMERR;
}
}
image->Create( (int)w, (int)h );
- if (!image->Ok())
+ if (!image->IsOk())
{
if (verbose)
{
wxXPMDecoder decoder;
wxImage img = decoder.ReadFile(stream);
- if ( !img.Ok() )
+ if ( !img.IsOk() )
return false;
*image = img;
return true;
bool wxOverlayImpl::IsOk()
{
- return m_bmpSaved.Ok() ;
+ return m_bmpSaved.IsOk() ;
}
void wxOverlayImpl::Init( wxDC* dc, int x , int y , int width , int height )
}
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);
}
}
{
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);
bool wxPrintPreview::IsOk() const
{
- return m_pimpl->Ok();
+ return m_pimpl->IsOk();
}
void wxPrintPreview::SetOk(bool ok)
if (flags & wxQUANTIZE_FILL_DESTINATION_IMAGE)
{
- if (!dest.Ok())
+ if (!dest.IsOk())
dest.Create(w, h);
imgdt = dest.GetData();
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;
delete addr;
- if (!m_server->Ok())
+ if (!m_server->IsOk())
{
m_server->Destroy();
m_server = NULL;
wxSocketBase *sock = server->Accept();
if (!sock)
return;
- if (!sock->Ok())
+ if (!sock->IsOk())
{
sock->Destroy();
return;
{
#if wxUSE_IMAGE
out = in.ConvertToGreyscale();
- if ( out.Ok() )
+ if ( out.IsOk() )
return true;
#endif // wxUSE_IMAGE
return false;
{
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;
// 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)
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());
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();
}
// 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);
wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption)
{
wxFontData data;
- if ( fontInit.Ok() )
+ if ( fontInit.IsOk() )
{
data.SetInitialFont(fontInit);
}
// 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;
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;
m_inheritBgCol = m_hasBgCol;
m_backgroundColour = colour;
- SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.Ok() );
+ SetThemeEnabled( !m_hasBgCol && !m_foregroundColour.IsOk() );
return true;
}
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;
}
ffile = static_cast<wxFFileInputStream*>(m_parent_i_stream);
wxZipEntryPtr_ entry;
- if (ffile->Ok()) {
+ if (ffile->IsOk()) {
do {
entry.reset(GetNextEntry());
}
// 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" );
#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);
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;
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{
- wxCHECK_MSG( Ok(), NULL, "invalid bitmap" );
+ wxCHECK_MSG( IsOk(), NULL, "invalid bitmap" );
AllocExclusive();
bool wxBitmap::HasAlpha() const
{
- wxCHECK_MSG( Ok(), false, "invalid bitmap" );
+ wxCHECK_MSG( IsOk(), false, "invalid bitmap" );
return M_BITMAP->m_surface->GetPixelFormat() == DSPF_ARGB;
}
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);
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);
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;
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(),
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;
#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);
image.SetPalette(*palette);
#endif // wxUSE_PALETTE
- if ( image.Ok() )
+ if ( image.IsOk() )
return image.SaveFile(filename, type);
else
{
#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);
}
wxIDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BITMAP->m_surface;
}
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;
}
// 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);
}
// 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);
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)
{
wxCHECK_RET( IsOk(), wxT("invalid dc") );
- wxFont f(font.Ok() ? font : DEFAULT_FONT);
+ wxFont f(font.IsOk() ? font : DEFAULT_FONT);
wxFont oldfont(m_font);
{
wxCHECK_RET( IsOk(), wxT("invalid dc") );
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_backgroundBrush = brush;
}
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);
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);
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 )
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(),
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()
{
m_bmp = bitmap;
- if ( !bitmap.Ok() )
+ if ( !bitmap.IsOk() )
{
// select the bitmap out of the DC
m_surface = NULL;
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);
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();
}
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();
}
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();
}
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;
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;
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;
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);
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;
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;
}
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;
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))
#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());
wxIcon wxAboutDialogInfo::GetIcon() const
{
wxIcon icon = m_icon;
- if ( !icon.Ok() && wxTheApp )
+ if ( !icon.IsOk() && wxTheApp )
{
const wxTopLevelWindow * const
tlw = wxDynamicCast(wxTheApp->GetTopWindow(), wxTopLevelWindow);
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));
const wxAcceleratorEntry *
wxAcceleratorTable::GetEntry(const wxKeyEvent& event) const
{
- if ( !Ok() )
+ if ( !IsOk() )
{
// not an error, the accel table is just empty
return NULL;
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
{
wxFileInputStream fis(filename);
- if (!fis.Ok())
+ if (!fis.IsOk())
return false;
return Load(fis, type);
}
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;
for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
{
wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]);
- if (col.Ok())
+ if (col.IsOk())
m_standardColours[i].Set(col.Red(), col.Green(), col.Blue());
else
m_standardColours[i].Set(0, 0, 0);
for (i = 0; i < WXSIZEOF(m_customColours); i++)
{
wxColour c = m_colourData.GetCustomColour(i);
- if (c.Ok())
+ if (c.IsOk())
m_customColours[i] = m_colourData.GetCustomColour(i);
else
m_customColours[i] = wxColour(255, 255, 255);
}
wxColour curr = m_colourData.GetColour();
- if ( curr.Ok() )
+ if ( curr.IsOk() )
{
bool m_initColourFound = false;
bool wxDataViewBitmapRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state) )
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
dc->DrawBitmap( m_bitmap, cell.x, cell.y );
- else if (m_icon.Ok())
+ else if (m_icon.IsOk())
dc->DrawIcon( m_icon, cell.x, cell.y );
return true;
wxSize wxDataViewBitmapRenderer::GetSize() const
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
return wxSize( m_bitmap.GetWidth(), m_bitmap.GetHeight() );
- else if (m_icon.Ok())
+ else if (m_icon.IsOk())
return wxSize( m_icon.GetWidth(), m_icon.GetHeight() );
return wxSize(wxDVC_DEFAULT_RENDERER_SIZE,wxDVC_DEFAULT_RENDERER_SIZE);
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
- if (!bitmap.Ok()) return;
+ if (!bitmap.IsOk()) return;
wxImage image = bitmap.ConvertToImage();
- if (!image.Ok()) return;
+ if (!image.IsOk()) return;
wxCoord w = image.GetWidth();
wxCoord h = image.GetHeight();
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
- if (!font.Ok()) return;
+ if (!font.IsOk()) return;
m_font = font;
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
- if (!pen.Ok()) return;
+ if (!pen.IsOk()) return;
int oldStyle = m_pen.GetStyle();
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_brush = brush;
if ( !textbuf )
return;
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
unsigned char blue = m_textForegroundColour.Blue();
SetFont( m_font );
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
unsigned char blue = m_textForegroundColour.Blue();
wxCoord wxPostScriptDCImpl::GetCharHeight() const
{
- if (m_font.Ok())
+ if (m_font.IsOk())
return m_font.GetPointSize();
else
return 12;
/ example:
/
/ wxPostScriptDC dc(NULL, true);
- / if (dc.Ok()){
+ / if (dc.IsOk()){
/ wxSetAFMPath("d:\\wxw161\\afm\\");
/ dc.StartDoc("Test");
/ dc.StartPage();
delete ft;
- if ( !ic.Ok() )
+ if ( !ic.IsOk() )
{
int newid = file;
m_HashTable->Put(extension, new wxFileIconEntry(newid));
wxBitmap bmp;
bmp.CopyFromIcon(ic);
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
int newid = file;
m_HashTable->Put(extension, new wxFileIconEntry(newid));
m_isDirty = false;
m_isDirty = false;
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
{
m_oldCursor = window->GetCursor();
window->SetCursor(m_cursor);
#ifndef wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
- if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y))
+ if (!backing->IsOk() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y))
(*backing) = wxBitmap(clientSize.x, clientSize.y);
#endif // !wxHAS_NATIVE_OVERLAY
#endif
m_window->ReleaseMouse();
- if (m_cursor.Ok() && m_oldCursor.Ok())
+ if (m_cursor.IsOk() && m_oldCursor.IsOk())
{
m_window->SetCursor(m_oldCursor);
}
DoDrawImage(*m_windowDC, newPos);
#else // !wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
- if (!backing->Ok())
+ if (!backing->IsOk())
return false;
wxRect oldRect(GetImageRect(oldPos));
// keep reallocating all the time.
int excess = 50;
- if (!m_repairBitmap.Ok() || (m_repairBitmap.GetWidth() < fullRect.GetWidth() || m_repairBitmap.GetHeight() < fullRect.GetHeight()))
+ if (!m_repairBitmap.IsOk() || (m_repairBitmap.GetWidth() < fullRect.GetWidth() || m_repairBitmap.GetHeight() < fullRect.GetHeight()))
{
m_repairBitmap = wxBitmap(fullRect.GetWidth() + excess, fullRect.GetHeight() + excess);
}
// Override this if you are using a virtual image (drawing your own image)
bool wxGenericDragImage::DoDrawImage(wxDC& dc, const wxPoint& pos) const
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
dc.DrawBitmap(m_bitmap, pos.x, pos.y, (m_bitmap.GetMask() != 0));
return true;
}
- else if (m_icon.Ok())
+ else if (m_icon.IsOk())
{
dc.DrawIcon(m_icon, pos.x, pos.y);
return true;
// Override this if you are using a virtual image (drawing your own image)
wxRect wxGenericDragImage::GetImageRect(const wxPoint& pos) const
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
return wxRect(pos.x, pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight());
}
- else if (m_icon.Ok())
+ else if (m_icon.IsOk())
{
return wxRect(pos.x, pos.y, m_icon.GetWidth(), m_icon.GetHeight());
}
if (IsLink())
{
wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") );
- if ( dg.Ok() )
+ if ( dg.IsOk() )
item.SetTextColour(dg);
}
item.m_data = wxPtrToUInt(this);
dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(0, 0, size.x, size.y);
- if ( font.Ok() )
+ if ( font.IsOk() )
{
dc.SetFont(font);
dc.SetTextForeground(GetForegroundColour());
int fontSize = 12;
bool fontUnderline = false;
- if (m_fontData.m_initialFont.Ok())
+ if (m_fontData.m_initialFont.IsOk())
{
fontFamily = m_fontData.m_initialFont.GetFamily();
fontWeight = m_fontData.m_initialFont.GetWeight();
if ( !m_colourChoice->GetStringSelection().empty() )
{
wxColour col = wxTheColourDatabase->Find(m_colourChoice->GetStringSelection());
- if (col.Ok())
+ if (col.IsOk())
{
m_fontData.m_fontColour = col;
}
}
// Update color here so that we can also use the color originally passed in
// (EnableEffects may be false)
- if (m_fontData.m_fontColour.Ok())
+ if (m_fontData.m_fontColour.IsOk())
m_previewer->SetForegroundColour(m_fontData.m_fontColour);
m_previewer->Refresh();
void wxGenericFontButton::UpdateFont()
{
- if ( !m_selectedFont.Ok() )
+ if ( !m_selectedFont.IsOk() )
return;
SetForegroundColour(m_data.GetColour());
{
/*
wxBitmap* bmp = pen.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
wxDELETE( m_penImage );
wxDELETE( m_penBrush );
else
{
wxBitmap* bmp = brush.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
wxDELETE( m_brushImage );
m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),(HPALETTE)bmp->GetPalette()->GetHPALETTE());
wxGraphicsPen wxCairoRenderer::CreatePen(const wxPen& pen)
{
- if ( !pen.Ok() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
+ if ( !pen.IsOk() || pen.GetStyle() == wxPENSTYLE_TRANSPARENT )
return wxNullGraphicsPen;
else
{
wxGraphicsBrush wxCairoRenderer::CreateBrush(const wxBrush& brush )
{
- if ( !brush.Ok() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
+ if ( !brush.IsOk() || brush.GetStyle() == wxBRUSHSTYLE_TRANSPARENT )
return wxNullGraphicsBrush;
else
{
// sets the font
wxGraphicsFont wxCairoRenderer::CreateFont( const wxFont &font , const wxColour &col )
{
- if ( font.Ok() )
+ if ( font.IsOk() )
{
wxGraphicsFont p;
p.SetRefData(new wxCairoFontData( this , font, col ));
wxGraphicsBitmap wxCairoRenderer::CreateBitmap( const wxBitmap& bmp )
{
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
wxGraphicsBitmap p;
p.SetRefData(new wxCairoBitmapData( this , bmp ));
else
{
// restore the standard colours fonts
- if ( m_colFgOld.Ok() )
+ if ( m_colFgOld.IsOk() )
{
m_control->SetForegroundColour(m_colFgOld);
m_colFgOld = wxNullColour;
}
- if ( m_colBgOld.Ok() )
+ if ( m_colBgOld.IsOk() )
{
m_control->SetBackgroundColour(m_colBgOld);
m_colBgOld = wxNullColour;
// Workaround for GTK+1 font setting problem on some platforms
#if !defined(__WXGTK__) || defined(__WXGTK20__)
- if ( m_fontOld.Ok() )
+ if ( m_fontOld.IsOk() )
{
m_control->SetFont(m_fontOld);
m_fontOld = wxNullFont;
m_htmlParser->SetDC(new wxClientDC(self));
m_htmlParser->SetFS(&self->m_filesystem);
#if !wxUSE_UNICODE
- if (GetFont().Ok())
+ if (GetFont().IsOk())
m_htmlParser->SetInputEncoding(GetFont().GetEncoding());
#endif
// use system's default GUI font by default:
int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
{
wxBitmap bmp(bitmap);
- if (mask.Ok())
+ if (mask.IsOk())
bmp.SetMask(new wxMask(mask));
return Add(bmp);
}
m_images.Insert( next, newBitmap );
}
- if (mask.Ok())
+ if (mask.IsOk())
newBitmap->SetMask(new wxMask(mask));
return true;
// This may very well fail if there are insufficient colours available.
// Degrade gracefully.
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
loadedIcons = false;
wxImage imgSrc(bitmap.ConvertToImage());
imgSrc.SetMask(false);
wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue()));
- if ( !image.Ok() )
+ if ( !image.IsOk() )
return false;
m_bitmap = wxBitmap(image, 1);
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
#else // !wxUSE_IMAGE
wxUnusedVar(bitmap);
wxUnusedVar(colour);
bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap)
{
- wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap") );
+ wxCHECK_MSG( bitmap.IsOk(), false, wxT("Invalid bitmap") );
wxCHECK_MSG( bitmap.GetDepth() == 1, false, wxT("Cannot create mask from colour bitmap") );
m_bitmap = bitmap;
// native hot-tracking line (on XP)
const int penwidth = 3;
int y = rect.y + rect.height + 1 - penwidth;
- wxColour c = (params && params->m_selectionColour.Ok()) ?
+ wxColour c = (params && params->m_selectionColour.IsOk()) ?
params->m_selectionColour : wxColour(0x66, 0x66, 0x66);
wxPen pen(c, penwidth);
pen.SetCap(wxCAP_BUTT);
triPt[2].y = ar.height;
}
- wxColour c = (params && params->m_arrowColour.Ok()) ?
+ wxColour c = (params && params->m_arrowColour.IsOk()) ?
params->m_arrowColour : wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW);
wxDCPenChanger setPen(dc, c);
int bmpWidth = 0;
// draw the bitmap if there is one
- if ( params && params->m_labelBitmap.Ok() )
+ if ( params && params->m_labelBitmap.IsOk() )
{
int w = params->m_labelBitmap.GetWidth();
int h = params->m_labelBitmap.GetHeight();
const int margin = 5; // number of pixels to reserve on either side of the label
labelWidth += 2*margin;
- wxFont font = params->m_labelFont.Ok() ?
+ wxFont font = params->m_labelFont.IsOk() ?
params->m_labelFont : win->GetFont();
- wxColour clr = params->m_labelColour.Ok() ?
+ wxColour clr = params->m_labelColour.IsOk() ?
params->m_labelColour : win->GetForegroundColour();
wxString label( params->m_labelText );
void wxSplashScreenWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
wxDrawSplashBitmap(dc, m_bitmap, 0, 0);
}
void wxSplashScreenWindow::OnEraseBackground(wxEraseEvent& event)
{
- if (event.GetDC() && m_bitmap.Ok())
+ if (event.GetDC() && m_bitmap.IsOk())
{
wxDrawSplashBitmap(* event.GetDC(), m_bitmap, 0, 0);
}
else
{
wxClientDC dc(this);
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
wxDrawSplashBitmap(dc, m_bitmap, 0, 0);
}
}
void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap )
{
m_searchBitmap = bitmap;
- m_searchBitmapUser = bitmap.Ok();
+ m_searchBitmapUser = bitmap.IsOk();
if ( m_searchBitmapUser )
{
if ( m_searchButton && !HasMenu() )
void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap )
{
m_searchMenuBitmap = bitmap;
- m_searchMenuBitmapUser = bitmap.Ok();
+ m_searchMenuBitmapUser = bitmap.IsOk();
if ( m_searchMenuBitmapUser )
{
if ( m_searchButton && m_menu )
void wxSearchCtrl::SetCancelBitmap( const wxBitmap& bitmap )
{
m_cancelBitmap = bitmap;
- m_cancelBitmapUser = bitmap.Ok();
+ m_cancelBitmapUser = bitmap.IsOk();
if ( m_cancelBitmapUser )
{
if ( m_cancelButton )
if ( !m_searchBitmapUser )
{
if (
- !m_searchBitmap.Ok() ||
+ !m_searchBitmap.IsOk() ||
m_searchBitmap.GetHeight() != bitmapHeight ||
m_searchBitmap.GetWidth() != bitmapWidth
)
if ( !m_searchMenuBitmapUser )
{
if (
- !m_searchMenuBitmap.Ok() ||
+ !m_searchMenuBitmap.IsOk() ||
m_searchMenuBitmap.GetHeight() != bitmapHeight ||
m_searchMenuBitmap.GetWidth() != bitmapWidth
)
if ( !m_cancelBitmapUser )
{
if (
- !m_cancelBitmap.Ok() ||
+ !m_cancelBitmap.IsOk() ||
m_cancelBitmap.GetHeight() != bitmapHeight ||
m_cancelBitmap.GetWidth() != bitmapHeight
)
);
#if wxUSE_STATBMP
- if ( m_bitmap.Ok() )
+ if ( m_bitmap.IsOk() )
{
wxSize bitmapSize(wxDefaultSize);
if (GetBitmapPlacement())
if ( m_statbmp )
{
bmp = m_page->GetBitmap();
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
bmp = m_bitmap;
- if ( !bmpPrev.Ok() )
+ if ( !bmpPrev.IsOk() )
bmpPrev = m_bitmap;
if (!GetBitmapPlacement())
if (!GetBitmapPlacement())
return false;
- if (bmp.Ok())
+ if (bmp.IsOk())
{
wxSize pageSize = m_sizerPage->GetSize();
if (pageSize == wxSize(0,0))
int bitmapWidth = wxMax(bmp.GetWidth(), GetMinimumBitmapWidth());
int bitmapHeight = pageSize.y;
- if (!m_statbmp->GetBitmap().Ok() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight)
+ if (!m_statbmp->GetBitmap().IsOk() || m_statbmp->GetBitmap().GetHeight() != bitmapHeight)
{
wxBitmap bitmap(bitmapWidth, bitmapHeight);
{
gtk_about_dialog_set_license(dlg, NULL);
wxIcon icon = info.GetIcon();
- if ( icon.Ok() )
+ if ( icon.IsOk() )
gtk_about_dialog_set_logo(dlg, info.GetIcon().GetPixbuf());
if ( info.HasWebSite() )
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
void wxColourDialog::ColourDataToDialog()
{
const GdkColor * const
- col = m_data.GetColour().Ok() ? m_data.GetColour().GetColor()
+ col = m_data.GetColour().IsOk() ? m_data.GetColour().GetColor()
: NULL;
#if wxUSE_LIBHILDON
for (unsigned i = 0; i < 16; i++)
{
wxColour c = m_data.GetCustomColour(i);
- if (c.Ok())
+ if (c.IsOk())
{
colors[n_colors] = *c.GetColor();
n_colors++;
m_data.SetColour(*clr);
#elif wxUSE_LIBHILDON2 // !wxUSE_LIBHILDON
const GdkColor * const
- col = m_data.GetColour().Ok() ? m_data.GetColour().GetColor() : NULL;
+ col = m_data.GetColour().IsOk() ? m_data.GetColour().GetColor() : NULL;
GdkColor clr;
if (col)
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return wxByte(M_COLDATA->m_red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return wxByte(M_COLDATA->m_green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return wxByte(M_COLDATA->m_blue >> SHIFT);
}
unsigned char wxColour::Alpha() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return M_COLDATA->m_alpha;
}
void wxColour::CalcPixel( GdkColormap *cmap )
{
- if (!Ok()) return;
+ if (!IsOk()) return;
M_COLDATA->AllocColour( cmap );
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return M_COLDATA->m_color.pixel;
}
const GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") );
return &M_COLDATA->m_color;
}
if (gs_busyCount++ > 0)
return;
- wxASSERT_MSG( !gs_savedCursor.Ok(),
+ wxASSERT_MSG( !gs_savedCursor.IsOk(),
wxT("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
m_bitmap = wxBitmap(image);
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
}
void wxBitmapDataObject::DoConvertToPng()
{
- if ( !m_bitmap.Ok() )
+ if ( !m_bitmap.IsOk() )
return;
wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,
{
wxDataViewColumnBase::SetBitmap( bitmap );
- if (bitmap.Ok())
+ if (bitmap.IsOk())
{
GtkImage *gtk_image = GTK_IMAGE(m_image);
Destroy();
m_selected = bitmap;
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
m_gdkwindow = m_selected.GetPixmap();
void wxMemoryDCImpl::SetPen( const wxPen& penOrig )
{
wxPen pen( penOrig );
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetDepth() == 1 &&
(pen != *wxTRANSPARENT_PEN) )
{
void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig )
{
wxBrush brush( brushOrig );
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetDepth() == 1 &&
(brush != *wxTRANSPARENT_BRUSH) )
{
{
wxBrush brush(brushOrig);
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetDepth() == 1 &&
(brush != *wxTRANSPARENT_BRUSH) )
{
void wxMemoryDCImpl::SetTextForeground( const wxColour& col )
{
- if ( m_selected.Ok() && m_selected.GetDepth() == 1 )
+ if ( m_selected.IsOk() && m_selected.GetDepth() == 1 )
wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
else
wxWindowDCImpl::SetTextForeground( col );
void wxMemoryDCImpl::SetTextBackground( const wxColour &col )
{
- if (m_selected.Ok() && m_selected.GetDepth() == 1)
+ if (m_selected.IsOk() && m_selected.GetDepth() == 1)
wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
else
wxWindowDCImpl::SetTextBackground( col );
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (width) (*width) = m_selected.GetWidth();
if (height) (*height) = m_selected.GetHeight();
m_iconMove = iconMove;
m_iconNone = iconNone;
- if ( !m_iconCopy.Ok() )
+ if ( !m_iconCopy.IsOk() )
m_iconCopy = wxIcon(page_xpm);
- if ( !m_iconMove.Ok() )
+ if ( !m_iconMove.IsOk() )
m_iconMove = m_iconCopy;
- if ( !m_iconNone.Ok() )
+ if ( !m_iconNone.IsOk() )
m_iconNone = m_iconCopy;
}
G_CALLBACK (gtk_fontdialog_delete_callback), this);
wxFont font = m_fontData.GetInitialFont();
- if( font.Ok() )
+ if( font.IsOk() )
{
const wxNativeFontInfo *info = font.GetNativeFontInfo();
wxCoord x, wxCoord y,
bool WXUNUSED(useMask))
{
- if (!bitmap.Ok()) return;
+ if (!bitmap.IsOk()) return;
if (bitmap.HasPixbuf())
{
{
wxImage image = bitmap.ConvertToImage();
- if (!image.Ok()) return;
+ if (!image.IsOk()) return;
gs_libGnomePrint->gnome_print_gsave( m_gpc );
double matrix[6];
double xx = XLOG2DEV(x);
double yy = YLOG2DEV(y);
- bool underlined = m_font.Ok() && m_font.GetUnderlined();
+ bool underlined = m_font.IsOk() && m_font.GetUnderlined();
const wxScopedCharBuffer data(text.utf8_str());
pango_attr_list_unref(attrs);
}
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
unsigned char blue = m_textForegroundColour.Blue();
{
m_font = font;
- if (m_font.Ok())
+ if (m_font.IsOk())
{
if (m_fontdesc)
pango_font_description_free( m_fontdesc );
void wxGnomePrinterDCImpl::SetPen( const wxPen& pen )
{
- if (!pen.Ok()) return;
+ if (!pen.IsOk()) return;
m_pen = pen;
void wxGnomePrinterDCImpl::SetBrush( const wxBrush& brush )
{
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_brush = brush;
void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style)
{
- if (m_hasBgCol && m_backgroundColour.Ok())
+ if (m_hasBgCol && m_backgroundColour.IsOk())
{
GdkWindow *window = gtk_tree_view_get_bin_window(m_treeview);
if (window)
int wxPen::GetDashes( wxDash **ptr ) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = (wxDash*)M_PENDATA->m_dash;
return M_PENDATA->m_countDashes;
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return (M_PENDATA->m_countDashes);
}
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return (wxDash*)M_PENDATA->m_dash;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_capStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_joinStyle;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_width;
}
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour;
}
angle = -angle;
- bool underlined = m_font.Ok() && m_font.GetUnderlined();
+ bool underlined = m_font.IsOk() && m_font.GetUnderlined();
const wxScopedCharBuffer data = text.utf8_str();
pango_attr_list_unref(attrs);
}
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
unsigned char red = m_textForegroundColour.Red();
unsigned char blue = m_textForegroundColour.Blue();
{
m_font = font;
- if (m_font.Ok())
+ if (m_font.IsOk())
{
if (m_fontdesc)
pango_font_description_free( m_fontdesc );
void wxGtkPrinterDCImpl::SetPen( const wxPen& pen )
{
- if (!pen.Ok()) return;
+ if (!pen.IsOk()) return;
m_pen = pen;
void wxGtkPrinterDCImpl::SetBrush( const wxBrush& brush )
{
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_brush = brush;
bool wxRegion::DoUnionWithRegion( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
case wxSYS_SYSTEM_FONT:
case wxSYS_DEVICE_DEFAULT_FONT:
case wxSYS_DEFAULT_GUI_FONT:
- if (!gs_fontSystem.Ok())
+ if (!gs_fontSystem.IsOk())
{
wxNativeFontInfo info;
info.description = ButtonStyle()->font_desc;
m_widget = gtk_image_new();
g_object_ref(m_widget);
- if (bitmap.Ok())
+ if (bitmap.IsOk())
SetBitmap(bitmap);
PostCreation(size);
{
m_bitmap = bitmap;
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
// always use pixbuf, because pixmap mask does not
// work with disabled images in some themes
// disabled and enabled mode, or we end up with a different colour under the
// text.
wxColour oldColour = GetBackgroundColour();
- if (oldColour.Ok())
+ if (oldColour.IsOk())
{
// Need to set twice or it'll optimize the useful stuff out
if (oldColour == * wxWHITE)
if ( !wxControl::SetBackgroundColour( colour ) )
return false;
- if (!m_backgroundColour.Ok())
+ if (!m_backgroundColour.IsOk())
return false;
// change active background color too
void wxBitmapToggleButton::OnSetBitmap()
{
- if (!m_bitmap.Ok()) return;
+ if (!m_bitmap.IsOk()) return;
GtkWidget* image = gtk_bin_get_child(GTK_BIN(m_widget));
if (image == NULL)
{
wxSize best;
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
int border = HasFlag(wxNO_BORDER) ? 4 : 10;
best.x = m_bitmap.GetWidth()+border;
wxCHECK_MSG( (m_widget != NULL), 12, wxT("invalid window") );
wxFont font = GetFont();
- wxCHECK_MSG( font.Ok(), 12, wxT("invalid font") );
+ wxCHECK_MSG( font.IsOk(), 12, wxT("invalid font") );
PangoContext* context = gtk_widget_get_pango_context(m_widget);
wxCHECK_MSG( (m_widget != NULL), 8, wxT("invalid window") );
wxFont font = GetFont();
- wxCHECK_MSG( font.Ok(), 8, wxT("invalid font") );
+ wxCHECK_MSG( font.IsOk(), 8, wxT("invalid font") );
PangoContext* context = gtk_widget_get_pango_context(m_widget);
{
wxFont fontToUse = theFont ? *theFont : GetFont();
- wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
+ wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") );
if (string.empty())
{
bool wxWindowGTK::SetCursor( const wxCursor &cursor )
{
- if ( !wxWindowBase::SetCursor(cursor.Ok() ? cursor : *wxSTANDARD_CURSOR) )
+ if ( !wxWindowBase::SetCursor(cursor.IsOk() ? cursor : *wxSTANDARD_CURSOR) )
return false;
GTKUpdateCursor();
{
if (update_self)
{
- wxCursor cursor(g_globalCursor.Ok() ? g_globalCursor : GetCursor());
- if ( cursor.Ok() )
+ wxCursor cursor(g_globalCursor.IsOk() ? g_globalCursor : GetCursor());
+ if ( cursor.IsOk() )
{
wxArrayGdkWindows windowsThis;
GdkWindow* window = GTKGetWindow(windowsThis);
if (!wxWindowBase::SetBackgroundColour(colour))
return false;
- if (colour.Ok())
+ if (colour.IsOk())
{
// We need the pixel value e.g. for background clearing.
m_backgroundColour.CalcPixel(gtk_widget_get_colormap(m_widget));
return false;
}
- if (colour.Ok())
+ if (colour.IsOk())
{
// We need the pixel value e.g. for background clearing.
m_foregroundColour.CalcPixel(gtk_widget_get_colormap(m_widget));
{
// do we need to apply any changes at all?
if ( !forceStyle &&
- !m_font.Ok() &&
- !m_foregroundColour.Ok() && !m_backgroundColour.Ok() )
+ !m_font.IsOk() &&
+ !m_foregroundColour.IsOk() && !m_backgroundColour.IsOk() )
{
return NULL;
}
GtkRcStyle *style = gtk_rc_style_new();
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
{
style->font_desc =
pango_font_description_copy( m_font.GetNativeFontInfo()->description );
flagsActive = 0,
flagsInsensitive = 0;
- if ( m_foregroundColour.Ok() )
+ if ( m_foregroundColour.IsOk() )
{
const GdkColor *fg = m_foregroundColour.GetColor();
flagsActive |= GTK_RC_FG | GTK_RC_TEXT;
}
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
{
const GdkColor *bg = m_backgroundColour.GetColor();
wxCHECK_RET( window, wxT("CaptureMouse() failed") );
const wxCursor* cursor = &m_cursor;
- if (!cursor->Ok())
+ if (!cursor->IsOk())
cursor = wxSTANDARD_CURSOR;
gdk_pointer_grab( window, FALSE,
}
wxImage image = bitmap.ConvertToImage();
- if (!image.Ok()) return false;
+ if (!image.IsOk()) return false;
m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, image.GetWidth(), image.GetHeight(), 1 );
GdkGC *gc = gdk_gc_new( m_bitmap );
m_bitmap = NULL;
}
- if (!bitmap.Ok()) return false;
+ if (!bitmap.IsOk()) return false;
wxCHECK_MSG( bitmap.GetBitmap(), false, wxT("Cannot create mask from colour bitmap") );
wxBitmap wxBitmap::Rescale( int clipx, int clipy, int clipwidth, int clipheight, int newx, int newy )
{
- wxCHECK_MSG( Ok(), wxNullBitmap, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullBitmap, wxT("invalid bitmap") );
if (newy==M_BMPDATA->m_width && newy==M_BMPDATA->m_height)
return *this;
{
UnRef();
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") );
wxCHECK_MSG( depth == -1 || depth == 1, false, wxT("invalid bitmap depth") );
if (image.GetWidth() <= 0 || image.GetHeight() <= 0)
{
wxImage image;
- wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
image.Create(GetWidth(), GetHeight());
unsigned char *data = image.GetData();
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask( wxMask *mask )
{
- wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
AllocExclusive();
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
- wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
if (ret.GetPixmap())
{
bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type, const wxPalette *WXUNUSED(palette) ) const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") );
// Try to save the bitmap via wxImage handlers:
{
wxImage image = ConvertToImage();
- if (image.Ok()) return image.SaveFile( name, type );
+ if (image.IsOk()) return image.SaveFile( name, type );
}
return false;
else // try if wxImage can load it
{
wxImage image;
- if ( !image.LoadFile( name, type ) || !image.Ok() )
+ if ( !image.LoadFile( name, type ) || !image.IsOk() )
return false;
*this = wxBitmap(image);
#if wxUSE_PALETTE
wxPalette *wxBitmap::GetPalette() const
{
- if (!Ok())
+ if (!IsOk())
return NULL;
return M_BMPDATA->m_palette;
GdkPixmap *wxBitmap::GetPixmap() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_pixmap;
}
bool wxBitmap::HasPixmap() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") );
return M_BMPDATA->m_pixmap != NULL;
}
GdkBitmap *wxBitmap::GetBitmap() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_bitmap;
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
void wxCheckBox::OnInternalIdle()
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
GdkWindow *event_window = TOGGLE_BUTTON_EVENT_WIN(m_widgetCheckbox);
- if ( event_window && cursor.Ok() )
+ if ( event_window && cursor.IsOk() )
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
void wxColour::CalcPixel( GdkColormap *cmap )
{
- if (!Ok()) return;
+ if (!IsOk()) return;
M_COLDATA->AllocColour( cmap );
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") );
return &M_COLDATA->m_color;
}
if (gs_busyCount++ > 0)
return;
- wxASSERT_MSG( !gs_savedCursor.Ok(),
+ wxASSERT_MSG( !gs_savedCursor.IsOk(),
wxT("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
m_bitmap = wxBitmap(image);
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
}
void wxBitmapDataObject::DoConvertToPng()
{
- if ( !m_bitmap.Ok() )
+ if ( !m_bitmap.IsOk() )
return;
wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,
{
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
- wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( bitmap.IsOk(), wxT("invalid bitmap") );
bool is_mono = (bitmap.GetBitmap() != NULL);
if (srcDC->m_isMemDC)
{
- if (!memDC->m_selected.Ok()) return false;
+ if (!memDC->m_selected.IsOk()) return false;
is_mono = (memDC->m_selected.GetDepth() == 1);
m_pen = pen;
- if (!m_pen.Ok()) return;
+ if (!m_pen.IsOk()) return;
if (!m_window) return;
m_brush = brush;
- if (!m_brush.Ok()) return;
+ if (!m_brush.IsOk()) return;
if (!m_window) return;
gdk_gc_set_fill( m_brushGC, GDK_SOLID );
- if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok()))
+ if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->IsOk()))
{
if (m_brush.GetStipple()->GetPixmap())
{
m_backgroundBrush = brush;
- if (!m_backgroundBrush.Ok()) return;
+ if (!m_backgroundBrush.IsOk()) return;
if (!m_window) return;
gdk_gc_set_fill( m_bgGC, GDK_SOLID );
- if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok()))
+ if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->IsOk()))
{
if (m_backgroundBrush.GetStipple()->GetPixmap())
{
// don't set m_textForegroundColour to an invalid colour as we'd crash
// later then (we use m_textForegroundColour.GetColor() without checking
// in a few places)
- if ( !col.Ok() || (m_textForegroundColour == col) )
+ if ( !col.IsOk() || (m_textForegroundColour == col) )
return;
m_textForegroundColour = col;
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
// same as above
- if ( !col.Ok() || (m_textBackgroundColour == col) )
+ if ( !col.IsOk() || (m_textBackgroundColour == col) )
return;
m_textBackgroundColour = col;
wxGTKDCImpl::ComputeScaleAndOrigin();
// if scale has changed call SetPen to recalulate the line width
- if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.Ok() )
+ if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.IsOk() )
{
// this is a bit artificial, but we need to force wxDC to think the pen
// has changed
Destroy();
m_selected = bitmap;
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (m_selected.GetPixmap())
{
void wxMemoryDCImpl::SetPen( const wxPen& penOrig )
{
wxPen pen( penOrig );
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetBitmap() &&
(pen != *wxTRANSPARENT_PEN) )
{
void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig )
{
wxBrush brush( brushOrig );
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetBitmap() &&
(brush != *wxTRANSPARENT_BRUSH) )
{
{
wxBrush brush(brushOrig);
- if ( m_selected.Ok() &&
+ if ( m_selected.IsOk() &&
m_selected.GetBitmap() &&
(brush != *wxTRANSPARENT_BRUSH) )
{
void wxMemoryDCImpl::SetTextForeground( const wxColour& col )
{
- if ( m_selected.Ok() && m_selected.GetBitmap() )
+ if ( m_selected.IsOk() && m_selected.GetBitmap() )
{
wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
}
void wxMemoryDCImpl::SetTextBackground( const wxColour &col )
{
- if (m_selected.Ok() && m_selected.GetBitmap())
+ if (m_selected.IsOk() && m_selected.GetBitmap())
{
wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
}
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (width) (*width) = m_selected.GetWidth();
if (height) (*height) = m_selected.GetHeight();
m_iconMove = iconMove;
m_iconNone = iconNone;
- if ( !m_iconCopy.Ok() )
+ if ( !m_iconCopy.IsOk() )
m_iconCopy = wxIcon(page_xpm);
- if ( !m_iconMove.Ok() )
+ if ( !m_iconMove.IsOk() )
m_iconMove = m_iconCopy;
- if ( !m_iconNone.Ok() )
+ if ( !m_iconNone.IsOk() )
m_iconNone = m_iconCopy;
}
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->m_faceName;
}
wxFontStyle wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") );
return M_FONTDATA->m_style;
}
wxFontWeight wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->m_weight;
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->m_underlined;
}
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
// m_encoding is unused in wxGTK2, return encoding that the user set.
return M_FONTDATA->m_encoding;
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
if ( !M_FONTDATA->HasNativeFont() )
{
bool wxFont::IsFixedWidth() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
if ( M_FONTDATA->HasNativeFont() )
{
{
GdkFont *font = NULL;
- wxCHECK_MSG( Ok(), font, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), font, wxT("invalid font") );
long int_scale = long(scale * 100.0 + 0.5); // key for fontlist
int point_scale = (int)((M_FONTDATA->m_pointSize * 10 * int_scale) / 100);
GTK_SIGNAL_FUNC(gtk_fontdialog_delete_callback), (gpointer)this );
wxFont font = m_fontData.GetInitialFont();
- if( font.Ok() )
+ if( font.IsOk() )
{
const wxNativeFontInfo *info = font.GetNativeFontInfo();
void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style)
{
- if (m_hasBgCol && m_backgroundColour.Ok())
+ if (m_hasBgCol && m_backgroundColour.IsOk())
{
GdkWindow *window = GTK_WIDGET(m_list)->window;
if ( window )
void wxListBox::OnInternalIdle()
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
- if (GTK_WIDGET(m_list)->window && cursor.Ok())
+ if (GTK_WIDGET(m_list)->window && cursor.IsOk())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
// TODO
menuItem = gtk_menu_item_new();
}
- else if (mitem->GetBitmap().Ok())
+ else if (mitem->GetBitmap().IsOk())
{
text = mitem->wxMenuItemBase::GetItemLabel();
const wxBitmap *bitmap = &mitem->GetBitmap();
int wxPen::GetDashes( wxDash **ptr ) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = (wxDash*)M_PENDATA->m_dash;
return M_PENDATA->m_countDashes;
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return (M_PENDATA->m_countDashes);
}
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return (wxDash*)M_PENDATA->m_dash;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_capStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_joinStyle;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_width;
}
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour;
}
void wxRadioButton::OnInternalIdle()
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget);
- if ( win && cursor.Ok())
+ if ( win && cursor.IsOk())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
case wxSYS_COLOUR_BTNFACE:
case wxSYS_COLOUR_MENUBAR:
case wxSYS_COLOUR_3DLIGHT:
- if (!gs_objects.m_colBtnFace.Ok())
+ if (!gs_objects.m_colBtnFace.IsOk())
{
int red, green, blue;
if ( !GetColourFromGTKWidget(red, green, blue) )
case wxSYS_COLOUR_GRAYTEXT:
case wxSYS_COLOUR_BTNSHADOW:
//case wxSYS_COLOUR_3DSHADOW:
- if (!gs_objects.m_colBtnShadow.Ok())
+ if (!gs_objects.m_colBtnShadow.IsOk())
{
wxColour faceColour(GetColour(wxSYS_COLOUR_3DFACE));
gs_objects.m_colBtnShadow =
return * wxWHITE;
case wxSYS_COLOUR_HIGHLIGHT:
- if (!gs_objects.m_colHighlight.Ok())
+ if (!gs_objects.m_colHighlight.IsOk())
{
int red, green, blue;
if ( !GetColourFromGTKWidget(red, green, blue,
return gs_objects.m_colHighlight;
case wxSYS_COLOUR_LISTBOX:
- if (!gs_objects.m_colListBox.Ok())
+ if (!gs_objects.m_colListBox.IsOk())
{
int red, green, blue;
if ( GetColourFromGTKWidget(red, green, blue,
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
case wxSYS_COLOUR_BTNTEXT:
case wxSYS_COLOUR_LISTBOXTEXT:
- if (!gs_objects.m_colBtnText.Ok())
+ if (!gs_objects.m_colBtnText.IsOk())
{
int red, green, blue;
if ( !GetColourFromGTKWidget(red, green, blue,
return gs_objects.m_colBtnText;
case wxSYS_COLOUR_INFOBK:
- if (!gs_objects.m_colTooltip.Ok()) {
+ if (!gs_objects.m_colTooltip.IsOk()) {
GetTooltipColors();
}
return gs_objects.m_colTooltip;
case wxSYS_COLOUR_INFOTEXT:
- if (!gs_objects.m_colTooltipText.Ok()) {
+ if (!gs_objects.m_colTooltipText.IsOk()) {
GetTooltipColors();
}
return gs_objects.m_colTooltipText;
case wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT:
case wxSYS_COLOUR_HIGHLIGHTTEXT:
- if (!gs_objects.m_colHighlightText.Ok())
+ if (!gs_objects.m_colHighlightText.IsOk())
{
wxColour hclr = GetColour(wxSYS_COLOUR_HIGHLIGHT);
if (hclr.Red() > 200 && hclr.Green() > 200 && hclr.Blue() > 200)
case wxSYS_COLOUR_ACTIVECAPTION:
case wxSYS_COLOUR_MENUHILIGHT:
- if (!gs_objects.m_colMenuItemHighlight.Ok())
+ if (!gs_objects.m_colMenuItemHighlight.IsOk())
{
int red, green, blue;
if ( !GetColourFromGTKWidget(red, green, blue,
case wxSYS_DEVICE_DEFAULT_FONT:
case wxSYS_DEFAULT_GUI_FONT:
{
- if (!gs_objects.m_fontSystem.Ok())
+ if (!gs_objects.m_fontSystem.IsOk())
{
gs_objects.m_fontSystem = wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
}
m_bitmap = bitmap;
- wxBitmap bmp(bitmap.Ok() ? bitmap : wxBitmap(bogus_xpm));
+ wxBitmap bmp(bitmap.IsOk() ? bitmap : wxBitmap(bogus_xpm));
m_widget = gtk_pixmap_new(bmp.GetPixmap(), NULL);
- if (bitmap.Ok())
+ if (bitmap.IsOk())
SetBitmap(bitmap);
PostCreation(size);
{
m_bitmap = bitmap;
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
GdkBitmap *mask = NULL;
if (m_bitmap.GetMask())
// disabled and enabled mode, or we end up with a different colour under the
// text.
wxColour oldColour = GetBackgroundColour();
- if (oldColour.Ok())
+ if (oldColour.IsOk())
{
// Need to set twice or it'll optimize the useful stuff out
if (oldColour == * wxWHITE)
if (!m_widget->window)
return false;
- if (!m_backgroundColour.Ok())
+ if (!m_backgroundColour.IsOk())
return false;
if (m_windowStyle & wxTE_MULTILINE)
void wxTextCtrl::OnInternalIdle()
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
- if (cursor.Ok())
+ if (cursor.IsOk())
{
GdkWindow *window = NULL;
if (HasFlag(wxTE_MULTILINE))
if (window)
gdk_window_set_cursor( window, cursor.GetCursor() );
- if (!g_globalCursor.Ok())
+ if (!g_globalCursor.IsOk())
cursor = *wxSTANDARD_CURSOR;
window = m_widget->window;
if (style & wxNO_BORDER)
gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
OnSetBitmap();
}
void wxToggleBitmapButton::OnSetBitmap()
{
- if (!m_bitmap.Ok()) return;
+ if (!m_bitmap.IsOk()) return;
GdkBitmap *mask = NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok())
+ if (g_globalCursor.IsOk())
cursor = g_globalCursor;
GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget);
- if ( win && cursor.Ok() )
+ if ( win && cursor.IsOk() )
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
{
wxSize best;
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
int border = HasFlag(wxNO_BORDER) ? 4 : 10;
best.x = m_bitmap.GetWidth()+border;
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok())
+ if (g_globalCursor.IsOk())
cursor = g_globalCursor;
GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget);
- if ( win && cursor.Ok() )
+ if ( win && cursor.IsOk() )
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
void SetPixmap(const wxBitmap& bitmap)
{
- if (bitmap.Ok())
+ if (bitmap.IsOk())
{
GdkBitmap *mask = bitmap.GetMask() ? bitmap.GetMask()->GetBitmap()
: NULL;
{
wxBitmap bitmap = tool->GetNormalBitmap();
- wxCHECK_MSG( bitmap.Ok(), false,
+ wxCHECK_MSG( bitmap.IsOk(), false,
wxT("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, false,
void wxToolBar::OnInternalIdle()
{
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
- if (cursor.Ok())
+ if (cursor.IsOk())
{
/* I now set the cursor the anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
return;
wxIcon icon = icons.GetIcon(-1);
- if (icon.Ok())
+ if (icon.IsOk())
{
wxMask *mask = icon.GetMask();
GdkBitmap *bm = NULL;
GtkUpdate();
wxCursor cursor = m_cursor;
- if (g_globalCursor.Ok()) cursor = g_globalCursor;
+ if (g_globalCursor.IsOk()) cursor = g_globalCursor;
- if (cursor.Ok())
+ if (cursor.IsOk())
{
/* I now set the cursor anew in every OnInternalIdle call
as setting the cursor in a parent window also effects the
if (window)
gdk_window_set_cursor( window, cursor.GetCursor() );
- if (!g_globalCursor.Ok())
+ if (!g_globalCursor.IsOk())
cursor = *wxSTANDARD_CURSOR;
window = m_widget->window;
wxCHECK_MSG( (m_widget != NULL), 12, wxT("invalid window") );
wxFont font = GetFont();
- wxCHECK_MSG( font.Ok(), 12, wxT("invalid font") );
+ wxCHECK_MSG( font.IsOk(), 12, wxT("invalid font") );
GdkFont *gfont = font.GetInternalFont( 1.0 );
wxCHECK_MSG( (m_widget != NULL), 8, wxT("invalid window") );
wxFont font = GetFont();
- wxCHECK_MSG( font.Ok(), 8, wxT("invalid font") );
+ wxCHECK_MSG( font.IsOk(), 8, wxT("invalid font") );
GdkFont *gfont = font.GetInternalFont( 1.0 );
{
wxFont fontToUse = theFont ? *theFont : GetFont();
- wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
+ wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") );
if (string.empty())
{
if (!wxWindowBase::SetBackgroundColour(colour))
return false;
- if (colour.Ok())
+ if (colour.IsOk())
{
// We need the pixel value e.g. for background clearing.
m_backgroundColour.CalcPixel(gtk_widget_get_colormap(m_widget));
return false;
}
- if (colour.Ok())
+ if (colour.IsOk())
{
// We need the pixel value e.g. for background clearing.
m_foregroundColour.CalcPixel(gtk_widget_get_colormap(m_widget));
{
// do we need to apply any changes at all?
if ( !forceStyle &&
- !m_font.Ok() &&
- !m_foregroundColour.Ok() && !m_backgroundColour.Ok() )
+ !m_font.IsOk() &&
+ !m_foregroundColour.IsOk() && !m_backgroundColour.IsOk() )
{
return NULL;
}
GtkRcStyle *style = gtk_rc_style_new();
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
{
wxString xfontname = m_font.GetNativeFontInfo()->GetXFontName();
style->fontset_name = g_strdup(xfontname.c_str());
}
- if ( m_foregroundColour.Ok() )
+ if ( m_foregroundColour.IsOk() )
{
GdkColor *fg = m_foregroundColour.GetColor();
style->color_flags[GTK_STATE_ACTIVE] = GTK_RC_FG;
}
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
{
GdkColor *bg = m_backgroundColour.GetColor();
wxCHECK_RET( window, wxT("CaptureMouse() failed") );
const wxCursor* cursor = &m_cursor;
- if (!cursor->Ok())
+ if (!cursor->IsOk())
cursor = wxSTANDARD_CURSOR;
gdk_pointer_grab( window, FALSE,
wxBitmap woptionsBitmap =
wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_TOOLBAR);
- wxASSERT_MSG( (wpanelBitmap.Ok() && wbackBitmap.Ok() &&
- wforwardBitmap.Ok() && wupnodeBitmap.Ok() &&
- wupBitmap.Ok() && wdownBitmap.Ok() &&
- wopenBitmap.Ok() && wprintBitmap.Ok() &&
- woptionsBitmap.Ok()),
+ wxASSERT_MSG( (wpanelBitmap.IsOk() && wbackBitmap.IsOk() &&
+ wforwardBitmap.IsOk() && wupnodeBitmap.IsOk() &&
+ wupBitmap.IsOk() && wdownBitmap.IsOk() &&
+ wopenBitmap.IsOk() && wprintBitmap.IsOk() &&
+ woptionsBitmap.IsOk()),
wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ;
// wxHtmlCell::GetCursor() method simply returns wxNullCursor, so we
// know that GetCursor() was overridden iff it returns valid cursor.
wxCursor cur = GetCursor();
- if (cur.Ok())
+ if (cur.IsOk())
return cur;
#endif // WXWIN_COMPATIBILITY_2_6
// Pass two printout objects: for preview, and possible printing.
wxPrintDialogData printDialogData(*GetPrintData());
wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData);
- if (!preview->Ok())
+ if (!preview->IsOk())
{
delete preview;
return false;
void wxHtmlEasyPrinting::PageSetup()
{
- if (!GetPrintData()->Ok())
+ if (!GetPrintData()->IsOk())
{
wxLogError(_("There was a problem during page setup: you may need to set a default printer."));
return;
#endif // wxUSE_GIF && wxUSE_TIMER
{
wxImage image(*s, wxBITMAP_TYPE_ANY);
- if ( image.Ok() )
+ if ( image.IsOk() )
SetImage(image);
}
}
void wxHtmlImageCell::SetImage(const wxImage& img)
{
#if !defined(__WXMSW__) || wxUSE_WXDIB
- if ( img.Ok() )
+ if ( img.IsOk() )
{
delete m_bitmap;
if ( is )
{
wxImage image(*is);
- if ( image.Ok() )
+ if ( image.IsOk() )
winIface->SetHTMLBackgroundImage(image);
}
if (tag.HasParam(wxT("BGCOLOR")))
{
tag.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg);
- if (m_tBkg.Ok())
+ if (m_tBkg.IsOk())
SetBackgroundColour(m_tBkg);
}
if (tag.HasParam(wxT("VALIGN")))
wxColour bk = m_rBkg;
if (tag.HasParam(wxT("BGCOLOR")))
tag.GetParamAsColour(wxT("BGCOLOR"), &bk);
- if (bk.Ok())
+ if (bk.IsOk())
cell->SetBackgroundColour(bk);
}
if (m_Border > 0)
SetMonoPalette(wxColour(255, 255, 255), wxColour(0, 0, 0));
}
- return Ok();
+ return IsOk();
}
wxBitmap::wxBitmap(const wxImage& image, int depth)
{
long width, height;
- wxCHECK_RET( image.Ok(), wxT("invalid image") );
+ wxCHECK_RET( image.IsOk(), wxT("invalid image") );
width = image.GetWidth();
height = image.GetHeight();
wxImage wxBitmap::ConvertToImage() const
{
- wxCHECK_MSG( Ok(), wxImage(), wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxImage(), wxT("invalid bitmap") );
int width, height;
width = GetWidth();
height = GetHeight();
wxImage image(width, height);
- wxASSERT_MSG( image.Ok(), wxT("cannot create image") );
+ wxASSERT_MSG( image.IsOk(), wxT("cannot create image") );
MGLMemoryDC idc(width, height, 24, &gs_pixel_format_wxImage,
width * 3, (void*)image.GetData(), NULL);
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask(wxMask *mask)
{
- wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
AllocExclusive();
delete M_BMPDATA->m_mask;
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= M_BMPDATA->m_width) && (rect.y+rect.height <= M_BMPDATA->m_height),
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
- wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
if ( GetPalette() )
ret.SetPalette(*GetPalette());
void wxBitmap::SetMonoPalette(const wxColour& fg, const wxColour& bg)
{
- wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
AllocExclusive();
palette_t *mono = M_BMPDATA->m_bitmap->pal;
MGLDevCtx *wxBitmap::CreateTmpDC() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
MGLDevCtx *tdc = new MGLMemoryDC(GetWidth(), GetHeight(),
M_BMPDATA->m_bitmap->bitsPerPixel,
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;
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);
if ( palette )
image.SetPalette(*palette);
- if ( image.Ok() )
+ if ( image.IsOk() )
return image.SaveFile(filename, type);
else
{
wxPalette *wxBitmap::GetPalette() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_palette;
}
void wxBitmap::SetPalette(const wxPalette& palette)
{
- wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
AllocExclusive();
wxDELETE(M_BMPDATA->m_palette);
- if ( !palette.Ok() ) return;
+ if ( !palette.IsOk() ) return;
M_BMPDATA->m_palette = new wxPalette(palette);
if ( !MGL_getBitmapSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return false;
bitmap->Create(width, height, -1);
- if ( !bitmap->Ok() ) return false;
+ if ( !bitmap->IsOk() ) return false;
dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadBitmapIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return false;
if ( !MGL_getJPEGSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return false;
bitmap->Create(width, height, -1);
- if ( !bitmap->Ok() ) return false;
+ if ( !bitmap->IsOk() ) return false;
dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadJPEGIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return false;
if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return false;
bitmap->Create(width, height, -1);
- if ( !bitmap->Ok() ) return false;
+ if ( !bitmap->IsOk() ) return false;
dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadPNGIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return false;
if ( !MGL_getPCXSize(fullname.mb_str(), &width, &height, &bpp) )
return false;
bitmap->Create(width, height, -1);
- if ( !bitmap->Ok() ) return false;
+ if ( !bitmap->IsOk() ) return false;
dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadPCXIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return false;
if ( bmp == NULL ) return false;
bitmap->Create(bmp->width, bmp->height, -1);
- if ( !bitmap->Ok() ) return false;
+ if ( !bitmap->IsOk() ) return false;
// convert bmp to display's depth and write it to *bitmap:
wxMemoryDC dc;
wxBrush::wxBrush(const wxBitmap &stippleBitmap)
{
- wxCHECK_RET( stippleBitmap.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( stippleBitmap.IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8,
wxT("stipple bitmap must be 8x8") );
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
void* wxBrush::GetMaskPattern() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return (void*)&(M_BRUSHDATA->m_maskPattern);
}
void* wxBrush::GetPixPattern() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return (void*)&(M_BRUSHDATA->m_pixPattern);
}
{
AllocExclusive();
- wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
wxT("stipple bitmap must be 8x8") );
void wxSetCursor(const wxCursor& cursor)
{
- if ( cursor.Ok() )
+ if ( cursor.IsOk() )
{
if ( g_winMng )
MGL_wmSetGlobalCursor(g_winMng, *cursor.GetMGLCursor());
{
if ( gs_busyCount++ > 0 ) return;
- wxASSERT_MSG( !gs_savedCursor.Ok(),
+ wxASSERT_MSG( !gs_savedCursor.IsOk(),
wxT("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = gs_globalCursor;
- if ( cursor->Ok() )
+ if ( cursor->IsOk() )
wxSetCursor(*cursor);
else
wxSetCursor(wxCursor(wxCURSOR_WAIT));
void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxRect rect(XLOG2DEV(cx), YLOG2DEV(cy), XLOG2DEVREL(cw), YLOG2DEVREL(ch));
void wxDC::DoSetDeviceClippingRegion(const wxRegion& region)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( region.IsEmpty() )
{
void wxDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( !m_globalClippingRegion.IsNull() )
{
void wxDC::Clear()
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
m_MGLDC->makeCurrent(); // will go away with MGL6.0
if ( m_backgroundBrush.GetStyle() != wxTRANSPARENT )
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( m_pen.GetStyle() != wxTRANSPARENT )
{
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( m_pen.GetStyle() != wxTRANSPARENT )
{
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( m_pen.GetStyle() != wxTRANSPARENT )
{
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,wxPolygonFillMode WXUNUSED(fillStyle))
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCoord xxoffset = XLOG2DEVREL(xoffset),
yyoffset = YLOG2DEVREL(yoffset);
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( m_pen.GetStyle() != wxTRANSPARENT )
{
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( radius < 0.0 )
radius = -radius * ((width < height) ? width : height);
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCoord x2 = (x+width);
wxCoord y2 = (y+height);
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxCoord x2 = (x+w);
wxCoord y2 = (y+h);
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
SelectMGLFont();
void wxDC::SelectPen()
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxColour& clr = m_pen.GetColour();
m_MGLDC->makeCurrent(); // will go away with MGL6.0
void wxDC::SelectBrush()
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
wxColour fg, bg;
m_MGLDC->makeCurrent(); // will go away with MGL6.0
void wxDC::SetPen(const wxPen& pen)
{
- if ( !pen.Ok() ) return;
+ if ( !pen.IsOk() ) return;
if ( m_pen == pen ) return;
m_pen = pen;
m_penSelected = false;
void wxDC::SetBrush(const wxBrush& brush)
{
- if ( !brush.Ok() ) return;
+ if ( !brush.IsOk() ) return;
if ( m_brush == brush ) return;
m_brush = brush;
m_brushSelected = false;
void wxDC::SetPalette(const wxPalette& palette)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
- if ( !palette.Ok() )
+ if ( !palette.IsOk() )
{
- if ( m_oldPalette.Ok() )
+ if ( m_oldPalette.IsOk() )
SetPalette(m_oldPalette);
return;
}
void wxDC::SetFont(const wxFont& font)
{
- if ( font.Ok() )
+ if ( font.IsOk() )
{
m_font = font;
m_mglFont = NULL;
void wxDC::SetBackground(const wxBrush& brush)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
- if (!brush.Ok()) return;
+ if (!brush.IsOk()) return;
m_backgroundBrush = brush;
wxColour &clr = m_backgroundBrush.GetColour();
void wxDC::SetLogicalFunction(wxRasterOperationMode function)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
m_logicalFunction = function;
wxRasterOperationMode rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask)
{
- wxCHECK_MSG( Ok(), false, wxT("invalid dc") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid dc") );
wxCHECK_MSG( source, false, wxT("invalid source dc") );
// transform the source DC coords to the device ones
void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
- wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
+ wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") );
wxCoord w = bmp.GetWidth();
wxCoord h = bmp.GetHeight();
wxCoord x, wxCoord y, wxCoord w, wxCoord h,
wxCoord destx, wxCoord desty, int rop, bool useMask)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
- wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
+ wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap") );
CalcBoundingBox(x, y);
CalcBoundingBox(x + w, y + h);
void wxMemoryDC::DoSelect(const wxBitmap& bitmap)
{
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
m_selected = bitmap;
SetMGLDC(m_selected.CreateTmpDC(), TRUE);
void wxMemoryDC::SetPen(const wxPen &pen)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( GetDepth() == 1 && *wxTRANSPARENT_PEN != pen )
{
void wxMemoryDC::SetBrush(const wxBrush &brush)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( GetDepth() == 1 && *wxTRANSPARENT_BRUSH != brush )
{
void wxMemoryDC::SetTextForeground(const wxColour &col)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( GetDepth() == 1 )
{
void wxMemoryDC::SetTextBackground(const wxColour &col)
{
- wxCHECK_RET( Ok(), wxT("invalid dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid dc") );
if ( GetDepth() == 1 )
{
struct font_t *wxFont::GetMGLfont_t(float scale, bool antialiased)
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
// we don't support DC scaling yet, so use scale=1
wxFontInstance *i = M_FONTDATA->GetFontInstance(1.0, antialiased);
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();
}
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();
}
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();
}
int wxPalette::GetColoursCount() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid palette") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid palette") );
return M_PALETTEDATA->m_count;
}
palette_t *wxPalette::GetMGLpalette_t() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid palette") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid palette") );
return M_PALETTEDATA->m_entries;
}
wxPen::wxPen(const wxBitmap& stipple, int width)
{
- wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
wxT("stipple bitmap must be 8x8") );
void wxPen::SetStipple(const wxBitmap& stipple)
{
- wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( stipple.IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8,
wxT("stipple bitmap must be 8x8") );
int wxPen::GetDashes(wxDash **ptr) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = (wxDash*)M_PENDATA->m_dash;
return M_PENDATA->m_countDashes;
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return (M_PENDATA->m_countDashes);
}
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return (wxDash*)M_PENDATA->m_dash;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_capStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_joinStyle;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_width;
}
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour;
}
wxBitmap *wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return &(M_PENDATA->m_stipple);
}
void* wxPen::GetPixPattern() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return (void*)&(M_PENDATA->m_pixPattern);
}
MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0);
MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0);
- if ( m_cursor.Ok() )
+ if ( m_cursor.IsOk() )
MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
else
MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
return false;
}
- if ( m_cursor.Ok() )
+ if ( m_cursor.IsOk() )
MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
else
MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
void wxCheckBox::ChangeBackgroundColour()
{
- if (!m_backgroundColour.Ok())
+ if (!m_backgroundColour.IsOk())
return;
wxComputeColours (XtDisplay((Widget) m_mainWidget), & m_backgroundColour,
wxDoChangeBackgroundColour((WXWidget) w, m_backgroundColour);
- if( m_font.Ok() )
+ if( m_font.IsOk() )
wxDoChangeFont( w, m_font );
m_widgetArray.Insert(w, pos);
// Note that this causes the widget to be resized back
// to its original size! We therefore have to set the size
// back again. TODO: a better way in Motif?
- if (m_mainWidget && m_font.Ok())
+ if (m_mainWidget && m_font.IsOk())
{
Display* dpy = XtDisplay((Widget) m_mainWidget);
int width, height, width1, height1;
void wxComboBox::ChangeFont(bool keepOriginalSize)
{
- if( m_font.Ok() && m_mainWidget != NULL )
+ if( m_font.IsOk() && m_mainWidget != NULL )
{
wxDoChangeFont( GetXmText(this), m_font );
wxDoChangeFont( GetXmList(this), m_font );
else
{
// Restore old cursor
- if (win->GetCursor().Ok())
+ if (win->GetCursor().IsOk())
attrs.cursor = (Cursor) win->GetCursor().GetXCursor(display);
else
attrs.cursor = None;
bool wxBitmapDataObject::GetDataHere(void* buf) const
{
- if( !GetBitmap().Ok() )
+ if( !GetBitmap().IsOk() )
return false;
(*(Pixmap*)buf) = (Pixmap)GetBitmap().GetDrawable();
void wxMotifDCImpl::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y)
{
wxCHECK_RET( IsOk(), "invalid dc" );
- wxCHECK_RET( icon.Ok(), "invalid icon" );
+ wxCHECK_RET( icon.IsOk(), "invalid icon" );
DoDrawBitmap(icon, x, y, true);
}
void wxMotifDCImpl::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask )
{
- wxCHECK_RET( bitmap.Ok(), "invalid bitmap" );
+ wxCHECK_RET( bitmap.IsOk(), "invalid bitmap" );
wxMemoryDC memDC;
memDC.SelectObjectAsSource(bitmap);
XFreeGC((Display*) m_display, (GC) m_gc);
m_gc = (WXGC) NULL;
- if (m_bitmap.Ok() && (bitmap.GetDisplay() == m_display))
+ if (m_bitmap.IsOk() && (bitmap.GetDisplay() == m_display))
{
m_pixmap = m_bitmap.GetDrawable();
Display* display = (Display*) m_display;
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
if (width) (*width) = m_bitmap.GetWidth();
if (height) (*height) = m_bitmap.GetHeight();
Arg args[10];
int ac = 0;
- if (m_backgroundColour.Ok())
+ if (m_backgroundColour.IsOk())
{
wxComputeColours (dpy, & m_backgroundColour, NULL);
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->m_faceName ;
}
wxFontStyle wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") );
return M_FONTDATA->m_style;
}
wxFontWeight wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->m_weight;
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->m_underlined;
}
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
return M_FONTDATA->m_encoding;
}
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
if(M_FONTDATA->m_nativeFontInfo.GetXFontName().empty())
GetInternalFont();
// font to list in the private data for future reference.
wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
{
- if ( !Ok() )
+ if ( !IsOk() )
return NULL;
long intScale = long(scale * 100.0 + 0.5); // key for wxXFont
WXFontType wxFont::GetFontType(WXDisplay* display) const
{
#if wxMOTIF_USE_RENDER_TABLE
- return Ok() ? GetRenderTable(display) : NULL;
+ return IsOk() ? GetRenderTable(display) : NULL;
#else
- return Ok() ? GetFontList(1.0, display) : NULL;
+ return IsOk() ? GetFontList(1.0, display) : NULL;
#endif
}
WXFontType wxFont::GetFontTypeC(WXDisplay* display) const
{
#if wxMOTIF_USE_RENDER_TABLE
- return Ok() ? GetRenderTable(display) : NULL;
+ return IsOk() ? GetRenderTable(display) : NULL;
#else
- return Ok() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL;
+ return IsOk() ? XmFontListCopy( (XmFontList)GetFontList(1.0, display) ) : NULL;
#endif
}
if (!m_frameShell)
return;
- if (!icon.Ok() || !icon.GetDrawable())
+ if (!icon.IsOk() || !icon.GetDrawable())
return;
XtVaSetValues((Widget) m_frameShell,
( m_windowStyle & wxLB_EXTENDED ) ? XmEXTENDED_SELECT :
XmBROWSE_SELECT );
++count;
- if( m_font.Ok() )
+ if( m_font.IsOk() )
{
XtSetArg( args[count],
(String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy) );
XtSetArg (args[0], XmNnumColumns, m_numColumns);
XtSetArg (args[1], XmNpacking, (m_numColumns > 1) ? XmPACK_COLUMN : XmPACK_TIGHT);
- if ( !m_font.Ok() )
+ if ( !m_font.IsOk() )
{
if ( menuBar )
m_font = menuBar->GetFont();
void wxMenu::SetBackgroundColour(const wxColour& col)
{
m_backgroundColour = col;
- if (!col.Ok())
+ if (!col.IsOk())
return;
if (m_menuWidget)
wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
void wxMenu::SetForegroundColour(const wxColour& col)
{
m_foregroundColour = col;
- if (!col.Ok())
+ if (!col.IsOk())
return;
if (m_menuWidget)
wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col);
{
// Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does
#if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 )
- if (!m_font.Ok() || !m_menuWidget)
+ if (!m_font.IsOk() || !m_menuWidget)
return;
Display* dpy = XtDisplay((Widget) m_menuWidget);
node = node->GetNext() )
{
wxMenuItem* item = node->GetData();
- if (m_menuWidget && item->GetButtonWidget() && m_font.Ok())
+ if (m_menuWidget && item->GetButtonWidget() && m_font.IsOk())
{
XtVaSetValues ((Widget) item->GetButtonWidget(),
wxFont::GetFontTag(), m_font.GetFontTypeC(dpy),
{
if (!wxWindowBase::SetBackgroundColour(col))
return false;
- if (!col.Ok())
+ if (!col.IsOk())
return false;
if (m_mainWidget)
wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col);
{
if (!wxWindowBase::SetForegroundColour(col))
return false;
- if (!col.Ok())
+ if (!col.IsOk())
return false;
if (m_mainWidget)
wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);
Display* dpy = XtDisplay(wParent);
- if (m_backgroundColour.Ok())
+ if (m_backgroundColour.IsOk())
{
wxComputeColours (dpy, & m_backgroundColour, NULL);
wxSize actualSize(size);
// work around the cases where the bitmap is a wxNull(Icon/Bitmap)
if (actualSize.x == -1)
- actualSize.x = bitmap.Ok() ? bitmap.GetWidth() : 1;
+ actualSize.x = bitmap.IsOk() ? bitmap.GetWidth() : 1;
if (actualSize.y == -1)
- actualSize.y = bitmap.Ok() ? bitmap.GetHeight() : 1;
+ actualSize.y = bitmap.IsOk() ? bitmap.GetHeight() : 1;
PostCreation();
DoSetBitmap();
Widget widget = (Widget) m_mainWidget;
int w2, h2;
- if (m_messageBitmapOriginal.Ok())
+ if (m_messageBitmapOriginal.IsOk())
{
w2 = m_messageBitmapOriginal.GetWidth();
h2 = m_messageBitmapOriginal.GetHeight();
wxColour col;
col.SetPixel(backgroundPixel);
- if( bmp.Ok() && bmp.GetMask() )
+ if( bmp.IsOk() && bmp.GetMask() )
{
bmp = wxCreateMaskedBitmap(bmp, col);
tool->SetNormalBitmap(bmp);
}
- if( insensBmp.Ok() && insensBmp.GetMask() )
+ if( insensBmp.IsOk() && insensBmp.GetMask() )
{
insensBmp = wxCreateMaskedBitmap(insensBmp, col);
tool->SetDisabledBitmap(insensBmp);
{
wxBitmap tmp = tool->GetDisabledBitmap();
- insensPixmap = tmp.Ok() ?
+ insensPixmap = tmp.IsOk() ?
(Pixmap)tmp.GetDrawable() :
tool->GetInsensPixmap();
}
// Change a widget's foreground and background colours.
void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
{
- if (!foregroundColour.Ok())
+ if (!foregroundColour.IsOk())
return;
// When should we specify the foreground, if it's calculated
void wxDoChangeBackgroundColour(WXWidget widget, const wxColour& backgroundColour, bool changeArmColour)
{
- if (!backgroundColour.Ok())
+ if (!backgroundColour.IsOk())
return;
wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
return false;
}
- // wxASSERT_MSG( m_cursor.Ok(),
+ // wxASSERT_MSG( m_cursor.IsOk(),
// wxT("cursor must be valid after call to the base version"));
const wxCursor* cursor2 = NULL;
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
cursor2 = & m_cursor;
else
cursor2 = wxSTANDARD_CURSOR;
{
int height;
- if (m_font.Ok())
+ if (m_font.IsOk())
wxGetTextExtent (GetXDisplay(), m_font, 1.0,
"x", NULL, &height, NULL, NULL);
else
{
int width;
- if (m_font.Ok())
+ if (m_font.IsOk())
wxGetTextExtent (GetXDisplay(), m_font, 1.0,
"x", &width, NULL, NULL, NULL);
else
if (externalLeading)
*externalLeading = 0;
- if (fontToUse->Ok())
+ if (fontToUse->IsOk())
wxGetTextExtent (GetXDisplay(), *fontToUse, 1.0,
string, x, y, NULL, descent);
else
bool wxWindow::ProcessAccelerator(wxKeyEvent& event)
{
#if wxUSE_ACCEL
- if (!m_acceleratorTable.Ok())
+ if (!m_acceleratorTable.IsOk())
return false;
int count = m_acceleratorTable.GetCount();
// to its original size! We therefore have to set the size
// back again. TODO: a better way in Motif?
Widget w = (Widget) GetLabelWidget(); // Usually the main widget
- if (w && m_font.Ok())
+ if (w && m_font.IsOk())
{
int width, height, width1, height1;
GetSize(& width, & height);
bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const
{
MSG *msg = (MSG *)wxmsg;
- return Ok() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg);
+ return IsOk() && ::TranslateAccelerator(GetHwndOf(window), GetHaccel(), msg);
}
#endif // wxUSE_ACCEL
{
UnRef();
- if ( !cursor.Ok() )
+ if ( !cursor.IsOk() )
return false;
return CopyFromIconOrCursor(cursor, transp);
{
UnRef();
- if ( !icon.Ok() )
+ if ( !icon.IsOk() )
return false;
return CopyFromIconOrCursor(icon, transp);
SetHBITMAP((WXHBITMAP)hbmp);
- return Ok();
+ return IsOk();
}
#if wxUSE_IMAGE
// so the 'depth' argument is ignored.
// TODO: transparency (create a mask image)
- if (!Ok())
+ if (!IsOk())
{
wxFAIL_MSG( wxT("bitmap is invalid") );
return wxNullImage;
wxImage image;
- wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
// create an wxImage object
int width = GetWidth();
bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
{
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") );
UnRef();
// and then DIB to our wxImage
wxImage image = dib.ConvertToImage();
- if ( !image.Ok() )
+ if ( !image.IsOk() )
{
return wxNullImage;
}
else // no bitmap handler found
{
wxImage image;
- if ( image.LoadFile( filename, type ) && image.Ok() )
+ if ( image.LoadFile( filename, type ) && image.IsOk() )
{
*this = wxBitmap(image);
{
// FIXME what about palette? shouldn't we use it?
wxImage image = ConvertToImage();
- if ( image.Ok() )
+ if ( image.IsOk() )
{
return image.SaveFile(filename, type);
}
wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= GetWidth()) &&
(rect.y+rect.height <= GetHeight()),
wxNullBitmap, wxT("Invalid bitmap or bitmap region") );
wxBitmap ret( rect.width, rect.height, GetDepth() );
- wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
#ifndef __WXMICROWIN__
// handle alpha channel, if any
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
{
#if wxUSE_WXDIB
- if ( !Ok() )
+ if ( !IsOk() )
{
// no bitmap, no data (raw or otherwise)
return NULL;
void wxBitmap::UngetRawData(wxPixelDataBase& dataBase)
{
#if wxUSE_WXDIB
- if ( !Ok() )
+ if ( !IsOk() )
return;
if ( !&dataBase )
bool wxMask::Create(const wxBitmap& bitmap)
{
#ifndef __WXMICROWIN__
- wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, false,
+ wxCHECK_MSG( bitmap.IsOk() && bitmap.GetDepth() == 1, false,
wxT("can't create mask from invalid or not monochrome bitmap") );
if ( m_maskBitmap )
}
#if wxUSE_PALETTE
- if (bitmap.Ok() && bitmap.GetPalette()->Ok())
+ if (bitmap.IsOk() && bitmap.GetPalette()->IsOk())
{
unsigned char red, green, blue;
if (bitmap.GetPalette()->GetRGB(paletteIndex, &red, &green, &blue))
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{
#ifndef __WXMICROWIN__
- wxCHECK_MSG( bitmap.Ok(), false, wxT("invalid bitmap in wxMask::Create") );
+ wxCHECK_MSG( bitmap.IsOk(), false, wxT("invalid bitmap in wxMask::Create") );
if ( m_maskBitmap )
{
int hotSpotX,
int hotSpotY)
{
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
// we can't create an icon/cursor form nothing
return 0;
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour();
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle();
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple();
}
WXHANDLE wxBrush::GetResourceHandle() const
{
- wxCHECK_MSG( Ok(), FALSE, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), FALSE, wxT("invalid brush") );
return (WXHANDLE)M_BRUSHDATA->GetHBRUSH();
}
// the only way to change the checkbox foreground colour under Windows XP
// is to owner draw it
if ( wxUxThemeEngine::GetIfActive() )
- MakeOwnerDrawn(colour.Ok());
+ MakeOwnerDrawn(colour.IsOk());
return true;
}
{
wxBitmap *bitmap = (wxBitmap *)data;
- if ( bitmap && bitmap->Ok() )
+ if ( bitmap && bitmap->IsOk() )
{
wxDIB dib(*bitmap);
if ( dib.IsOk() )
HDC hdc = (HDC)pDC;
WXHBRUSH hbr = 0;
- if ( !colBg.Ok() )
+ if ( !colBg.IsOk() )
{
if ( wxWindow *win = wxFindWinFromHandle(hWnd) )
hbr = win->MSWGetBgBrush(pDC);
// use the background colour override if a valid colour is given: this is
// used when the control is disabled to grey it out and also if colBg was
// set just above
- if ( colBg.Ok() )
+ if ( colBg.IsOk() )
{
wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg);
hbr = (WXHBRUSH)brush->GetResourceHandle();
void wxSetCursor(const wxCursor& cursor)
{
- if ( cursor.Ok() )
+ if ( cursor.IsOk() )
{
::SetCursor(GetHcursorOf(cursor));
if ( m_oldBitmap )
{
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
- if ( m_selectedBitmap.Ok() )
+ if ( m_selectedBitmap.IsOk() )
{
m_selectedBitmap.SetSelectedInto(NULL);
m_selectedBitmap = wxNullBitmap;
void wxMemoryDCImpl::DoGetSize(int *width, int *height) const
{
- if ( m_selectedBitmap.Ok() )
+ if ( m_selectedBitmap.IsOk() )
{
*width = m_selectedBitmap.GetWidth();
*height = m_selectedBitmap.GetHeight();
{
wxBrush brush(dc.GetBrush());
wxPen pen(dc.GetPen());
- if (brush.Ok() && brush.GetStyle() != wxTRANSPARENT)
+ if (brush.IsOk() && brush.GetStyle() != wxTRANSPARENT)
{
HBRUSH hBrush = (HBRUSH) brush.GetResourceHandle() ;
if (hBrush)
}
}
width --; height --;
- if (pen.Ok() && pen.GetStyle() != wxTRANSPARENT)
+ if (pen.IsOk() && pen.GetStyle() != wxTRANSPARENT)
{
dc.DrawLine(x, y, x + width, y);
dc.DrawLine(x, y, x, y + height);
// Set this to 1 to work around an apparent video driver bug
// (visible with e.g. 70x70 rectangle on a memory DC; see Drawing sample)
#if wxUSE_MEMORY_DC_DRAW_RECTANGLE
- if (m_brush.Ok() && m_pen.Ok() &&
+ if (m_brush.IsOk() && m_pen.IsOk() &&
(m_brush.GetStyle() == wxSOLID || m_brush.GetStyle() == wxTRANSPARENT) &&
(m_pen.GetStyle() == wxSOLID || m_pen.GetStyle() == wxTRANSPARENT) &&
(GetLogicalFunction() == wxCOPY))
wxCoord x, wxCoord y,
bool useMask)
{
- wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
+ wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
int width = bmp.GetWidth(),
height = bmp.GetHeight();
{
// set our cursor for all windows (but see below)
wxCursor cursor = m_cursor;
- if ( !cursor.Ok() )
+ if ( !cursor.IsOk() )
cursor = wxCURSOR_ARROW;
::SetCursor(GetHcursorOf(cursor));
bool wxDIB::Create(const wxImage& image, PixelFormat pf)
{
- wxCHECK_MSG( image.Ok(), false, wxT("invalid wxImage in wxDIB ctor") );
+ wxCHECK_MSG( image.IsOk(), false, wxT("invalid wxImage in wxDIB ctor") );
const int h = image.GetHeight();
const int w = image.GetWidth();
const int w = GetWidth();
const int h = GetHeight();
wxImage image(w, h, false /* don't bother clearing memory */);
- if ( !image.Ok() )
+ if ( !image.IsOk() )
{
wxFAIL_MSG( wxT("could not allocate data for image") );
return wxNullImage;
return false;
}
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
{
#if wxUSE_SIMPLER_DRAGIMAGE
m_oldCursor = window->GetCursor();
}
#if !wxUSE_SIMPLER_DRAGIMAGE
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
::ShowCursor(FALSE);
#endif
}
#if wxUSE_SIMPLER_DRAGIMAGE
- if (m_cursor.Ok() && m_oldCursor.Ok())
+ if (m_cursor.IsOk() && m_oldCursor.IsOk())
m_window->SetCursor(m_oldCursor);
#else
::ShowCursor(TRUE);
bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
{
- wxCHECK_MSG( Ok(), false, wxT("can't play invalid enhanced metafile") );
+ wxCHECK_MSG( IsOk(), false, wxT("can't play invalid enhanced metafile") );
wxCHECK_MSG( dc, false, wxT("invalid wxDC in wxEnhMetaFile::Play") );
RECT rect;
{
wxSize size = wxDefaultSize;
- if ( Ok() )
+ if ( IsOk() )
{
ENHMETAHEADER hdr;
if ( !::GetEnhMetaFileHeader(GetEMF(), sizeof(hdr), &hdr) )
bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
{
- wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") );
+ wxCHECK_MSG( m_metafile.IsOk(), false, wxT("copying invalid enh metafile") );
HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE();
bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const
{
- wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") );
+ wxCHECK_MSG( m_metafile.IsOk(), false, wxT("copying invalid enh metafile") );
HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE();
chooseFontStruct.hwndOwner = GetHwndOf(m_parent);
chooseFontStruct.lpLogFont = &logFont;
- if ( m_fontData.m_initialFont.Ok() )
+ if ( m_fontData.m_initialFont.IsOk() )
{
flags |= CF_INITTOLOGFONTSTRUCT;
wxFillLogFont(&logFont, &m_fontData.m_initialFont);
}
- if ( m_fontData.m_fontColour.Ok() )
+ if ( m_fontData.m_fontColour.IsOk() )
{
chooseFontStruct.rgbColors = wxColourToRGB(m_fontData.m_fontColour);
}
case WM_QUERYDRAGICON:
{
const wxIcon& icon = GetIcon();
- HICON hIcon = icon.Ok() ? GetHiconOf(icon)
+ HICON hIcon = icon.IsOk() ? GetHiconOf(icon)
: (HICON)GetDefaultIcon();
rc = (WXLRESULT)hIcon;
processed = rc != 0;
// TODO: load colourmap.
bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.wx_str()));
- if ( !bitmap->Ok() )
+ if ( !bitmap->IsOk() )
{
// it's probably not found
wxLogError(wxT("Can't load bitmap '%s' from resources! Check .rc file."),
icon->SetHICON((WXHICON)hicon);
icon->SetSize(size.x, size.y);
- return icon->Ok();
+ return icon->IsOk();
}
bool wxICOResourceHandler::LoadIcon(wxIcon *icon,
icon->SetHICON((WXHICON)hicon);
- return icon->Ok();
+ return icon->IsOk();
}
// ----------------------------------------------------------------------------
m_palette = palette;
- if ( !m_palette.Ok() )
+ if ( !m_palette.IsOk() )
{
m_palette = CreateDefaultPalette();
- if ( !m_palette.Ok() )
+ if ( !m_palette.IsOk() )
return false;
}
void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
{
/* realize palette if this is the current window */
- if ( GetPalette()->Ok() ) {
+ if ( GetPalette()->IsOk() ) {
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette(GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
::RealizePalette(GetHDC());
{
/* realize palette if this is *not* the current window */
if ( GetPalette() &&
- GetPalette()->Ok() && (this != event.GetChangedWindow()) )
+ GetPalette()->IsOk() && (this != event.GetChangedWindow()) )
{
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette(GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
case wxPENSTYLE_STIPPLE :
{
wxBitmap* bmp = pen.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
m_penImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
#if wxUSE_PALETTE
else
{
wxBitmap* bmp = brush.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
wxDELETE( m_brushImage );
m_brushImage = Bitmap::FromHBITMAP((HBITMAP)bmp->GetHBITMAP(),
wxGraphicsPen wxGDIPlusRenderer::CreatePen(const wxPen& pen)
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsPen);
- if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT )
+ if ( !pen.IsOk() || pen.GetStyle() == wxTRANSPARENT )
return wxNullGraphicsPen;
else
{
wxGraphicsBrush wxGDIPlusRenderer::CreateBrush(const wxBrush& brush )
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsBrush);
- if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT )
+ if ( !brush.IsOk() || brush.GetStyle() == wxTRANSPARENT )
return wxNullGraphicsBrush;
else
{
const wxColour &col )
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsFont);
- if ( font.Ok() )
+ if ( font.IsOk() )
{
wxGraphicsFont p;
p.SetRefData(new wxGDIPlusFontData( this, gc, font, col ));
wxGraphicsBitmap wxGDIPlusRenderer::CreateBitmap( const wxBitmap &bitmap )
{
ENSURE_LOADED_OR_RETURN(wxNullGraphicsBitmap);
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
wxGraphicsBitmap p;
p.SetRefData(new wxGDIPlusBitmapData( this , bitmap ));
if ( solidBackground )
{
const wxBrush& brush = dc.GetBackground();
- if ( brush.Ok() )
+ if ( brush.IsOk() )
{
clr = wxColourToRGB(brush.GetColour());
}
wxMask *pMask;
bool deleteMask = false;
- if ( mask.Ok() )
+ if ( mask.IsOk() )
{
hbmpMask = GetHbitmapOf(mask);
pMask = NULL;
// them in any case if the item has custom colours or font
static const wxWinVersion winver = wxGetWinVersion();
bool mustUseOwnerDrawn = winver < wxWinVersion_98 ||
- pItem->GetTextColour().Ok() ||
- pItem->GetBackgroundColour().Ok() ||
- pItem->GetFont().Ok();
+ pItem->GetTextColour().IsOk() ||
+ pItem->GetBackgroundColour().IsOk() ||
+ pItem->GetFont().IsOk();
if ( !mustUseOwnerDrawn )
{
const wxBitmap& bmpUnchecked = pItem->GetBitmap(false),
bmpChecked = pItem->GetBitmap(true);
- if ( (bmpUnchecked.Ok() && IsGreaterThanStdSize(bmpUnchecked)) ||
- (bmpChecked.Ok() && IsGreaterThanStdSize(bmpChecked)) )
+ if ( (bmpUnchecked.IsOk() && IsGreaterThanStdSize(bmpUnchecked)) ||
+ (bmpChecked.IsOk() && IsGreaterThanStdSize(bmpChecked)) )
{
mustUseOwnerDrawn = true;
}
- data->CheckBgMargin.cyBottomHeight
- data->CheckMargin.cyBottomHeight);
- if ( IsCheckable() && !m_bmpChecked.Ok() )
+ if ( IsCheckable() && !m_bmpChecked.IsOk() )
{
if ( stat & wxODChecked )
{
bmp = GetDisabledBitmap();
}
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
// for not checkable bitmaps we should always use unchecked one
// because their checked bitmap is not set
bmp = GetBitmap(!IsCheckable() || (stat & wxODChecked));
#if wxUSE_IMAGE
- if ( bmp.Ok() && stat & wxODDisabled )
+ if ( bmp.IsOk() && stat & wxODDisabled )
{
// we need to grey out the bitmap as we don't have any specific
// disabled bitmap
wxImage imgGrey = bmp.ConvertToImage().ConvertToGreyscale();
- if ( imgGrey.Ok() )
+ if ( imgGrey.IsOk() )
bmp = wxBitmap(imgGrey);
}
#endif // wxUSE_IMAGE
}
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
wxMemoryDC dcMem(&dc);
dcMem.SelectObjectAsSource(bmp);
HRESULT STDMETHODCALLTYPE TranslateAccelerator(LPMSG lpmsg, WORD)
{
// TODO: send an event with this id
- if (m_window->m_oleInPlaceActiveObject.Ok())
+ if (m_window->m_oleInPlaceActiveObject.IsOk())
m_window->m_oleInPlaceActiveObject->TranslateAccelerator(lpmsg);
return S_FALSE;
}
HRESULT STDMETHODCALLTYPE DeactivateAndUndo(){return S_OK; }
HRESULT STDMETHODCALLTYPE OnPosRectChange(LPCRECT lprcPosRect)
{
- if (m_window->m_oleInPlaceObject.Ok() && lprcPosRect)
+ if (m_window->m_oleInPlaceObject.IsOk() && lprcPosRect)
{
//
// Result of several hours and days of bug hunting -
{
wxAutoIOleInPlaceSite inPlaceSite(
IID_IOleInPlaceSite, (IDispatch *) this);
- if (!inPlaceSite.Ok())
+ if (!inPlaceSite.IsOk())
return E_FAIL;
if (pViewToActivate)
{
wxAutoIOleDocument oleDoc(
IID_IOleDocument, m_window->m_oleObject);
- if (! oleDoc.Ok())
+ if (! oleDoc.IsOk())
return E_FAIL;
HRESULT hr = oleDoc->CreateView(inPlaceSite, NULL,
wxActiveXContainer::~wxActiveXContainer()
{
// disconnect connection points
- if (m_oleInPlaceObject.Ok())
+ if (m_oleInPlaceObject.IsOk())
{
m_oleInPlaceObject->InPlaceDeactivate();
m_oleInPlaceObject->UIDeactivate();
}
- if (m_oleObject.Ok())
+ if (m_oleObject.IsOk())
{
if (m_docAdviseCookie != 0)
m_oleObject->Unadvise(m_docAdviseCookie);
CHECK_HR(hret);
// adviseSink
wxAutoIAdviseSink adviseSink(IID_IAdviseSink, (IDispatch *) m_frameSite);
- wxASSERT(adviseSink.Ok());
+ wxASSERT(adviseSink.IsOk());
// Get Dispatch interface
hret = m_Dispatch.QueryInterface(IID_IDispatch, m_ActiveX);
// get type info via class info
wxAutoIProvideClassInfo classInfo(IID_IProvideClassInfo, m_ActiveX);
- wxASSERT(classInfo.Ok());
+ wxASSERT(classInfo.IsOk());
// type info
wxAutoITypeInfo typeInfo;
hret = classInfo->GetClassInfo(typeInfo.GetRef());
CHECK_HR(hret);
- wxASSERT(typeInfo.Ok());
+ wxASSERT(typeInfo.IsOk());
// TYPEATTR
TYPEATTR *ta = NULL;
// get dispatch type info interface
wxAutoITypeInfo ti;
hret = typeInfo->GetRefTypeInfo(rt, ti.GetRef());
- if (! ti.Ok())
+ if (! ti.IsOk())
continue;
CHECK_HR(hret);
DWORD adviseCookie = 0;
wxAutoIConnectionPointContainer cpContainer(IID_IConnectionPointContainer, m_ActiveX);
- wxASSERT( cpContainer.Ok());
+ wxASSERT( cpContainer.IsOk());
HRESULT hret =
cpContainer->FindConnectionPoint(ta->guid, cp.GetRef());
wxAutoIPersistStreamInit
pPersistStreamInit(IID_IPersistStreamInit, m_oleObject);
- if (pPersistStreamInit.Ok())
+ if (pPersistStreamInit.IsOk())
{
hret = pPersistStreamInit->InitNew();
CHECK_HR(hret);
m_oleObjectHWND = 0;
- if (m_oleInPlaceObject.Ok())
+ if (m_oleInPlaceObject.IsOk())
{
hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
if (SUCCEEDED(hret))
wxCopyRectToRECT(m_realparent->GetClientSize(), posRect);
if (posRect.right > 0 && posRect.bottom > 0 &&
- m_oleInPlaceObject.Ok())
+ m_oleInPlaceObject.IsOk())
{
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
}
CHECK_HR(hret);
}
- if (! m_oleObjectHWND && m_oleInPlaceObject.Ok())
+ if (! m_oleObjectHWND && m_oleInPlaceObject.IsOk())
{
hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
CHECK_HR(hret);
return;
// extents are in HIMETRIC units
- if (m_oleObject.Ok())
+ if (m_oleObject.IsOk())
{
m_oleObject->DoVerb(OLEIVERB_HIDE, 0, m_clientSite, 0,
(HWND)m_realparent->GetHWND(), &posRect);
(HWND)m_realparent->GetHWND(), &posRect);
}
- if (m_oleInPlaceObject.Ok())
+ if (m_oleInPlaceObject.IsOk())
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
event.Skip();
//---------------------------------------------------------------------------
void wxActiveXContainer::OnSetFocus(wxFocusEvent& event)
{
- if (m_oleInPlaceActiveObject.Ok())
+ if (m_oleInPlaceActiveObject.IsOk())
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
event.Skip();
//---------------------------------------------------------------------------
void wxActiveXContainer::OnKillFocus(wxFocusEvent& event)
{
- if (m_oleInPlaceActiveObject.Ok())
+ if (m_oleInPlaceActiveObject.IsOk())
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
event.Skip();
wxBitmap bitmap(bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes);
bitmap.SetHBITMAP((WXHBITMAP)hbmp);
- if ( !bitmap.Ok() ) {
+ if ( !bitmap.IsOk() ) {
wxFAIL_MSG(wxT("pasting/dropping invalid bitmap"));
return false;
bool wxBitmapDataObject::GetDataHere(const wxDataFormat& format,
void *pBuf) const
{
- wxASSERT_MSG( m_bitmap.Ok(), wxT("copying invalid bitmap") );
+ wxASSERT_MSG( m_bitmap.IsOk(), wxT("copying invalid bitmap") );
HBITMAP hbmp = (HBITMAP)m_bitmap.GetHBITMAP();
if ( format.GetFormatId() == CF_DIB )
m_bitmap.SetHBITMAP((WXHBITMAP)hbmp);
- wxASSERT_MSG( m_bitmap.Ok(), wxT("pasting invalid bitmap") );
+ wxASSERT_MSG( m_bitmap.IsOk(), wxT("pasting invalid bitmap") );
return true;
}
bool wxDropSource::GiveFeedback(wxDragResult effect)
{
const wxCursor& cursor = GetCursor(effect);
- if ( cursor.Ok() )
+ if ( cursor.IsOk() )
{
::SetCursor((HCURSOR)cursor.GetHCURSOR());
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->GetColour();
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->GetWidth();
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->GetStyle();
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->GetJoin();
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->GetCap();
}
int wxPen::GetDashes(wxDash** ptr) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = M_PENDATA->GetDash();
return M_PENDATA->GetDashCount();
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return m_refData ? M_PENDATA->GetDash() : NULL;
}
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return m_refData ? M_PENDATA->GetDashCount() : 0;
}
wxBitmap* wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return m_refData ? M_PENDATA->GetStipple() : NULL;
}
wxFFileOutputStream ostr(filename, wxT("w"));
- return ostr.Ok() && Export(ostr);
+ return ostr.IsOk() && Export(ostr);
#else
wxUnusedVar(filename);
return false;
bool wxStaticBitmap::ImageIsOk() const
{
- return m_image && m_image->Ok();
+ return m_image && m_image->IsOk();
}
wxIcon wxStaticBitmap::GetIcon() const
{
wxClientDC dc(const_cast<wxStaticText *>(this));
wxFont font(GetFont());
- if (!font.Ok())
+ if (!font.IsOk())
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
dc.SetFont(font);
NotifyIconData notifyData(GetHwndOf(m_win));
- if (icon.Ok())
+ if (icon.IsOk())
{
notifyData.uFlags |= NIF_ICON;
notifyData.hIcon = GetHiconOf(icon);
wxFontEncoding encoding = wxFONTENCODING_SYSTEM;
wxFont font = m_defaultStyle.GetFont();
- if ( !font.Ok() )
+ if ( !font.IsOk() )
font = GetFont();
- if ( font.Ok() )
+ if ( font.IsOk() )
{
encoding = font.GetEncoding();
}
if ( GetRichVersion() > 1 )
{
wxFont font = m_defaultStyle.GetFont();
- if ( !font.Ok() )
+ if ( !font.IsOk() )
font = GetFont();
- if ( font.Ok() )
+ if ( font.IsOk() )
{
wxFontEncoding encoding = font.GetEncoding();
if ( encoding != wxFONTENCODING_SYSTEM )
lf.lfWeight = FW_NORMAL;
wxFont font = wxCreateFontFromLogFont(& lf);
- if (font.Ok())
+ if (font.IsOk())
{
style.SetFont(font);
}
{
wxToolBarToolBase *tool = node->GetData();
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
- if ( bmpDisabled.Ok() )
+ if ( bmpDisabled.IsOk() )
{
const wxSize sizeBitmap = bmpDisabled.GetSize();
m_disabledImgList = new wxImageList
const int w = bmp.GetWidth();
const int h = bmp.GetHeight();
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
int xOffset = wxMax(0, (m_defaultWidth - w)/2);
int yOffset = wxMax(0, (m_defaultHeight - h)/2);
{
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
#if wxUSE_IMAGE && wxUSE_WXDIB
- if ( !bmpDisabled.Ok() )
+ if ( !bmpDisabled.IsOk() )
{
// no disabled bitmap specified but we still need to
// fill the space in the image list with something, so
if ( winTop )
{
wxIcon icon = winTop->GetIcon();
- if ( icon.Ok() )
+ if ( icon.IsOk() )
{
::SendMessage(GetHwnd(), WM_SETICON,
(WPARAM)TRUE,
}
int n = 0;
- if ( bmpToUse.Ok() )
+ if ( bmpToUse.IsOk() )
{
n = ::CommandBar_AddBitmap( (HWND) GetHWND(), NULL, (int) (HBITMAP) bmpToUse.GetHBITMAP(),
1, 16, 16 );
}
// don't "overwrite" busy cursor
- if ( m_cursor.Ok() && !wxIsBusy() )
+ if ( m_cursor.IsOk() && !wxIsBusy() )
{
// normally we should change the cursor only if it's over this window
// but we should do it always if we capture the mouse currently
int *externalLeading,
const wxFont *fontToUse) const
{
- wxASSERT_MSG( !fontToUse || fontToUse->Ok(),
+ wxASSERT_MSG( !fontToUse || fontToUse->IsOk(),
wxT("invalid font in GetTextExtent()") );
HFONT hfontToUse;
// m_cursor if the user code caught EVT_SET_CURSOR() and returned
// nothing from it - this is a way to say that our cursor shouldn't
// be used for this point
- if ( !processedEvtSetCursor && m_cursor.Ok() )
+ if ( !processedEvtSetCursor && m_cursor.IsOk() )
{
hcursor = GetHcursorOf(m_cursor);
}
if ( !hcursor && !GetParent() )
{
const wxCursor *cursor = wxGetGlobalCursor();
- if ( cursor && cursor->Ok() )
+ if ( cursor && cursor->IsOk() )
{
hcursor = GetHcursorOf(*cursor);
}
// to.
wxLogNull logNo; // suppress error if we couldn't load the bitmap
wxBitmap stdColourBitmap(wxT("wxBITMAP_STD_COLOURS"));
- if ( stdColourBitmap.Ok() )
+ if ( stdColourBitmap.IsOk() )
{
// the pixels in the bitmap must correspond to wxSTD_COL_XXX!
wxASSERT_MSG( stdColourBitmap.GetWidth() == wxSTD_COL_MAX,
,GetHaccel()
,pMsg
);
- return (Ok() && rc);
+ return (IsOk() && rc);
} // end of wxAcceleratorTable::Translate
// ---------------------------------------------------------------------------
{
UnRef();
- if (!rCursor.Ok())
+ if (!rCursor.IsOk())
return(false);
return(CopyFromIconOrCursor(rCursor));
} // end of wxBitmap::CopyFromCursor
{
UnRef();
- if (!rIcon.Ok())
+ if (!rIcon.IsOk())
return(false);
return CopyFromIconOrCursor(rIcon);
}
SetHBITMAP((WXHBITMAP)hBmp);
- return Ok();
+ return IsOk();
} // end of wxBitmap::Create
bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
else // no bitmap handler found
{
wxImage image;
- if ( image.LoadFile( filename, type ) && image.Ok() )
+ if ( image.LoadFile( filename, type ) && image.IsOk() )
{
*this = wxBitmap(image);
// FIXME what about palette? shouldn't we use it?
wxImage vImage = ConvertToImage();
- if (!vImage.Ok())
+ if (!vImage.IsOk())
return false;
return(vImage.SaveFile( rFilename
, int nDepth
)
{
- wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image"));
+ wxCHECK_MSG(rImage.IsOk(), false, wxT("invalid image"));
m_refData = new wxBitmapRefData();
int nSizeLimit = 1024 * 768 * 3;
//
// Set bitmap parameters
//
- wxCHECK_MSG(rImage.Ok(), false, wxT("invalid image"));
+ wxCHECK_MSG(rImage.IsOk(), false, wxT("invalid image"));
SetWidth(nWidth);
SetHeight(nBmpHeight);
if (nDepth == 1)
);
#if wxUSE_PALETTE
HPAL hOldPalette = NULLHANDLE;
- if (rImage.GetPalette().Ok())
+ if (rImage.GetPalette().IsOk())
{
hOldPalette = ::GpiSelectPalette(hPS, (HPAL)rImage.GetPalette().GetHPALETTE());
}
wxImage vImage;
wxDC* pDC;
- wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
//
// Create an wxImage object
const wxRect& rRect
) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rRect.x >= 0) && (rRect.y >= 0) &&
(rRect.x + rRect.width <= GetWidth()) &&
(rRect.y + rRect.height <= GetHeight()),
,rRect.height
,GetDepth()
);
- wxASSERT_MSG( vRet.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( vRet.IsOk(), wxT("GetSubBitmap error") );
//
::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap);
m_hMaskBitmap = 0;
}
- if (!rBitmap.Ok() || rBitmap.GetDepth() != 1)
+ if (!rBitmap.IsOk() || rBitmap.GetDepth() != 1)
{
return false;
}
::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap);
m_hMaskBitmap = 0;
}
- if (rBitmap.Ok() && rBitmap.GetPalette()->Ok())
+ if (rBitmap.IsOk() && rBitmap.GetPalette()->IsOk())
{
unsigned char cRed;
unsigned char cGreen;
::GpiDeleteBitmap((HBITMAP) m_hMaskBitmap);
m_hMaskBitmap = 0;
}
- if (!rBitmap.Ok())
+ if (!rBitmap.IsOk())
{
return false;
}
break;
case wxSTIPPLE:
- if (M_BRUSHDATA->m_vStipple.Ok())
+ if (M_BRUSHDATA->m_vStipple.IsOk())
{
::GpiSetBitmapId( M_BRUSHDATA->m_hBrush
,(USHORT)M_BRUSHDATA->m_vStipple.GetHBITMAP()
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_vColour;
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_nStyle;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return &(M_BRUSHDATA->m_vStipple);
}
int wxBrush::GetPS() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") );
return M_BRUSHDATA->m_hBrush;
}
WXHANDLE wxBrush::GetResourceHandle() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid brush") );
return (WXHANDLE)M_BRUSHDATA->m_hBrush;
} // end of wxBrush::GetResourceHandle
{
extern wxCursor *g_globalCursor;
- if ( cursor.Ok() && cursor.GetHCURSOR() )
+ if ( cursor.IsOk() && cursor.GetHCURSOR() )
{
// ::SetCursor((HCURSOR) cursor.GetHCURSOR());
m_bitmap = wxBitmap(vImage);
#endif //wxUSE_STREAMS
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
}
void wxBitmapDataObject::DoConvertToPng()
{
- if (!m_bitmap.Ok())
+ if (!m_bitmap.IsOk())
return;
#if wxUSE_STREAMS
if (m_hOldBitmap)
{
::GpiSetBitmap(hPS, (HBITMAP) m_hOldBitmap);
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vSelectedBitmap.SetSelectedInto(NULL);
}
}
else
{
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
vPoint[0].y = vY1;
vPoint[1].x = vX2;
vPoint[1].y = vY2;
- if (m_pen.Ok())
+ if (m_pen.IsOk())
{
vColor = m_pen.GetColour().GetPixel();
}
POINTL vPoint;
COLORREF vColor = 0x00ffffff;
- if (m_pen.Ok())
+ if (m_pen.IsOk())
{
vColor = m_pen.GetColour().GetPixel();
}
vY = OS2Y(vY,vHeight);
else
{
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
vY = OS2Y(vY,vHeight);
else
{
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
lColor = pWindowDC->m_pCanvas->GetBackgroundColour().GetPixel();
}
- else if (GetBrush().Ok())
+ else if (GetBrush().IsOk())
lColor = GetBrush().GetColour().GetPixel();
else
lColor = m_textBackgroundColour.GetPixel();
ULONG lOldForeGround = ::GpiQueryColor((HPS)GetHPS());
ULONG lOldBackGround = ::GpiQueryBackColor((HPS)GetHPS());
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
::GpiSetColor( (HPS)GetHPS()
,m_textForegroundColour.GetPixel()
);
}
- if (m_textBackgroundColour.Ok())
+ if (m_textBackgroundColour.IsOk())
{
::GpiSetBackColor( (HPS)GetHPS()
,m_textBackgroundColour.GetPixel()
//
// Set text color attributes
//
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
SetTextColor( m_hPS
,(int)m_textForegroundColour.GetPixel()
);
}
- if (m_textBackgroundColour.Ok())
+ if (m_textBackgroundColour.IsOk())
{
nOldBackground = SetTextBkColor( m_hPS
,(int)m_textBackgroundColour.GetPixel()
}
else
{
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
// it never is set to anything else, but background should remain
// transparent even if we just drew an opaque string)
//
- if (m_textBackgroundColour.Ok())
+ if (m_textBackgroundColour.IsOk())
SetTextBkColor( m_hPS
,nOldBackground
);
m_hOldPalette = 0;
}
- if (m_palette.Ok())
+ if (m_palette.IsOk())
{
HPALETTE hOldPal;
m_hOldFont = 0;
}
m_palette = rPalette;
- if (!rPalette.Ok())
+ if (!rPalette.IsOk())
{
if (m_hOldFont)
{
m_hOldFont = 0;
}
m_font = rFont;
- if (!rFont.Ok())
+ if (!rFont.IsOk())
{
m_hOldFont = 0;
}
m_font.SetPS(m_hPS); // this will realize the font
- if (m_font.Ok())
+ if (m_font.IsOk())
{
HFONT hFont = m_font.GetResourceHandle();
if (hFont == (HFONT) NULL)
if (m_pen == rPen)
return;
m_pen = rPen;
- if (!m_pen.Ok())
+ if (!m_pen.IsOk())
return;
if (m_hOldPen)
m_hOldPen = 0L;
m_pen = rPen;
- if (!m_pen.Ok())
+ if (!m_pen.IsOk())
{
if (m_hOldPen)
{
m_hOldPen = 0L;
}
- if (m_pen.Ok())
+ if (m_pen.IsOk())
{
if (m_pen.GetResourceHandle())
{
if (m_hOldBrush)
m_hOldBrush = 0L;
m_brush = rBrush;
- if (!m_brush.Ok())
+ if (!m_brush.IsOk())
if (m_brush == rBrush)
return;
- if (!m_brush.Ok())
+ if (!m_brush.IsOk())
if (m_hOldBrush)
m_hOldBrush = 0L;
- if (!m_brush.Ok())
+ if (!m_brush.IsOk())
{
if (m_hOldBrush)
{
m_hOldBrush = 0L;
}
- if (m_brush.Ok())
+ if (m_brush.IsOk())
{
if (m_brush.GetResourceHandle())
{
{
m_backgroundBrush = rBrush;
- if (m_backgroundBrush.Ok())
+ if (m_backgroundBrush.IsOk())
{
(void)::GpiSetBackColor((HPS)m_hPS, m_backgroundBrush.GetColour().GetPixel());
}
const wxBitmap& rBmp = pm_impl->GetSelectedBitmap();
pMask = rBmp.GetMask();
- if (!(rBmp.Ok() && pMask && pMask->GetMaskBitmap()))
+ if (!(rBmp.IsOk() && pMask && pMask->GetMaskBitmap()))
{
bUseMask = false;
}
);
vOldTextColor = (COLORREF)vCbnd.lColor;
- if (m_textForegroundColour.Ok())
+ if (m_textForegroundColour.IsOk())
{
vCbnd.lColor = (LONG)m_textForegroundColour.GetPixel();
::GpiSetAttrs( m_hPS // presentation-space handle
,&vCbnd // buffer for attributes.
);
}
- if (m_textBackgroundColour.Ok())
+ if (m_textBackgroundColour.IsOk())
{
::GpiSetBackColor(m_hPS, (LONG)m_textBackgroundColour.GetPixel());
}
if (m_hOldBitmap)
{
::GpiSetBitmap(m_hPS, NULLHANDLE);
- if (m_vSelectedBitmap.Ok())
+ if (m_vSelectedBitmap.IsOk())
{
m_vSelectedBitmap.SetSelectedInto(NULL);
m_vSelectedBitmap = wxNullBitmap;
, int* pHeight
) const
{
- if (!m_vSelectedBitmap.Ok())
+ if (!m_vSelectedBitmap.IsOk())
{
*pWidth = 0;
*pHeight = 0;
wxCoord WXUNUSED(vY),
bool WXUNUSED(bUseMask))
{
- wxCHECK_RET( rBmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
+ wxCHECK_RET( rBmp.IsOk(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") );
// int nWidth = rBmp.GetWidth();
// int nHeight = rBmp.GetHeight();
{
const wxCursor& rCursor = GetCursor(eEffect);
- if (rCursor.Ok())
+ if (rCursor.IsOk())
{
::WinSetPointer(HWND_DESKTOP, (HPOINTER)rCursor.GetHCURSOR());
m_vDragImage.hImage = (LHANDLE)rCursor.GetHCURSOR();
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->GetPointSize();
} // end of wxFont::GetPointSize
wxFontStyle wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") );
return M_FONTDATA->GetStyle();
} // end of wxFont::GetStyle
wxFontWeight wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->GetWeight();
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->GetUnderlined();
} // end of wxFont::GetUnderlined
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->GetFaceName();
} // end of wxFont::GetFaceName
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
return M_FONTDATA->GetEncoding();
} // end of wxFont::GetEncoding
const wxIcon& vIcon = GetIcon();
HPOINTER hIcon;
- if (vIcon.Ok())
+ if (vIcon.IsOk())
hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L);
else
hIcon = (HPOINTER)m_hDefaultIcon;
const wxIcon& vIcon = GetIcon();
HPOINTER hIcon;
- if (vIcon.Ok())
+ if (vIcon.IsOk())
hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
else
hIcon = (HPOINTER)m_hDefaultIcon;
wxBitmapRefData* pData = pBitmap->GetBitmapData();
- if ( pBitmap->Ok() )
+ if ( pBitmap->IsOk() )
{
BITMAPINFOHEADER vBmph;
pData->m_nHeight = vBmph.cy;
pData->m_nDepth = vBmph.cBitCount;
}
- return(pBitmap->Ok());
+ return(pBitmap->IsOk());
} // end of wxBMPResourceHandler::LoadFile
bool wxBMPFileHandler::LoadFile( wxBitmap* pBitmap,
pIcon->SetHICON((WXHICON)hIcon);
- return pIcon->Ok();
+ return pIcon->IsOk();
} // end of wxICOResourceHandler::LoadIcon
// resize the space so the BMP will fit. Without this, BMPs
// must be no larger or smaller than 16x16.
//
- if (m_bmpChecked.Ok())
+ if (m_bmpChecked.IsOk())
{
//
// Is BMP height larger than text height?
// Draw the bitmap
// ---------------
//
- if (IsCheckable() && !m_bmpChecked.Ok())
+ if (IsCheckable() && !m_bmpChecked.IsOk())
{
if (eStatus & wxODChecked)
{
//
wxBitmap vBmp(GetBitmap(IsCheckable() ? ((eStatus & wxODChecked) != 0) : TRUE));
- if (vBmp.Ok())
+ if (vBmp.IsOk())
{
wxMemoryDC vDCMem(&rDC);
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_vColour;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_nWidth;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nJoin;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_nCap;
}
int wxPen::GetPS() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid pen") );
return M_PENDATA->m_hPen;
}
int wxPen::GetDashes(wxDash** ptr) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = M_PENDATA->m_dash;
return M_PENDATA->m_nbDash;
wxDash* wxPen::GetDash() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return M_PENDATA->m_dash;
}
int wxPen::GetDashCount() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_nbDash;
}
wxBitmap* wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return &(M_PENDATA->m_vStipple);
}
,NULL // no control data
,NULL // no Presentation parameters
);
- if (GetFont().Ok())
+ if (GetFont().IsOk())
{
if (GetFont().GetResourceHandle())
{
bool wxStaticBitmap::ImageIsOk() const
{
- return(m_pImage && m_pImage->Ok());
+ return(m_pImage && m_pImage->IsOk());
}
void wxStaticBitmap::Free()
PrepareDC(rDc);
- if (!vBitmap.Ok())
+ if (!vBitmap.IsOk())
return;
if ((pMask = vBitmap.GetMask()) != NULL)
if (pMask->GetMaskBitmap() != NULLHANDLE)
wxColour vColor(wxT("GREY"));
rDc.SetTextForeground(vColor);
- if (!pTool->GetDisabledBitmap().Ok())
+ if (!pTool->GetDisabledBitmap().IsOk())
pTool->SetDisabledBitmap(wxDisableBitmap( vBitmap
,(long)GetBackgroundColour().GetPixel()
));
LowerTool(pTool);
rDc.SetTextForeground(vColor);
- if (!pTool->GetDisabledBitmap().Ok())
+ if (!pTool->GetDisabledBitmap().IsOk())
pTool->SetDisabledBitmap(wxDisableBitmap( vBitmap
,(long)GetBackgroundColour().GetPixel()
));
const wxIcon& vIcon = rIcons.GetIconOfExactSize(32);
- if (vIcon.Ok())
+ if (vIcon.IsOk())
{
::WinSendMsg( m_hFrame
,WM_SETICON
::GpiSetBitmap(hPS, NULLHANDLE);
::GpiDestroyPS(hPS);
::DevCloseDC(hDC);
- if (vNewBmp.Ok())
+ if (vNewBmp.IsOk())
return(vNewBmp);
return(wxNullBitmap);
} // end of wxDisableBitmap
return false;
}
- if ( m_cursor.Ok() ) {
+ if ( m_cursor.IsOk() ) {
HWND hWnd = GetHwnd();
POINTL vPoint;
RECTL vRect;
int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
{
- if (!Ok()) return -1;
+ if (!IsOk()) return -1;
wxAccelList::compatibility_iterator node = M_ACCELDATA->m_accels.GetFirst();
while (node)
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->GetColour();
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->GetStyle();
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return M_BRUSHDATA->GetStipple();
}
#if wxUSE_IMAGE
wxImage image ;
image.LoadFile( cursor_file, flags ) ;
- if ( image.Ok() )
+ if ( image.IsOk() )
{
image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX ) ;
image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY ) ;
{
Init();
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
SetBitmap( rBitmap );
}
{
Clear();
wxBitmapDataObjectBase::SetBitmap( rBitmap );
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
CGImageRef cgImageRef = (CGImageRef) m_bitmap.CreateCGImage();
cgImageRef = NULL;
}
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
}
#endif
UInt32 noOfColumns;
- wxCFStringRef title(columnPtr->GetTitle(),m_font.Ok() ? dynamic_cast<wxDataViewCtrl*>(GetWXPeer())->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
+ wxCFStringRef title(columnPtr->GetTitle(),m_font.IsOk() ? dynamic_cast<wxDataViewCtrl*>(GetWXPeer())->GetFont().GetEncoding() : wxLocale::GetSystemEncoding());
// try to get new ID for the column:
{
wxCHECK_MSG(GetValue().GetType() == GetVariantType(),false,wxString(_("Text renderer cannot render value; value type: ")) << GetValue().GetType());
- wxCFStringRef cfString(GetValue().GetString(),(GetView()->GetFont().Ok() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
+ wxCFStringRef cfString(GetValue().GetString(),(GetView()->GetFont().IsOk() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
return (::SetDataBrowserItemDataText(GetNativeData()->GetItemDataRef(),cfString) == noErr);
}
wxBitmap bitmap;
bitmap << GetValue();
- return (!(bitmap.Ok()) || (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),bitmap.GetIconRef()) == noErr));
+ return (!(bitmap.IsOk()) || (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),bitmap.GetIconRef()) == noErr));
}
IMPLEMENT_CLASS(wxDataViewBitmapRenderer,wxDataViewRenderer)
iconText << GetValue();
- wxCFStringRef cfString(iconText.GetText(),(GetView()->GetFont().Ok() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
+ wxCFStringRef cfString(iconText.GetText(),(GetView()->GetFont().IsOk() ? GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
if (iconText.GetIcon().IsOk())
if (::SetDataBrowserItemDataIcon(GetNativeData()->GetItemDataRef(),MAC_WXHICON(iconText.GetIcon().GetHICON())) != noErr)
DataBrowserListViewHeaderDesc headerDescription;
wxCHECK_RET(macDataViewListCtrlPtr->GetHeaderDesc(GetNativeData()->GetPropertyID(),&headerDescription) == noErr,_("Could not get header description."));
- if (GetBitmap().Ok())
+ if (GetBitmap().IsOk())
headerDescription.btnContentInfo.u.iconRef = GetBitmap().GetIconRef();
else
headerDescription.btnContentInfo.u.iconRef = NULL;
if (macDataViewListCtrlPtr != NULL)
{
DataBrowserListViewHeaderDesc headerDescription;
- wxCFStringRef cfTitle(title,(dataViewCtrlPtr->GetFont().Ok() ? dataViewCtrlPtr->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
+ wxCFStringRef cfTitle(title,(dataViewCtrlPtr->GetFont().IsOk() ? dataViewCtrlPtr->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
wxCHECK_RET(macDataViewListCtrlPtr->GetHeaderDesc(GetNativeData()->GetPropertyID(),&headerDescription) == noErr,_("Could not get header description."));
headerDescription.titleString = cfTitle;
// returns 0 in case of no Error, otherwise platform specific error codes
virtual wxUint32 GetStatus() const = 0 ;
- bool Ok() { return GetStatus() == 0 ; }
+ bool IsOk() { return GetStatus() == 0 ; }
static wxNativePrinterDC* Create(wxPrintData* data) ;
} ;
m_nativePrinterDC = wxNativePrinterDC::Create( &m_printData ) ;
if ( m_nativePrinterDC )
{
- m_ok = m_nativePrinterDC->Ok() ;
+ m_ok = m_nativePrinterDC->IsOk() ;
if ( !m_ok )
{
wxString message ;
{
// in case we have to do additional things when successful
}
- m_ok = m_nativePrinterDC->Ok() ;
+ m_ok = m_nativePrinterDC->IsOk() ;
if ( !m_ok )
{
wxString message ;
return ;
m_nativePrinterDC->EndDoc( (wxPrinterDC*) GetOwner() ) ;
- m_ok = m_nativePrinterDC->Ok() ;
+ m_ok = m_nativePrinterDC->IsOk() ;
if ( !m_ok )
{
m_backgroundBrush = *wxWHITE_BRUSH;
m_nativePrinterDC->StartPage( (wxPrinterDC*) GetOwner() ) ;
- m_ok = m_nativePrinterDC->Ok() ;
+ m_ok = m_nativePrinterDC->IsOk() ;
}
return ;
m_nativePrinterDC->EndPage( (wxPrinterDC*) GetOwner() );
- m_ok = m_nativePrinterDC->Ok() ;
+ m_ok = m_nativePrinterDC->IsOk() ;
}
void wxPrinterDCImpl::DoGetSize(int *width, int *height) const
const wxNativeFontInfo * wxFont::GetNativeFontInfo() const
{
wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") );
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
// cast away constness otherwise lazy font resolution is not possible
const_cast<wxFont *>(this)->RealizeResource();
OSStatus err ;
wxFont font = *wxNORMAL_FONT ;
- if ( m_fontData.m_initialFont.Ok() )
+ if ( m_fontData.m_initialFont.IsOk() )
{
font = m_fontData.m_initialFont ;
}
wxSize size = GetSize();
wxFont font = GetFont();
- if ( font.Ok() )
+ if ( font.IsOk() )
{
dc.SetFont(font);
// Calculate vertical centre
InitializeControls();
m_previewCtrl->SetFont(m_dialogFont);
- if (m_fontData.GetColour().Ok())
+ if (m_fontData.GetColour().IsOk())
{
m_previewCtrl->SetForegroundColour(m_fontData.GetColour());
}
bool fontUnderline = false;
wxString fontName;
- if (m_fontData.m_initialFont.Ok())
+ if (m_fontData.m_initialFont.IsOk())
{
fontFamily = m_fontData.m_initialFont.GetFamily();
fontWeight = m_fontData.m_initialFont.GetWeight();
}
m_facenameCtrl->SetStringSelection(facename);
- if (m_colourCtrl && m_fontData.GetColour().Ok())
+ if (m_colourCtrl && m_fontData.GetColour().IsOk())
{
m_colourCtrl->SetColour(m_fontData.GetColour());
m_colourCtrl->Refresh();
[accessoryView resetFlags];
#if wxOSX_USE_COCOA
wxFont font = *wxNORMAL_FONT ;
- if ( fontdata.m_initialFont.Ok() )
+ if ( fontdata.m_initialFont.IsOk() )
{
font = fontdata.m_initialFont ;
}
[[NSFontPanel sharedFontPanel] setPanelFont: font.OSXGetNSFont() isMultiple:NO];
- if(fontdata.m_fontColour.Ok())
+ if(fontdata.m_fontColour.IsOk())
[[NSColorPanel sharedColorPanel] setColor:
[NSColor colorWithCalibratedRed:fontdata.m_fontColour.Red() / 255.0
green:fontdata.m_fontColour.Green() / 255.0
//if the font is valid set the default (selected) font of the
//NSFontDialog to that font
- if (thewxfont.Ok())
+ if (thewxfont.IsOk())
{
NSFontTraitMask theMask = 0;
}
- if(m_fontData.m_fontColour.Ok())
+ if(m_fontData.m_fontColour.IsOk())
[[NSColorPanel sharedColorPanel] setColor:
[NSColor colorWithCalibratedRed:m_fontData.m_fontColour.Red() / 255.0
green:m_fontData.m_fontColour.Green() / 255.0
public :
ImagePattern( const wxBitmap* bmp , const CGAffineTransform& transform )
{
- wxASSERT( bmp && bmp->Ok() );
+ wxASSERT( bmp && bmp->IsOk() );
#ifdef __WXMAC__
Init( (CGImageRef) bmp->CreateCGImage() , transform );
#endif
case wxPENSTYLE_STIPPLE:
{
wxBitmap* bmp = pen.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
m_colorSpace.reset( CGColorSpaceCreatePattern( NULL ) );
m_pattern.reset( (CGPatternRef) *( new ImagePattern( bmp , CGAffineTransformMakeScale( 1,-1 ) ) ) );
{
// now brush is a bitmap
wxBitmap* bmp = brush.GetStipple();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
{
m_isPattern = true;
m_patternColorComponents = new CGFloat[1] ;
wxGraphicsPen wxMacCoreGraphicsRenderer::CreatePen(const wxPen& pen)
{
- if ( !pen.Ok() || pen.GetStyle() == wxTRANSPARENT )
+ if ( !pen.IsOk() || pen.GetStyle() == wxTRANSPARENT )
return wxNullGraphicsPen;
else
{
wxGraphicsBrush wxMacCoreGraphicsRenderer::CreateBrush(const wxBrush& brush )
{
- if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT )
+ if ( !brush.IsOk() || brush.GetStyle() == wxTRANSPARENT )
return wxNullGraphicsBrush;
else
{
wxGraphicsBitmap wxMacCoreGraphicsRenderer::CreateBitmap( const wxBitmap& bmp )
{
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
wxGraphicsBitmap p;
p.SetRefData(new wxMacCoreGraphicsBitmapData( this , bmp.CreateCGImage(), bmp.GetDepth() == 1 ) );
// sets the font
wxGraphicsFont wxMacCoreGraphicsRenderer::CreateFont( const wxFont &font , const wxColour &col )
{
- if ( font.Ok() )
+ if ( font.IsOk() )
{
wxGraphicsFont p;
p.SetRefData(new wxMacCoreGraphicsFontData( this , font, col ));
WXHICON wxIcon::GetHICON() const
{
- wxASSERT( Ok() ) ;
+ wxASSERT( IsOk() ) ;
return (WXHICON) ((wxIconRefData*)m_refData)->GetHICON() ;
}
int wxIcon::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid icon") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid icon") );
return M_ICONDATA->GetWidth();
}
int wxIcon::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid icon") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid icon") );
return M_ICONDATA->GetHeight();
}
else
{
wxImage loadimage( filename, type );
- if (loadimage.Ok())
+ if (loadimage.IsOk())
{
if ( desiredWidth == -1 )
desiredWidth = loadimage.GetWidth() ;
if ( icon.LoadFile( name , wxBITMAP_TYPE_ICON_RESOURCE , desiredWidth , desiredHeight ) )
{
bitmap->CopyFromIcon( icon ) ;
- return bitmap->Ok() ;
+ return bitmap->IsOk() ;
}
return false;
}
// TODO: Why is m_font not defined when we enter wxLC_LIST mode, but is
// defined for other modes?
wxFontEncoding enc;
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
enc = m_font.GetEncoding();
else
enc = wxLocale::GetSystemEncoding();
if (item.GetMask() & wxLIST_MASK_TEXT)
{
wxFontEncoding enc;
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
enc = GetFont().GetEncoding();
else
enc = wxLocale::GetSystemEncoding();
if (imageList && imageList->GetImageCount() > 0)
{
wxBitmap bmp = imageList->GetBitmap(0);
- //if (bmp.Ok())
+ //if (bmp.IsOk())
// type = kDataBrowserIconAndTextType;
}
if (bgColor == wxNullColour)
bgColor = listBgColor;
- if (!font.Ok())
+ if (!font.IsOk())
font = list->GetFont();
wxCFStringRef cfString( text, wxLocale::GetSystemEncoding() );
else
{
- if (color.Ok())
+ if (color.IsOk())
color.GetRGBColor(&labelColor);
- else if (list->GetTextColour().Ok())
+ else if (list->GetTextColour().IsOk())
list->GetTextColour().GetRGBColor(&labelColor);
- if (bgColor.Ok())
+ if (bgColor.IsOk())
{
bgColor.GetRGBColor(&backgroundColor);
CGContextSaveGState(context);
{
info.version = kHIThemeTextInfoVersionOne;
info.fontID = kThemeViewsFont;
- if (font.Ok())
+ if (font.IsOk())
{
info.fontID = kThemeSpecifiedFont;
info.font = (CTFontRef) font.OSXGetCTFont();
info.version = kHIThemeTextInfoVersionZero;
info.fontID = kThemeViewsFont;
- if (font.Ok())
+ if (font.IsOk())
{
info.fontID = font.MacGetThemeFontID();
MenuItemIndex i = FindMenuItemIndex() ;
if ( i > 0 )
{
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
#if wxUSE_BMPBUTTON
ControlButtonContentInfo info ;
{
wxSize dataSize = wxDefaultSize;
- if (Ok())
+ if (IsOk())
{
dataSize.x = M_METAFILEDATA->GetWidth();
dataSize.y = M_METAFILEDATA->GetHeight();
if ( notebook.GetImageList() && notebook.GetPageImage(ii) >= 0 )
{
const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( ii ) ) ;
- if ( bmap.Ok() )
+ if ( bmap.IsOk() )
{
ControlButtonContentInfo info ;
//! Union /e region with this.
bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op)
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid wxRegion") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid wxRegion") );
// Don't change shared data
if (!m_refData)
wxPaintDC dc(this);
PrepareDC(dc);
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ;
}
wxSize wxStaticBitmap::DoGetBestSize() const
{
- if ( m_bitmap.Ok() )
+ if ( m_bitmap.IsOk() )
return DoGetSizeFromClientSize( wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) );
// this is completely arbitrary
// convert the wxIcon into a wxBitmap so we can perform some
// wxBitmap operations with it
wxBitmap bmp( icon );
- wxASSERT( bmp.Ok() );
+ wxASSERT( bmp.IsOk() );
// get the CGImageRef for the wxBitmap:
// OSX builds only, but then the dock only exists in OSX
// TODO: Why is m_font not defined when we enter wxLC_LIST mode, but is
// defined for other modes?
wxFontEncoding enc;
- if ( m_font.Ok() )
+ if ( m_font.IsOk() )
enc = m_font.GetEncoding();
else
enc = wxLocale::GetSystemEncoding();
SetBezelStyleFromBorderFlags(v, style);
- if (bitmap.Ok())
+ if (bitmap.IsOk())
[v setImage:bitmap.GetNSImage() ];
[v setButtonType:NSMomentaryPushInButton];
if ( notebook.GetImageList() && notebook.GetPageImage(i) >= 0 )
{
const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( i ) ) ;
- if ( bmap.Ok() )
+ if ( bmap.IsOk() )
{
// TODO how to set an image on a tab
}
virtual bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxEmptyString) = 0;
virtual bool RemoveIcon() = 0;
- bool IsIconInstalled() const { return m_icon.Ok(); }
+ bool IsIconInstalled() const { return m_icon.IsOk(); }
virtual bool PopupMenu(wxMenu *menu) = 0;
virtual ~wxTaskBarIconImpl();
NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
wxNSButton* v = [[wxNSButton alloc] initWithFrame:r];
- if (label.Ok())
+ if (label.IsOk())
[v setImage:label.GetNSImage() ];
SetBezelStyleFromBorderFlags(v, style);
void wxMacCreateBitmapButton( ControlButtonContentInfo*info , const wxBitmap& bitmap , int forceType )
{
memset( info , 0 , sizeof(ControlButtonContentInfo) ) ;
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
wxBitmapRefData * bmap = bitmap.GetBitmapData() ;
if ( bmap == NULL )
void * wxBitmap::GetRawAccess() const
{
- wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ;
+ wxCHECK_MSG( IsOk() , NULL , wxT("invalid bitmap") ) ;
return M_BITMAPDATA->GetRawAccess() ;
}
void * wxBitmap::BeginRawAccess()
{
- wxCHECK_MSG( Ok() , NULL , wxT("invalid bitmap") ) ;
+ wxCHECK_MSG( IsOk() , NULL , wxT("invalid bitmap") ) ;
return M_BITMAPDATA->BeginRawAccess() ;
}
void wxBitmap::EndRawAccess()
{
- wxCHECK_RET( Ok() , wxT("invalid bitmap") ) ;
+ wxCHECK_RET( IsOk() , wxT("invalid bitmap") ) ;
M_BITMAPDATA->EndRawAccess() ;
}
CGImageRef wxBitmap::CreateCGImage() const
{
- wxCHECK_MSG( Ok(), NULL , wxT("invalid bitmap") ) ;
+ wxCHECK_MSG( IsOk(), NULL , wxT("invalid bitmap") ) ;
return M_BITMAPDATA->CreateCGImage() ;
}
#ifndef __WXOSX_IPHONE__
IconRef wxBitmap::GetIconRef() const
{
- wxCHECK_MSG( Ok(), NULL , wxT("invalid bitmap") ) ;
+ wxCHECK_MSG( IsOk(), NULL , wxT("invalid bitmap") ) ;
return M_BITMAPDATA->GetIconRef() ;
}
#endif
wxBitmap wxBitmap::GetSubBitmap(const wxRect &rect) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= GetWidth()) &&
(rect.y+rect.height <= GetHeight()),
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
wxBitmap ret( rect.width, rect.height, GetDepth() );
- wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
int destwidth = rect.width ;
int destheight = rect.height ;
{
#if wxUSE_IMAGE
wxImage loadimage(filename, type);
- if (loadimage.Ok())
+ if (loadimage.IsOk())
{
*this = loadimage;
wxBitmap::wxBitmap(const wxImage& image, int depth)
{
- wxCHECK_RET( image.Ok(), wxT("invalid image") );
+ wxCHECK_RET( image.IsOk(), wxT("invalid image") );
// width and height of the device-dependent bitmap
int width = image.GetWidth();
{
wxImage image;
- wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
// create an wxImage object
int width = GetWidth();
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BITMAPDATA->GetHeight();
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BITMAPDATA->GetWidth() ;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BITMAPDATA->GetDepth();
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BITMAPDATA->m_bitmapMask;
}
bool wxBitmap::HasAlpha() const
{
- wxCHECK_MSG( Ok(), false , wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), false , wxT("invalid bitmap") );
return M_BITMAPDATA->HasAlpha() ;
}
#if wxUSE_PALETTE
wxPalette *wxBitmap::GetPalette() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("Invalid bitmap GetPalette()") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("Invalid bitmap GetPalette()") );
return &M_BITMAPDATA->m_bitmapPalette;
}
void *wxBitmap::GetRawData(wxPixelDataBase& data, int WXUNUSED(bpp))
{
- if ( !Ok() )
+ if ( !IsOk() )
// no bitmap, no data (raw or otherwise)
return NULL;
wxMemoryDCImpl::~wxMemoryDCImpl()
{
- if ( m_selected.Ok() )
+ if ( m_selected.IsOk() )
{
m_selected.EndRawAccess() ;
wxDELETE(m_graphicContext);
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{
- if ( m_selected.Ok() )
+ if ( m_selected.IsOk() )
{
m_selected.EndRawAccess() ;
wxDELETE(m_graphicContext);
}
m_selected = bitmap;
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if ( m_selected.GetDepth() != 1 )
m_selected.UseAlpha() ;
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (width)
(*width) = m_selected.GetWidth();
bool wxDropSource::MacInstallDefaultCursor(wxDragResult effect)
{
const wxCursor& cursor = GetCursor(effect);
- bool result = cursor.Ok();
+ bool result = cursor.IsOk();
if ( result )
cursor.MacInstall();
int wxImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
{
wxBitmap bmp( bitmap );
- if (mask.Ok())
+ if (mask.IsOk())
bmp.SetMask( new wxMask( mask ) );
return Add( bmp );
m_images.Insert( next, newBitmap );
}
- if (mask.Ok())
+ if (mask.IsOk())
newBitmap->SetMask(new wxMask(mask));
return true;
[bui initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
bui.width = 25.0f;
}
- else if ( bmpNormal.Ok() )
+ else if ( bmpNormal.IsOk() )
{
[bui initWithImage:bmpNormal.GetUIImage() style:UIBarButtonItemStylePlain target:toolbar
action:@selector(clickedAction:)];
if ( !m_parentMenu )
return;
- if ( m_bitmap.Ok() )
+ if ( m_bitmap.IsOk() )
{
GetPeer()->SetBitmap( m_bitmap );
}
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_width;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_style;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_join;
}
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_cap;
}
int wxPen::GetDashes(wxDash **ptr) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = M_PENDATA->m_dash;
return M_PENDATA->m_nbDash;
wxBitmap *wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid pen") );
return &M_PENDATA->m_stipple;
}
{
// Don't assert, in case we set the window variant before
// the window is created
- // wxASSERT( GetPeer()->Ok() ) ;
+ // wxASSERT( GetPeer()->IsOk() ) ;
m_windowVariant = variant ;
{
if (m_growBox)
{
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
m_growBox->SetBackgroundColour(m_backgroundColour);
else
m_growBox->SetBackgroundColour(*wxWHITE);
return false ;
}
- wxASSERT_MSG( m_cursor.Ok(),
+ wxASSERT_MSG( m_cursor.IsOk(),
wxT("cursor must be valid after call to the base version"));
if ( GetPeer() != NULL )
CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ;
CGContextSaveGState( cgContext );
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
{
CGContextSetFillColorWithColor( cgContext, m_backgroundColour.GetCGColor() );
}
#else
if (m_growBox)
{
- if ( m_backgroundColour.Ok() )
+ if ( m_backgroundColour.IsOk() )
m_growBox->SetBackgroundColour(m_backgroundColour);
else
m_growBox->SetBackgroundColour(*wxWHITE);
// if the user code caught EVT_SET_CURSOR() and returned nothing from
// it - this is a way to say that our cursor shouldn't be used for this
// point
- if ( !processedEvtSetCursor && m_cursor.Ok() )
+ if ( !processedEvtSetCursor && m_cursor.IsOk() )
cursor = m_cursor ;
if ( !wxIsBusy() && !GetParent() )
cursor = *wxSTANDARD_CURSOR ;
}
- if ( cursor.Ok() )
+ if ( cursor.IsOk() )
cursor.MacInstall() ;
}
- return cursor.Ok() ;
+ return cursor.IsOk() ;
}
wxString wxWindowMac::MacGetToolTipString( wxPoint &WXUNUSED(pt) )
wxString wxFont::GetNativeFontInfoDesc() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
// be sure we have an HFONT associated...
wxConstCast(this, wxFont)->RealizeResource();
wxString wxFont::GetNativeFontInfoUserDesc() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
// be sure we have an HFONT associated...
wxConstCast(this, wxFont)->RealizeResource();
wxFont font;
font << m_value;
- if ( !font.Ok() )
+ if ( !font.IsOk() )
{
m_value << *wxNORMAL_FONT;
}
{
wxColourPropertyValue cpv;
- if ( colour.Ok() )
+ if ( colour.IsOk() )
cpv.Init( type, colour );
else
cpv.Init( type, *wxWHITE );
cpv << m_value;
wxColour col = cpv.m_colour;
- if ( !col.Ok() )
+ if ( !col.IsOk() )
{
SetValueToUnspecified();
SetIndex(wxNOT_FOUND);
wxColour col;
col << m_value;
- if ( !col.Ok() )
+ if ( !col.IsOk() )
{
SetValueToUnspecified();
SetIndex(wxNOT_FOUND);
col = GetVal().m_colour;
}
- if ( col.Ok() )
+ if ( col.IsOk() )
{
dc.SetBrush(col);
dc.DrawRectangle(rect);
void wxColourProperty::Init( wxColour colour )
{
- if ( !colour.Ok() )
+ if ( !colour.IsOk() )
colour = *wxWHITE;
wxVariant variant;
variant << colour;
const wxRect& rect,
wxPGPaintData& )
{
- if ( m_pBitmap || (m_pImage && m_pImage->Ok() ) )
+ if ( m_pBitmap || (m_pImage && m_pImage->IsOk() ) )
{
// Draw the thumbnail
const wxBitmap* itemBitmap = NULL;
- if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().Ok() && comValIndex == -1 )
+ if ( item >= 0 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 )
itemBitmap = &choices.Item(item).GetBitmap();
//
dc.SetFont(font);
const wxBitmap& bmp = cell.GetBitmap();
- if ( bmp.Ok() &&
+ if ( bmp.IsOk() &&
// Do not draw oversized bitmap outside choice popup
((flags & ChoicePopup) || bmp.GetHeight() < rect.height )
)
{
wxBitmap* bmp = property->GetValueImage();
- if ( bmp && bmp->Ok() )
+ if ( bmp && bmp->IsOk() )
return wxSize(bmp->GetWidth(),bmp->GetHeight());
}
}
{
wxBitmap* bmp = m_valueBitmap;
- wxCHECK_RET( bmp && bmp->Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( bmp && bmp->IsOk(), wxT("invalid bitmap") );
wxCHECK_RET( rect.x >= 0, wxT("unexpected measure call") );
{
delete m_valueBitmap;
- if ( &bmp && bmp.Ok() )
+ if ( &bmp && bmp.IsOk() )
{
// Resize the image
wxSize maxSz = GetGrid()->GetImageSize();
int lineSpacing = 0;
// Let's assume line spacing of 10 is normal, 15 is 1.5, 20 is 2, etc.
- if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().Ok())
+ if (attr.HasLineSpacing() && attr.GetLineSpacing() > 0 && attr.GetFont().IsOk())
{
wxCheckSetFont(dc, attr.GetFont());
lineSpacing = (int) (double(dc.GetCharHeight()) * (double(attr.GetLineSpacing())/10.0 - 1.0));
int charHeight = dc.GetCharHeight();
int x, y;
- if ( textFont.Ok() )
+ if ( textFont.IsOk() )
{
if ( textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) )
{
bool bScript(false);
wxFont font(GetBuffer()->GetFontTable().FindFont(textAttr));
- if (font.Ok())
+ if (font.IsOk())
{
if ( textAttr.HasTextEffects() && ( (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT)
|| (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT) ) )
bool wxRichTextStdRenderer::DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxRichTextAttr& bulletAttr, const wxRect& rect)
{
- if (bulletAttr.GetTextColour().Ok())
+ if (bulletAttr.GetTextColour().IsOk())
{
wxCheckSetPen(dc, wxPen(bulletAttr.GetTextColour()));
wxCheckSetBrush(dc, wxBrush(bulletAttr.GetTextColour()));
wxCheckSetFont(dc, font);
- if (attr.GetTextColour().Ok())
+ if (attr.GetTextColour().IsOk())
dc.SetTextForeground(attr.GetTextColour());
dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
bool wxRichTextFileHandler::LoadFile(wxRichTextBuffer *buffer, const wxString& filename)
{
wxFFileInputStream stream(filename);
- if (stream.Ok())
+ if (stream.IsOk())
return LoadFile(buffer, stream);
return false;
bool wxRichTextFileHandler::SaveFile(wxRichTextBuffer *buffer, const wxString& filename)
{
wxFFileOutputStream stream(filename);
- if (stream.Ok())
+ if (stream.IsOk())
return SaveFile(buffer, stream);
return false;
unsigned char* wxRichTextImageBlock::ReadBlock(const wxString& filename, size_t size)
{
wxFileInputStream stream(filename);
- if (!stream.Ok())
+ if (!stream.IsOk())
return NULL;
return ReadBlock(stream, size);
bool wxRichTextImageBlock::WriteBlock(const wxString& filename, unsigned char* block, size_t size)
{
wxFileOutputStream outStream(filename);
- if (!outStream.Ok())
+ if (!outStream.IsOk())
return false;
return WriteBlock(outStream, block, size);
validator, name))
return false;
- if (!GetFont().Ok())
+ if (!GetFont().IsOk())
{
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
void wxRichTextCtrl::PaintBackground(wxDC& dc)
{
wxColour backgroundColour = GetBackgroundColour();
- if (!backgroundColour.Ok())
+ if (!backgroundColour.IsOk())
backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
// Clear the background
if (sz.x < 1 || sz.y < 1)
return false;
- if (!m_bufferBitmap.Ok() || m_bufferBitmap.GetWidth() < sz.x || m_bufferBitmap.GetHeight() < sz.y)
+ if (!m_bufferBitmap.IsOk() || m_bufferBitmap.GetWidth() < sz.x || m_bufferBitmap.GetHeight() < sz.y)
m_bufferBitmap = wxBitmap(sz.x, sz.y);
- return m_bufferBitmap.Ok();
+ return m_bufferBitmap.IsOk();
}
#endif
bool wxRichTextCtrl::WriteImage(const wxBitmap& bitmap, wxBitmapType bitmapType, const wxRichTextAttr& textAttr)
{
- if (bitmap.Ok())
+ if (bitmap.IsOk())
{
wxRichTextImageBlock imageBlock;
wxImage image = bitmap.ConvertToImage();
- if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType))
+ if (image.IsOk() && imageBlock.MakeImageBlock(image, bitmapType))
return WriteImage(imageBlock, textAttr);
}
font.SetPointSize( static_cast<int>(size) );
}
- if ( font.Ok() )
+ if ( font.IsOk() )
{
dc.SetFont(font);
// Calculate vertical and horizontal centre
if (!facename.IsEmpty() && facename != _("(none)"))
str << wxT(" face=\"") << facename << wxT("\"");
/*
- if (def->GetStyle().GetTextColour().Ok())
+ if (def->GetStyle().GetTextColour().IsOk())
str << wxT(" color=\"#") << ColourToHexString(def->GetStyle().GetTextColour()) << wxT("\"");
*/
if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY)
{
#if 0
- if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
+ if (!image->GetImage().IsOk() && image->GetImageBlock().GetData())
image->LoadFromBlock();
- if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
+ if (image->GetImage().IsOk() && !image->GetImageBlock().GetData())
image->MakeBlock();
#endif
else if (GetFlags() & wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES)
{
#if 0
- if (!image->GetImage().Ok() && image->GetImageBlock().GetData())
+ if (!image->GetImage().IsOk() && image->GetImageBlock().GetData())
image->LoadFromBlock();
- if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
+ if (image->GetImage().IsOk() && !image->GetImageBlock().GetData())
image->MakeBlock();
#endif
- if (image->GetImageBlock().Ok())
+ if (image->GetImageBlock().IsOk())
{
wxString tempDir(GetTempDir());
if (tempDir.IsEmpty())
str << GetMimeType(image->GetImageBlock().GetImageType());
str << wxT(";base64,");
#if 0
- if (image->GetImage().Ok() && !image->GetImageBlock().GetData())
+ if (image->GetImage().IsOk() && !image->GetImageBlock().GetData())
image->MakeBlock();
#endif
- if (image->GetImageBlock().Ok())
+ if (image->GetImageBlock().IsOk())
{
wxChar* data = b64enc( image->GetImageBlock().GetData(), image->GetImageBlock().GetDataSize() );
str << data;
if (page > 1 || m_headerFooterData.GetShowOnFirstPage())
{
- if (m_headerFooterData.GetFont().Ok())
+ if (m_headerFooterData.GetFont().IsOk())
dc->SetFont(m_headerFooterData.GetFont());
else
dc->SetFont(*wxNORMAL_FONT);
- if (m_headerFooterData.GetTextColour().Ok())
+ if (m_headerFooterData.GetTextColour().IsOk())
dc->SetTextForeground(m_headerFooterData.GetTextColour());
else
dc->SetTextForeground(*wxBLACK);
!m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() ||
!m_headerFooterData.GetHeaderText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty())
{
- if (m_headerFooterData.GetFont().Ok())
+ if (m_headerFooterData.GetFont().IsOk())
dc->SetFont(m_headerFooterData.GetFont());
else
dc->SetFont(*wxNORMAL_FONT);
!m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_CENTRE).IsEmpty() ||
!m_headerFooterData.GetFooterText(wxRICHTEXT_PAGE_EVEN, wxRICHTEXT_PAGE_RIGHT).IsEmpty())
{
- if (m_headerFooterData.GetFont().Ok())
+ if (m_headerFooterData.GetFont().IsOk())
dc->SetFont(m_headerFooterData.GetFont());
else
dc->SetFont(*wxNORMAL_FONT);
// Pass two printout objects: for preview, and possible printing.
wxPrintDialogData printDialogData(*GetPrintData());
wxPrintPreview *preview = new wxPrintPreview(printout1, printout2, &printDialogData);
- if (!preview->Ok())
+ if (!preview->IsOk())
{
delete preview;
return false;
void wxRichTextPrinting::PageSetup()
{
- if (!GetPrintData()->Ok())
+ if (!GetPrintData()->IsOk())
{
wxLogError(_("There was a problem during page setup: you may need to set a default printer."));
return;
if (!attr.GetFontFaceName().IsEmpty())
str << wxT(" face=\"") << attr.GetFontFaceName() << wxT("\"");
- if (attr.GetTextColour().Ok())
+ if (attr.GetTextColour().IsOk())
str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\"");
str << wxT(">");
wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool isPara)
{
wxString str;
- if (attr.HasTextColour() && attr.GetTextColour().Ok())
+ if (attr.HasTextColour() && attr.GetTextColour().IsOk())
AddAttribute(str, wxT("textcolor"), attr.GetTextColour());
- if (attr.HasBackgroundColour() && attr.GetBackgroundColour().Ok())
+ if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk())
AddAttribute(str, wxT("bgcolor"), attr.GetBackgroundColour());
if (attr.HasFontSize())
bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr, bool isPara)
{
- if (attr.HasTextColour() && attr.GetTextColour().Ok())
+ if (attr.HasTextColour() && attr.GetTextColour().IsOk())
node->AddAttribute(wxT("textcolor"), MakeString(attr.GetTextColour()));
- if (attr.HasBackgroundColour() && attr.GetBackgroundColour().Ok())
+ if (attr.HasBackgroundColour() && attr.GetBackgroundColour().IsOk())
node->AddAttribute(wxT("bgcolor"), MakeString(attr.GetBackgroundColour()));
if (attr.HasFontSize())
::OutputIndentation(stream, indent);
::OutputString(stream, wxT("<image"), handler->GetConvMem(), handler->GetConvFile());
- if (!GetImageBlock().Ok())
+ if (!GetImageBlock().IsOk())
{
// No data
::OutputString(stream, style + wxT(">"), handler->GetConvMem(), handler->GetConvFile());
wxXmlNode* elementNode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("image"));
parent->AddChild(elementNode);
- if (GetImageBlock().Ok())
+ if (GetImageBlock().IsOk())
elementNode->AddAttribute(wxT("imagetype"), MakeString((int) GetImageBlock().GetImageType()));
handler->AddAttributes(elementNode, GetAttributes(), false);
const wxColour& background) {
SendMsg(2040, markerNumber, markerSymbol);
- if (foreground.Ok())
+ if (foreground.IsOk())
MarkerSetForeground(markerNumber, foreground);
- if (background.Ok())
+ if (background.IsOk())
MarkerSetBackground(markerNumber, background);
}
SetLabel(label);
- if (bitmap.Ok())
+ if (bitmap.IsOk())
SetBitmap(bitmap); // SetInitialSize called by SetBitmap()
else
SetInitialSize(size);
wxCoord width, height;
dc.GetMultiLineTextExtent(GetLabel(), &width, &height);
- if ( m_bitmap.Ok() )
+ if ( m_bitmap.IsOk() )
{
// allocate extra space for the bitmap
wxCoord heightBmp = m_bitmap.GetHeight() + 2*m_marginBmpY;
rect.width = size.x;
rect.height = size.y;
- if ( GetBackgroundBitmap().Ok() )
+ if ( GetBackgroundBitmap().IsOk() )
{
// get the bitmap and the flags
int alignment;
wxBitmap wxCheckBox::GetBitmap(State state, Status status) const
{
wxBitmap bmp = m_bitmaps[state][status];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
bmp = m_bitmaps[State_Normal][status];
return bmp;
wxSize wxCheckBox::GetBitmapSize() const
{
wxBitmap bmp = GetBitmap(State_Normal, Status_Checked);
- return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight())
+ return bmp.IsOk() ? wxSize(bmp.GetWidth(), bmp.GetHeight())
: GetRenderer()->GetCheckBitmapSize();
}
m_dc.SetTextForeground(m_window->GetForegroundColour());
wxString label = m_window->GetLabel();
- if ( !label.empty() || bitmap.Ok() )
+ if ( !label.empty() || bitmap.IsOk() )
{
wxRect rectLabel = m_rect;
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
rectLabel.Inflate(-marginX, -marginY);
}
{
// we may change the bitmap if we stretch it
wxBitmap bmp = bitmap;
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
return;
int width = bmp.GetWidth(),
bmp = item->GetDisabledBitmap();
}
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
// strangely enough, for unchecked item we use the
// "checked" bitmap because this is the default one - this
wxSize wxRadioButton::GetBitmapSize() const
{
wxBitmap bmp = GetBitmap(State_Normal, Status_Checked);
- return bmp.Ok() ? wxSize(bmp.GetWidth(), bmp.GetHeight())
+ return bmp.IsOk() ? wxSize(bmp.GetWidth(), bmp.GetHeight())
: GetRenderer()->GetRadioBitmapSize();
}
{
wxColour colBg;
- if (col.Ok())
+ if (col.IsOk())
{
colBg = col;
}
wxAlignment align,
int indexAccel)
{
- if (bitmap.Ok())
+ if (bitmap.IsOk())
DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel);
else
DrawCheckOrRadioButton(dc, label, GetCheckBitmap(flags), rect, flags, align, indexAccel);
wxAlignment align,
int indexAccel)
{
- if (bitmap.Ok())
+ if (bitmap.IsOk())
DrawCheckOrRadioButton(dc, label, bitmap, rect, flags, align, indexAccel);
else
DrawCheckOrRadioButton(dc, label, GetRadioBitmap(flags), rect, flags, align, indexAccel);
const wxIcon& icon,
int flags)
{
- if ( icon.Ok() )
+ if ( icon.IsOk() )
{
wxRect r = GetFrameClientArea(rect, flags & ~wxTOPLEVEL_TITLEBAR);
dc.DrawIcon(icon, r.x, r.y);
}
wxBitmap bmp = GetFrameButtonBitmap(idx);
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
return;
wxRect rectBtn(x, y, FRAME_BUTTON_WIDTH, FRAME_BUTTON_HEIGHT);
if ( !win->ShouldInheritColours() )
{
// doesn't depend on the state
- if ( !col.Ok() )
+ if ( !col.IsOk() )
{
col = Get(WINDOW);
}
// the colour set by the user should be used for the normal state
// and for the states for which we don't have any specific colours
- if ( !col.Ok() || (flags != 0) )
+ if ( !col.IsOk() || (flags != 0) )
{
#if wxUSE_SCROLLBAR
if ( wxDynamicCast(win, wxScrollBar) )
wxBitmap wxGTKRenderer::GetCheckBitmap(int flags)
{
- if ( !m_bitmapsCheckbox[0][0].Ok() )
+ if ( !m_bitmapsCheckbox[0][0].IsOk() )
{
// init the bitmaps once only
wxRect rect;
GetIndicatorsFromFlags(flags, state, status);
wxBitmap& bmp = m_bitmapsRadiobtn[state][status];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
const wxSize size = GetRadioBitmapSize();
wxBitmap wxGTKRenderer::GetLineWrapBitmap() const
{
- if ( !m_bmpLineWrap.Ok() )
+ if ( !m_bmpLineWrap.IsOk() )
{
// the line wrap bitmap as used by GTK+
#define line_wrap_width 6
};
wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height);
- if ( !bmpLineWrap.Ok() )
+ if ( !bmpLineWrap.IsOk() )
{
wxFAIL_MSG( wxT("Failed to create line wrap XBM") );
}
int tbarStyle)
{
// we don't draw the separators at all
- if ( !label.empty() || bitmap.Ok() )
+ if ( !label.empty() || bitmap.IsOk() )
{
wxRect rect = rectOrig;
rect.Deflate(BORDER_THICKNESS);
dc.DrawBitmap(bmpLineWrap,
rect.x, rect.y + (rect.height - bmpLineWrap.GetHeight())/2);
- if ( colFgOld.Ok() )
+ if ( colFgOld.IsOk() )
{
// restore old colour
dc.SetTextForeground(colFgOld);
if ( geometryInfo )
{
wxBitmap bmp = bitmap;
- if ( !bmp.Ok() && (flags & wxCONTROL_CHECKABLE) )
+ if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKABLE) )
{
bmp = GetCheckBitmap(flags);
}
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
rect.SetRight(geometryInfo->GetLabelOffset());
wxControlRenderer::DrawBitmap(dc, bmp, rect);
}
const wxBitmap& bmp = item->GetBitmap();
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
wxCoord widthBmp = bmp.GetWidth();
if ( widthBmp > widthBmpMax )
wxBitmap *bmpPressed,
wxBitmap *bmpDisabled)
{
- if ( !m_bitmapsCombo[ComboState_Normal].Ok() )
+ if ( !m_bitmapsCombo[ComboState_Normal].IsOk() )
{
InitComboBitmaps();
}
case wxUP:
dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
dc.DrawPoint(ptArrow[Point_First]);
- if ( penShadow[3].Ok() )
+ if ( penShadow[3].IsOk() )
{
dc.SetPen(penShadow[3]);
dc.DrawLine(ptArrow[Point_First].x + 1, ptArrow[Point_First].y,
dc.DrawPoint(ptArrow[Point_Third]);
dc.DrawLine(ptArrow[Point_Third].x - 2, ptArrow[Point_Third].y,
ptArrow[Point_First].x + 1, ptArrow[Point_First].y);
- if ( penShadow[2].Ok() )
+ if ( penShadow[2].IsOk() )
{
dc.SetPen(penShadow[2]);
dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
dc.DrawLine(ptArrow[Point_First], ptArrow[Point_Second]);
dc.DrawLine(ptArrow[Point_First].x + 2, ptArrow[Point_First].y,
ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y);
- if ( penShadow[2].Ok() )
+ if ( penShadow[2].IsOk() )
{
dc.SetPen(penShadow[2]);
dc.DrawLine(ptArrow[Point_Second].x, ptArrow[Point_Second].y - 1,
case wxLEFT:
dc.DrawLine(ptArrow[Point_Second], ptArrow[Point_First]);
dc.DrawPoint(ptArrow[Point_First]);
- if ( penShadow[2].Ok() )
+ if ( penShadow[2].IsOk() )
{
dc.SetPen(penShadow[2]);
dc.DrawLine(ptArrow[Point_Third].x - 1, ptArrow[Point_Third].y,
}
// doesn't depend on the state
- if ( !col.Ok() )
+ if ( !col.IsOk() )
{
col = GetBg();
}
GetIndicatorsFromFlags(flags, indState, indStatus);
wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
const char **xpm = ms_xpmIndicators[indType][indState][indStatus];
if ( xpm )
{
if ( type == FrameButton_Close )
{
- if ( !m_bmpFrameClose.Ok() )
+ if ( !m_bmpFrameClose.IsOk() )
{
static const char *xpmFrameClose[] = {
/* columns rows colors chars-per-pixel */
wxCHECK_RET( arrowDir != Arrow_Max, wxT("invalid arrow direction") );
wxBitmap& bmp = m_bmpArrows[arrowDir];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
bmp = wxBitmap(ms_xpmArrows[arrowDir]);
}
col = Get(CONTROL);
else
{
- if ( !col.Ok() )
+ if ( !col.IsOk() )
{
// doesn't depend on the state
col = Get(WINDOW);
}
#endif // wxUSE_TEXTCTRL
- if (!col.Ok())
+ if (!col.IsOk())
col = Get(CONTROL); // Most controls should be this colour, not WINDOW
}
else
// the colour set by the user should be used for the normal state
// and for the states for which we don't have any specific colours
- if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 )
+ if ( !col.IsOk() || (flags & wxCONTROL_PRESSED) != 0 )
{
#if wxUSE_SCROLLBAR
if ( wxDynamicCast(win, wxScrollBar) )
int flags)
{
wxBitmap bmp;
- if ( bitmap.Ok() )
+ if ( bitmap.IsOk() )
{
bmp = bitmap;
}
? IndicatorStatus_Checked
: IndicatorStatus_Unchecked;
- if ( !m_bmpCheckBitmaps[i].Ok() )
+ if ( !m_bmpCheckBitmaps[i].IsOk() )
{
m_bmpCheckBitmaps[i] = wxBitmap(ms_xpmChecked[i]);
}
GetIndicatorsFromFlags(flags, indState, indStatus);
wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
const char **xpm = ms_xpmIndicators[indType][indState][indStatus];
if ( xpm )
// draw the bitmap: use the bitmap provided or the standard checkmark for
// the checkable items
wxBitmap bmp = bitmap;
- if ( !bmp.Ok() && (flags & wxCONTROL_CHECKED) )
+ if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKED) )
{
bmp = GetIndicator(IndicatorType_Menu, flags);
}
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
rect.SetRight(geometryInfo.GetLabelOffset());
wxControlRenderer::DrawBitmap(dc, bmp, rect);
}
const wxBitmap& bmp = item->GetBitmap();
- if ( bmp.Ok() )
+ if ( bmp.IsOk() )
{
wxCoord widthBmp = bmp.GetWidth();
if ( widthBmp > widthBmpMax )
wxBitmap wxWin32Renderer::GetFrameButtonBitmap(FrameButtonType type)
{
wxBitmap& bmp = m_bmpFrameButtons[type];
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
bmp = wxBitmap(ms_xpmFrameButtons[type]);
}
{
#if wxUSE_IMAGE
// created disabled-state bitmap on demand
- if ( !enable && !tool->GetDisabledBitmap().Ok() )
+ if ( !enable && !tool->GetDisabledBitmap().IsOk() )
{
wxImage image(tool->GetNormalBitmap().ConvertToImage());
if ( IsMaximized() )
style |= wxTOPLEVEL_MAXIMIZED;
- if ( GetIcon().Ok() )
+ if ( GetIcon().IsOk() )
style |= wxTOPLEVEL_ICON;
if ( m_isActive )
style |= wxTOPLEVEL_ACTIVE;
wxSize size = m_renderer->GetFrameIconSize();
const wxIcon& icon = icons.GetIcon( size );
- if ( !icon.Ok() || size.x == wxDefaultCoord )
+ if ( !icon.IsOk() || size.x == wxDefaultCoord )
m_titlebarIcon = icon;
else
{
wxBitmap bmp1;
bmp1.CopyFromIcon(icon);
- if ( !bmp1.Ok() )
+ if ( !bmp1.IsOk() )
m_titlebarIcon = wxNullIcon;
else if ( bmp1.GetWidth() == size.x && bmp1.GetHeight() == size.y )
m_titlebarIcon = icon;
const wxBitmap& wxWindow::GetBackgroundBitmap(int *alignment,
wxStretch *stretch) const
{
- if ( m_bitmapBg.Ok() )
+ if ( m_bitmapBg.IsOk() )
{
if ( alignment )
*alignment = m_alignBgBitmap;
void wxWindow::EraseBackground(wxDC& dc, const wxRect& rect)
{
- if ( GetBackgroundBitmap().Ok() )
+ if ( GetBackgroundBitmap().IsOk() )
{
// Get the bitmap and the flags
int alignment;
m_display = bitmap.GetDisplay();
wxImage image = bitmap.ConvertToImage();
- if (!image.Ok()) return false;
+ if (!image.IsOk()) return false;
m_display = bitmap.GetDisplay();
m_bitmap = NULL;
}
- if (!bitmap.Ok()) return false;
+ if (!bitmap.IsOk()) return false;
wxCHECK_MSG( bitmap.GetBitmap(), false, wxT("Cannot create mask from colour bitmap") );
bool wxBitmap::CreateFromImage( const wxImage& image, int depth )
{
#if wxUSE_NANOX
- if (!image.Ok())
+ if (!image.IsOk())
{
- wxASSERT_MSG(image.Ok(), wxT("Invalid wxImage passed to wxBitmap::CreateFromImage."));
+ wxASSERT_MSG(image.IsOk(), wxT("Invalid wxImage passed to wxBitmap::CreateFromImage."));
return false;
}
UnRef();
- wxCHECK_MSG( image.Ok(), false, wxT("invalid image") );
+ wxCHECK_MSG( image.IsOk(), false, wxT("invalid image") );
wxCHECK_MSG( depth == -1, false, wxT("invalid bitmap depth") );
m_refData = new wxBitmapRefData();
{
wxImage image;
- wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
Display *xdisplay = (Display*) M_BMPDATA->m_display;
wxASSERT_MSG( xdisplay, wxT("No display") );
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask( wxMask *mask )
{
- wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
AllocExclusive();
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
{
- wxCHECK_MSG( Ok() &&
+ wxCHECK_MSG( IsOk() &&
(rect.x >= 0) && (rect.y >= 0) &&
(rect.x+rect.width <= M_BMPDATA->m_width ) &&
(rect.y+rect.height <= M_BMPDATA->m_height),
wxNullBitmap, wxT("invalid bitmap or bitmap region") );
wxBitmap ret( rect.width, rect.height, M_BMPDATA->m_bpp );
- wxASSERT_MSG( ret.Ok(), wxT("GetSubBitmap error") );
+ wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
if( GetMask() )
{
bool wxBitmap::SaveFile( const wxString &name, wxBitmapType type,
const wxPalette *palette ) const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid bitmap") );
wxBitmapHandler *handler = FindHandler(type);
if (handler == NULL)
{
wxImage image(this->ConvertToImage());
- if (image.Ok()) return image.SaveFile( name, type );
+ if (image.IsOk()) return image.SaveFile( name, type );
return false;
}
if (!image.LoadFile( name, type ))
return false;
- if (image.Ok())
+ if (image.IsOk())
{
*this = wxBitmap(image);
return true;
void wxBitmap::SetPalette(const wxPalette& palette)
{
- wxCHECK_RET(Ok(), wxT("invalid bitmap"));
+ wxCHECK_RET(IsOk(), wxT("invalid bitmap"));
wxCHECK_RET(GetDepth() > 1 && GetDepth() <= 8,
wxT("cannot set palette for bitmap of this depth"));
AllocExclusive();
wxDELETE(M_BMPDATA->m_palette);
- if (!palette.Ok()) return;
+ if (!palette.IsOk()) return;
M_BMPDATA->m_palette = new wxPalette(palette);
}
wxPalette *wxBitmap::GetPalette() const
{
- if (!Ok()) return NULL;
+ if (!IsOk()) return NULL;
return M_BMPDATA->m_palette;
}
WXPixmap wxBitmap::GetPixmap() const
{
- wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") );
return (WXPixmap)M_BMPDATA->m_pixmap;
}
WXPixmap wxBitmap::GetBitmap() const
{
- wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") );
return (WXPixmap)M_BMPDATA->m_bitmap;
}
WXPixmap wxBitmap::GetDrawable() const
{
- wxCHECK_MSG( Ok(), (WXPixmap) NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), (WXPixmap) NULL, wxT("invalid bitmap") );
return (WXPixmap)(M_BMPDATA->m_bpp == 1 ? M_BMPDATA->m_bitmap
: M_BMPDATA->m_pixmap);
WXDisplay *wxBitmap::GetDisplay() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid bitmap") );
return M_BMPDATA->m_display;
}
const wxPalette *WXUNUSED(palette)) const
{
wxImage image(bitmap->ConvertToImage());
- if (image.Ok())
+ if (image.IsOk())
return image.SaveFile( name, type );
return false;
#else // !wxHAVE_LIB_XPM
wxXPMDecoder decoder;
wxImage image(decoder.ReadData((const char **)bits));
- return image.Ok() && bitmap->CreateFromImage(image);
+ return image.IsOk() && bitmap->CreateFromImage(image);
#endif // wxHAVE_LIB_XPM/!wxHAVE_LIB_XPM
}
wxBrushStyle wxBrush::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") );
return M_BRUSHDATA->m_style;
}
wxColour wxBrush::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid brush") );
return M_BRUSHDATA->m_colour;
}
wxBitmap *wxBrush::GetStipple() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid brush") );
return &M_BRUSHDATA->m_stipple;
}
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
#if wxUSE_NANOX
return (unsigned char) M_COLDATA->m_color.red ;
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
#if wxUSE_NANOX
return (unsigned char) M_COLDATA->m_color.green ;
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
#if wxUSE_NANOX
return (unsigned char) M_COLDATA->m_color.blue ;
void wxColour::CalcPixel( WXColormap cmap )
{
- wxCHECK_RET( Ok(), wxT("invalid colour") );
+ wxCHECK_RET( IsOk(), wxT("invalid colour") );
wxCHECK_RET( cmap, wxT("invalid colormap") );
unsigned long wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid colour") );
return M_COLDATA->m_color.pixel;
}
WXColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid colour") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid colour") );
return (WXColor*) &M_COLDATA->m_color;
}
if (gs_busyCount++ > 0)
return;
- wxASSERT_MSG( !gs_savedCursor.Ok(),
+ wxASSERT_MSG( !gs_savedCursor.IsOk(),
wxT("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
m_bitmap = image;
- return m_bitmap.Ok();
+ return m_bitmap.IsOk();
#else
return false;
#endif
void wxBitmapDataObject::DoConvertToPng()
{
#if wxUSE_LIBPNG
- if (!m_bitmap.Ok())
+ if (!m_bitmap.IsOk())
return;
wxImage image = m_bitmap.ConvertToImage();
Destroy();
m_selected = bitmap;
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (m_selected.GetPixmap())
{
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
- if (m_selected.Ok())
+ if (m_selected.IsOk())
{
if (width) (*width) = m_selected.GetWidth();
if (height) (*height) = m_selected.GetHeight();
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), 0, wxT("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxEmptyString, wxT("invalid font") );
return M_FONTDATA->m_faceName;
}
wxFontStyle wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxFONTSTYLE_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTSTYLE_MAX, wxT("invalid font") );
return M_FONTDATA->m_style;
}
wxFontWeight wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), wxFONTWEIGHT_MAX, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, wxT("invalid font") );
return M_FONTDATA->m_weight;
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
return M_FONTDATA->m_underlined;
}
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
return M_FONTDATA->m_encoding;
}
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
- wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), NULL, wxT("invalid font") );
#if wxUSE_UNICODE
#else
bool wxFont::IsFixedWidth() const
{
- wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid font") );
#if wxUSE_UNICODE
return wxFontBase::IsFixedWidth();
// font to list in the private data for future reference.
wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const
{
- if ( !Ok() )
+ if ( !IsOk() )
return NULL;
long intScale = long(scale * 100.0 + 0.5); // key for wxXFont
int wxPen::GetDashes( wxDash **ptr ) const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
*ptr = (wxDash*)M_PENDATA->m_dash;
return M_PENDATA->m_countDashes;
wxPenCap wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxCAP_INVALID, wxT("invalid pen") );
return M_PENDATA->m_capStyle;
}
wxPenJoin wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxJOIN_INVALID, wxT("invalid pen") );
return M_PENDATA->m_joinStyle;
}
wxPenStyle wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), wxPENSTYLE_INVALID, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxPENSTYLE_INVALID, wxT("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), -1, wxT("invalid pen") );
return M_PENDATA->m_width;
}
wxColour wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), wxNullColour, wxT("invalid pen") );
return M_PENDATA->m_colour;
}
wxBitmap *wxPen::GetStipple() const
{
- wxCHECK_MSG( Ok(), &wxNullBitmap, wxT("invalid pen") );
+ wxCHECK_MSG( IsOk(), &wxNullBitmap, wxT("invalid pen") );
return &M_PENDATA->m_stipple;
}
bool wxRegion::DoUnionWithRegion( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoIntersect( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoSubtract( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
bool wxRegion::DoXor( const wxRegion& region )
{
- wxCHECK_MSG( region.Ok(), false, wxT("invalid region") );
+ wxCHECK_MSG( region.IsOk(), false, wxT("invalid region") );
if (!m_refData)
{
void wxTopLevelWindowX11::DoSetIcon(const wxIcon& icon)
{
- if (icon.Ok() && X11GetMainWindow())
+ if (icon.IsOk() && X11GetMainWindow())
{
#if !wxUSE_NANOX
XWMHints *wmHints = XAllocWMHints();
wxCHECK_MSG( xwindow, false, wxT("invalid window") );
wxCursor cursorToUse;
- if (m_cursor.Ok())
+ if (m_cursor.IsOk())
cursorToUse = m_cursor;
else
cursorToUse = *wxSTANDARD_CURSOR;
int wxWindowX11::GetCharHeight() const
{
wxFont font(GetFont());
- wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") );
+ wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") );
#if wxUSE_UNICODE
// There should be an easier way.
int wxWindowX11::GetCharWidth() const
{
wxFont font(GetFont());
- wxCHECK_MSG( font.Ok(), 0, wxT("valid window font needed") );
+ wxCHECK_MSG( font.IsOk(), 0, wxT("valid window font needed") );
#if wxUSE_UNICODE
// There should be an easier way.
wxFont fontToUse = GetFont();
if (theFont) fontToUse = *theFont;
- wxCHECK_RET( fontToUse.Ok(), wxT("invalid font") );
+ wxCHECK_RET( fontToUse.IsOk(), wxT("invalid font") );
if (string.empty())
{
bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding, int flags)
{
wxFileInputStream stream(filename);
- if (!stream.Ok())
+ if (!stream.IsOk())
return false;
return Load(stream, encoding, flags);
}
bool wxXmlDocument::Save(const wxString& filename, int indentstep) const
{
wxFileOutputStream stream(filename);
- if (!stream.Ok())
+ if (!stream.IsOk())
return false;
return Save(stream, indentstep);
}
// the colour doesn't use #RRGGBB format, check if it is symbolic
// colour name:
clr = GetSystemColour(v);
- if (clr.Ok())
+ if (clr.IsOk())
return clr;
ReportParamError
art_id, art_client) )
{
wxBitmap stockArt(wxArtProvider::GetBitmap(art_id, art_client, size));
- if ( stockArt.Ok() )
+ if ( stockArt.IsOk() )
return stockArt;
}
wxImage img(name);
#endif
- if (!img.Ok())
+ if (!img.IsOk())
{
ReportParamError
(
// is this font based on a system font?
wxFont font = GetSystemFont(GetParamValue(wxT("sysfont")));
- if (font.Ok())
+ if (font.IsOk())
{
if (hasSize && isize != -1)
font.SetPointSize(isize);
// then load the archive file
{
wxFFileInputStream in(tmparc);
- if (in.Ok())
+ if (in.IsOk())
out.Write(in);
}
// for the non-seekable test, have the archiver output to "-"
// and read the archive via a pipe
PFileInputStream in(wxString::Format(archiver, wxT("-")));
- if (in.Ok())
+ if (in.IsOk())
out.Write(in);
}
}
// write the archive to a temporary file
{
wxFFileOutputStream out(tmparc);
- if (out.Ok())
+ if (out.IsOk())
out.Write(in);
}
// for the non-seekable test, have the archiver extract "-" and
// feed it the archive via a pipe
PFileOutputStream out(wxString::Format(unarchiver, wxT("-")));
- if (out.Ok())
+ if (out.IsOk())
out.Write(in);
}
if (!isDir) {
wxFFileInputStream in(path);
CPPUNIT_ASSERT_MESSAGE(
- "entry not found in archive" + error_entry, in.Ok());
+ "entry not found in archive" + error_entry, in.IsOk());
size_t size = (size_t)in.GetLength();
wxCharBuffer buf(size);
{
PFileInputStream in(cmd);
- if (in.Ok())
+ if (in.IsOk())
out.Write(in);
}
ProcessData(&*Values.begin(), Values.size(), pfnWriter, pfnReader);
}
- bool Ok(void) const {
+ bool IsOk() const
+ {
return m_ok;
}
};
CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l)) == wxLongLong(0x12345678l) );
CPPUNIT_ASSERT( TestRW(wxLongLong(0x12345678l, 0xabcdef01l)) == wxLongLong(0x12345678l, 0xabcdef01l) );
- CPPUNIT_ASSERT( TestMultiRW<wxLongLong>(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() );
- CPPUNIT_ASSERT( TestMultiRW<wxULongLong>(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).Ok() );
+ CPPUNIT_ASSERT( TestMultiRW<wxLongLong>(ValuesLL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() );
+ CPPUNIT_ASSERT( TestMultiRW<wxULongLong>(ValuesULL, &wxDataOutputStream::WriteLL, &wxDataInputStream::ReadLL).IsOk() );
}
#endif
CPPUNIT_ASSERT( TestRW(wxUint64(0x12345678l)) == wxUint64(0x12345678l) );
CPPUNIT_ASSERT( TestRW((wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l)) == (wxUint64(0x12345678l) << 32) + wxUint64(0xabcdef01l) );
- CPPUNIT_ASSERT( TestMultiRW<wxInt64>(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() );
- CPPUNIT_ASSERT( TestMultiRW<wxUint64>(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).Ok() );
+ CPPUNIT_ASSERT( TestMultiRW<wxInt64>(ValuesI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() );
+ CPPUNIT_ASSERT( TestMultiRW<wxUint64>(ValuesUI64, &wxDataOutputStream::Write64, &wxDataInputStream::Read64).IsOk() );
}
#endif
wxInputStream *LargeFileTest_wxFile::MakeInStream(const wxString& name) const
{
auto_ptr<wxFileInputStream> in(new wxFileInputStream(name));
- CPPUNIT_ASSERT(in->Ok());
+ CPPUNIT_ASSERT(in->IsOk());
return in.release();
}
wxInputStream *LargeFileTest_wxFFile::MakeInStream(const wxString& name) const
{
auto_ptr<wxFFileInputStream> in(new wxFFileInputStream(name));
- CPPUNIT_ASSERT(in->Ok());
+ CPPUNIT_ASSERT(in->IsOk());
return in.release();
}
{
wxString filename = wxT("testdata.fc");
wxFileInputStream fsIn(filename);
- if ( !fsIn.Ok() )
+ if ( !fsIn.IsOk() )
{
return;
}
wxPaintDC dc(this);
wxSize sz = GetClientSize();
- if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.Ok())
+ if (wxGetApp().m_emulatorInfo.m_emulatorBackgroundBitmap.IsOk())
{
int deviceWidth = wxGetApp().m_emulatorInfo.m_emulatorDeviceSize.x;
int deviceHeight = wxGetApp().m_emulatorInfo.m_emulatorDeviceSize.y;