| 1 | // $Header$ |
| 2 | /*************************************************************************** |
| 3 | * Copyright (C) 2006-2007 by Guy Rutenberg * |
| 4 | * [email protected] * |
| 5 | * * |
| 6 | * This program is free software; you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, write to the * |
| 18 | * Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | /**\file wxDynamicBitmap.h |
| 22 | *\brief Header file for DBwrapper class. |
| 23 | * |
| 24 | * This file contains the header for the wxDynamicBitmap class and all the nessecery include files. |
| 25 | */ |
| 26 | |
| 27 | #include <wx/wx.h> |
| 28 | //#include <wx/control.h> |
| 29 | |
| 30 | #ifndef WXDYNAMICBITMAP |
| 31 | #define WXDYNAMICBITMAP |
| 32 | |
| 33 | /// wxDynamicBitmap class - a wrapper for databases |
| 34 | /** |
| 35 | the wxDynamicBitmap class is a wxWidgets class for dynamicly displaying bitmaps. This is different |
| 36 | than wxStaticBitmap in the fact that it immediatly draws the bitmap and doesn't wait for the paint event. |
| 37 | */ |
| 38 | |
| 39 | class wxDynamicBitmap : public wxControl { |
| 40 | public: |
| 41 | wxDynamicBitmap (wxWindow* parent, wxWindowID id, wxBitmap *bitmap, |
| 42 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
| 43 | long style = wxNO_BORDER, const wxString& name = wxPanelNameStr); |
| 44 | virtual void SetBitmap(wxBitmap *bitmap); |
| 45 | wxBitmap GetBitmap(); |
| 46 | void OnPaint(wxPaintEvent& event); |
| 47 | void OnClick(wxMouseEvent& event); |
| 48 | wxSize DoGetBestSize() const; |
| 49 | void SetGrayScale(bool grayscale=true); |
| 50 | void ConvertToGrayScale(wxImage& image) const; |
| 51 | private: |
| 52 | void PaintBitmap(wxDC& dc); |
| 53 | wxBitmap m_bitmap; |
| 54 | wxBitmap m_graybitmap; |
| 55 | bool m_grayscale; |
| 56 | }; |
| 57 | |
| 58 | #endif //WXDYNAMICBITMAP |