Implements dropdown with supporting of any type items. Use a base class when developing a dropdown-like controls.
You can find more information in comments below. Overrided methods can be found in corresponding base classes and interfaces.
class CCustomDropDown :public CControlItemList
{
public:
void(*OnChange)(IControl *sender); // Event called when text changed
void(*OnSelect)(IControl *sender, const int index); // Event called when item selected
// IControl methods
void Refresh(const bool refresh_children) override;
bool setDPI(const Point &value) override;
int getItemCount() override;
IListItem *getItem(const int index) override;
int getItemIndex(IListItem *item) override;
bool AddItem(IListItem *item) override;
bool InsertItem(IListItem *item, const int before) override;
bool DeleteItem(const int index) override;
bool DeleteItem(IListItem *item) override;
bool DeleteItems() override;
IControl *getControl(const PointF &position) override;
RectF getClientRect() override;
RectF getRenderRect() override;
CURSOR_TYPE getCursor() override;
IListItemOwner *QueryListItemOwner() override;
CCustomDropDown(const String &class_name, const bool accept_form, const bool accept_control, const bool tab_stop, const bool editable, const Point &design_dpi = DesignDPI);
~CCustomDropDown() override;
// Return layout properties
CBuiltInDropDown::STATE getState();
bool isEditable();
bool isOpened();
bool isArrowAtRight();
bool isSortable();
CBuiltInDropDown::OPEN_DIRECTION getOpenDirection();
CBuiltInDropDown::ARROW_AREA getArrowArea();
float getListWidth();
float getListMaxHeight();
String getText();
int getActiveIndex();
float getArrowAreaSize();
float getArrowSize();
RectF getBorderWidth();
RectF getBorderRadius();
RectF getPadding();
RectF getArrowBorderWidth();
RectF getArrowBorderRadius();
RectF getListBorderWidth();
RectF getListBorderRadius();
RectF getListPadding();
Color getShadowColor(const CBuiltInDropDown::STATE state);
Color getShadowColorEditable(const CBuiltInDropDown::STATE state);
PointF getShadowShift(const CBuiltInDropDown::STATE state);
PointF getShadowShiftEditable(const CBuiltInDropDown::STATE state);
int getShadowRadius(const CBuiltInDropDown::STATE state);
int getShadowRadiusEditable(const CBuiltInDropDown::STATE state);
RectC getBorderColor(const CBuiltInDropDown::STATE state);
RectC getBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getLeftBorderColor(const CBuiltInDropDown::STATE state);
Color getLeftBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getTopBorderColor(const CBuiltInDropDown::STATE state);
Color getTopBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getRightBorderColor(const CBuiltInDropDown::STATE state);
Color getRightBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getBottomBorderColor(const CBuiltInDropDown::STATE state);
Color getBottomBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getBackgroundColor(const CBuiltInDropDown::STATE state);
Color getBackgroundColorEditable(const CBuiltInDropDown::STATE state);
Gradient *getBackgroundGradient(const CBuiltInDropDown::STATE state);
Gradient *getBackgroundGradientEditable(const CBuiltInDropDown::STATE state);
RectC getArrowBorderColor(const CBuiltInDropDown::STATE state);
RectC getArrowBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getArrowLeftBorderColor(const CBuiltInDropDown::STATE state);
Color getArrowLeftBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getArrowTopBorderColor(const CBuiltInDropDown::STATE state);
Color getArrowTopBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getArrowRightBorderColor(const CBuiltInDropDown::STATE state);
Color getArrowRightBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getArrowBottomBorderColor(const CBuiltInDropDown::STATE state);
Color getArrowBottomBorderColorEditable(const CBuiltInDropDown::STATE state);
Color getArrowBackgroundColor(const CBuiltInDropDown::STATE state);
Color getArrowBackgroundColorEditable(const CBuiltInDropDown::STATE state);
Gradient *getArrowBackgroundGradient(const CBuiltInDropDown::STATE state);
Gradient *getArrowBackgroundGradientEditable(const CBuiltInDropDown::STATE state);
Color getArrowColor(const CBuiltInDropDown::STATE state);
Color getArrowColorEditable(const CBuiltInDropDown::STATE state);
RectC getListBorderColor();
RectC getListBorderColorEditable();
Color getListLeftBorderColor();
Color getListLeftBorderColorEditable();
Color getListTopBorderColor();
Color getListTopBorderColorEditable();
Color getListRightBorderColor();
Color getListRightBorderColorEditable();
Color getListBottomBorderColor();
Color getListBottomBorderColorEditable();
Color getListBackgroundColor();
Color getListBackgroundColorEditable();
Gradient *getListBackgroundGradient();
Gradient *getListBackgroundGradientEditable();
Color getListShadowColor();
Color getListShadowColorEditable();
PointF getListShadowShift();
PointF getListShadowShiftEditable();
int getListShadowRadius();
int getListShadowRadiusEditable();
float getSearchResetInterval();
IBuiltInDropDown::FCompare getCompareFunc();
IBuiltInDropDown::FGetItemText getItemTextFunc();
IBuiltInDropDown::FSearch getSearchFunc();
bool setDropDown(IBuiltInDropDown *value); // Assign another built-in dropdown
// Set layout properties
bool setEditable(const bool value);
bool setArrowAtRight(const bool value);
bool setSortable(const bool value);
bool setOpenDirection(const CBuiltInDropDown::OPEN_DIRECTION value);
bool setListWidth(const float value);
bool setListMaxHeight(const float value);
bool setText(const String &value);
bool setActiveIndex(const int value);
bool setArrowArea(const CBuiltInDropDown::ARROW_AREA value);
bool setArrowAreaSize(const float value);
bool setArrowSize(const float value);
bool setBorderWidth(const RectF &value);
bool setBorderRadius(const RectF &value);
bool setPadding(const RectF &value);
bool setArrowBorderWidth(const RectF &value);
bool setArrowBorderRadius(const RectF &value);
bool setListBorderWidth(const RectF &value);
bool setListBorderRadius(const RectF &value);
bool setListPadding(const RectF &value);
bool setShadowColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setShadowColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setShadowShift(const CBuiltInDropDown::STATE state, const PointF &value);
bool setShadowShiftEditable(const CBuiltInDropDown::STATE state, const PointF &value);
bool setShadowRadius(const CBuiltInDropDown::STATE state, const int value);
bool setShadowRadiusEditable(const CBuiltInDropDown::STATE state, const int value);
bool setBorderColor(const CBuiltInDropDown::STATE state, const RectC &value);
bool setBorderColorEditable(const CBuiltInDropDown::STATE state, const RectC &value);
bool setLeftBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setLeftBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setTopBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setTopBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setRightBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setRightBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setBottomBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setBottomBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setBackgroundColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setBackgroundColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowBorderColor(const CBuiltInDropDown::STATE state, const RectC &value);
bool setArrowBorderColorEditable(const CBuiltInDropDown::STATE state, const RectC &value);
bool setArrowLeftBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowLeftBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowTopBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowTopBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowRightBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowRightBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowBottomBorderColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowBottomBorderColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowBackgroundColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowBackgroundColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowColor(const CBuiltInDropDown::STATE state, const Color &value);
bool setArrowColorEditable(const CBuiltInDropDown::STATE state, const Color &value);
bool setListBorderColor(const RectC &value);
bool setListBorderColorEditable(const RectC &value);
bool setListLeftBorderColor(const Color &value);
bool setListLeftBorderColorEditable(const Color &value);
bool setListTopBorderColor(const Color &value);
bool setListTopBorderColorEditable(const Color &value);
bool setListRightBorderColor(const Color &value);
bool setListRightBorderColorEditable(const Color &value);
bool setListBottomBorderColor(const Color &value);
bool setListBottomBorderColorEditable(const Color &value);
bool setListBackgroundColor(const Color &value);
bool setListBackgroundColorEditable(const Color &value);
bool setListShadowColor(const Color &value);
bool setListShadowColorEditable(const Color &value);
bool setListShadowShift(const PointF &value);
bool setListShadowShiftEditable(const PointF &value);
bool setListShadowRadius(const int value);
bool setListShadowRadiusEditable(const int value);
bool setSearchResetInterval(const float value);
bool setCompareFunc(IBuiltInDropDown::FCompare value);
bool setGetItemTextFunc(IBuiltInDropDown::FGetItemText value);
bool setSearchFunc(IBuiltInDropDown::FSearch value);
bool Open(); // Open list
bool Close(); // Close list
};
Namespace: | nitisa::standard |
Include: | Standard/Controls/DropDown/CustomDropDown.h |