ToolMap
Loading...
Searching...
No Matches
tmcolourpickerctrl.h
1/***************************************************************************
2 tmcolourpickerctrl.h
3 Create a nice colour picker even on mac
4 -------------------
5 copyright : (C) 2007 CREALP Lucien Schreiber
6 ***************************************************************************/
7
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
32#ifndef _TM_COLOURPICKERCTRL_H_
33#define _TM_COLOURPICKERCTRL_H_
34
35// For compilers that support precompilation, includes "wx/wx.h".
36#include <wx/wxprec.h>
37
38// Include wxWidgets' headers
39#ifndef WX_PRECOMP
40#include <wx/wx.h>
41#endif
42
43#if (__WXMAC__) // SPECIFIC CODE FOR MAC
44
45#include <wx/colordlg.h>
46
47const wxSize tmCOLOURPICKERCTRL_SIZE(15, 15);
48
49class tmColourPickerCtrl : public wxBitmapButton {
50 private:
51 wxColour m_Colour;
52 void InitMemberValues();
53 wxBitmap CreateColourBitmap(const wxColour& col);
54
55 // event function
56 void OnChooseColour(wxCommandEvent& event);
57
58 protected:
59 public:
61 tmColourPickerCtrl(wxWindow* parent, wxWindowID id, const wxColour& colour = *wxBLACK,
62 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
64
65 wxColour GetColour() {
66 return m_Colour;
67 }
68 void SetColour(const wxColour& col);
69};
70
71#else // UNDER WINDOWS AND LINUX, USE wxColourPickerCtrl
72
73#include <wx/clrpicker.h>
74
75class tmColourPickerCtrl : public wxColourPickerCtrl {
76 private:
77 protected:
78 public:
80 ;
81 }
82
83 tmColourPickerCtrl(wxWindow* parent, wxWindowID id, const wxColour& colour = *wxBLACK,
84 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
85
87 ;
88 }
89};
90
91#endif
92
93#endif
Definition tmcolourpickerctrl.h:75