FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Tile.H
1//
2// Tile header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17#ifndef Fl_Tile_H
18#define Fl_Tile_H
19
20#include "Fl_Group.H"
21
22/*
23 The Fl_Tile class lets you resize its children by dragging
24 the border between them.
25*/
26
27class FL_EXPORT Fl_Tile : public Fl_Group {
28public:
29 int handle(int event) FL_OVERRIDE;
30 Fl_Tile(int X, int Y, int W, int H, const char *L=0);
32 void resize(int X, int Y, int W, int H) FL_OVERRIDE;
33 virtual void move_intersection(int oldx, int oldy, int newx, int newy);
34 virtual void drag_intersection(int oldx, int oldy, int newx, int newy);
35 FL_DEPRECATED("in 1.4.0 - use move_intersection(p) instead",
36 void position(int oldx, int oldy, int newx, int newy)) { move_intersection(oldx, oldy, newx, newy); }
37 void position(int x, int y) { Fl_Group::position(x, y); }
38 void size_range(int index, int minw, int minh, int maxw=0x7FFFFFFF, int maxh=0x7FFFFFFF);
39 void size_range(Fl_Widget *w , int minw, int minh, int maxw=0x7FFFFFFF, int maxh=0x7FFFFFFF);
40 void init_size_range(int default_min_w = -1, int default_min_h = -1);
41
42protected:
43 int cursor_;
45
51 return cursors_[n];
52 }
53
54 void set_cursor(int n); // set one of n (0..3) cursors
55
56 typedef struct { int minw, minh, maxw, maxh; } Size_Range;
57
58 Size_Range *size_range_;
59 int size_range_size_, size_range_capacity_;
60 int default_min_w_, default_min_h_;
61 void request_shrink_l(int old_l, int &new_l, Fl_Rect *final_size);
62 void request_shrink_r(int old_r, int &new_r, Fl_Rect *final_size);
63 void request_shrink_t(int old_t, int &new_t, Fl_Rect *final_size);
64 void request_shrink_b(int old_b, int &new_b, Fl_Rect *final_size);
65 void request_grow_l(int old_l, int &new_l, Fl_Rect *final_size);
66 void request_grow_r(int old_r, int &new_r, Fl_Rect *final_size);
67 void request_grow_t(int old_t, int &new_t, Fl_Rect *final_size);
68 void request_grow_b(int old_b, int &new_b, Fl_Rect *final_size);
69
71 int on_move(int, int) FL_OVERRIDE;
72 void on_remove(int) FL_OVERRIDE;
73};
74
75#endif
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1261
Fl_Group and Fl_End classes.
The Fl_Group class is the FLTK container widget.
Definition Fl_Group.H:56
virtual void on_remove(int)
Allow derived groups to act when a child widget is removed from the group.
Definition Fl_Group.cxx:569
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Group.cxx:145
virtual int on_move(int, int)
Allow derived groups to act when a widget is moved within the group.
Definition Fl_Group.cxx:497
void resize(int, int, int, int) FL_OVERRIDE
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:823
virtual int on_insert(Fl_Widget *, int)
Allow derived groups to act when a widget is added as a child.
Definition Fl_Group.cxx:473
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition Fl_Rect.H:30
The Fl_Tile class lets you resize its children by dragging the border between them.
Definition Fl_Tile.H:27
void position(int oldx, int oldy, int newx, int newy)
Definition Fl_Tile.H:36
int cursor_
current cursor index (0..3)
Definition Fl_Tile.H:43
Fl_Cursor * cursors_
points at the array of 4 cursors (may be overridden)
Definition Fl_Tile.H:44
Fl_Cursor cursor(int n)
Returns the cursor for cursor index n.
Definition Fl_Tile.H:50
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:104
void position(int X, int Y)
Repositions the window or widget.
Definition Fl_Widget.H:401
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
#define FL_DEPRECATED(msg, func)
Enclosing a function or method in FL_DEPRECATED marks it as no longer recommended.
Definition fl_attr.h:57
Definition Fl_Tile.H:56