11 #include "Alternative.h" 17 #include "swighelper.h" 18 #include "utils/ColorUtils.h" 25 #define CONTROL_TEXT_OFFSET_X 10 26 #define CONTROL_TEXT_OFFSET_Y 2 74 virtual bool canAcceptMessages(
int actionId) {
return false; }
76 #ifdef DOXYGEN_SHOULD_USE_THIS 95 virtual int getId() {
return iControlId; }
98 inline bool operator==(
const Control& other)
const {
return iControlId == other.iControlId; }
99 inline bool operator>(
const Control& other)
const {
return iControlId > other.iControlId; }
100 inline bool operator<(
const Control& other)
const {
return iControlId < other.iControlId; }
103 #ifdef DOXYGEN_SHOULD_USE_THIS 122 virtual std::vector<int> getPosition();
125 #ifdef DOXYGEN_SHOULD_USE_THIS 144 int getX() {
return dwPosX; }
147 #ifdef DOXYGEN_SHOULD_USE_THIS 166 int getY() {
return dwPosY; }
169 #ifdef DOXYGEN_SHOULD_USE_THIS 188 virtual int getHeight() {
return dwHeight; }
192 #ifdef DOXYGEN_SHOULD_USE_THIS 211 virtual int getWidth() {
return dwWidth; }
215 #ifdef DOXYGEN_SHOULD_USE_THIS 234 virtual void setEnabled(
bool enabled);
238 #ifdef DOXYGEN_SHOULD_USE_THIS 261 virtual void setVisible(
bool visible);
265 #ifdef DOXYGEN_SHOULD_USE_THIS 286 virtual bool isVisible();
290 #ifdef DOXYGEN_SHOULD_USE_THIS 291 setVisibleCondition(...);
316 virtual void setVisibleCondition(
const char* visible,
bool allowHiddenFocus =
false);
320 #ifdef DOXYGEN_SHOULD_USE_THIS 321 setEnableCondition(...);
344 virtual void setEnableCondition(
const char* enable);
348 #ifdef DOXYGEN_SHOULD_USE_THIS 379 #ifdef DOXYGEN_SHOULD_USE_THIS 401 virtual void setPosition(
long x,
long y);
405 #ifdef DOXYGEN_SHOULD_USE_THIS 424 virtual void setWidth(
long width);
428 #ifdef DOXYGEN_SHOULD_USE_THIS 447 virtual void setHeight(
long height);
451 #ifdef DOXYGEN_SHOULD_USE_THIS 480 virtual void setNavigation(
const Control* up,
const Control* down,
485 #ifdef DOXYGEN_SHOULD_USE_THIS 511 virtual void controlUp(
const Control* up);
515 #ifdef DOXYGEN_SHOULD_USE_THIS 541 virtual void controlDown(
const Control* control);
545 #ifdef DOXYGEN_SHOULD_USE_THIS 571 virtual void controlLeft(
const Control* control);
575 #ifdef DOXYGEN_SHOULD_USE_THIS 601 virtual void controlRight(
const Control* control);
612 int iControlDown = 0;
613 int iControlLeft = 0;
614 int iControlRight = 0;
615 std::string m_label{};
616 bool m_visible{
true};
654 #ifdef DOXYGEN_SHOULD_USE_THIS 689 virtual void setTextures(
const char* up,
const char* down,
691 const char* downFocus,
692 const char* upDisabled,
const char* downDisabled);
696 UTILS::COLOR::Color color;
697 std::string strTextureUp;
698 std::string strTextureDown;
699 std::string strTextureUpFocus;
700 std::string strTextureDownFocus;
701 std::string strTextureUpDisabled;
702 std::string strTextureDownDisabled;
769 ControlLabel(
long x,
long y,
long width,
long height,
const String& label,
770 const char* font = NULL,
const char* textColor = NULL,
771 const char* disabledColor = NULL,
773 bool hasPath =
false,
long angle = 0);
777 #ifdef DOXYGEN_SHOULD_USE_THIS 796 virtual String getLabel();
799 #ifdef DOXYGEN_SHOULD_USE_THIS 829 virtual void setLabel(
const String& label = emptyString,
830 const char* font = NULL,
831 const char* textColor = NULL,
832 const char* disabledColor = NULL,
833 const char* shadowColor = NULL,
834 const char* focusedColor = NULL,
835 const String& label2 = emptyString);
843 UTILS::COLOR::Color textColor;
844 UTILS::COLOR::Color disabledColor;
846 bool bHasPath =
false;
915 ControlEdit(
long x,
long y,
long width,
long height,
const String& label,
916 const char* font = NULL,
const char* textColor = NULL,
917 const char* disabledColor = NULL,
918 long _alignment =
XBFONT_LEFT,
const char* focusTexture = NULL,
919 const char* noFocusTexture = NULL);
923 #ifdef DOXYGEN_SHOULD_USE_THIS 953 virtual void setLabel(
const String& label = emptyString,
954 const char* font = NULL,
955 const char* textColor = NULL,
956 const char* disabledColor = NULL,
957 const char* shadowColor = NULL,
958 const char* focusedColor = NULL,
959 const String& label2 = emptyString);
963 #ifdef DOXYGEN_SHOULD_USE_THIS 982 virtual String getLabel();
986 #ifdef DOXYGEN_SHOULD_USE_THIS 1005 virtual void setText(
const String& text);
1009 #ifdef DOXYGEN_SHOULD_USE_THIS 1029 virtual String getText();
1035 std::string strFont;
1036 std::string strText;
1037 std::string strTextureFocus;
1038 std::string strTextureNoFocus;
1039 UTILS::COLOR::Color textColor;
1040 UTILS::COLOR::Color disabledColor;
1047 #ifdef DOXYGEN_SHOULD_USE_THIS 1081 virtual void setType(
int type,
const String& heading);
1154 ControlList(
long x,
long y,
long width,
long height,
const char* font = NULL,
1155 const char* textColor = NULL,
const char* buttonTexture = NULL,
1156 const char* buttonFocusTexture = NULL,
1157 const char* selectedColor = NULL,
1158 long _imageWidth=10,
long _imageHeight=10,
long _itemTextXOffset = CONTROL_TEXT_OFFSET_X,
1159 long _itemTextYOffset = CONTROL_TEXT_OFFSET_Y,
long _itemHeight = 27,
long _space = 2,
1164 #ifdef DOXYGEN_SHOULD_USE_THIS 1186 #ifdef DOXYGEN_SHOULD_USE_THIS 1212 #ifdef DOXYGEN_SHOULD_USE_THIS 1231 virtual void selectItem(
long item);
1234 #ifdef DOXYGEN_SHOULD_USE_THIS 1254 virtual void removeItem(
int index);
1257 #ifdef DOXYGEN_SHOULD_USE_THIS 1300 virtual void reset();
1303 #ifdef DOXYGEN_SHOULD_USE_THIS 1324 virtual Control* getSpinControl();
1327 #ifdef DOXYGEN_SHOULD_USE_THIS 1328 getSelectedPosition();
1346 virtual long getSelectedPosition();
1349 #ifdef DOXYGEN_SHOULD_USE_THIS 1377 #ifdef DOXYGEN_SHOULD_USE_THIS 1378 setImageDimensions(...);
1397 virtual void setImageDimensions(
long imageWidth,
long imageHeight);
1401 #ifdef DOXYGEN_SHOULD_USE_THIS 1420 virtual void setItemHeight(
long height);
1424 #ifdef DOXYGEN_SHOULD_USE_THIS 1444 virtual void setSpace(
int space);
1448 #ifdef DOXYGEN_SHOULD_USE_THIS 1449 setPageControlVisible(...);
1468 virtual void setPageControlVisible(
bool visible);
1472 #ifdef DOXYGEN_SHOULD_USE_THIS 1492 virtual long size();
1496 #ifdef DOXYGEN_SHOULD_USE_THIS 1516 virtual long getItemHeight();
1520 #ifdef DOXYGEN_SHOULD_USE_THIS 1540 virtual long getSpace();
1544 #ifdef DOXYGEN_SHOULD_USE_THIS 1569 #ifdef DOXYGEN_SHOULD_USE_THIS 1570 setStaticContent(...);
1591 virtual void setStaticContent(
const ListItemList* items);
1595 void sendLabelBind(
int tail);
1597 bool canAcceptMessages(
int actionId)
override 1598 {
return ((actionId == ACTION_SELECT_ITEM) | (actionId == ACTION_MOUSE_LEFT_CLICK)); }
1604 std::vector<AddonClass::Ref<ListItem> > vecItems;
1605 std::string strFont;
1608 UTILS::COLOR::Color textColor;
1609 UTILS::COLOR::Color selectedColor;
1610 std::string strTextureButton;
1611 std::string strTextureButtonFocus;
1613 int imageHeight = 0;
1618 int itemTextOffsetX = 0;
1619 int itemTextOffsetY = 0;
1620 uint32_t alignmentY;
1685 const char* font = NULL,
1686 const char* textColor = NULL,
1690 #ifdef DOXYGEN_SHOULD_USE_THIS 1711 virtual void addLabel(
const String& label);
1714 #ifdef DOXYGEN_SHOULD_USE_THIS 1735 virtual void setScrolling(
bool scroll);
1738 #ifdef DOXYGEN_SHOULD_USE_THIS 1755 virtual void reset();
1759 std::string strFont;
1760 UTILS::COLOR::Color textColor;
1761 std::vector<std::string> vecLabels;
1826 const char* font = NULL,
1827 const char* textColor = NULL);
1830 #ifdef DOXYGEN_SHOULD_USE_THIS 1854 virtual void setText(
const String& text);
1858 #ifdef DOXYGEN_SHOULD_USE_THIS 1880 virtual String getText();
1884 #ifdef DOXYGEN_SHOULD_USE_THIS 1903 virtual void reset();
1907 #ifdef DOXYGEN_SHOULD_USE_THIS 1930 virtual void scroll(
long id);
1934 #ifdef DOXYGEN_SHOULD_USE_THIS 1959 virtual void autoScroll(
int delay,
int time,
int repeat);
1963 std::string strFont;
1964 UTILS::COLOR::Color textColor;
2020 const char* filename,
long aspectRatio = 0,
2021 const char* colorDiffuse = NULL);
2023 #ifdef DOXYGEN_SHOULD_USE_THIS 2048 virtual void setImage(
const char* imageFilename,
const bool useCache =
true);
2051 #ifdef DOXYGEN_SHOULD_USE_THIS 2052 setColorDiffuse(...);
2073 virtual void setColorDiffuse(
const char* hexString);
2079 std::string strFileName;
2080 int aspectRatio = 0;
2081 UTILS::COLOR::Color colorDiffuse;
2158 const char* texturebg = NULL,
2159 const char* textureleft = NULL,
2160 const char* texturemid = NULL,
2161 const char* textureright = NULL,
2162 const char* textureoverlay = NULL);
2164 #ifdef DOXYGEN_SHOULD_USE_THIS 2188 virtual void setPercent(
float pct);
2191 #ifdef DOXYGEN_SHOULD_USE_THIS 2212 virtual float getPercent();
2216 std::string strTextureLeft;
2217 std::string strTextureMid;
2218 std::string strTextureRight;
2219 std::string strTextureBg;
2220 std::string strTextureOverlay;
2221 int aspectRatio = 0;
2222 UTILS::COLOR::Color colorDiffuse;
2302 ControlButton(
long x,
long y,
long width,
long height,
const String& label,
2303 const char* focusTexture = NULL,
const char* noFocusTexture = NULL,
2304 long textOffsetX = CONTROL_TEXT_OFFSET_X,
2305 long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2307 const char* font = NULL,
const char* textColor = NULL,
2308 const char* disabledColor = NULL,
long angle = 0,
2309 const char* shadowColor = NULL,
const char* focusedColor = NULL);
2312 #ifdef DOXYGEN_SHOULD_USE_THIS 2343 virtual void setLabel(
const String& label = emptyString,
2344 const char* font = NULL,
2345 const char* textColor = NULL,
2346 const char* disabledColor = NULL,
2347 const char* shadowColor = NULL,
2348 const char* focusedColor = NULL,
2349 const String& label2 = emptyString);
2353 #ifdef DOXYGEN_SHOULD_USE_THIS 2354 setDisabledColor(...);
2374 virtual void setDisabledColor(
const char* color);
2378 #ifdef DOXYGEN_SHOULD_USE_THIS 2399 virtual String getLabel();
2403 #ifdef DOXYGEN_SHOULD_USE_THIS 2424 virtual String getLabel2();
2428 bool canAcceptMessages(
int actionId)
override {
return true; }
2430 int textOffsetX = 0;
2431 int textOffsetY = 0;
2432 UTILS::COLOR::Color align;
2433 std::string strFont;
2434 UTILS::COLOR::Color textColor;
2435 UTILS::COLOR::Color disabledColor;
2437 int shadowColor = 0;
2438 int focusedColor = 0;
2439 std::string strText;
2440 std::string strText2;
2441 std::string strTextureFocus;
2442 std::string strTextureNoFocus;
2578 const char* focusOnTexture = NULL,
const char* noFocusOnTexture = NULL,
2579 const char* focusOffTexture = NULL,
const char* noFocusOffTexture = NULL,
2580 const char* focusTexture = NULL,
const char* noFocusTexture = NULL,
2581 long textOffsetX = CONTROL_TEXT_OFFSET_X,
2582 long textOffsetY = CONTROL_TEXT_OFFSET_Y,
2584 const char* font = NULL,
const char* textColor = NULL,
2585 const char* disabledColor = NULL,
long angle = 0,
2586 const char* shadowColor = NULL,
const char* focusedColor = NULL,
2587 const char* disabledOnTexture = NULL,
const char* disabledOffTexture = NULL);
2590 #ifdef DOXYGEN_SHOULD_USE_THIS 2615 virtual void setSelected(
bool selected);
2619 #ifdef DOXYGEN_SHOULD_USE_THIS 2639 virtual bool isSelected();
2643 #ifdef DOXYGEN_SHOULD_USE_THIS 2681 virtual void setLabel(
const String& label = emptyString,
2682 const char* font = NULL,
2683 const char* textColor = NULL,
2684 const char* disabledColor = NULL,
2685 const char* shadowColor = NULL,
2686 const char* focusedColor = NULL,
2687 const String& label2 = emptyString);
2691 #ifdef DOXYGEN_SHOULD_USE_THIS 2692 setRadioDimension(...);
2719 virtual void setRadioDimension(
long x,
long y,
long width,
long height);
2723 bool canAcceptMessages(
int actionId)
override {
return true; }
2725 std::string strFont;
2726 std::string strText;
2727 std::string strTextureFocus;
2728 std::string strTextureNoFocus;
2729 std::string strTextureRadioOnFocus;
2730 std::string strTextureRadioOnNoFocus;
2731 std::string strTextureRadioOffFocus;
2732 std::string strTextureRadioOffNoFocus;
2733 std::string strTextureRadioOnDisabled;
2734 std::string strTextureRadioOffDisabled;
2735 UTILS::COLOR::Color textColor;
2736 UTILS::COLOR::Color disabledColor;
2737 int textOffsetX = 0;
2738 int textOffsetY = 0;
2741 UTILS::COLOR::Color shadowColor;
2742 UTILS::COLOR::Color focusedColor;
2795 const char* textureback = NULL,
2796 const char* texture = NULL,
2797 const char* texturefocus = NULL,
int orientation = 1);
2799 #ifdef DOXYGEN_SHOULD_USE_THIS 2819 virtual float getPercent();
2822 #ifdef DOXYGEN_SHOULD_USE_THIS 2842 virtual void setPercent(
float pct);
2845 #ifdef DOXYGEN_SHOULD_USE_THIS 2866 virtual int getInt();
2869 #ifdef DOXYGEN_SHOULD_USE_THIS 2893 virtual void setInt(
int value,
int min,
int delta,
int max);
2896 #ifdef DOXYGEN_SHOULD_USE_THIS 2917 virtual float getFloat();
2920 #ifdef DOXYGEN_SHOULD_USE_THIS 2944 virtual void setFloat(
float value,
float min,
float delta,
float max);
2948 std::string strTextureBack;
2949 std::string strTexture;
2950 std::string strTextureFoc;
Definition: Control.h:649
constexpr int XBFONT_LEFT
Align X left.
Definition: GUIFont.h:38
constexpr int XBFONT_CENTER_Y
Align Y center.
Definition: GUIFont.h:41
Definition: Control.h:2016
This class is a smart pointer for a Referenced class.
Definition: AddonClass.h:154
Definition: Control.h:1681
Base class for controls.
Definition: GUIControl.h:75
Definition: Control.h:1822
Definition: Control.h:2154
Definition: Control.h:2488
Definition: Control.h:2791
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: ListItem.h:52
Definition: Control.h:766
Definition: Alternative.h:17
Definition: Control.h:912
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57
Definition: Control.h:1149