summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Spinner.H40
-rw-r--r--documentation/Fl_Spinner.html107
-rw-r--r--documentation/Makefile1
-rw-r--r--documentation/fltk.book1
-rw-r--r--documentation/widgets.html2
-rw-r--r--fluid/fluid.cxx15
-rw-r--r--fluid/makedepend33
-rw-r--r--fluid/print_panel.cxx2
-rw-r--r--fluid/print_panel.fl6
9 files changed, 164 insertions, 43 deletions
diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H
index 139079980..35a9badfb 100644
--- a/FL/Fl_Spinner.H
+++ b/FL/Fl_Spinner.H
@@ -45,10 +45,10 @@
class Fl_Spinner : public Fl_Group
{
- int value_; // Current value
- int minimum_; // Minimum value
- int maximum_; // Maximum value
- int step_; // Amount to add/subtract for up/down
+ double value_; // Current value
+ double minimum_; // Minimum value
+ double maximum_; // Maximum value
+ double step_; // Amount to add/subtract for up/down
const char *format_; // Format string
Fl_Input input_; // Input field for the value
@@ -57,11 +57,11 @@ class Fl_Spinner : public Fl_Group
down_button_; // Down button
static void sb_cb(Fl_Widget *w, Fl_Spinner *sb) {
- int v; // New value
+ double v; // New value
if (w == &(sb->input_)) {
// Something changed in the input field...
- v = atoi(sb->input_.value());
+ v = atof(sb->input_.value());
if (v < sb->minimum_) {
sb->value_ = sb->minimum_;
@@ -107,11 +107,11 @@ class Fl_Spinner : public Fl_Group
H / 2 + 2, H / 2, "@-22>") {
end();
- value_ = 1;
- minimum_ = 1;
- maximum_ = 100;
- step_ = 1;
- format_ = "%d";
+ value_ = 1.0;
+ minimum_ = 1.0;
+ maximum_ = 100.0;
+ step_ = 1.0;
+ format_ = "%.0f";
align(FL_ALIGN_LEFT);
@@ -127,11 +127,11 @@ class Fl_Spinner : public Fl_Group
const char *format() { return (format_); }
void format(const char *f) { format_ = f; update(); }
- int maxinum() const { return (maximum_); }
- void maximum(int m) { maximum_ = m; }
- int mininum() const { return (minimum_); }
- void minimum(int m) { minimum_ = m; }
- void range(int a, int b) { minimum_ = a; maximum_ = b; }
+ double maxinum() const { return (maximum_); }
+ void maximum(double m) { maximum_ = m; }
+ double mininum() const { return (minimum_); }
+ void minimum(double m) { minimum_ = m; }
+ void range(double a, double b) { minimum_ = a; maximum_ = b; }
void resize(int X, int Y, int W, int H) {
Fl_Group::resize(X,Y,W,H);
@@ -140,8 +140,8 @@ class Fl_Spinner : public Fl_Group
down_button_.resize(X + W - H / 2 - 2, Y + H - H / 2,
H / 2 + 2, H / 2);
}
- int step() const { return (step_); }
- void step(int s) { step_ = s; }
+ double step() const { return (step_); }
+ void step(double s) { step_ = s; }
Fl_Color textcolor() const {
return (input_.textcolor());
}
@@ -160,8 +160,8 @@ class Fl_Spinner : public Fl_Group
void textsize(uchar s) {
input_.textsize(s);
}
- int value() const { return (value_); }
- void value(int v) { value_ = v; update(); }
+ double value() const { return (value_); }
+ void value(double v) { value_ = v; update(); }
};
#endif // !Fl_Spinner_H
diff --git a/documentation/Fl_Spinner.html b/documentation/Fl_Spinner.html
new file mode 100644
index 000000000..ab6383c77
--- /dev/null
+++ b/documentation/Fl_Spinner.html
@@ -0,0 +1,107 @@
+<html>
+<body>
+
+<!-- NEW PAGE -->
+
+<h2><a name=Fl_Spinner>class Fl_Spinner</a></h2>
+
+<hr>
+
+<h3>Class Hierarchy</h3>
+
+<ul><pre>
+<a href=Fl_Group.html#Fl_Group>Fl_Group</a>
+ |
+ +----<b>Fl_Spinner</b>
+ |
+ +----<a href=Fl_Input.html#Fl_Input>Fl_Input</a>
+ <a href=Fl_Repeat_Button.html#Fl_Repeat_Button>Fl_Repeat_Button</a>
+</pre></ul>
+
+<h3>Include Files</h3>
+
+<ul><pre>
+#include &lt;FL/Fl_Spinner.H&gt;
+</pre></ul>
+
+<h3>Description</h3>
+
+<p>The <tt>Fl_Spinner</tt> widget is a combination of the input
+widget and repeat buttons. The user can either type into the
+input area or use the buttons to change the value.
+
+<h3>Methods</h3>
+
+<ul>
+
+ <li><a href='#Fl_Spinner.Fl_Spinner'>Fl_Spinner</a></li>
+ <li><a href='#Fl_Spinner.~Fl_Spinner'>~Fl_Spinner</a></li>
+ <li><a href='#Fl_Spinner.format'>format</a></li>
+ <li><a href='#Fl_Spinner.maximum'>maximum</a></li>
+ <li><a href='#Fl_Spinner.minimum'>minimum</a></li>
+ <li><a href='#Fl_Spinner.range'>range</a></li>
+ <li><a href='#Fl_Spinner.step'>step</a></li>
+ <li><a href='#Fl_Spinner.textcolor'>textcolor</a></li>
+ <li><a href='#Fl_Spinner.textfont'>textfont</a></li>
+ <li><a href='#Fl_Spinner.textsize'>textsize</a></li>
+ <li><a href='#Fl_Spinner.value'>value</a></li>
+
+</ul>
+
+<h4><a name="Fl_Spinner.Fl_Spinner">Fl_Spinner::Fl_Spinner(int x, int y, int w,
+int h, const char *label = 0)</a></h4>
+
+<p>Creates a new <TT>Fl_Spinner</TT> widget using the given position, size,
+and label string.
+
+<h4><a name="Fl_Spinner.~Fl_Spinner">virtual Fl_Spinner::~Fl_Spinner()</a></h4>
+
+<p>Destroys the widget and any value associated with it.
+
+<h4><a name='Fl_Spinner.format'>void format(const char *f)<br />
+const char *format()</a></h4>
+
+<p>Sets or returns the format string for the value.</p>
+
+<h4><a name='Fl_Spinner.maximum'>void maximum(double m)<br />
+double maximum() const</a></h4>
+
+<p>Sets or returns the maximum value of the widget.</p>
+
+<h4><a name='Fl_Spinner.minimum'>void minimum(double m)<br />
+double minimum() const</a></h4>
+
+<p>Sets or returns the minimum value of the widget.</p>
+
+<h4><a name='Fl_Spinner.range'>void range(double minval, double maxval)</a></h4>
+
+<p>Sets the minimum and maximum values for the widget.</p>
+
+<h4><a name='Fl_Spinner.step'>void step(double s)<br />
+double step() const</a></h4>
+
+<p>Sets or returns the amount to change the value when the user
+clicks a button.</p>
+
+<h4><a name='Fl_Spinner.textcolor'>void textcolor(Fl_Color c)<br />
+Fl_Color textcolor() const</a></h4>
+
+<p>Sets or returns the color of the text in the input field.</p>
+
+<h4><a name='Fl_Spinner.textfont'>void textfont(uchar f)<br />
+uchar textfont() const</a></h4>
+
+<p>Sets or returns the font of the text in the input field.</p>
+
+<h4><a name='Fl_Spinner.textsize'>void textsize(uchar s)<br />
+uchar textsize() const</a></h4>
+
+<p>Sets or returns the size of the text in the input field.</p>
+
+<h4><a name="Fl_Spinner.value">void Fl_Spinner::value(double v)<br />
+double Fl_Spinner::value() const</a></h4>
+
+<p>Sets or returns the current value of the widget.</p>
+
+</body>
+</html>
diff --git a/documentation/Makefile b/documentation/Makefile
index a8434510a..a648c6304 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -119,6 +119,7 @@ HTMLFILES = \
Fl_Shared_Image.html \
Fl_Single_Window.html \
Fl_Slider.html \
+ Fl_Spinner.html \
Fl_Tabs.html \
Fl_Text_Buffer.html \
Fl_Text_Display.html \
diff --git a/documentation/fltk.book b/documentation/fltk.book
index cc71dc505..436ffe97d 100644
--- a/documentation/fltk.book
+++ b/documentation/fltk.book
@@ -76,6 +76,7 @@ Fl_Secret_Input.html
Fl_Select_Browser.html
Fl_Single_Window.html
Fl_Slider.html
+Fl_Spinner.html
Fl_Tabs.html
Fl_Text_Buffer.html
Fl_Text_Display.html
diff --git a/documentation/widgets.html b/documentation/widgets.html
index d101330c6..393b8af65 100644
--- a/documentation/widgets.html
+++ b/documentation/widgets.html
@@ -79,6 +79,7 @@ description of the <TT>fl_</TT> functions, see
<A HREF="Fl_Shared_Image.html">Fl_Shared_Image</A><BR>
<A HREF="Fl_Single_Window.html">Fl_Single_Window</A><BR>
<A HREF="Fl_Slider.html">Fl_Slider</A><BR>
+<A HREF="Fl_Spinner.html">Fl_Spinner</A><BR>
<A HREF="Fl_Tabs.html">Fl_Tabs</A><BR>
<A HREF="Fl_Text_Buffer.html">Fl_Text_Buffer</A><BR>
<A HREF="Fl_Text_Display.html">Fl_Text_Display</A><BR>
@@ -165,6 +166,7 @@ description of the <TT>fl_</TT> functions, see
<LI><A HREF="Fl_Input_Choice.html">Fl_Input_Choice</A>
<LI><A HREF="Fl_Pack.html#Fl_Pack">Fl_Pack</A>
<LI><A HREF="Fl_Scroll.html#Fl_Scroll">Fl_Scroll</A>
+ <LI><A HREF="Fl_Slider.html#Fl_Slider">Fl_Slider</A>
<LI><A HREF="Fl_Tabs.html#Fl_Tabs">Fl_Tabs</A>
<LI><A HREF="Fl_Text_Display.html">Fl_Text_Display</A>
<UL>
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index a44e0fbcf..f138690b7 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -909,7 +909,7 @@ void print_cb(Fl_Return_Button *, void *) {
print_progress->show();
// Figure out how many pages we'll have to print...
- if (print_collate_button->value()) copies = print_copies->value();
+ if (print_collate_button->value()) copies = (int)print_copies->value();
else copies = 1;
if (print_pages->value()) {
@@ -958,8 +958,8 @@ void print_cb(Fl_Return_Button *, void *) {
// Pipe the output into the lp command...
const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
- snprintf(command, sizeof(command), "lp -s -d %s -n %d -t '%s' -o media=%s",
- printer, print_collate_button->value() ? 1 : print_copies->value(),
+ snprintf(command, sizeof(command), "lp -s -d %s -n %.0f -t '%s' -o media=%s",
+ printer, print_collate_button->value() ? 1.0 : print_copies->value(),
basename, print_page_size->text(print_page_size->value()));
outfile = popen(command, "w");
} else {
@@ -1483,7 +1483,8 @@ void load_history() {
fl_filename_relative(relative_history[i], sizeof(relative_history[i]),
absolute_history[i]);
- Main_Menu[i + HISTORY_ITEM].flags = 0;
+ if (i == 9) Main_Menu[i + HISTORY_ITEM].flags = FL_MENU_DIVIDER;
+ else Main_Menu[i + HISTORY_ITEM].flags = 0;
} else break;
}
@@ -1531,8 +1532,10 @@ void update_history(const char *flname) {
// Update the menu items as needed...
for (i = 0; i < max_files; i ++) {
fluid_prefs.set( Fl_Preferences::Name("file%d", i), absolute_history[i]);
- if (absolute_history[i][0]) Main_Menu[i + HISTORY_ITEM].flags = 0;
- else break;
+ if (absolute_history[i][0]) {
+ if (i == 9) Main_Menu[i + HISTORY_ITEM].flags = FL_MENU_DIVIDER;
+ else Main_Menu[i + HISTORY_ITEM].flags = 0;
+ } else break;
}
for (; i < 10; i ++) {
diff --git a/fluid/makedepend b/fluid/makedepend
index 0c4ffa713..51ba4404c 100644
--- a/fluid/makedepend
+++ b/fluid/makedepend
@@ -56,7 +56,8 @@ Fl_Menu_Type.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
Fl_Menu_Type.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H ../FL/Fl_Button.H
Fl_Menu_Type.o: ../FL/Fl_Box.H ../FL/Fl_Light_Button.H
Fl_Menu_Type.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
-Fl_Menu_Type.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H ../FL/fl_message.H
+Fl_Menu_Type.o: ../FL/Fl_Button.H ../FL/Fl_Spinner.H ../FL/Fl_Repeat_Button.H
+Fl_Menu_Type.o: ../FL/Fl.H ../FL/Fl_Return_Button.H ../FL/fl_message.H
Fl_Menu_Type.o: ../FL/fl_ask.H ../src/flstring.h ../FL/Fl_Export.H
Fl_Menu_Type.o: ../config.h ../FL/Fl_Output.H ../FL/Fl_Input.H
Fl_Menu_Type.o: Shortcut_Button.h
@@ -108,12 +109,14 @@ Fl_Widget_Type.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
Fl_Widget_Type.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H ../FL/Fl_Button.H
Fl_Widget_Type.o: ../FL/Fl_Box.H ../FL/Fl_Light_Button.H
Fl_Widget_Type.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H
-Fl_Widget_Type.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
-Fl_Widget_Type.o: ../FL/fl_message.H ../FL/fl_ask.H ../FL/Fl_Slider.H
-Fl_Widget_Type.o: ../src/flstring.h ../FL/Fl_Export.H ../config.h
-Fl_Widget_Type.o: widget_panel.h ../FL/Fl_Value_Input.H ../FL/Fl_Input.H
-Fl_Widget_Type.o: Shortcut_Button.h CodeEditor.h ../FL/Fl_Text_Editor.H
-Fl_Widget_Type.o: ../FL/Fl_Text_Display.H ../FL/fl_show_colormap.H
+Fl_Widget_Type.o: ../FL/Fl_Button.H ../FL/Fl_Spinner.H
+Fl_Widget_Type.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H
+Fl_Widget_Type.o: ../FL/Fl_Return_Button.H ../FL/fl_message.H ../FL/fl_ask.H
+Fl_Widget_Type.o: ../FL/Fl_Slider.H ../src/flstring.h ../FL/Fl_Export.H
+Fl_Widget_Type.o: ../config.h widget_panel.h ../FL/Fl_Value_Input.H
+Fl_Widget_Type.o: ../FL/Fl_Input.H Shortcut_Button.h CodeEditor.h
+Fl_Widget_Type.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H
+Fl_Widget_Type.o: ../FL/fl_show_colormap.H
Fl_Window_Type.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Window_Type.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
Fl_Window_Type.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
@@ -133,6 +136,7 @@ Fl_Window_Type.o: ../FL/Fl_Double_Window.H ../FL/Fl_Preferences.H
Fl_Window_Type.o: ../FL/Fl_Tooltip.H ../FL/Fl_Button.H ../FL/Fl_Box.H
Fl_Window_Type.o: ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H
Fl_Window_Type.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
+Fl_Window_Type.o: ../FL/Fl_Spinner.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H
Fl_Window_Type.o: ../FL/Fl_Return_Button.H widget_panel.h
Fl_Window_Type.o: ../FL/Fl_Value_Input.H ../FL/Fl_Input.H Shortcut_Button.h
Fl_Window_Type.o: CodeEditor.h ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H
@@ -182,6 +186,7 @@ alignment_panel.o: ../FL/Fl_Input_.H ../FL/Fl_Light_Button.H
alignment_panel.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H
alignment_panel.o: ../FL/Fl_Image.H ../FL/Fl_Check_Button.H
alignment_panel.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
+alignment_panel.o: ../FL/Fl_Spinner.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H
alignment_panel.o: ../FL/Fl_Return_Button.H
code.o: ../src/flstring.h ../FL/Fl_Export.H ../config.h ../FL/Fl.H
code.o: ../FL/Enumerations.H ../FL/Fl_Export.H Fl_Type.h ../FL/Fl_Widget.H
@@ -197,7 +202,8 @@ code.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
code.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Double_Window.H ../FL/Fl_Window.H
code.o: ../FL/Fl_Preferences.H ../FL/Fl_Tooltip.H ../FL/Fl_Button.H
code.o: ../FL/Fl_Box.H ../FL/Fl_Light_Button.H ../FL/Fl_Check_Button.H
-code.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
+code.o: ../FL/Fl_Light_Button.H ../FL/Fl_Button.H ../FL/Fl_Spinner.H
+code.o: ../FL/Fl_Repeat_Button.H ../FL/Fl.H ../FL/Fl_Return_Button.H
code.o: ../FL/filename.H
factory.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/Fl_Group.H
factory.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Widget.H ../FL/Fl_Image.H
@@ -236,6 +242,7 @@ file.o: ../FL/Fl_Tabs.H ../FL/Fl_Group.H ../FL/Fl_Box.H ../FL/Fl_Input.H
file.o: ../FL/Fl_Input_.H ../FL/Fl_Light_Button.H ../FL/Fl_Choice.H
file.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/Fl_Image.H
file.o: ../FL/Fl_Check_Button.H ../FL/Fl_Light_Button.H ../FL/Fl_Button.H
+file.o: ../FL/Fl_Spinner.H ../FL/Fl_Repeat_Button.H ../FL/Fl.H
file.o: ../FL/Fl_Return_Button.H ../FL/fl_message.H ../FL/fl_ask.H
file.o: Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Menu.H Fluid_Image.h
file.o: ../FL/Fl_Shared_Image.H ../FL/fl_draw.H ../FL/Fl_Pack.H
@@ -259,11 +266,11 @@ fluid.o: ../FL/Fl_Return_Button.H ../FL/fl_message.H ../FL/fl_ask.H
fluid.o: ../FL/filename.H ../src/flstring.h ../FL/Fl_Export.H ../config.h
fluid.o: alignment_panel.h ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H
fluid.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
-fluid.o: ../FL/Fl_Tabs.H ../FL/Fl_Light_Button.H function_panel.h
-fluid.o: ../FL/Fl_Window.H CodeEditor.h ../FL/Fl_Text_Editor.H
-fluid.o: ../FL/Fl_Text_Display.H template_panel.h ../FL/Fl_Browser.H
-fluid.o: print_panel.h ../FL/Fl_Round_Button.H ../FL/Fl_Spinner.H
-fluid.o: ../FL/Fl_Repeat_Button.H ../FL/Fl_Progress.H about_panel.h undo.h
+fluid.o: ../FL/Fl_Tabs.H ../FL/Fl_Light_Button.H ../FL/Fl_Spinner.H
+fluid.o: ../FL/Fl_Repeat_Button.H function_panel.h ../FL/Fl_Window.H
+fluid.o: CodeEditor.h ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H
+fluid.o: template_panel.h ../FL/Fl_Browser.H print_panel.h
+fluid.o: ../FL/Fl_Round_Button.H ../FL/Fl_Progress.H about_panel.h undo.h
fluid.o: Fl_Type.h ../FL/Fl_Menu.H Fluid_Image.h ../FL/Fl_Shared_Image.H
fluid.o: ../FL/Fl_Pack.H ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H
fluid.o: ../FL/Fl_Input_Choice.H
diff --git a/fluid/print_panel.cxx b/fluid/print_panel.cxx
index 18f8d970c..9e7d21113 100644
--- a/fluid/print_panel.cxx
+++ b/fluid/print_panel.cxx
@@ -296,7 +296,7 @@ Fl_Double_Window* make_print_panel() {
o->box(FL_THIN_DOWN_BOX);
o->labelfont(1);
o->align(FL_ALIGN_TOP_LEFT);
- { Fl_Spinner* o = print_copies = new Fl_Spinner(326, 96, 40, 25, "# Copies:");
+ { Fl_Spinner* o = print_copies = new Fl_Spinner(321, 96, 45, 25, "# Copies:");
o->callback((Fl_Callback*)cb_print_copies);
o->when(FL_WHEN_CHANGED);
}
diff --git a/fluid/print_panel.fl b/fluid/print_panel.fl
index 07aeb1cc0..723dbe841 100644
--- a/fluid/print_panel.fl
+++ b/fluid/print_panel.fl
@@ -109,8 +109,8 @@ print_to->deactivate();}
print_collate_button->activate();
print_collate_group[0]->activate();
print_collate_group[1]->activate();
-}}
- xywh {326 96 40 25} when 1
+}} selected
+ xywh {321 96 45 25} when 1
}
Fl_Check_Button print_collate_button {
label Collate
@@ -277,7 +277,7 @@ print_update_status();}
}
Fl_Button {} {
label Use
- callback {print_properties_panel->hide();} selected
+ callback {print_properties_panel->hide();}
xywh {60 95 53 25}
}
}