1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// Tile header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2023-10-16 11:53:18 +03:00
|
|
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
2014-10-19 18:17:47 +04:00
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
2011-07-19 08:49:30 +04:00
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-04-16 04:13:17 +04:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
#ifndef Fl_Tile_H
|
|
|
|
#define Fl_Tile_H
|
|
|
|
|
|
|
|
#include "Fl_Group.H"
|
|
|
|
|
2014-10-19 18:17:47 +04:00
|
|
|
/*
|
|
|
|
The Fl_Tile class lets you resize its children by dragging
|
|
|
|
the border between them.
|
2008-09-14 19:45:27 +04:00
|
|
|
*/
|
2014-10-19 18:17:47 +04:00
|
|
|
|
2002-08-14 20:49:38 +04:00
|
|
|
class FL_EXPORT Fl_Tile : public Fl_Group {
|
1998-10-06 22:21:25 +04:00
|
|
|
public:
|
2022-12-30 21:14:36 +03:00
|
|
|
int handle(int event) FL_OVERRIDE;
|
2016-05-09 14:29:59 +03:00
|
|
|
Fl_Tile(int X, int Y, int W, int H, const char *L=0);
|
2023-11-22 16:45:07 +03:00
|
|
|
~Fl_Tile() FL_OVERRIDE;
|
2022-12-30 21:14:36 +03:00
|
|
|
void resize(int X, int Y, int W, int H) FL_OVERRIDE;
|
2023-10-16 11:53:18 +03:00
|
|
|
virtual void move_intersection(int oldx, int oldy, int newx, int newy);
|
2023-11-22 16:45:07 +03:00
|
|
|
virtual void drag_intersection(int oldx, int oldy, int newx, int newy);
|
2023-02-10 18:27:42 +03:00
|
|
|
FL_DEPRECATED("in 1.4.0 - use move_intersection(p) instead",
|
2023-10-16 11:53:18 +03:00
|
|
|
void position(int oldx, int oldy, int newx, int newy)) { move_intersection(oldx, oldy, newx, newy); }
|
2023-02-02 22:54:19 +03:00
|
|
|
void position(int x, int y) { Fl_Group::position(x, y); }
|
2023-11-22 16:45:07 +03:00
|
|
|
void size_range(int index, int minw, int minh, int maxw=0x7FFFFFFF, int maxh=0x7FFFFFFF);
|
|
|
|
void size_range(Fl_Widget *w , int minw, int minh, int maxw=0x7FFFFFFF, int maxh=0x7FFFFFFF);
|
|
|
|
void init_size_range(int default_min_w = -1, int default_min_h = -1);
|
2023-10-16 11:53:18 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int cursor_; ///< current cursor index (0..3)
|
|
|
|
Fl_Cursor *cursors_; ///< points at the array of 4 cursors (may be overridden)
|
|
|
|
|
|
|
|
/** Returns the cursor for cursor index n.
|
|
|
|
\see Fl_Tile::set_cursor(int)
|
|
|
|
*/
|
|
|
|
|
|
|
|
Fl_Cursor cursor(int n) {
|
|
|
|
return cursors_[n];
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_cursor(int n); // set one of n (0..3) cursors
|
2023-11-22 16:45:07 +03:00
|
|
|
|
|
|
|
typedef struct { int minw, minh, maxw, maxh; } Size_Range;
|
|
|
|
|
|
|
|
Size_Range *size_range_;
|
|
|
|
int size_range_size_, size_range_capacity_;
|
|
|
|
int default_min_w_, default_min_h_;
|
|
|
|
void request_shrink_l(int old_l, int &new_l, Fl_Rect *final_size);
|
|
|
|
void request_shrink_r(int old_r, int &new_r, Fl_Rect *final_size);
|
|
|
|
void request_shrink_t(int old_t, int &new_t, Fl_Rect *final_size);
|
|
|
|
void request_shrink_b(int old_b, int &new_b, Fl_Rect *final_size);
|
|
|
|
void request_grow_l(int old_l, int &new_l, Fl_Rect *final_size);
|
|
|
|
void request_grow_r(int old_r, int &new_r, Fl_Rect *final_size);
|
|
|
|
void request_grow_t(int old_t, int &new_t, Fl_Rect *final_size);
|
|
|
|
void request_grow_b(int old_b, int &new_b, Fl_Rect *final_size);
|
|
|
|
|
|
|
|
int on_insert(Fl_Widget*, int) FL_OVERRIDE;
|
|
|
|
int on_move(int, int) FL_OVERRIDE;
|
|
|
|
void on_remove(int) FL_OVERRIDE;
|
1998-10-06 22:21:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|