summaryrefslogtreecommitdiff
path: root/plugingui/combobox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/combobox.cc')
-rw-r--r--plugingui/combobox.cc25
1 files changed, 4 insertions, 21 deletions
diff --git a/plugingui/combobox.cc b/plugingui/combobox.cc
index e6ed3f6..752dbb3 100644
--- a/plugingui/combobox.cc
+++ b/plugingui/combobox.cc
@@ -33,7 +33,8 @@
#define BORDER 10
-namespace GUI {
+namespace GUI
+{
void ComboBox::listboxSelectHandler()
{
@@ -46,16 +47,6 @@ ComboBox::ComboBox(Widget* parent)
: Widget(parent)
, listbox(parent)
{
- box.topLeft = new Image(":widget_tl.png");
- box.top = new Image(":widget_t.png");
- box.topRight = new Image(":widget_tr.png");
- box.left = new Image(":widget_l.png");
- box.right = new Image(":widget_r.png");
- box.bottomLeft = new Image(":widget_bl.png");
- box.bottom = new Image(":widget_b.png");
- box.bottomRight = new Image(":widget_br.png");
- box.center = new Image(":widget_c.png");
-
CONNECT(&listbox, selectionNotifier, this, &ComboBox::listboxSelectHandler);
CONNECT(&listbox, clickNotifier, this, &ComboBox::listboxSelectHandler);
@@ -64,15 +55,6 @@ ComboBox::ComboBox(Widget* parent)
ComboBox::~ComboBox()
{
- delete box.topLeft;
- delete box.top;
- delete box.topRight;
- delete box.left;
- delete box.right;
- delete box.bottomLeft;
- delete box.bottom;
- delete box.bottomRight;
- delete box.center;
}
void ComboBox::addItem(std::string name, std::string value)
@@ -128,7 +110,8 @@ void ComboBox::repaintEvent(RepaintEvent* repaintEvent)
return;
}
- p.drawBox(0, 0, box, w, h);
+ box.setSize(w, h);
+ p.drawImage(0, 0, box);
p.setColour(Colour(183.0/255.0, 219.0/255.0 , 255.0/255.0, 1));
p.drawText(BORDER - 4 + 3, height()/2+5 + 1 + 1, font, _text);