summaryrefslogtreecommitdiff
path: root/src/Fl_Group.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
commitb4995f979d127cea667b4e2b71c91e9db4ab52ef (patch)
treefbebc775e10932bace8d6a7c3481b1ba200c64db /src/Fl_Group.cxx
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'src/Fl_Group.cxx')
-rw-r--r--src/Fl_Group.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index 31fca05d8..1fb22d14f 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -290,7 +290,8 @@ int Fl_Group::handle(int event) {
if (i >= children()) i = 0;
if (children()) {
- for (int j = i;;) {
+ int j;
+ for (j = i;;) {
if (a[j]->takesevents()) if (send(a[j], event)) return 1;
j++;
if (j >= children()) j = 0;
@@ -409,7 +410,8 @@ void Fl_Group::clear() {
// child which is much faster than the other way around and
// should be the "natural order" (last in, first out).
- for (int i = children() - 1; i >= 0; i--) {
+ int i;
+ for (i = children() - 1; i >= 0; i--) {
// some children may have been deleted, so check always
if (i >= children()) continue;
delete_child(i);
@@ -517,11 +519,12 @@ void Fl_Group::insert(Fl_Widget &o, int index) {
// now it's OK to move the child inside this group
+ int j;
if (index > n) { // target > current position: move "up" and all other children "down"
- for (int j = n; j < index; j++)
+ for (j = n; j < index; j++)
child_[j] = child_[j + 1];
} else { // n > index: move "down" and all other children "up"
- for (int j = n; j > index; j--)
+ for (j = n; j > index; j--)
child_[j] = child_[j - 1];
}
child_[index] = &o;
@@ -766,7 +769,8 @@ Fl_Rect* Fl_Group::bounds() {
// next is all the children's sizes:
p += 2;
Fl_Widget*const* a = array();
- for (int i = children(); i--;) {
+ int i;
+ for (i = children(); i--;) {
*p++ = Fl_Rect(*a++);
}
}
@@ -804,7 +808,8 @@ int* Fl_Group::sizes() {
// allocate new sizes_ array and copy bounds_ over to sizes_
int* pi = sizes_ = new int[4*(children() + 2)];
Fl_Rect *rb = bounds();
- for (int i = 0; i < children() + 2; i++, rb++) {
+ int i;
+ for (i = 0; i < children() + 2; i++, rb++) {
*pi++ = rb->x();
*pi++ = rb->r();
*pi++ = rb->y();
@@ -839,6 +844,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
// just move the children.
// This case covers also window rescaling where dw == dh == 0.
+ int i;
if (!resizable() || (dw==0 && dh==0)) {
// top window and subwindows must not change the position of their children
@@ -851,7 +857,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
if (Fl_Window::is_a_rescale() || dx || dy) {
Fl_Widget*const* a = array();
- for (int i = children(); i--;) {
+ for (i = children(); i--;) {
Fl_Widget* o = *a++;
o->resize(o->x() + dx, o->y() + dy, o->w(), o->h());
}
@@ -888,7 +894,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
// resize children
Fl_Widget*const* a = array();
- for (int i = children(); i--; p++) {
+ for (i = children(); i--; p++) {
Fl_Widget* o = *a++;
int L = p->x();
@@ -929,14 +935,15 @@ void Fl_Group::draw_children() {
h() - Fl::box_dh(box()));
}
+ int i;
if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
- for (int i = children(); i--;) {
+ for (i = children(); i--;) {
Fl_Widget& o = **a++;
draw_child(o);
draw_outside_label(o);
}
} else { // only redraw the children that need it:
- for (int i = children(); i--;)
+ for (i = children(); i--;)
update_child(**a++);
}