mirror of https://github.com/fltk/fltk
Add Fl_Spinner widget (another combo of existing widgets in a header file)
Set the window callback to do the same as the cancel button in the template panel. Clean up widget bin + tooltips (didn't have correct tooltips for new widgets) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4149 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
0919d57c33
commit
e12e37c5f9
2
CHANGES
2
CHANGES
|
@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
|
|||
|
||||
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
||||
#744, STR #745)
|
||||
- Added Fl_Spinner widget (another combination of
|
||||
existing widgets in a header file)
|
||||
- FLUID now provides support for UI templates.
|
||||
- fl_not_clipped() incorrectly used the current window
|
||||
dimensions for gross clipping, which interfered with
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
//
|
||||
// "$Id$"
|
||||
//
|
||||
// Spinner widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// Copyright 1998-2005 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Library General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA.
|
||||
//
|
||||
// Please report all bugs and problems on the following page:
|
||||
//
|
||||
// http://www.fltk.org/str.php
|
||||
//
|
||||
|
||||
#ifndef Fl_Spinner_H
|
||||
# define Fl_Spinner_H
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
# include <FL/Fl_Group.H>
|
||||
# include <FL/Fl_Input.H>
|
||||
# include <FL/Fl_Repeat_Button.H>
|
||||
# include <stdlib.h>
|
||||
|
||||
|
||||
//
|
||||
// Fl_Spinner widget class...
|
||||
//
|
||||
|
||||
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
|
||||
const char *format_; // Format string
|
||||
|
||||
Fl_Input input_; // Input field for the value
|
||||
Fl_Repeat_Button
|
||||
up_button_, // Up button
|
||||
down_button_; // Down button
|
||||
|
||||
static void sb_cb(Fl_Widget *w, Fl_Spinner *sb) {
|
||||
int v; // New value
|
||||
|
||||
if (w == &(sb->input_)) {
|
||||
// Something changed in the input field...
|
||||
v = atoi(sb->input_.value());
|
||||
|
||||
if (v < sb->minimum_) {
|
||||
sb->value_ = sb->minimum_;
|
||||
sb->update();
|
||||
} else if (v > sb->maximum_) {
|
||||
sb->value_ = sb->maximum_;
|
||||
sb->update();
|
||||
} else sb->value_ = v;
|
||||
} else if (w == &(sb->up_button_)) {
|
||||
// Up button pressed...
|
||||
v = sb->value_ + sb->step_;
|
||||
|
||||
if (v > sb->maximum_) sb->value_ = sb->minimum_;
|
||||
else sb->value_ = v;
|
||||
|
||||
sb->update();
|
||||
} else if (w == &(sb->down_button_)) {
|
||||
// Down button pressed...
|
||||
v = sb->value_ - sb->step_;
|
||||
|
||||
if (v < sb->minimum_) sb->value_ = sb->maximum_;
|
||||
else sb->value_ = v;
|
||||
|
||||
sb->update();
|
||||
}
|
||||
|
||||
sb->do_callback();
|
||||
}
|
||||
void update() {
|
||||
char s[255]; // Value string
|
||||
|
||||
sprintf(s, format_, value_);
|
||||
input_.value(s);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Fl_Spinner(int X, int Y, int W, int H, const char *L = 0)
|
||||
: Fl_Group(X, Y, W, H, L),
|
||||
input_(X, Y, W - H / 2 - 2, H),
|
||||
up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-22<"),
|
||||
down_button_(X + W - H / 2 - 2, Y + H - H / 2,
|
||||
H / 2 + 2, H / 2, "@-22>") {
|
||||
end();
|
||||
|
||||
value_ = 1;
|
||||
minimum_ = 1;
|
||||
maximum_ = 100;
|
||||
step_ = 1;
|
||||
format_ = "%d";
|
||||
|
||||
align(FL_ALIGN_LEFT);
|
||||
|
||||
input_.value("1");
|
||||
input_.type(FL_INT_INPUT);
|
||||
input_.when(FL_WHEN_CHANGED);
|
||||
input_.callback((Fl_Callback *)sb_cb, this);
|
||||
|
||||
up_button_.callback((Fl_Callback *)sb_cb, this);
|
||||
|
||||
down_button_.callback((Fl_Callback *)sb_cb, this);
|
||||
}
|
||||
|
||||
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; }
|
||||
void resize(int X, int Y, int W, int H) {
|
||||
Fl_Group::resize(X,Y,W,H);
|
||||
|
||||
input_.resize(X, Y, W - H / 2 - 2, H);
|
||||
up_button_.resize(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2);
|
||||
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; }
|
||||
Fl_Color textcolor() const {
|
||||
return (input_.textcolor());
|
||||
}
|
||||
void textcolor(Fl_Color c) {
|
||||
input_.textcolor(c);
|
||||
}
|
||||
uchar textfont() const {
|
||||
return (input_.textfont());
|
||||
}
|
||||
void textfont(uchar f) {
|
||||
input_.textfont(f);
|
||||
}
|
||||
uchar textsize() const {
|
||||
return (input_.textsize());
|
||||
}
|
||||
void textsize(uchar s) {
|
||||
input_.textsize(s);
|
||||
}
|
||||
int value() const { return (value_); }
|
||||
void value(int v) { value_ = v; update(); }
|
||||
};
|
||||
|
||||
#endif // !Fl_Spinner_H
|
||||
|
||||
//
|
||||
// End of "$Id$".
|
||||
//
|
|
@ -98,6 +98,7 @@ static Fl_Pixmap lock_pixmap(lock_xpm);
|
|||
#include "pixmaps/flRoller.xpm"
|
||||
#include "pixmaps/flValueInput.xpm"
|
||||
#include "pixmaps/flValueOutput.xpm"
|
||||
#include "pixmaps/flSpinner.xpm"
|
||||
|
||||
static Fl_Pixmap window_pixmap(flWindow_xpm);
|
||||
static Fl_Pixmap button_pixmap(flButton_xpm);
|
||||
|
@ -145,6 +146,7 @@ static Fl_Pixmap dial_pixmap(flDial_xpm);
|
|||
static Fl_Pixmap roller_pixmap(flRoller_xpm);
|
||||
static Fl_Pixmap valueinput_pixmap(flValueInput_xpm);
|
||||
static Fl_Pixmap valueoutput_pixmap(flValueOutput_xpm);
|
||||
static Fl_Pixmap spinner_pixmap(flSpinner_xpm);
|
||||
|
||||
Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap, &roundbutton_pixmap, /* 0..4 */
|
||||
&box_pixmap, &group_pixmap, &function_pixmap, &code_pixmap, &codeblock_pixmap, &declaration_pixmap, /* 5..10 */
|
||||
|
@ -154,7 +156,7 @@ Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap,
|
|||
&output_pixmap, &textdisplay_pixmap, &textedit_pixmap, &fileinput_pixmap, &browser_pixmap, /* 27..32 */
|
||||
&checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */
|
||||
&slider_pixmap, &scrollbar_pixmap, &valueslider_pixmap, &adjuster_pixmap, &counter_pixmap, /* 37..41 */
|
||||
&dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap /* 42..46*/ };
|
||||
&dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap, &spinner_pixmap /* 42..47 */ };
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
@ -375,6 +375,43 @@ int Fl_Counter_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <FL/Fl_Spinner.H>
|
||||
class Fl_Spinner_Type : public Fl_Widget_Type {
|
||||
Fl_Menu_Item *subtypes() {return 0;}
|
||||
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c);
|
||||
int pixmapID() { return 47; }
|
||||
public:
|
||||
virtual void ideal_size(int &w, int &h) {
|
||||
Fl_Spinner *myo = (Fl_Spinner *)o;
|
||||
fl_font(myo->textfont(), myo->textsize());
|
||||
h = fl_height() + myo->textsize() - 6;
|
||||
if (h < 15) h = 15;
|
||||
w -= Fl::box_dw(o->box());
|
||||
int ww = (int)fl_width('m');
|
||||
w = ((w + ww - 1) / ww) * ww + Fl::box_dw(o->box()) + h / 2;
|
||||
if (w < 40) w = 40 ;
|
||||
}
|
||||
virtual const char *type_name() {return "Fl_Spinner";}
|
||||
Fl_Widget *widget(int x,int y,int w,int h) {
|
||||
return new Fl_Spinner(x,y,w,h,"spinner:");}
|
||||
Fl_Widget_Type *_make() {return new Fl_Spinner_Type();}
|
||||
};
|
||||
static Fl_Spinner_Type Fl_Spinner_type;
|
||||
|
||||
int Fl_Spinner_Type::textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
|
||||
Fl_Spinner *myo = (Fl_Spinner*)(w==4 ? ((Fl_Widget_Type*)factory)->o : o);
|
||||
switch (w) {
|
||||
case 4:
|
||||
case 0: f = (Fl_Font)myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break;
|
||||
case 1: myo->textfont(f); break;
|
||||
case 2: myo->textsize(s); break;
|
||||
case 3: myo->textcolor(c); break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <FL/Fl_Input.H>
|
||||
static Fl_Menu_Item input_type_menu[] = {
|
||||
{"Normal",0,0,(void*)FL_NORMAL_INPUT},
|
||||
|
@ -922,6 +959,7 @@ Fl_Menu_Item New_Menu[] = {
|
|||
{0,0,cb,(void*)&Fl_Value_Slider_type},
|
||||
{0,0,cb,(void*)&Fl_Adjuster_type},
|
||||
{0,0,cb,(void*)&Fl_Counter_type},
|
||||
{0,0,cb,(void*)&Fl_Spinner_type},
|
||||
{0,0,cb,(void*)&Fl_Dial_type},
|
||||
{0,0,cb,(void*)&Fl_Roller_type},
|
||||
{0,0,cb,(void*)&Fl_Value_Input_type},
|
||||
|
|
|
@ -432,7 +432,7 @@ Fl_Window *widgetbin_panel=(Fl_Window *)0;
|
|||
|
||||
Fl_Window* make_widgetbin() {
|
||||
Fl_Window* w;
|
||||
{ Fl_Window* o = widgetbin_panel = new Fl_Window(465, 100, "Widget Bin");
|
||||
{ Fl_Window* o = widgetbin_panel = new Fl_Window(485, 100, "Widget Bin");
|
||||
w = o;
|
||||
{ Fl_Group* o = new Fl_Group(3, 3, 74, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
|
@ -566,7 +566,7 @@ Fl_Window* make_widgetbin() {
|
|||
}
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(207, 3, 74, 74);
|
||||
{ Fl_Group* o = new Fl_Group(207, 3, 97, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
{ Fl_Button* o = new Fl_Button(208, 4, 24, 24);
|
||||
o->tooltip("Slider");
|
||||
|
@ -611,46 +611,52 @@ Fl_Window* make_widgetbin() {
|
|||
o->image(pixmap[43]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(232, 52, 24, 24);
|
||||
o->tooltip("Value Input");
|
||||
o->tooltip("Spinner");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Input"));
|
||||
o->image(pixmap[44]);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Spinner"));
|
||||
o->image(pixmap[47]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(256, 52, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(278, 4, 24, 24);
|
||||
o->tooltip("Value Output");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Output"));
|
||||
o->image(pixmap[45]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(256, 52, 24, 24);
|
||||
o->tooltip("Value Input");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Input"));
|
||||
o->image(pixmap[44]);
|
||||
}
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(283, 3, 50, 74);
|
||||
{ Fl_Group* o = new Fl_Group(307, 3, 50, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
{ Fl_Button* o = new Fl_Button(284, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(308, 4, 24, 24);
|
||||
o->tooltip("Input");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Input"));
|
||||
o->image(pixmap[14]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(308, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(332, 4, 24, 24);
|
||||
o->tooltip("Output");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Output"));
|
||||
o->image(pixmap[27]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(284, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(308, 28, 24, 24);
|
||||
o->tooltip("Text Edit");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Editor"));
|
||||
o->image(pixmap[29]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(308, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(332, 28, 24, 24);
|
||||
o->tooltip("Text Display");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Display"));
|
||||
o->image(pixmap[28]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(284, 52, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(308, 52, 24, 24);
|
||||
o->tooltip("File Input");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Input"));
|
||||
|
@ -658,55 +664,61 @@ Fl_Window* make_widgetbin() {
|
|||
}
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(335, 3, 50, 74);
|
||||
{ Fl_Group* o = new Fl_Group(359, 3, 50, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
{ Fl_Button* o = new Fl_Button(336, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(360, 4, 24, 24);
|
||||
o->tooltip("Menu Bar");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Bar"));
|
||||
o->image(pixmap[17]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(360, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(384, 28, 24, 24);
|
||||
o->tooltip("Menu Item");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("menuitem"));
|
||||
o->image(pixmap[16]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(336, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(360, 28, 24, 24);
|
||||
o->tooltip("Menu Button");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Button"));
|
||||
o->image(pixmap[26]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(360, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(384, 52, 24, 24);
|
||||
o->tooltip("Sub Menu");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("submenu"));
|
||||
o->image(pixmap[18]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(336, 52, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(360, 52, 24, 24);
|
||||
o->tooltip("Choice");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Choice"));
|
||||
o->image(pixmap[15]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(384, 4, 24, 24);
|
||||
o->tooltip("Input Choice");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Input_Choice"));
|
||||
o->image(pixmap[15]);
|
||||
}
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(387, 3, 26, 74);
|
||||
{ Fl_Group* o = new Fl_Group(411, 3, 26, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
{ Fl_Button* o = new Fl_Button(388, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(412, 4, 24, 24);
|
||||
o->tooltip("Browser");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Browser"));
|
||||
o->image(pixmap[31]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(388, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(412, 28, 24, 24);
|
||||
o->tooltip("Check Browser");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Check_Browser"));
|
||||
o->image(pixmap[32]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(388, 52, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(412, 52, 24, 24);
|
||||
o->tooltip("File Browser");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Browser"));
|
||||
|
@ -714,27 +726,27 @@ Fl_Window* make_widgetbin() {
|
|||
}
|
||||
o->end();
|
||||
}
|
||||
{ Fl_Group* o = new Fl_Group(415, 3, 50, 74);
|
||||
{ Fl_Group* o = new Fl_Group(439, 3, 50, 74);
|
||||
o->box(FL_THIN_DOWN_BOX);
|
||||
{ Fl_Button* o = new Fl_Button(416, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(440, 4, 24, 24);
|
||||
o->tooltip("Box");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Box"));
|
||||
o->image(pixmap[5]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(440, 4, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(464, 4, 24, 24);
|
||||
o->tooltip("Clock");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Clock"));
|
||||
o->image(pixmap[34]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(416, 28, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(440, 28, 24, 24);
|
||||
o->tooltip("Help Browser");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Help_View"));
|
||||
o->image(pixmap[35]);
|
||||
}
|
||||
{ Fl_Button* o = new Fl_Button(416, 52, 24, 24);
|
||||
{ Fl_Button* o = new Fl_Button(440, 52, 24, 24);
|
||||
o->tooltip("Progress");
|
||||
o->box(FL_THIN_UP_BOX);
|
||||
o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Progress"));
|
||||
|
|
|
@ -282,11 +282,11 @@ Function {type_make_cb(Fl_Widget*w,void*d)} {open return_type void
|
|||
Function {make_widgetbin()} {open
|
||||
} {
|
||||
Fl_Window widgetbin_panel {
|
||||
label {Widget Bin} selected
|
||||
xywh {325 137 465 100} type Single hide
|
||||
code0 {o->size(o->w(),80);} non_modal
|
||||
label {Widget Bin} open
|
||||
xywh {385 53 485 100} type Single
|
||||
code0 {o->size(o->w(),80);} non_modal visible
|
||||
} {
|
||||
Fl_Group {} {
|
||||
Fl_Group {} {open
|
||||
xywh {3 3 74 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
|
@ -419,7 +419,7 @@ Function {make_widgetbin()} {open
|
|||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
xywh {207 3 74 74} box THIN_DOWN_BOX
|
||||
xywh {207 3 97 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Slider"}
|
||||
|
@ -464,133 +464,145 @@ Function {make_widgetbin()} {open
|
|||
code0 {o->image(pixmap[43]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Value_Input"}
|
||||
user_data {"Fl_Spinner"}
|
||||
callback type_make_cb
|
||||
tooltip {Value Input} xywh {232 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[44]);}
|
||||
tooltip Spinner xywh {232 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[47]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Value_Output"}
|
||||
callback type_make_cb
|
||||
tooltip {Value Output} xywh {256 52 24 24} box THIN_UP_BOX
|
||||
tooltip {Value Output} xywh {278 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[45]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Value_Input"}
|
||||
callback type_make_cb
|
||||
tooltip {Value Input} xywh {256 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[44]);}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
xywh {283 3 50 74} box THIN_DOWN_BOX
|
||||
xywh {307 3 50 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Input"}
|
||||
callback type_make_cb
|
||||
tooltip Input xywh {284 4 24 24} box THIN_UP_BOX
|
||||
tooltip Input xywh {308 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[14]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Output"}
|
||||
callback type_make_cb
|
||||
tooltip Output xywh {308 4 24 24} box THIN_UP_BOX
|
||||
tooltip Output xywh {332 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[27]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Text_Editor"}
|
||||
callback type_make_cb
|
||||
tooltip {Text Edit} xywh {284 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Text Edit} xywh {308 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[29]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Text_Display"}
|
||||
callback type_make_cb
|
||||
tooltip {Text Display} xywh {308 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Text Display} xywh {332 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[28]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_File_Input"}
|
||||
callback type_make_cb
|
||||
tooltip {File Input} xywh {284 52 24 24} box THIN_UP_BOX
|
||||
tooltip {File Input} xywh {308 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[30]);}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
xywh {335 3 50 74} box THIN_DOWN_BOX
|
||||
xywh {359 3 50 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Menu_Bar"}
|
||||
callback type_make_cb
|
||||
tooltip {Menu Bar} xywh {336 4 24 24} box THIN_UP_BOX
|
||||
tooltip {Menu Bar} xywh {360 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[17]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"menuitem"}
|
||||
callback type_make_cb
|
||||
tooltip {Menu Item} xywh {360 4 24 24} box THIN_UP_BOX
|
||||
tooltip {Menu Item} xywh {384 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[16]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Menu_Button"}
|
||||
callback type_make_cb
|
||||
tooltip {Menu Button} xywh {336 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Menu Button} xywh {360 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[26]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"submenu"}
|
||||
callback type_make_cb
|
||||
tooltip {Sub Menu} xywh {360 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Sub Menu} xywh {384 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[18]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Choice"}
|
||||
callback type_make_cb
|
||||
tooltip Choice xywh {336 52 24 24} box THIN_UP_BOX
|
||||
tooltip Choice xywh {360 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[15]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Input_Choice"}
|
||||
callback type_make_cb selected
|
||||
tooltip {Input Choice} xywh {384 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[15]);}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
xywh {387 3 26 74} box THIN_DOWN_BOX
|
||||
xywh {411 3 26 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Browser"}
|
||||
callback type_make_cb
|
||||
tooltip Browser xywh {388 4 24 24} box THIN_UP_BOX
|
||||
tooltip Browser xywh {412 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[31]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Check_Browser"}
|
||||
callback type_make_cb
|
||||
tooltip {Check Browser} xywh {388 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Check Browser} xywh {412 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[32]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_File_Browser"}
|
||||
callback type_make_cb
|
||||
tooltip {File Browser} xywh {388 52 24 24} box THIN_UP_BOX
|
||||
tooltip {File Browser} xywh {412 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[33]);}
|
||||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
xywh {415 3 50 74} box THIN_DOWN_BOX
|
||||
xywh {439 3 50 74} box THIN_DOWN_BOX
|
||||
} {
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Box"}
|
||||
callback type_make_cb
|
||||
tooltip Box xywh {416 4 24 24} box THIN_UP_BOX
|
||||
tooltip Box xywh {440 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[5]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Clock"}
|
||||
callback type_make_cb
|
||||
tooltip Clock xywh {440 4 24 24} box THIN_UP_BOX
|
||||
tooltip Clock xywh {464 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[34]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Help_View"}
|
||||
callback type_make_cb
|
||||
tooltip {Help Browser} xywh {416 28 24 24} box THIN_UP_BOX
|
||||
tooltip {Help Browser} xywh {440 28 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[35]);}
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Progress"}
|
||||
callback type_make_cb
|
||||
tooltip Progress xywh {416 52 24 24} box THIN_UP_BOX
|
||||
tooltip Progress xywh {440 52 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[36]);}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ Fl_Type.o: pixmaps/flSlider.xpm pixmaps/flScrollBar.xpm
|
|||
Fl_Type.o: pixmaps/flValueSlider.xpm pixmaps/flAdjuster.xpm
|
||||
Fl_Type.o: pixmaps/flCounter.xpm pixmaps/flDial.xpm pixmaps/flRoller.xpm
|
||||
Fl_Type.o: pixmaps/flValueInput.xpm pixmaps/flValueOutput.xpm
|
||||
Fl_Type.o: pixmaps/flSpinner.xpm
|
||||
Fl_Widget_Type.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
Fl_Widget_Type.o: ../FL/Fl_Group.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
|
||||
Fl_Widget_Type.o: Fl_Widget_Type.h Fl_Type.h ../FL/Fl_Widget.H
|
||||
|
@ -209,14 +210,15 @@ factory.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H ../FL/Fl_Browser.H
|
|||
factory.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
|
||||
factory.o: ../FL/Fl_Valuator.H ../FL/Fl_Check_Browser.H
|
||||
factory.o: ../FL/Fl_File_Browser.H ../FL/Fl_Browser.H ../FL/Fl_File_Icon.H
|
||||
factory.o: ../FL/filename.H ../FL/Fl_Counter.H ../FL/Fl_File_Input.H
|
||||
factory.o: ../FL/Fl_Text_Display.H ../FL/fl_draw.H ../FL/Fl_Text_Buffer.H
|
||||
factory.o: ../FL/Fl_Text_Editor.H ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H
|
||||
factory.o: ../FL/Fl_Help_View.H ../FL/Fl_Shared_Image.H ../FL/Fl_Progress.H
|
||||
factory.o: ../FL/Fl_Adjuster.H ../FL/Fl_Dial.H ../FL/Fl_Roller.H
|
||||
factory.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Output.H ../FL/Fl_Input.H
|
||||
factory.o: ../FL/Fl_Value_Input.H ../FL/Fl_Value_Output.H
|
||||
factory.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Multi_Label.H
|
||||
factory.o: ../FL/filename.H ../FL/Fl_Counter.H ../FL/Fl_Spinner.H
|
||||
factory.o: ../FL/Fl_File_Input.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
factory.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Editor.H
|
||||
factory.o: ../FL/Fl_Text_Display.H ../FL/Fl_Clock.H ../FL/Fl_Help_View.H
|
||||
factory.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Progress.H ../FL/Fl_Adjuster.H
|
||||
factory.o: ../FL/Fl_Dial.H ../FL/Fl_Roller.H ../FL/Fl_Scrollbar.H
|
||||
factory.o: ../FL/Fl_Output.H ../FL/Fl_Input.H ../FL/Fl_Value_Input.H
|
||||
factory.o: ../FL/Fl_Value_Output.H ../FL/Fl_Value_Slider.H
|
||||
factory.o: ../FL/Fl_Multi_Label.H
|
||||
file.o: ../src/flstring.h ../FL/Fl_Export.H ../config.h alignment_panel.h
|
||||
file.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
|
||||
file.o: ../FL/Fl_Text_Buffer.H ../FL/Fl_Text_Display.H ../FL/fl_draw.H
|
||||
|
@ -276,11 +278,12 @@ template_panel.o: ../FL/Fl_Export.H ../FL/Fl_Double_Window.H
|
|||
template_panel.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
|
||||
template_panel.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
|
||||
template_panel.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Box.H
|
||||
template_panel.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Button.H
|
||||
template_panel.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
|
||||
template_panel.o: ../src/flstring.h ../FL/Fl_Export.H ../config.h
|
||||
template_panel.o: ../FL/filename.H ../FL/fl_ask.H ../FL/Fl_Shared_Image.H
|
||||
template_panel.o: ../FL/Fl_Image.H ../FL/Fl_Preferences.H
|
||||
template_panel.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Group.H
|
||||
template_panel.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
|
||||
template_panel.o: ../FL/Fl_Button.H ../src/flstring.h ../FL/Fl_Export.H
|
||||
template_panel.o: ../config.h ../FL/filename.H ../FL/fl_ask.H
|
||||
template_panel.o: ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H
|
||||
template_panel.o: ../FL/Fl_Preferences.H
|
||||
undo.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_Type.h
|
||||
undo.o: ../FL/Fl_Widget.H ../FL/Fl_Menu.H ../FL/Fl_Menu_Item.H
|
||||
undo.o: ../FL/Fl_Widget.H ../FL/Fl_Image.H Fluid_Image.h
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/* XPM */
|
||||
static const char *flSpinner_xpm[]={
|
||||
"16 16 6 1",
|
||||
". c None",
|
||||
"c c #000000",
|
||||
"d c #606060",
|
||||
"b c #c0c0c0",
|
||||
"# c #e0e0e0",
|
||||
"a c #ffffff",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"###############.",
|
||||
"#aaaaaaaaa#bcbd.",
|
||||
"#aaaaaacaa#cccd.",
|
||||
"#aaaaaccaaddddd.",
|
||||
"#aaaaaacaa####d.",
|
||||
"#aaaaaccca#cccd.",
|
||||
"#aaaaaaaaa#bcbd.",
|
||||
"ddddddddddddddd.",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................"};
|
|
@ -45,6 +45,17 @@ extern Fl_Preferences fluid_prefs;
|
|||
|
||||
Fl_Double_Window *template_panel=(Fl_Double_Window *)0;
|
||||
|
||||
static void cb_template_panel(Fl_Double_Window*, void*) {
|
||||
Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
|
||||
if (img) img->release();
|
||||
template_preview->image(0);
|
||||
|
||||
template_browser->deselect();
|
||||
template_name->value("");
|
||||
template_instance->value("");
|
||||
template_panel->hide();
|
||||
}
|
||||
|
||||
Fl_Browser *template_browser=(Fl_Browser *)0;
|
||||
|
||||
static void cb_template_browser(Fl_Browser*, void*) {
|
||||
|
@ -139,6 +150,7 @@ Fl_Double_Window* make_template_panel() {
|
|||
Fl_Double_Window* w;
|
||||
{ Fl_Double_Window* o = template_panel = new Fl_Double_Window(460, 355, "New/Save Template");
|
||||
w = o;
|
||||
o->callback((Fl_Callback*)cb_template_panel);
|
||||
{ Fl_Browser* o = template_browser = new Fl_Browser(10, 28, 180, 250, "Available Templates:");
|
||||
o->type(2);
|
||||
o->labelfont(1);
|
||||
|
|
|
@ -59,7 +59,15 @@ decl {extern Fl_Preferences fluid_prefs;} {}
|
|||
Function {make_template_panel()} {open
|
||||
} {
|
||||
Fl_Window template_panel {
|
||||
label {New/Save Template} open
|
||||
label {New/Save Template}
|
||||
callback {Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image();
|
||||
if (img) img->release();
|
||||
template_preview->image(0);
|
||||
|
||||
template_browser->deselect();
|
||||
template_name->value("");
|
||||
template_instance->value("");
|
||||
template_panel->hide();} open selected
|
||||
xywh {340 237 460 355} type Double resizable modal visible
|
||||
} {
|
||||
Fl_Browser template_browser {
|
||||
|
@ -112,7 +120,7 @@ if (img) {
|
|||
|
||||
template_preview->image(img);
|
||||
template_preview->redraw();
|
||||
}} selected
|
||||
}}
|
||||
xywh {10 28 180 250} type Hold labelfont 1 align 5 when 3
|
||||
}
|
||||
Fl_Box template_preview {
|
||||
|
|
Loading…
Reference in New Issue