Phase 3: Inspector prop tables for containers and remaining families (Frame, Image, ProgressBar, SpinEdit, Calendar, ColorBox, ListView, TreeView, Notebook, ToggleButton, Splitter, StatusBar, ToolBar, Shape, StringGrid, Toplevel)

This commit is contained in:
cnmcdee committed 2026-11-30 11:57:48 +00:00
1 parent b79e44b97d
commit 5a5420637a
2 files changed
+120 -3

No files matched your search

+110 -3
View File
@@ -31,7 +31,15 @@ inline const int kWrapValues[] = {0, 1, 2, 3}; // NONE, CHAR, WORD, WORD_C
inline const int kScaleModeValues[] = {0, 1}; // PRICE, PERCENT
inline const int kOrientationValues[] = {0, 1}; // HORIZONTAL, VERTICAL
inline const int kToolbarStyleValues[] = {0, 1, 2, 3}; // ICONS, TEXT, BOTH, BOTH_HORIZ
inline const int kShapeValues[] = {0, 1, 2, 3}; // RECTANGLE, ELLIPSE, LINE, TRIANGLE
inline const int kShapeValues[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; // TShapeType: RECTANGLE, SQUARE, ROUNDRECT, ROUNDSQUARE, ELLIPSE, CIRCLE, TRIANGLE, DIAMOND, PENTAGON, HEXAGON
inline const int kViewStyleValues[] = {0, 1, 2, 3}; // REPORT, ICON, SMALL_ICON, LIST
inline const int kSortTypeValues[] = {0, 1, 2}; // NONE, ASCENDING, DESCENDING
inline const int kTabPositionValues[] = {0, 1, 2, 3}; // TOP, BOTTOM, LEFT, RIGHT
inline const int kBorderStyleValues[] = {0, 1, 2, 3}; // DEFAULT, NONE, SINGLE, DIALOG
inline const int kWindowPositionValues[] = {0, 1, 2, 3, 4}; // DEFAULT, CENTER, SCREEN_CENTER, MAIN_FORM_CENTER, DESIGNED
inline const int kWindowStateValues[] = {0, 1, 2, 3}; // NORMAL, MINIMIZED, MAXIMIZED, FULLSCREEN
inline const int kColorStyleValues[] = {0, 1, 2, 3}; // STANDARD, EXTENDED, SYSTEM, CUSTOM
inline const int kResizeStyleValues[] = {0, 1}; // UPDATE, LINE
inline const int kAlignValues[] = {0, 1, 2, 3, 4, 5}; // NONE, TOP, BOTTOM, LEFT, RIGHT, CLIENT
inline const int kButtonKindValues[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; // NONE, OK, CANCEL, YES, NO, CLOSE, HELP, RETRY, IGNORE, ABORT
inline const int kButtonLayoutValues[] = {0, 1, 2, 3}; // LEFT, RIGHT, TOP, BOTTOM
@@ -137,6 +145,14 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
{"value-checked", K::Str, ""},
{"value-unchecked", K::Str, ""},
};
static const std::vector<PropDef> togglebutton = {
{"text", K::Str, ""},
{"active", K::Bool, "false"},
{"group-index", K::Int, "0", 0, 100000},
{"allow-all-up", K::Bool, "false"},
{"flat", K::Bool, "false"},
{"glyph", K::Str, ""},
};
static const std::vector<PropDef> radiobutton = {
{"label", K::Str, ""},
{"active", K::Bool, "false"},
@@ -144,6 +160,9 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
};
static const std::vector<PropDef> frame = {
{"label", K::Str, ""},
{"label-xalign", K::Double, "0", 0, 1},
{"inset", K::Int, "8", 0, 1000},
{"top-inset", K::Int, "14", 0, 1000},
{"shadow-type", K::Enum, "3", 0, 0, "None|In|Out|Etched in|Etched out",
kShadowValues},
};
@@ -239,26 +258,43 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
};
static const std::vector<PropDef> groupbox = {
{"label", K::Str, ""},
{"label-xalign", K::Double, "0", 0, 1},
{"inset", K::Int, "8", 0, 1000},
{"top-inset", K::Int, "14", 0, 1000},
{"shadow-type", K::Enum, "3", 0, 0, "None|In|Out|Etched in|Etched out",
kShadowValues},
};
static const std::vector<PropDef> panel = {
{"label", K::Str, ""},
{"label-xalign", K::Double, "0", 0, 1},
{"inset", K::Int, "8", 0, 1000},
{"top-inset", K::Int, "14", 0, 1000},
{"shadow-type", K::Enum, "3", 0, 0, "None|In|Out|Etched in|Etched out",
kShadowValues},
};
static const std::vector<PropDef> image = {
{"file", K::Str, ""},
{"pixel-size", K::Int, "-1", -1, 512},
{"stretch", K::Bool, "false"},
{"proportional", K::Bool, "true"},
{"center", K::Bool, "true"},
{"transparent", K::Bool, "false"},
};
static const std::vector<PropDef> shape = {
{"shape", K::Enum, "0", 0, 0, "Rectangle|Ellipse|Line|Triangle",
{"shape", K::Enum, "0", 0, 0,
"Rectangle|Square|RoundRect|RoundSquare|Ellipse|Circle|Triangle|Diamond|Pentagon|Hexagon",
kShapeValues},
{"fill-color", K::Color, "rgb(53,132,228)"},
{"fill-color", K::Color, "rgb(70,130,200)"},
{"pen-color", K::Color, "rgb(20,40,80)"},
{"pen-width", K::Int, "2", 1, 100},
};
static const std::vector<PropDef> notebook = {
{"pages", K::Str, "Tab 1|Tab 2|Tab 3"},
{"page", K::Int, "0", 0, 100},
{"tab-height", K::Int, "26", 0, 1000},
{"tab-position", K::Enum, "0", 0, 0, "Top|Bottom|Left|Right",
kTabPositionValues},
{"tab-width", K::Int, "0", 0, 1000},
};
static const std::vector<PropDef> scrollbox = {
{"label", K::Str, ""},
@@ -267,14 +303,24 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
{"position", K::Int, "100", 0, 10000},
{"orientation", K::Enum, "0", 0, 0, "Horizontal|Vertical",
kOrientationValues},
{"min-size", K::Int, "0", 0, 10000},
{"resize-style", K::Enum, "0", 0, 0, "Update|Line",
kResizeStyleValues},
{"auto-snap", K::Bool, "false"},
};
static const std::vector<PropDef> statusbar = {
{"text", K::Str, ""},
{"panels", K::Str, ""},
{"size-grip", K::Bool, "true"},
};
static const std::vector<PropDef> toolbar = {
{"items", K::Str, "New|Open|Save"},
{"toolbar-style", K::Enum, "2", 0, 0, "Icons|Text|Both|Both horizontal",
kToolbarStyleValues},
{"show-captions", K::Bool, "true"},
{"flat", K::Bool, "false"},
{"button-width", K::Int, "0", 0, 1000},
{"button-height", K::Int, "0", 0, 1000},
};
static const std::vector<PropDef> menubar = {
{"menus", K::Str, "File|Edit|Help"},
@@ -287,6 +333,7 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
{"digits", K::Int, "0", 0, 10},
{"numeric", K::Bool, "true"},
{"wrap", K::Bool, "false"},
{"editor-enabled", K::Bool, "true"},
};
static const std::vector<PropDef> trackbar = {
{"minimum", K::Int, "0", -1000000, 1000000},
@@ -308,16 +355,36 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
};
static const std::vector<PropDef> progressbar = {
{"fraction", K::Double, "0", 0, 1},
{"position", K::Double, "45", -1000000, 1000000},
{"minimum", K::Double, "0", -1000000, 1000000},
{"maximum", K::Double, "100", -1000000, 1000000},
{"step", K::Double, "1", 0, 1000000},
{"show-text", K::Bool, "false"},
{"text", K::Str, ""},
{"pulsing", K::Bool, "false"},
{"inverted", K::Bool, "false"},
{"bar-color", K::Color, "rgb(52,101,164)"},
{"trough-color", K::Color, "rgb(225,225,225)"},
};
static const std::vector<PropDef> datetimepicker = {
{"date", K::Str, ""},
{"show-heading", K::Bool, "true"},
{"show-day-names", K::Bool, "true"},
{"show-week-numbers", K::Bool, "false"},
{"grid-color", K::Color, "rgb(205,205,205)"},
{"selected-fill-color", K::Color, "rgb(52,101,164)"},
{"selected-text-color", K::Color, "rgb(255,255,255)"},
{"today-color", K::Color, "rgb(200,50,50)"},
{"dim-text-color", K::Color, "rgb(110,110,110)"},
{"weekends-color", K::Color, "rgb(170,60,60)"},
{"disabled-color", K::Color, "rgb(150,150,150)"},
};
static const std::vector<PropDef> colorbox = {
{"color", K::Color, "rgb(53,132,228)"},
{"style", K::Enum, "0", 0, 0, "Standard|Extended|System|Custom",
kColorStyleValues},
{"default-color", K::Color, "rgb(255,255,255)"},
{"none-color", K::Color, "rgb(0,0,0)"},
{"use-alpha", K::Bool, "false"},
{"title", K::Str, ""},
};
@@ -325,15 +392,41 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
{"columns", K::Str, "Name|Value"},
{"items", K::Str, "Row 1,Value 1;Row 2,Value 2"},
{"headers-visible", K::Bool, "true"},
{"item-index", K::Int, "-1", -1, 100000},
{"item-height", K::Int, "0", 0, 1000},
{"view-style", K::Enum, "0", 0, 0, "Report|Icon|SmallIcon|List",
kViewStyleValues},
{"grid-lines", K::Bool, "false"},
{"row-select", K::Bool, "true"},
{"multi-select", K::Bool, "false"},
{"sort-type", K::Enum, "0", 0, 0, "None|Ascending|Descending",
kSortTypeValues},
};
static const std::vector<PropDef> treeview = {
{"items", K::Str, "Root/Child 1;Root/Child 2;Other"},
{"headers-visible", K::Bool, "true"},
{"item-index", K::Int, "-1", -1, 100000},
{"item-height", K::Int, "0", 0, 1000},
{"header-height", K::Int, "22", 0, 1000},
{"grid-lines", K::Bool, "false"},
{"row-select", K::Bool, "true"},
{"multi-select", K::Bool, "false"},
{"sort-type", K::Enum, "0", 0, 0, "None|Ascending|Descending",
kSortTypeValues},
{"indent", K::Int, "16", 0, 1000},
{"show-buttons", K::Bool, "true"},
{"show-lines", K::Bool, "true"},
{"show-root", K::Bool, "true"},
};
static const std::vector<PropDef> stringgrid = {
{"rows", K::Int, "5", 1, 50},
{"columns", K::Int, "4", 1, 26},
{"headers-visible", K::Bool, "true"},
{"fixed-cols", K::Int, "0", 0, 26},
{"fixed-rows", K::Int, "0", 0, 50},
{"default-col-width", K::Int, "84", 1, 1000},
{"default-row-height", K::Int, "20", 1, 1000},
{"grid-line-width", K::Int, "1", 0, 100},
};
static const std::vector<PropDef> plot = {
{"title", K::Str, ""},
@@ -343,6 +436,7 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
if (type == "Label") return label;
if (type == "Entry") return entry;
if (type == "Checkbutton") return checkbutton;
if (type == "ToggleButton") return togglebutton;
if (type == "Radiobutton") return radiobutton;
if (type == "Frame") return frame;
if (type == "Combobox") return combobox;
@@ -375,10 +469,23 @@ inline const std::vector<PropDef>& props_for(const std::string& type) {
static const std::vector<PropDef> toplevel = {
{"title", K::Str, ""},
{"resizable", K::Bool, "true"},
{"border-style", K::Enum, "0", 0, 0, "Default|None|Single|Dialog",
kBorderStyleValues},
{"icon", K::Str, ""},
{"position", K::Enum, "0", 0, 0,
"Default|Center|ScreenCenter|MainFormCenter|Designed",
kWindowPositionValues},
{"window-state", K::Enum, "0", 0, 0,
"Normal|Minimized|Maximized|Fullscreen", kWindowStateValues},
};
static const std::vector<PropDef> spreadsheet = {
{"rows", K::Int, "5", 1, 50},
{"columns", K::Int, "4", 1, 26},
{"fixed-cols", K::Int, "0", 0, 26},
{"fixed-rows", K::Int, "0", 0, 50},
{"default-col-width", K::Int, "84", 1, 1000},
{"default-row-height", K::Int, "20", 1, 1000},
{"grid-line-width", K::Int, "1", 0, 100},
};
if (type == "Toplevel") return toplevel;
if (type == "Spreadsheet") return spreadsheet;
+10
View File
@@ -290,6 +290,16 @@ public:
}
// Phase 3: IWidget live-apply name for the label alignment.
void set_xalign(double a)
{
set_label_xalign(a);
}
// Inner content area, inset past the border and the label band.
void content_rect(int& cx1, int& cy1, int& cx2, int& cy2)