2023-10-20 20:00:42 +03:00
|
|
|
//
|
|
|
|
// Fl_Grid type header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
|
|
|
// Copyright 2023 by Bill Spitzak and others.
|
|
|
|
//
|
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// https://www.fltk.org/COPYING.php
|
|
|
|
//
|
|
|
|
// Please see the following page on how to report bugs and issues:
|
|
|
|
//
|
|
|
|
// https://www.fltk.org/bugs.php
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _FLUID_FL_GRID_TYPE_H
|
|
|
|
#define _FLUID_FL_GRID_TYPE_H
|
|
|
|
|
|
|
|
#include "Fl_Group_Type.h"
|
2023-11-01 00:00:29 +03:00
|
|
|
#include <FL/Fl_Grid.H>
|
2023-10-20 20:00:42 +03:00
|
|
|
|
|
|
|
// ---- Fl_Grid_Type --------------------------------------------------- MARK: -
|
|
|
|
|
|
|
|
extern const char grid_type_name[];
|
|
|
|
|
2023-11-01 00:00:29 +03:00
|
|
|
class Fl_Grid_Proxy : public Fl_Grid {
|
2023-11-05 22:04:43 +03:00
|
|
|
protected:
|
|
|
|
typedef struct { Fl_Widget *widget; Cell *cell; } Cell_Widget_Pair;
|
|
|
|
Cell_Widget_Pair *transient_;
|
|
|
|
int num_transient_;
|
|
|
|
int cap_transient_;
|
|
|
|
void transient_make_room_(int n);
|
|
|
|
void transient_remove_(Fl_Widget *w);
|
2023-11-01 00:00:29 +03:00
|
|
|
public:
|
2023-11-05 22:04:43 +03:00
|
|
|
Fl_Grid_Proxy(int X,int Y,int W,int H);
|
|
|
|
~Fl_Grid_Proxy();
|
2023-11-01 00:00:29 +03:00
|
|
|
void resize(int,int,int,int) FL_OVERRIDE;
|
2023-11-01 19:22:31 +03:00
|
|
|
void draw() FL_OVERRIDE;
|
2023-11-02 17:18:03 +03:00
|
|
|
void draw_overlay();
|
2023-11-05 22:04:43 +03:00
|
|
|
void move_cell(Fl_Widget *child, int to_row, int to_col, int how = 0);
|
|
|
|
Cell* any_cell(Fl_Widget *widget) const;
|
2023-11-06 00:18:56 +03:00
|
|
|
Cell* transient_cell(Fl_Widget *widget) const;
|
2023-11-05 22:04:43 +03:00
|
|
|
Cell* transient_widget(Fl_Widget *wi, int row, int col, int row_span, int col_span, Fl_Grid_Align align = FL_GRID_FILL);
|
|
|
|
Cell* widget(Fl_Widget *wi, int row, int col, Fl_Grid_Align align = FL_GRID_FILL);
|
|
|
|
Cell* widget(Fl_Widget *wi, int row, int col, int rowspan, int colspan, Fl_Grid_Align align = FL_GRID_FILL);
|
2023-11-01 00:00:29 +03:00
|
|
|
};
|
|
|
|
|
2023-10-20 20:00:42 +03:00
|
|
|
class Fl_Grid_Type : public Fl_Group_Type
|
|
|
|
{
|
|
|
|
typedef Fl_Group_Type super;
|
|
|
|
public:
|
|
|
|
Fl_Grid_Type();
|
|
|
|
const char *type_name() FL_OVERRIDE {return grid_type_name;}
|
|
|
|
const char *alt_type_name() FL_OVERRIDE {return "fltk::GridGroup";}
|
|
|
|
Fl_Widget_Type *_make() FL_OVERRIDE { return new Fl_Grid_Type(); }
|
|
|
|
Fl_Widget *widget(int X,int Y,int W,int H) FL_OVERRIDE;
|
|
|
|
ID id() const FL_OVERRIDE { return ID_Grid; }
|
|
|
|
bool is_a(ID inID) const FL_OVERRIDE { return (inID==ID_Grid) ? true : super::is_a(inID); }
|
|
|
|
void write_properties(Fd_Project_Writer &f) FL_OVERRIDE;
|
|
|
|
void read_property(Fd_Project_Reader &f, const char *) FL_OVERRIDE;
|
2023-10-21 14:18:50 +03:00
|
|
|
void write_parent_properties(Fd_Project_Writer &f, Fl_Type *child, bool encapsulate) FL_OVERRIDE;
|
2023-11-05 16:53:42 +03:00
|
|
|
void read_parent_property(Fd_Project_Reader &f, Fl_Type *child, const char *property) FL_OVERRIDE;
|
2023-10-20 20:00:42 +03:00
|
|
|
void copy_properties() FL_OVERRIDE;
|
|
|
|
void write_code1(Fd_Code_Writer& f) FL_OVERRIDE;
|
|
|
|
void write_code2(Fd_Code_Writer& f) FL_OVERRIDE;
|
|
|
|
void add_child(Fl_Type*, Fl_Type*) FL_OVERRIDE;
|
|
|
|
void move_child(Fl_Type*, Fl_Type*) FL_OVERRIDE;
|
|
|
|
void remove_child(Fl_Type*) FL_OVERRIDE;
|
2023-11-01 00:00:29 +03:00
|
|
|
void layout_widget() FL_OVERRIDE;
|
2023-10-21 18:45:30 +03:00
|
|
|
void child_resized(Fl_Widget_Type *child);
|
2023-10-23 02:36:55 +03:00
|
|
|
void insert_child_at(Fl_Widget *child, int x, int y);
|
2023-11-06 00:18:56 +03:00
|
|
|
void insert_child_at_next_free_cell(Fl_Widget *child);
|
2023-11-02 17:18:03 +03:00
|
|
|
void keyboard_move_child(Fl_Widget_Type*, int key);
|
2023-10-22 21:25:41 +03:00
|
|
|
|
|
|
|
static class Fl_Grid *selected();
|
2023-10-20 20:00:42 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FLUID_FL_GRID_TYPE_H
|