summaryrefslogtreecommitdiff
path: root/FL
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 /FL
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Browser.H3
-rw-r--r--FL/Fl_Input_Choice.H3
-rw-r--r--FL/Fl_Menu_.H3
-rw-r--r--FL/Fl_Table.H9
-rw-r--r--FL/Fl_Tree.H11
-rw-r--r--FL/Fl_Tree_Item.H6
6 files changed, 23 insertions, 12 deletions
diff --git a/FL/Fl_Browser.H b/FL/Fl_Browser.H
index ef5064171..7da8a7219 100644
--- a/FL/Fl_Browser.H
+++ b/FL/Fl_Browser.H
@@ -73,7 +73,8 @@ struct FL_BLINE;
Some common coding patterns used for working with Fl_Browser:
\code
// How to loop through all the items in the browser
- for ( int t=1; t<=browser->size(); t++ ) { // index 1 based..!
+ int t;
+ for (t =1; t<=browser->size(); t++ ) { // index 1 based..!
printf("item #%d, label='%s'\n", t, browser->text(t));
}
\endcode
diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H
index b2023052f..5284882c8 100644
--- a/FL/Fl_Input_Choice.H
+++ b/FL/Fl_Input_Choice.H
@@ -182,7 +182,8 @@ public:
Fl_Input_Choice *choice = new Fl_Input_Choice(100,10,120,25,"Choice:");
[..]
// Print all the items in the choice menu
- for ( int t=0; t<choice->menubutton()->size(); t++ ) {
+ int t;
+ for (t =0; t<choice->menubutton()->size(); t++ ) {
const Fl_Menu_Item &item = choice->menubutton()->menu()[t];
printf("item %d -- label=%s\n", t, item.label() ? item.label() : "(Null)");
}
diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H
index f0ddf59d7..c2bf5eed8 100644
--- a/FL/Fl_Menu_.H
+++ b/FL/Fl_Menu_.H
@@ -119,7 +119,8 @@ public:
\b Example: How to walk the array:
\code
- for ( int t=0; t<menubar->size(); t++ ) { // walk array of items
+ int t;
+ for (t =0; t<menubar->size(); t++ ) { // walk array of items
const Fl_Menu_Item &item = menubar->menu()[t]; // get each item
fprintf(stderr, "item #%d -- label=%s, value=%s type=%s\n",
t,
diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H
index 80a96593c..94b249b4b 100644
--- a/FL/Fl_Table.H
+++ b/FL/Fl_Table.H
@@ -679,7 +679,8 @@ public:
same value, in pixels. The screen is redrawn.
*/
void row_height_all(int height) { // set all row/col heights
- for ( int r=0; r<rows(); r++ ) {
+ int r;
+ for (r =0; r<rows(); r++ ) {
row_height(r, height);
}
}
@@ -689,7 +690,8 @@ public:
same value, in pixels. The screen is redrawn.
*/
void col_width_all(int width) {
- for ( int c=0; c<cols(); c++ ) {
+ int c;
+ for (c =0; c<cols(); c++ ) {
col_width(c, width);
}
}
@@ -836,7 +838,8 @@ public:
Typically used in loops, eg:
\code
- for ( int i=0; i<children(); i++ ) {
+ int i;
+ for (i =0; i<children(); i++ ) {
Fl_Widget *w = child(i);
[..]
}
diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H
index 3d85066e8..338fd4e5c 100644
--- a/FL/Fl_Tree.H
+++ b/FL/Fl_Tree.H
@@ -179,7 +179,8 @@
To find all the selected items:
\par
\code
- for ( Fl_Tree_Item *i=first_selected_item(); i; i=next_selected_item(i) )
+ Fl_Tree_Item *i;
+ for (i =first_selected_item(); i; i=next_selected_item(i) )
printf("Item %s is selected\n", i->label());
\endcode
\par
@@ -196,7 +197,8 @@
\par
\code
// Walk all the items in the tree, and print their labels
- for ( Fl_Tree_Item *item = tree->first(); item; item = tree->next(item) ) {
+ Fl_Tree_Item *item;
+ for (item = tree->first(); item; item = tree->next(item) ) {
printf("Item: %s\n", item->label());
}
\endcode
@@ -207,7 +209,8 @@
\code
// Find all of the item's children and print an indented report of their labels
void my_print_all_children(Fl_Tree_Item *item, int indent=0) {
- for ( int t=0; t<item->children(); t++ ) {
+ int t;
+ for (t =0; t<item->children(); t++ ) {
printf("%*s Item: %s\n", indent, "", item->child(t)->label());
my_print_all_children(item->child(t), indent+4); // recurse
}
@@ -230,7 +233,7 @@
\par
\code
// Change the font and color of all items currently in the tree
- for ( Fl_Tree_Item *item = tree->first(); item; item = tree->next(item) ) {
+ for (item = tree->first(); item; item = tree->next(item) ) {
item->labelfont(FL_COURIER);
item->labelcolor(FL_RED);
}
diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H
index ba5188219..3290bf523 100644
--- a/FL/Fl_Tree_Item.H
+++ b/FL/Fl_Tree_Item.H
@@ -323,7 +323,8 @@ public:
select();
++count;
}
- for ( int t=0; t<children(); t++ ) {
+ int t;
+ for (t =0; t<children(); t++ ) {
count += child(t)->select_all();
}
return(count);
@@ -342,7 +343,8 @@ public:
deselect();
++count;
}
- for ( int t=0; t<children(); t++ ) {
+ int t;
+ for (t =0; t<children(); t++ ) {
count += child(t)->deselect_all();
}
return(count);