mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added drop down list box, specialization for color editor; todo: proper positioning & sizing, redrawing the arrow button
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@91 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <util/error.hpp>
|
||||
#include <util/rotation.hpp>
|
||||
#include <wx/mstream.h>
|
||||
#include <wx/renderer.h>
|
||||
|
||||
#if wxUSE_UXTHEME
|
||||
#include <wx/msw/uxtheme.h>
|
||||
@@ -138,3 +139,23 @@ void draw_control_border(Window* win, DC& dc, const wxRect& rect) {
|
||||
draw3DBorder(dc, rect.x - 1, rect.y - 1, rect.x + rect.width, rect.y + rect.height);
|
||||
#endif
|
||||
}
|
||||
|
||||
// portable, based on wxRendererGeneric::DrawComboBoxDropButton
|
||||
void draw_menu_arrow(Window* win, DC& dc, const wxRect& rect, bool active) {
|
||||
wxPoint pt[] =
|
||||
{ wxPoint(0, 0)
|
||||
, wxPoint(4, 4)
|
||||
, wxPoint(0, 8)
|
||||
};
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(wxSystemSettings::GetColour(active ? wxSYS_COLOUR_HIGHLIGHTTEXT : wxSYS_COLOUR_WINDOWTEXT));
|
||||
dc.DrawPolygon(3, pt, rect.x + rect.width - 6, rect.y + (rect.height - 9) / 2);
|
||||
}
|
||||
|
||||
void draw_drop_down_arrow(Window* win, DC& dc, const wxRect& rect, bool active) {
|
||||
wxRendererNative& rn = wxRendererNative::GetDefault();
|
||||
int w = wxSystemSettings::GetMetric(wxSYS_VSCROLL_ARROW_X); // drop down arrow is same size
|
||||
rn.DrawComboBoxDropButton(win, dc,
|
||||
wxRect(rect.x + rect.width - w, rect.y, w, rect.height)
|
||||
, active ? wxCONTROL_PRESSED : 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user