diff options
| author | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 18:12:40 +0500 |
|---|---|---|
| committer | maxim nikonov <maxim.nikonov@hqo.co> | 2026-02-06 18:12:40 +0500 |
| commit | b4995f979d127cea667b4e2b71c91e9db4ab52ef (patch) | |
| tree | fbebc775e10932bace8d6a7c3481b1ba200c64db /src/Fl_Tile.cxx | |
| parent | 9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff) | |
wip
Diffstat (limited to 'src/Fl_Tile.cxx')
| -rw-r--r-- | src/Fl_Tile.cxx | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/Fl_Tile.cxx b/src/Fl_Tile.cxx index 0eb7e0a70..2f84a9a22 100644 --- a/src/Fl_Tile.cxx +++ b/src/Fl_Tile.cxx @@ -177,7 +177,8 @@ static int fl_max(int a, int b) { return a>b ? a : b; } void Fl_Tile::request_shrink_l(int old_l, int &new_l, Fl_Rect *final_size) { Fl_Rect *p = bounds(); int min_l = new_l; - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->x() == old_l) { if (ri->w() == 0) { @@ -224,7 +225,8 @@ void Fl_Tile::request_shrink_l(int old_l, int &new_l, Fl_Rect *final_size) { void Fl_Tile::request_shrink_r(int old_r, int &new_r, Fl_Rect *final_size) { Fl_Rect *p = bounds(); int min_r = new_r; - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->r() == old_r) { if (ri->w() == 0) { @@ -271,7 +273,8 @@ void Fl_Tile::request_shrink_r(int old_r, int &new_r, Fl_Rect *final_size) { void Fl_Tile::request_shrink_t(int old_t, int &new_t, Fl_Rect *final_size) { Fl_Rect *p = bounds(); int min_y = new_t; - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->y() == old_t) { if (ri->h() == 0) { @@ -318,7 +321,8 @@ void Fl_Tile::request_shrink_t(int old_t, int &new_t, Fl_Rect *final_size) { void Fl_Tile::request_shrink_b(int old_b, int &new_b, Fl_Rect *final_size) { Fl_Rect *p = bounds(); int min_b = new_b; - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->b() == old_b) { if (ri->h() == 0) { @@ -362,7 +366,8 @@ void Fl_Tile::request_shrink_b(int old_b, int &new_b, Fl_Rect *final_size) { */ void Fl_Tile::request_grow_l(int old_l, int &new_l, Fl_Rect *final_size) { Fl_Rect *p = bounds(); - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->x() == old_l) { final_size[i].w(final_size[i].r() - new_l); @@ -383,7 +388,8 @@ void Fl_Tile::request_grow_l(int old_l, int &new_l, Fl_Rect *final_size) { */ void Fl_Tile::request_grow_r(int old_r, int &new_r, Fl_Rect *final_size) { Fl_Rect *p = bounds(); - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->r() == old_r) { final_size[i].r(new_r); @@ -403,7 +409,8 @@ void Fl_Tile::request_grow_r(int old_r, int &new_r, Fl_Rect *final_size) { */ void Fl_Tile::request_grow_t(int old_t, int &new_t, Fl_Rect *final_size) { Fl_Rect *p = bounds(); - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->y() == old_t) { final_size[i].h(final_size[i].b() - new_t); @@ -424,7 +431,8 @@ void Fl_Tile::request_grow_t(int old_t, int &new_t, Fl_Rect *final_size) { */ void Fl_Tile::request_grow_b(int old_b, int &new_b, Fl_Rect *final_size) { Fl_Rect *p = bounds(); - for (int i=0; i<children(); i++) { + int i; + for (i =0; i<children(); i++) { Fl_Rect *ri = p+i+2; if (ri->b() == old_b) { final_size[i].b(new_b); @@ -458,7 +466,8 @@ void Fl_Tile::move_intersection(int oldx, int oldy, int newx, int newy) { Fl_Widget*const* a = array(); Fl_Rect *p = bounds(); p += 2; // skip group & resizable's saved size - for (int i=children(); i--; p++) { + int i; + for (i =children(); i--; p++) { Fl_Widget* o = *a++; if (o == resizable()) continue; int X = o->x(); @@ -564,7 +573,7 @@ void Fl_Tile::drag_intersection(int oldx, int oldy, int newx, int newy) { See the Fl_Tile class documentation about how the resizable() works. */ void Fl_Tile::resize(int X,int Y,int W,int H) { - + int i; if (size_range_) { // -- handle size_range style resizing int dx = X - x(); @@ -580,7 +589,7 @@ void Fl_Tile::resize(int X,int Y,int W,int H) { } // -- if the position changes, move all widgets first if ((dx!=0) || (dy!=0)) { - for (int i = 0; i < children(); i++) { + for (i = 0; i < children(); i++) { Fl_Widget *c = child(i); c->position(c->x()+dx, c->y()+dy); } @@ -589,7 +598,7 @@ void Fl_Tile::resize(int X,int Y,int W,int H) { init_sizes(); Fl_Rect *p = bounds(); int bbr = X, bbb = Y; - for (int i = 0; i < children(); i++) { + for (i = 0; i < children(); i++) { // find the current bounding box bbr = fl_max(bbr, p[i+2].r()); bbb = fl_max(bbb, p[i+2].b()); @@ -661,7 +670,7 @@ void Fl_Tile::resize(int X,int Y,int W,int H) { // move everything to be on correct side of new resizable: Fl_Widget*const* a = array(); p += 2; - for (int i=children(); i--; p++) { + for (i =children(); i--; p++) { Fl_Widget* o = *a++; int xx = o->x()+dx; int R = xx+o->w(); @@ -723,7 +732,8 @@ int Fl_Tile::handle(int event) { Fl_Widget*const* a = array(); Fl_Rect *q = bounds(); Fl_Rect *p = q+2; - for (int i=children(); i--; p++) { + int i; + for (i =children(); i--; p++) { Fl_Widget* o = *a++; if (!size_range_ && o == resizable()) continue; if (p->r() < q->r() && o->y()<=my+GRABAREA && o->y()+o->h()>=my-GRABAREA) { @@ -896,7 +906,8 @@ void Fl_Tile::init_size_range(int default_min_w, int default_min_h) { size_range_size_ = children(); size_range_capacity_ = (size_range_size_+8) & ~7; // allocate in steps of 8 size_range_ = (Size_Range*)::realloc(size_range_, sizeof(Size_Range)*size_range_capacity_); - for (int i=0; i<size_range_size_; i++) { + int i; + for (i =0; i<size_range_size_; i++) { size_range_[i].minw = default_min_w_; size_range_[i].minh = default_min_h_; size_range_[i].maxw = 0x7FFFFFFF; |
