summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-12-15 16:46:40 +0100
committerGitHub <noreply@github.com>2022-12-15 16:46:40 +0100
commit44a2547394a3b4f8b0177c2f33aa8ed47a2c1051 (patch)
treed0611bedf1be051c9e5b2183314bc7e17648c5ad /test
parent2fd1866f492daa4caa7fdad6c05cd34bc79ba913 (diff)
Rename some Fl_Flex methods for FLTK compliance (#594)
Change some method names to comply with FLTK style as discussed in fltk.coredev, thread "Fl_Flex method name question". * Rename Fl_Flex::margins(...) to Fl_Flex::margin(...) (use singular form for all margin related methods) * Remove Fl_Flex::setSize() and isSetSize() "backwards compatibility" methods * Rename Fl_Flex::set_size(...) to fixed(...) Note: the latter affects existing (pre-release) fluid (.fl) files: you may want to edit and replace "set_size_tuples" with "fixed_size_tuples"
Diffstat (limited to 'test')
-rw-r--r--test/flex_demo.cxx12
-rw-r--r--test/flex_login.cxx28
2 files changed, 20 insertions, 20 deletions
diff --git a/test/flex_demo.cxx b/test/flex_demo.cxx
index 67726910a..811a34def 100644
--- a/test/flex_demo.cxx
+++ b/test/flex_demo.cxx
@@ -95,8 +95,8 @@ Fl_Flex *create_row() {
col2->color(fl_rgb_color(255, 128, 128));
}
- row->set_size(box2, 50);
- row->set_size(col2, 100);
+ row->fixed(box2, 50);
+ row->fixed(col2, 100);
row->end();
// TEST
@@ -128,7 +128,7 @@ int main(int argc, char **argv) {
col1->end();
row1->end();
- col->set_size(create_row(), 90); // sets height of created (anonymous) row #2
+ col->fixed(create_row(), 90); // sets height of created (anonymous) row #2
create_button("Something1"); // "row" #3
@@ -136,13 +136,13 @@ int main(int argc, char **argv) {
Fl_Button *cancel = create_button("Cancel");
Fl_Button *ok = create_button("OK");
new Fl_Input(0, 0, 120, 10, "");
- row4->set_size(cancel, 100);
- row4->set_size(ok, 100);
+ row4->fixed(cancel, 100);
+ row4->fixed(ok, 100);
row4->end();
create_button("Something2"); // "row" #5
- col->set_size(row4, 30);
+ col->fixed(row4, 30);
col->margin(6, 10, 6, 10);
col->gap(6);
col->end();
diff --git a/test/flex_login.cxx b/test/flex_login.cxx
index e8098cbce..be72e6c8b 100644
--- a/test/flex_login.cxx
+++ b/test/flex_login.cxx
@@ -40,7 +40,7 @@ void buttons_panel(Fl_Flex *parent) {
b->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
Fl_Input *username = new Fl_Input(0, 0, 0, 0, "");
- urow->set_size(username, 180);
+ urow->fixed(username, 180);
urow->end();
}
@@ -50,7 +50,7 @@ void buttons_panel(Fl_Flex *parent) {
b->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
Fl_Input *password = new Fl_Input(0, 0, 0, 0, "");
- prow->set_size(password, 180);
+ prow->fixed(password, 180);
prow->end();
}
@@ -62,8 +62,8 @@ void buttons_panel(Fl_Flex *parent) {
Fl_Button *reg = create_button("Register");
Fl_Button *login = create_button("Login");
- brow->set_size(reg, 80);
- brow->set_size(login, 80);
+ brow->fixed(reg, 80);
+ brow->fixed(login, 80);
brow->gap(20);
brow->end();
@@ -71,12 +71,12 @@ void buttons_panel(Fl_Flex *parent) {
Fl_Box *b = new Fl_Box(0, 0, 0, 0, "");
- parent->set_size(w, 60);
- parent->set_size(urow, 30);
- parent->set_size(prow, 30);
- parent->set_size(pad, 1);
- parent->set_size(brow, 30);
- parent->set_size(b, 30);
+ parent->fixed(w, 60);
+ parent->fixed(urow, 30);
+ parent->fixed(prow, 30);
+ parent->fixed(pad, 1);
+ parent->fixed(brow, 30);
+ parent->fixed(b, 30);
}
// create widgets inside a row, i.e. parent is type(ROW)
@@ -95,9 +95,9 @@ void middle_panel(Fl_Flex *parent) {
new Fl_Box(0, 0, 0, 0, "");
- parent->set_size(box, 200);
- parent->set_size(spacer, 10);
- parent->set_size(bp, 300);
+ parent->fixed(box, 200);
+ parent->fixed(spacer, 10);
+ parent->fixed(bp, 300);
}
// The main panel consists of three "rows" inside a column, i.e. parent is
@@ -114,7 +114,7 @@ void mainPanel(Fl_Flex *parent) {
new Fl_Box(0, 0, 0, 0, ""); // flexible separator
- parent->set_size(mp, 200);
+ parent->fixed(mp, 200);
}
int main(int argc, char **argv) {