KiCad PCB EDA Suite
Loading...
Searching...
No Matches
grid_button.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KICAD_GRID_BUTTON_H
21#define KICAD_GRID_BUTTON_H
22
23#include <wx/bmpbuttn.h>
24#include <wx/button.h>
25#include <wx/grid.h>
26
27
28class GRID_BUTTON_RENDERER : public wxGridCellRenderer
29{
30public:
31 GRID_BUTTON_RENDERER( const wxString& aLabel );
32
33 virtual ~GRID_BUTTON_RENDERER() = default;
34
35 GRID_BUTTON_RENDERER* Clone() const override;
36
37 void Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC& aDc, const wxRect& aRect,
38 int aRow, int aCol, bool aIsSelected ) override;
39
40 wxSize GetBestSize( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC& aDc,
41 int aRow, int aCol ) override;
42
43private:
44 wxButton m_button;
45};
46
47
48class GRID_BITMAP_BUTTON_RENDERER : public wxGridCellRenderer
49{
50public:
51 GRID_BITMAP_BUTTON_RENDERER( const wxBitmapBundle& aBitmap );
52
53 virtual ~GRID_BITMAP_BUTTON_RENDERER() = default;
54
55 GRID_BITMAP_BUTTON_RENDERER* Clone() const override;
56
57 void Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC& aDc, const wxRect& aRect,
58 int aRow, int aCol, bool aIsSelected ) override;
59
60 wxSize GetBestSize( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC& aDc,
61 int aRow, int aCol ) override;
62
63private:
64 wxBitmapBundle m_bitmap;
65};
66
67#endif //KICAD_GRID_BUTTON_H
GRID_BITMAP_BUTTON_RENDERER(const wxBitmapBundle &aBitmap)
wxSize GetBestSize(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDc, int aRow, int aCol) override
void Draw(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDc, const wxRect &aRect, int aRow, int aCol, bool aIsSelected) override
virtual ~GRID_BITMAP_BUTTON_RENDERER()=default
GRID_BITMAP_BUTTON_RENDERER * Clone() const override
GRID_BUTTON_RENDERER(const wxString &aLabel)
virtual ~GRID_BUTTON_RENDERER()=default
GRID_BUTTON_RENDERER * Clone() const override
wxSize GetBestSize(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDc, int aRow, int aCol) override
void Draw(wxGrid &aGrid, wxGridCellAttr &aAttr, wxDC &aDc, const wxRect &aRect, int aRow, int aCol, bool aIsSelected) override