From 7d3793ce1d8cb26e7608bf859beca21359cec6e9 Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Thu, 5 Feb 2026 16:35:56 +0500 Subject: wip --- FL/Fl_Group.H | 10 +++++----- FL/Fl_Table.H | 16 +++++++++------- FL/Fl_Table_Row.H | 12 +++++++++--- 3 files changed, 23 insertions(+), 15 deletions(-) (limited to 'FL') diff --git a/FL/Fl_Group.H b/FL/Fl_Group.H index 8e11adb01..3d33e4093 100644 --- a/FL/Fl_Group.H +++ b/FL/Fl_Group.H @@ -23,8 +23,6 @@ #include "Fl_Widget.H" -#include - // Don't #include Fl_Rect.H because this would introduce lots // of unnecessary dependencies on Fl_Rect.H class Fl_Rect; @@ -58,7 +56,9 @@ class Fl_Rect; */ class FL_EXPORT Fl_Group : public Fl_Widget { - std::vectorchild_; // vector of children + Fl_Widget **child_; // array of children + int children_; // number of children + int children_alloc_; // allocated size of child_ array Fl_Widget* savedfocus_; Fl_Widget* resizable_; Fl_Rect *bounds_; // remembered initial sizes of children @@ -94,7 +94,7 @@ public: /** Returns how many child widgets the group has. */ - int children() const { return (int)child_.size(); } + int children() const { return children_; } /** Returns the n'th child. @@ -240,7 +240,7 @@ public: // Note: Doxygen docs in Fl_Widget.H to avoid redundancy. Fl_Group* as_group() { return this; } - Fl_Group const* as_group() const override { return this; } + Fl_Group const* as_group() const { return this; } // back compatibility functions: diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H index 655df6b91..6d7c5d373 100644 --- a/FL/Fl_Table.H +++ b/FL/Fl_Table.H @@ -22,8 +22,6 @@ #include #include -#include - /** A table of widgets or other content. @@ -157,12 +155,16 @@ private: }; unsigned int flags_; - std::vector *_colwidths; // column widths in pixels - std::vector *_rowheights; // row heights in pixels + int *_colwidths; // column widths in pixels + int _colwidths_size; // number of columns + int _colwidths_alloc; // allocated size + int *_rowheights; // row heights in pixels + int _rowheights_size; // number of rows + int _rowheights_alloc; // allocated size - // number of columns and rows == size of corresponding vectors - int col_size(); // size of the column widths vector - int row_size(); // size of the row heights vector + // number of columns and rows + int col_size(); // number of columns + int row_size(); // number of rows Fl_Cursor _last_cursor; // last mouse cursor before changed to 'resize' cursor diff --git a/FL/Fl_Table_Row.H b/FL/Fl_Table_Row.H index 87c0eed15..ec5cd4512 100644 --- a/FL/Fl_Table_Row.H +++ b/FL/Fl_Table_Row.H @@ -24,7 +24,6 @@ #include #include -#include /** A table with row selection capabilities. @@ -52,7 +51,9 @@ public: }; private: - std::vector _rowselect; // selection flag for each row + unsigned char *_rowselect; // selection flag for each row + int _rowselect_size; // size of _rowselect array + int _rowselect_alloc; // allocated size // handle() state variables. // Put here instead of local statics in handle(), so more @@ -80,6 +81,9 @@ public: with headers and row/column resize behavior disabled. */ Fl_Table_Row(int X, int Y, int W, int H, const char *l=0) : Fl_Table(X,Y,W,H,l) { + _rowselect = 0; + _rowselect_size = 0; + _rowselect_alloc = 0; _dragging_select = 0; _last_row = -1; _last_y = -1; @@ -92,7 +96,9 @@ public: The destructor for the Fl_Table_Row. Destroys the table and its associated widgets. */ - ~Fl_Table_Row() { } + ~Fl_Table_Row() { + if (_rowselect) free(_rowselect); + } void rows(int val); // set number of rows int rows() { // get number of rows -- cgit v1.2.3