Commit Graph
14 Commits
Author SHA1 Message Date
Muse e474894bae Registry/palette drift fix: regenerate registry.h sorted (562) + re-index palette
Run the repo generator instead of the hand-appended batch-4 registry:
kWidgetNames now in sorted order (Rust extract_registry requires it),
kWidgetDefaultW/H extended 547 -> 562 with the default_size() rule,
factory cases reordered to match, XGraph index 545 -> 548.
Palette re-indexed via gen_xframe_palette_data.py (XGraph 548, --check clean).
widgets/README.md palette table: Misc / X 4 -> 19, 562 widgets.
Verified: Rust extract_registry build OK (562); make test SEAM ALL PASS.
2026-12-05 18:40:44 +00:00
Muse 843d9f8c8a Registry 547 -> 562: XFrame monitor widgets + README + generator fix
Register the 15 new X* monitor widgets (includes, kWidgetNames,
kWidgetSection as Misc / X, factory cases 547-561, kWidgetCount
562); sections.py Misc / X assignment; regenerate
src/xframe_palette.h (562 entries, palette --check clean); 16x16
icons; README 547 -> 562 plus X* monitor-family section with
per-widget one-liners and example build/run commands.

Also fix a pre-existing seam-test failure (proven on clean main
9088092): the generator emitted .w.set_label() for the
Frame/GroupBox/Panel kinds, but TFrame / TGroupBox / TPanel only
have set_text — gate the GtkFrame-only setters on the mapped class
being GtkFrame so the other classes fall through to set_text.
make test (seam test) now passes: 562 mapped, generated project
builds.
2026-12-05 17:56:33 +00:00
cnmcdee 56a34bb1cf Task 3: placement sizes are max(bucket default, content minimum) so the outer border encloses each widget's content
27 widgets (18 dialogs, 2 calendars, 3 views, 4 choosers) get larger defaults via MIN_SIZES in widgets/tools/gen_registry.py, applied in default_size() and regenerated into widgets/common/registry.h. Verified live under Xvfb (dialogs sweep, 28 widgets, screenshots): 15 of the 18 originally-overflowing dialogs now fit at placement time (e.g. GtkAboutDialog 520x260, TPageSetupDialog 320x400, TColorDialog 520x300, picture dialogs 480x240). Three are internal draw-layout collisions, not placement size: TFindDialog Direction label overlaps Find Next, GtkFileChooserDialog Name header overlaps the path field, TFontDialog caption overlaps OK/Cancel (its lists expand to fill the dialog height).
2026-12-02 05:10:27 +00:00
cnmcdee 05a85ddf8a Phase 4: named live-apply dispatch in registry.h; repair gen_registry.py
registry.h gains 8 Phase 4 IWidget virtuals (set_named_color/double/int/
bool/string, set_y_range, set_anchor, set_value_str), one SFINAE trait per
distinct Stock/Instrumentation setter, and Holder overrides with if-chains
over (prop -> setter). The named dispatch keeps the virtual count flat
while covering all 116 Phase 4 prop names.

gen_registry.py was stale: regenerating it deleted the hand-added Phase 2
colour virtuals and the whole Phase 3 block. tools/port_registry_blocks.py
ports those 60 virtuals/traits/overrides back into the template (verified:
regeneration is a byte-identical no-op) and inserts the Phase 4 blocks, so
registry.h is generated again, not hand-edited.
2026-11-30 14:07:19 +00:00
cnmcdee b79e44b97d Phase 3: IWidget virtuals for new Inspector setters (49 + 11 rgb colour virtuals) 2026-11-30 11:57:47 +00:00
cnmcdee 5c10871d15 Phase 2 widget setters (C++): Button default/cancel/kind/modal-result/layout with default ring and kind text; Entry alignment/char-case/numbers-only/hide-selection/auto-select with live filtering and max-length truncation; Label transparent/show-accel-char/focus-control with & stripping; CheckBox allow-grayed/alignment/value-checked/unchecked with right-box draw; RadioButton group-id; ComboBox style/drop-down-count/width/sorted/read-only/max-length/auto-complete/char-case; ListBox sorted; Scale show-sel-range/sel-start/sel-end with range draw; TextView/Memo max-length/alignment/scroll-bars/want-tabs/want-returns/hide-selection with Memo editable/cursor-visible; CheckListBox set_items/set_checked_items/selected-row/sorted; 35 new IWidget virtuals via SFINAE 2026-11-30 09:43:25 +00:00
cnmcdee c4057ced85 Phase 2 Flag 10: Lazarus event names (OnClick, OnChange, OnMouseDown, ...) in the Inspector Events pane; raw pointer/keyboard/double-click events wired through Holder IWidget callbacks (450ms double-click rule); generator find_map/event_callback normalise class names via xframe_type_key so event toggles reach generated code; cursor-changed on Spreadsheet/StringGrid wires on_select_cell (fixes generated XSpreadsheet compile error) 2026-11-30 09:24:07 +00:00
cnmcdee 2df40841ac Phase 1 C2 fix: placeholder detector uses the callable pattern
GtkEntry::set_placeholder_text takes std::string BY VALUE, so the
exact-signature static_cast detector never matched it and the
Holder set_placeholder_text was a silent no-op. The detector now
uses the callable pattern
decltype(std::declval<T&>().set_placeholder_text(std::declval<std::string>())).
registry.h regenerated; verified by the standalone registry test
(set_placeholder_text now resolves and returns true).
2026-11-30 05:54:57 +00:00
cnmcdee ca9abcc189 Phase 1 C2: IWidget live-apply virtuals for the generic property set
Adds set_value, set_active, set_active_index, set_items,
set_fill_color, set_range, set_digits, set_fraction, set_draw_value,
set_editable, set_max_length, set_placeholder_text, set_wrap,
set_wrap_mode, set_xalign, set_selectable, set_inconsistent,
set_show_heading, set_show_day_names, set_color_rgb,
set_orientation_vertical, set_page_size, set_upper, set_step,
set_lower, set_page_increment, set_password, set_show_password,
set_direction, set_cursor_visible, set_multi_select, and get_text.
Default no-op (false / empty), Holder overrides via SFINAE with
exact-signature static_cast member pointers, so a bool never matches
set_active(int) and a double never matches set_value(int). registry.h
is generated from gen_registry.py; the diff is additions only.
2026-11-30 05:30:57 +00:00
cnmcdee 37d53180cb Fix 6: Inspector tracks XFrame canvas selection
The Inspector read g_selected, a GTK Item* that real palette placements
never create, so it always showed Window (Root). The canvas now notifies
the designer on selection change (xframe_canvas_set_selection_callback,
fired after press/key/place/select/delete); the Inspector mirrors the
selected widget into g_xframe_sel with geometry spins, property editors
(mapped to the GTK prop/event tables), events and delete, and Inspector
edits live-apply (text/label/caption, enabled, visible via SFINAE
setters on IWidget/Holder) and persist to codegen through per-widget
props/signals stored in the core and copied by snapshot_project().
Also syncs the generator template (gen_registry.py) with the
hand-edited registry.h, verified by byte-identical regeneration.
2026-11-30 04:55:09 +00:00
cnmcdee 3ed3f57151 XFrame border: per-widget border style via the place file
- SStyle_Manager::add_border_style clones the base style and overrides
  only the border fields (line colour, radius, line width) when set;
  unset fields keep the style defaults (radius 6, 1px dark-grey
  outline), so existing widgets look identical.
