38 #include "render/graphics.h"
53 "dropdown_pressed.xml"
58 const bool isExtended,
61 const std::string &eventId) :
69 mShadowColor(getThemeColor(
ThemeColorId::DROPDOWN_SHADOW, 255U)),
70 mHighlightColor(getThemeColor(
ThemeColorId::HIGHLIGHT, 255U)),
75 mSelectionListeners(),
76 mExtended(isExtended),
91 for (
int i = 0; i < 2; i ++)
102 for (
int f = 0; f < 2; f ++)
104 if (rect.
grid[f] !=
nullptr)
106 rect.
grid[f]->incRef();
120 for (
int f = 0; f < 2; f ++)
149 if (!eventId.empty())
157 if (
mSkin !=
nullptr)
175 for (
int f = 0; f < 2; f ++)
177 for (
int i = 0; i < 2; i ++)
183 if (
theme !=
nullptr)
209 for (
int a = 0; a < 9; a++)
243 if (image ==
nullptr)
291 graphics->
drawLine(0, h + 1, w, h + 1);
326 if (image !=
nullptr)
331 (height - image->getHeight()) / 2);
342 PRAGMA45(GCC diagnostic ignored
"-Wswitch-enum")
366 getNumberOfElements() - 1);
409 const int x =
event.getX();
410 const int y =
event.getY();
448 if (listModel ==
nullptr)
464 if (listModel ==
nullptr)
490 const int pad2 = pad * 2;
582 (*iter)->valueChanged(event);
std::string getSelectedString() const
void drawFrame(Graphics *const graphics)
void hideDrop(bool event)
void action(const ActionEvent &actionEvent)
void setSelected(int selected)
void removeSelectionListener(SelectionListener *selectionListener)
void valueChanged(const SelectionEvent &event)
void keyPressed(KeyEvent &event)
SelectionListenerList::iterator SelectionListenerIterator
void draw(Graphics *const graphics)
void mousePressed(MouseEvent &event)
static ImageRect skinRect
void safeDraw(Graphics *const graphics)
ListModel * getListModel()
void mouseWheelMovedUp(MouseEvent &event)
static Image * buttons[2][2]
SelectionListenerList mSelectionListeners
void mouseDragged(MouseEvent &event)
void safeDrawFrame(Graphics *const graphics)
void setListModel(ListModel *const listModel)
void drawButton(Graphics *const graphics)
void mouseWheelMovedDown(MouseEvent &event)
DropDown(const Widget2 *const widget, ListModel *const listModel, const bool extended, const Modal modal, ActionListener *const listener, const std::string &eventId)
void distributeValueChangedEvent()
void mouseReleased(MouseEvent &event)
void setSelectedString(const std::string &str)
void addSelectionListener(SelectionListener *listener)
Widget * getSource() const
virtual const Image * getImageAt(int i)=0
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
virtual void setColor(const Color &color)
virtual void drawRectangle(const Rect &rectangle)=0
virtual void drawLine(int x1, int y1, int x2, int y2)=0
virtual void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
void removeDragged(const Widget *const widget)
virtual std::string getElementAt(int i)=0
virtual int getNumberOfElements()=0
MouseButtonT getButton() const
int getOption(const std::string &name) const
const ImageRect & getBorder() const
void unload(Skin *const skin)
static std::string getThemePath()
static void unloadRect(const ImageRect &rect, const int start, const int end)
Skin * load(const std::string &filename, const std::string &filename2, const bool full, const std::string &defaultPath)
void loadRect(ImageRect &image, const std::string &name, const std::string &name2, const int start, const int end)
float getMinimumOpacity() const
static std::string const dropdownFiles[2]
PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wredundant-decls") PRAGMA45(GCC diagnostic pop) class TestMain
#define BLOCK_START(name)