From 721a0afc29097c99b77d95228e8750287d107fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory?= Date: Wed, 16 Jun 2010 17:29:39 +0200 Subject: [PATCH] Files forgotten --- ressources/process-stop.png | Bin 0 -> 533 bytes view/wxGridCellBitmapRenderer.cpp | 24 ++++++++++++++++++++++++ view/wxGridCellBitmapRenderer.h | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 ressources/process-stop.png create mode 100644 view/wxGridCellBitmapRenderer.cpp create mode 100644 view/wxGridCellBitmapRenderer.h diff --git a/ressources/process-stop.png b/ressources/process-stop.png new file mode 100644 index 0000000000000000000000000000000000000000..217e33ba4e409c95b4aa3554a2a277e80232e133 GIT binary patch literal 533 zcmV+w0_y#VP)c<}y}iw8x0?WOn$UCX-BG<#(Ss-= zNmJ?~?2F6_4@Ec>A;~fZ!y$X+vbH*r6Erro<}QwBMF0mP9LNJ=fYEr2c3rH0@xEKzXNBMt0)3euK XNy@!oTx8sk00000NkvXXu0mjfxo71= literal 0 HcmV?d00001 diff --git a/view/wxGridCellBitmapRenderer.cpp b/view/wxGridCellBitmapRenderer.cpp new file mode 100644 index 0000000..8c5c622 --- /dev/null +++ b/view/wxGridCellBitmapRenderer.cpp @@ -0,0 +1,24 @@ +#include "wxGridCellBitmapRenderer.h" + +wxGridCellBitmapRenderer::wxGridCellBitmapRenderer(wxBitmap& bitmap) : _bitmap(bitmap) +{ + +} + +wxGridCellRenderer* wxGridCellBitmapRenderer::Clone () const +{ + wxBitmap bitmap(_bitmap); + return new wxGridCellBitmapRenderer(bitmap); +} + +void wxGridCellBitmapRenderer::Draw (wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, const wxRect &rect, int row, int col, bool isSelected) +{ + dc.SetBrush(wxBrush(grid.GetCellBackgroundColour(row, col))); + dc.DrawRectangle(rect); + dc.DrawBitmap (_bitmap, rect.x + (rect.width-_bitmap.GetWidth())/2, rect.y + (rect.height-_bitmap.GetHeight())/2, true); +} + +wxSize wxGridCellBitmapRenderer::GetBestSize (wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, int row, int col) +{ + return wxSize(_bitmap.GetWidth(), _bitmap.GetHeight()); +} diff --git a/view/wxGridCellBitmapRenderer.h b/view/wxGridCellBitmapRenderer.h new file mode 100644 index 0000000..7937934 --- /dev/null +++ b/view/wxGridCellBitmapRenderer.h @@ -0,0 +1,21 @@ +#ifndef WXGRIDCELLBITMAPRENDERER_H +#define WXGRIDCELLBITMAPRENDERER_H + +#include +#include +#include + +class wxGridCellBitmapRenderer : public wxGridCellRenderer +{ +public: + wxGridCellBitmapRenderer(wxBitmap& bitmap); + + virtual wxGridCellRenderer* Clone () const; + virtual void Draw (wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, const wxRect &rect, int row, int col, bool isSelected); + virtual wxSize GetBestSize (wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, int row, int col); + +private: + wxBitmap _bitmap; +}; + +#endif