2013-08-08 21:01:20 -03:00
|
|
|
// Aseprite UI Library
|
2015-04-09 07:46:55 -03:00
|
|
|
// Copyright (C) 2001-2013, 2015 David Capello
|
2013-04-02 21:34:30 -03:00
|
|
|
//
|
2014-03-29 20:08:05 -03:00
|
|
|
// This file is released under the terms of the MIT license.
|
|
|
|
// Read LICENSE.txt for more information.
|
2013-04-02 21:34:30 -03:00
|
|
|
|
|
|
|
#ifndef UI_LISTITEM_H_INCLUDED
|
|
|
|
#define UI_LISTITEM_H_INCLUDED
|
2014-03-29 19:40:17 -03:00
|
|
|
#pragma once
|
2013-04-02 21:34:30 -03:00
|
|
|
|
|
|
|
#include "ui/widget.h"
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
2015-04-09 07:46:55 -03:00
|
|
|
class ListItem : public Widget {
|
2013-04-02 21:34:30 -03:00
|
|
|
public:
|
2014-04-20 19:53:27 -03:00
|
|
|
ListItem(const std::string& text);
|
2013-04-02 21:34:30 -03:00
|
|
|
|
2015-04-09 07:46:55 -03:00
|
|
|
const std::string& getValue() const { return m_value; }
|
2014-06-22 21:56:04 -03:00
|
|
|
|
|
|
|
void setValue(const std::string& value) {
|
|
|
|
m_value = value;
|
|
|
|
}
|
|
|
|
|
2013-04-02 21:34:30 -03:00
|
|
|
protected:
|
2014-08-14 23:07:47 -03:00
|
|
|
void onPaint(PaintEvent& ev) override;
|
|
|
|
void onResize(ResizeEvent& ev) override;
|
|
|
|
void onPreferredSize(PreferredSizeEvent& ev) override;
|
2014-06-22 21:56:04 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_value;
|
2013-04-02 21:34:30 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
|
|
|
#endif
|