29 #include <wx/odcombo.h> 30 #include <wx/menuitem.h> 53 bmpDC.SelectObject( aLayerbmp );
55 brush.SetStyle( wxBRUSHSTYLE_SOLID );
56 if( aBackground != COLOR4D::UNSPECIFIED )
58 brush.SetColour( aBackground.
WithAlpha(1.0).ToColour() );
59 bmpDC.SetBrush( brush );
60 bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
63 brush.SetColour( aColor.ToColour() );
64 bmpDC.SetBrush( brush );
65 bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
67 bmpDC.SetBrush( *wxTRANSPARENT_BRUSH );
68 bmpDC.SetPen( *wxBLACK_PEN );
69 bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
77 const wxPoint& pos,
const wxSize& size,
78 int n,
const wxString choices[] ) :
79 wxBitmapComboBox( parent, id, wxEmptyString, pos, size, n, choices, wxCB_READONLY ),
90 const wxPoint& pos,
const wxSize& size,
91 const wxArrayString& choices ) :
92 wxBitmapComboBox( parent, id, wxEmptyString, pos, size, choices, wxCB_READONLY ),
95 if( !choices.IsEmpty() )
111 return GetSelection();
118 if( GetSelection() < 0 )
121 return (
LAYER_NUM)(intptr_t) GetClientData( GetSelection() );
128 int elements = GetCount();
130 for(
int i = 0; i < elements; i++ )
132 if( GetClientData( (
unsigned) i ) == (
void*)(intptr_t) layer )
134 if( GetSelection() != i )
152 int elements = GetCount();
154 for(
LAYER_NUM i = 0; i < elements; ++i )
156 wxBitmap layerbmp( 14, 14 );
165 if( aEvent.GetKeyCode() == WXK_ESCAPE && IsPopupShown() )
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
LAYER_BOX_SELECTOR(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL)
virtual COLOR4D getLayerColor(LAYER_NUM aLayer) const =0
~LAYER_BOX_SELECTOR() override
LAYER_NUM GetLayerSelection() const
int SetLayerSelection(LAYER_NUM layer)
bool SetLayersHotkeys(bool value)
int LAYER_NUM
This can be replaced with int and removed.
static void DrawColorSwatch(wxBitmap &aLayerbmp, COLOR4D aBackground, COLOR4D aColor)
Board layer functions and definitions.
void onKeyDown(wxKeyEvent &aEvent)
A color representation with 4 components: red, green, blue, alpha.