virtual void ComputeScaleAndOrigin();
virtual GdkWindow* GetGDKWindow() const { return NULL; }
- virtual wxBitmap GetSelectedBitmap() const { return wxNullBitmap; }
protected:
// implementation
virtual void SetTextBackground( const wxColour &col );
// implementation
- virtual wxBitmap GetSelectedBitmap() const { return m_selected; }
+ wxBitmap GetSelectedBitmap() const { return m_selected; }
wxBitmap m_selected;
protected:
void DoGetSize( int *width, int *height ) const;
virtual void DoSelect(const wxBitmap& bitmap);
- virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
- { return subrect == NULL ? GetSelectedBitmap() : GetSelectedBitmap().GetSubBitmap(*subrect); }
+ virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
+ {
+ wxBitmap bmp = GetSelectedBitmap();
+ return subrect ? bmp.GetSubBitmap(*subrect) : bmp;
+ }
private:
void Init();
xsrc = source->LogicalToDeviceX(xsrc);
ysrc = source->LogicalToDeviceY(ysrc);
+ wxBitmap selected;
wxMemoryDC *memDC = wxDynamicCast(source, wxMemoryDC);
- wxBitmap selected = source->GetSelectedBitmap();
+ if ( memDC )
+ {
+ selected = memDC->GetSelectedBitmap();
+ if ( !selected.IsOk() )
+ return false;
+ }
bool use_bitmap_method = false;
bool is_mono = false;
ysrcMask = ysrc;
}
- if (memDC && !selected.Ok()) return false;
-
if (selected.Ok())
{
is_mono = (selected.GetDepth() == 1);