- IWidget::set_style_name (pure virtual, forwarded by Holder<T>) lets
  the layout give a placed widget its own border style.
- Place file extended (backwards compatible): x y [width color radius];
  a bare old-format x y still places with the default border.
- Placed records the border; write_state reports border=<w> <color> <r>.
- Designer: the XFrame placement border is set in the Inspector Window
  (Root) view (the designer cannot show an XFrame widget in its
  Inspector) and written into the place file on canvas click.
- Verified: place file 512 360 3 #ff0000 10 -> layout state
  border=3 #ff0000 10, 1072 red pixels drawn.
2026-11-29 19:54:09 +00:00
cnmcdee 75470266f3 XFrame placement, 16px handles, About, menu to Code window, tabbed editor
- XFrame placement: layout raises+activates itself via EWMH
  (_NET_ACTIVE_WINDOW + XRaiseWindow + XSetInputFocus) on every new
  palette selection, and the designer forwards a canvas click to the
  layout via a place-request file (/tmp/lightgui-place.txt,
  $LIGHTGUI_PLACE) when an XFrame widget is selected, so placement
  works even when the click lands on the designer canvas. Verified
  under openbox (real WM): selection raises the layout, place file
  centres the widget on the click.
- Resize handles: 16px drawn (was 12px), 32x32 grab target (8px hit
  pad around each handle centre). All 8 handles verified by real
  mouse drags under openbox: SE corner resizes both axes exactly,
  N edge height-only, W edge width-only; handles drawn last
  (foreground) so they are always on top.
- Help -> About: GtkAboutDialog with the git commit hash baked in
  at build time (Makefile -DLIGHTGUI_GIT_HASH) and the build date.
- Menu bar moved out of the main designer window into the LightGUI
  Code window (reparented from root_box at startup); the layout
  window is now just the layout manager. Ctrl+E on the main window
  toggles the Code window back in when it is hidden.
- Tabbed multi-file editor in the Code window: GtkNotebook, one
  codeview per tab, File -> Open File in Code... opens a file in a
  new tab, per-tab dirty flag / Ctrl+S save / close button (asks
  before dropping unsaved edits), Variables pane + splitter and
  //region folding kept per tab. Debugger opens the stopped file in
  its own tab instead of overwriting the current one; refresh shows
  generated code in its own tab and never clobbers a hand-opened file.
- tests/code_window_tests.sh: reopen check now uses Ctrl+E.
2026-11-29 17:51:24 +00:00
cnmcdee 6e9e7b5fe3 Fix malformed 16px ICOs so all 547 palette icons load
Pillow writes 16px ICOs with unpadded 2-byte AND-mask rows (840 B vs spec
872 B, biSizeImage 768 vs 832); Ubuntu 26.04 glycin rejects them, so 0
icons attached to the palette. New widgets/tools/fix_icons.py pads each
mask row to 4 bytes and corrects the size fields (XOR pixels identical
547/547); gen_icons.py now calls it after every save; stale 32bpp
comments corrected to 24bpp. Glycin loads 547/547, ico.h harness 547/547,
palette self-test 583/583.
2026-11-29 04:49:52 +00:00
cnmcdee 77a5edfe2c Merge expanded widget set: 547 XFrame widgets, combined palette (583), layout, docs 2026-11-29 03:38:35 +00:00