From 54509f32baaf5f8a927b4a3ff80da34dbd4d0cfc Mon Sep 17 00:00:00 2001 From: cnmcdee Date: Mon, 30 Nov 2026 15:05:09 +0000 Subject: [PATCH] Phase 4: regenerate gen fixtures for the StockChart table change Cases 02, 03, 14, 15, 16: the StockChart up/down colours are now emitted by the generic Phase 4 loop with the widget's real defaults rgb(0,150,0)/rgb(200,30,30) (the legacy rgb(0,200,0)/rgb(220,0,0) did not match the widget), in table order, together with the rest of the candlestick custom props (grid-color, auto-y, axis-w/h, view-first/ count, y-range). Case 03 also gains set_text("Test value") -- the combined 17-prop StockChart table now carries a text prop. --- .../tests/fixtures/02_all_types/main.cpp | 11 +++++++++-- .../tests/fixtures/03_all_props/main.cpp | 12 ++++++++++-- .../tests/fixtures/14_stockchart/main.cpp | 11 +++++++++-- .../tests/fixtures/15_stockchart_indicators/main.cpp | 11 +++++++++-- .../tests/fixtures/16_stockchart_pro/main.cpp | 11 +++++++++-- 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/crates/lightgui-gen/tests/fixtures/02_all_types/main.cpp b/crates/lightgui-gen/tests/fixtures/02_all_types/main.cpp index 0124fe2..ec9be90 100644 --- a/crates/lightgui-gen/tests/fixtures/02_all_types/main.cpp +++ b/crates/lightgui-gen/tests/fixtures/02_all_types/main.cpp @@ -103,10 +103,17 @@ int main() { Spreadsheet_001.w.set_grid_line_width(1); // NOTE (model-only, no XFrame setter): columns=4 lg::Holder StockChart_001(display, screen, window, gc, &styles, 200, 530, 320, 200); - StockChart_001.w.set_up_color(Srgb{0, 200, 0}); - StockChart_001.w.set_down_color(Srgb{220, 0, 0}); // NOTE: StockChart design data not representable through the StockCandlestickChart API: // scale-mode: 0 (0 = price, 1 = percent) + StockChart_001.w.set_y_range(0.0, 1.0); + StockChart_001.w.set_down_color(Srgb{200, 30, 30}); + StockChart_001.w.set_grid_color(Srgb{225, 225, 225}); + StockChart_001.w.set_up_color(Srgb{0, 150, 0}); + StockChart_001.w.set_auto_y(true); + StockChart_001.w.set_axis_h(20); + StockChart_001.w.set_axis_w(56); + StockChart_001.w.set_view_count(0.0); + StockChart_001.w.set_view_first(0.0); lg::Holder Memo_001(display, screen, window, gc, &styles, 390, 530, 220, 120); Memo_001.w.set_editable(true); Memo_001.w.set_wordwrap(false); diff --git a/crates/lightgui-gen/tests/fixtures/03_all_props/main.cpp b/crates/lightgui-gen/tests/fixtures/03_all_props/main.cpp index ea3f387..39b2e31 100644 --- a/crates/lightgui-gen/tests/fixtures/03_all_props/main.cpp +++ b/crates/lightgui-gen/tests/fixtures/03_all_props/main.cpp @@ -352,14 +352,22 @@ int main() { // NOTE (model-only, no XFrame setter): hint="Test value", tooltip-text="tip with \"quotes\" and \\ slash", cursor="Test value", tab-stop=false, show-hint=true, font-underline=true, font-strikeout=true, columns=4 apply_autosize(&Spreadsheet_001, styles, "Spreadsheet_001_style", 10, 530, 0, 0, 0, 0); lg::Holder StockChart_001(display, screen, window, gc, &styles, 200, 530, 320, 200); - StockChart_001.w.set_up_color(Srgb{51, 102, 153}); - StockChart_001.w.set_down_color(Srgb{51, 102, 153}); + StockChart_001.w.set_text("Test value"); // NOTE: StockChart design data not representable through the StockCandlestickChart API: // data-file: "Test value" // indicators: "Test value" // drawings: "Test value" // compare-files: "Test value" // scale-mode: 1 (0 = price, 1 = percent) + StockChart_001.w.set_y_range(42.5, 42.5); + StockChart_001.w.set_down_color(Srgb{51, 102, 153}); + StockChart_001.w.set_grid_color(Srgb{51, 102, 153}); + StockChart_001.w.set_up_color(Srgb{51, 102, 153}); + StockChart_001.w.set_auto_y(false); + StockChart_001.w.set_axis_h(20); + StockChart_001.w.set_axis_w(56); + StockChart_001.w.set_view_count(42.5); + StockChart_001.w.set_view_first(42.5); StockChart_001.w.set_bg_color(Srgb{51, 102, 153}); StockChart_001.w.set_style_name("StockChart_001_style"); StockChart_001.set_enabled(false); diff --git a/crates/lightgui-gen/tests/fixtures/14_stockchart/main.cpp b/crates/lightgui-gen/tests/fixtures/14_stockchart/main.cpp index e75f9b1..4358572 100644 --- a/crates/lightgui-gen/tests/fixtures/14_stockchart/main.cpp +++ b/crates/lightgui-gen/tests/fixtures/14_stockchart/main.cpp @@ -34,11 +34,18 @@ int main() { styles.add_style_ex("dark", Srgb{45, 45, 48}, Srgb{20, 20, 22}, Srgb{200, 200, 200}, Srgb{240, 240, 240}, 6, 1, "-misc-fixed-medium-r-normal--13-*"); styles.set_active_style_byName("default"); lg::Holder StockChart_001(display, screen, window, gc, &styles, 10, 10, 640, 320); - StockChart_001.w.set_up_color(Srgb{0, 200, 0}); - StockChart_001.w.set_down_color(Srgb{220, 0, 0}); // NOTE: StockChart design data not representable through the StockCandlestickChart API: // data-file: "/opt/lightgui/tests/out/14_stockchart/SPY_fake.csv" // scale-mode: 0 (0 = price, 1 = percent) + StockChart_001.w.set_y_range(0.0, 1.0); + StockChart_001.w.set_down_color(Srgb{200, 30, 30}); + StockChart_001.w.set_grid_color(Srgb{225, 225, 225}); + StockChart_001.w.set_up_color(Srgb{0, 150, 0}); + StockChart_001.w.set_auto_y(true); + StockChart_001.w.set_axis_h(20); + StockChart_001.w.set_axis_w(56); + StockChart_001.w.set_view_count(0.0); + StockChart_001.w.set_view_first(0.0); lg::Holder Label_001(display, screen, window, gc, &styles, 10, 340, 100, 24); Label_001.w.set_text("Label_001"); Label_001.w.set_xalign(0.5); diff --git a/crates/lightgui-gen/tests/fixtures/15_stockchart_indicators/main.cpp b/crates/lightgui-gen/tests/fixtures/15_stockchart_indicators/main.cpp index cfbffb7..6354e7f 100644 --- a/crates/lightgui-gen/tests/fixtures/15_stockchart_indicators/main.cpp +++ b/crates/lightgui-gen/tests/fixtures/15_stockchart_indicators/main.cpp @@ -34,12 +34,19 @@ int main() { styles.add_style_ex("dark", Srgb{45, 45, 48}, Srgb{20, 20, 22}, Srgb{200, 200, 200}, Srgb{240, 240, 240}, 6, 1, "-misc-fixed-medium-r-normal--13-*"); styles.set_active_style_byName("default"); lg::Holder StockChart_001(display, screen, window, gc, &styles, 10, 10, 900, 500); - StockChart_001.w.set_up_color(Srgb{0, 200, 0}); - StockChart_001.w.set_down_color(Srgb{220, 0, 0}); // NOTE: StockChart design data not representable through the StockCandlestickChart API: // data-file: "/opt/lightgui/tests/out/15_stockchart_indicators/SPY_fake_long.csv" // indicators: "SMA(20), EMA(50), Bollinger Bands, RSI, MACD, Engulfing" // scale-mode: 0 (0 = price, 1 = percent) + StockChart_001.w.set_y_range(0.0, 1.0); + StockChart_001.w.set_down_color(Srgb{200, 30, 30}); + StockChart_001.w.set_grid_color(Srgb{225, 225, 225}); + StockChart_001.w.set_up_color(Srgb{0, 150, 0}); + StockChart_001.w.set_auto_y(true); + StockChart_001.w.set_axis_h(20); + StockChart_001.w.set_axis_w(56); + StockChart_001.w.set_view_count(0.0); + StockChart_001.w.set_view_first(0.0); std::vector widgets = { &StockChart_001 }; auto redraw_all = [&]() { XClearWindow(display, window); diff --git a/crates/lightgui-gen/tests/fixtures/16_stockchart_pro/main.cpp b/crates/lightgui-gen/tests/fixtures/16_stockchart_pro/main.cpp index 0b79629..a88adb6 100644 --- a/crates/lightgui-gen/tests/fixtures/16_stockchart_pro/main.cpp +++ b/crates/lightgui-gen/tests/fixtures/16_stockchart_pro/main.cpp @@ -34,14 +34,21 @@ int main() { styles.add_style_ex("dark", Srgb{45, 45, 48}, Srgb{20, 20, 22}, Srgb{200, 200, 200}, Srgb{240, 240, 240}, 6, 1, "-misc-fixed-medium-r-normal--13-*"); styles.set_active_style_byName("default"); lg::Holder StockChart_001(display, screen, window, gc, &styles, 10, 10, 1004, 748); - StockChart_001.w.set_up_color(Srgb{0, 200, 0}); - StockChart_001.w.set_down_color(Srgb{220, 0, 0}); // NOTE: StockChart design data not representable through the StockCandlestickChart API: // data-file: "/opt/lightgui/tests/out/16_stockchart_pro/SPY_fake_long.csv" // indicators: "SMA(20), RSI" // drawings: "trend 790 676 1150 690 red; hline 688 blue; fib 800 674 1000 692 purple; text 830 691 orange Resistance zone; rect 860 678 960 684 teal; arrow 920 690 1090 680 magenta; measure 840 677 1010 689 black" // compare-files: "/opt/lightgui/tests/out/16_stockchart_pro/QQQ_fake_long.csv" // scale-mode: 1 (0 = price, 1 = percent) + StockChart_001.w.set_y_range(0.0, 1.0); + StockChart_001.w.set_down_color(Srgb{200, 30, 30}); + StockChart_001.w.set_grid_color(Srgb{225, 225, 225}); + StockChart_001.w.set_up_color(Srgb{0, 150, 0}); + StockChart_001.w.set_auto_y(true); + StockChart_001.w.set_axis_h(20); + StockChart_001.w.set_axis_w(56); + StockChart_001.w.set_view_count(0.0); + StockChart_001.w.set_view_first(0.0); std::vector widgets = { &StockChart_001 }; auto redraw_all = [&]() { XClearWindow(display, window);