FLTK 1.4.4: Fl_Tile.H Source File

FLTK 1.4.4

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
27 class 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);
31 ~Fl_Tile() FL_OVERRIDE;
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("since 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_;
44 Fl_Cursor *cursors_;
45
49
50 Fl_Cursor cursor(int n) {
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
70 int on_insert(Fl_Widget*, int) FL_OVERRIDE;
71 int on_move(int, int) FL_OVERRIDE;
72 void on_remove(int) FL_OVERRIDE;
73};
74
75#endif
Fl_Cursor
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1283
Fl_Group.H
Fl_Group and Fl_End classes.
Fl_Group::on_remove
virtual void on_remove(int)
Allow derived groups to act when a child widget is removed from the group.
Definition Fl_Group.cxx:571
Fl_Group::handle
int handle(int) FL_OVERRIDE
Handles the specified event.
Definition Fl_Group.cxx:145
Fl_Group::on_move
virtual int on_move(int, int)
Allow derived groups to act when a widget is moved within the group.
Definition Fl_Group.cxx:499
Fl_Group::resize
void resize(int, int, int, int) FL_OVERRIDE
Resizes the Fl_Group widget and all of its children.
Definition Fl_Group.cxx:825
Fl_Group::on_insert
virtual int on_insert(Fl_Widget *, int)
Allow derived groups to act when a widget is added as a child.
Definition Fl_Group.cxx:475
Fl_Rect
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition Fl_Rect.H:30
Fl_Tile::request_grow_b
void request_grow_b(int old_b, int &new_b, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:425
Fl_Tile::request_grow_r
void request_grow_r(int old_r, int &new_r, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:384
Fl_Tile::request_grow_t
void request_grow_t(int old_t, int &new_t, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:404
Fl_Tile::request_shrink_b
void request_shrink_b(int old_b, int &new_b, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:318
Fl_Tile::Fl_Tile
Fl_Tile(int X, int Y, int W, int H, const char *L=0)
Creates a new Fl_Tile widget using the given position, size, and label string.
Definition Fl_Tile.cxx:921
Fl_Tile::drag_intersection
virtual void drag_intersection(int oldx, int oldy, int newx, int newy)
Drags the intersection at (oldx,oldy) to (newx,newy).
Definition Fl_Tile.cxx:498
Fl_Tile::request_shrink_t
void request_shrink_t(int old_t, int &new_t, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:271
Fl_Tile::request_shrink_r
void request_shrink_r(int old_r, int &new_r, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:224
Fl_Tile::request_grow_l
void request_grow_l(int old_l, int &new_l, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:363
Fl_Tile::move_intersection
virtual void move_intersection(int oldx, int oldy, int newx, int newy)
Drags the intersection at (oldx,oldy) to (newx,newy).
Definition Fl_Tile.cxx:453
Fl_Tile::request_shrink_l
void request_shrink_l(int old_l, int &new_l, Fl_Rect *final_size)
Request for children to change their layout.
Definition Fl_Tile.cxx:177
Fl_Tile::position
void position(int oldx, int oldy, int newx, int newy)
Definition Fl_Tile.H:36
Fl_Tile::cursor_
int cursor_
current cursor index (0..3)
Definition Fl_Tile.H:43
Fl_Tile::cursors_
Fl_Cursor * cursors_
points at the array of 4 cursors (may be overridden)
Definition Fl_Tile.H:44
Fl_Tile::cursor
Fl_Cursor cursor(int n)
Returns the cursor for cursor index n.
Definition Fl_Tile.H:50
Fl_Widget::position
void position(int X, int Y)
Repositions the window or widget.
Definition Fl_Widget.H:409
FL_OVERRIDE
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46
FL_DEPRECATED
#define FL_DEPRECATED(msg, func)
Enclosing a function or method in FL_DEPRECATED marks it as no longer recommended.
Definition fl_attr.h:57
Fl_Tile::Size_Range
Definition Fl_Tile.H:56