diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-10-20 19:00:42 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-10-20 19:00:52 +0200 |
| commit | 9817536cfd4a9ea8d9bb5ef41580a5ba3d254911 (patch) | |
| tree | c2f313d24dad7a95742f4673907863c65fd771b2 /src/Fl_Grid.cxx | |
| parent | 757b5c12273cc1b4de8007b7c3f8536b699d2600 (diff) | |
FLUID: basic Fl_Grid support
* no settings for children yet
* ne good interactive editing for children
Diffstat (limited to 'src/Fl_Grid.cxx')
| -rw-r--r-- | src/Fl_Grid.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Fl_Grid.cxx b/src/Fl_Grid.cxx index e88a0461e..c3b3e1334 100644 --- a/src/Fl_Grid.cxx +++ b/src/Fl_Grid.cxx @@ -641,6 +641,31 @@ void Fl_Grid::margin(int left, int top, int right, int bottom) { need_layout(1); } +/** + Returns all outside margin sizes of the grid. + + All margin sizes are returned in the given arguments. If any argument + is \p NULL the respective value is not returned. + + \param[out] left returns left margin if not \p NULL + \param[out] top returns top margin if not \p NULL + \param[out] right returns right margin if not \p NULL + \param[out] bottom returns bottom margin if not \p NULL + + \return whether all margins are equal + \retval 1 all margins have the same size + \retval 0 at least one margin has a different size + */ +int Fl_Grid::margin(int *left, int *top, int *right, int *bottom) const { + if (left) *left = margin_left_; + if (top) *top = margin_top_; + if (right) *right = margin_right_; + if (bottom) *bottom = margin_bottom_; + if (margin_left_ == margin_top_ && margin_top_ == margin_right_ && margin_right_ == margin_bottom_) + return 1; + return 0; +} + /** Set default gaps for rows and columns. @@ -670,6 +695,19 @@ void Fl_Grid::gap(int row_gap, int col_gap) { } /** + Get the default gaps for rows and columns. + + \param[out] row_gap pointer to int to receive column gap, may be NULL + \param[out] col_gap pointer to int to receive column gap, may be NULL + */ +void Fl_Grid::gap(int *row_gap, int *col_gap) const { + if (row_gap) + *row_gap = gap_row_; + if (col_gap) + *col_gap = gap_col_; +} + +/** Get the grid cell of row \p row and column \p col. Widgets and other attributes are organized in cells (Fl_Grid::Cell). |
