Add Fl_Wizard widget...

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1532 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2001-08-02 18:39:01 +00:00
parent b0e56bb248
commit 80247acbc2
5 changed files with 325 additions and 37 deletions

View File

@ -14,8 +14,8 @@ TODO - Added keyboard navigation to all widgets.
PARTIAL - Added support for mouse wheels using the new
FL_MOUSEWHEEL event type.
- Added the Fl_FileBrowser, Fl_FileChooser, and
Fl_FileIcon widgets from the bazaar.
- Added the Fl_FileBrowser, Fl_FileChooser, Fl_FileIcon,
and Fl_Wizard widgets from the bazaar.
TODO - Added the Fl_Check_Browser, Fl_HelpDialog,
Fl_HelpView, Fl_Tree_Browser, and Fl_Wizard widgets

60
FL/Fl_Wizard.H Normal file
View File

@ -0,0 +1,60 @@
//
// "$Id: Fl_Wizard.H,v 1.1.2.1 2001/08/02 18:39:01 easysw Exp $"
//
// Fl_Wizard widget definitions.
//
// Copyright 1999-2001 by Easy Software Products.
//
// 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 to "fltk-bugs@fltk.org".
//
//
// Include necessary header files...
//
#ifndef _Fl_Wizard_H_
# define _Fl_Wizard_H_
# include <FL/Fl_Group.H>
//
// Fl_Wizard class...
//
class Fl_Wizard : public Fl_Group
{
Fl_Widget *value_;
void draw();
public:
Fl_Wizard(int, int, int, int, const char * = 0);
void next();
void prev();
Fl_Widget *value();
void value(Fl_Widget *);
};
#endif // !_Fl_Wizard_H_
//
// End of "$Id: Fl_Wizard.H,v 1.1.2.1 2001/08/02 18:39:01 easysw Exp $".
//

202
src/Fl_Wizard.cxx Normal file
View File

@ -0,0 +1,202 @@
//
// "$Id: Fl_Wizard.cxx,v 1.1.2.1 2001/08/02 18:39:01 easysw Exp $"
//
// Fl_Wizard widget routines.
//
// Copyright 1997-2001 by Easy Software Products.
//
// 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 to "fltk-bugs@fltk.org".
//
// Contents:
//
// Fl_Wizard::Fl_Wizard() - Create an Fl_Wizard widget.
// Fl_Wizard::draw() - Draw the wizard border and visible child.
// Fl_Wizard::next() - Show the next child.
// Fl_Wizard::prev() - Show the previous child.
// Fl_Wizard::value() - Return the current visible child.
// Fl_Wizard::value() - Set the visible child.
//
//
// Include necessary header files...
//
#include <FL/Fl_Wizard.H>
#include <FL/fl_draw.H>
//
// 'Fl_Wizard::Fl_Wizard()' - Create an Fl_Wizard widget.
//
Fl_Wizard::Fl_Wizard(int xx, // I - Lefthand position
int yy, // I - Upper position
int ww, // I - Width
int hh, // I - Height
const char *l) : // I - Label
Fl_Group(xx, yy, ww, hh, l)
{
box(FL_THIN_UP_BOX);
value_ = (Fl_Widget *)0;
}
//
// 'Fl_Wizard::draw()' - Draw the wizard border and visible child.
//
void
Fl_Wizard::draw()
{
Fl_Widget *kid; // Visible child
kid = value();
if (damage() & FL_DAMAGE_ALL)
{
// Redraw everything...
if (kid)
{
draw_box(box(), x(), y(), w(), h(), kid->color());
draw_child(*kid);
}
else
draw_box(box(), x(), y(), w(), h(), color());
}
else if (kid)
update_child(*kid);
}
//
// 'Fl_Wizard::next()' - Show the next child.
//
void
Fl_Wizard::next()
{
int num_kids;
Fl_Widget * const *kids;
if ((num_kids = children()) == 0)
return;
for (kids = array(); num_kids > 0; kids ++, num_kids --)
if ((*kids)->visible())
break;
if (num_kids > 1)
value(kids[1]);
}
//
// 'Fl_Wizard::prev()' - Show the previous child.
//
void
Fl_Wizard::prev()
{
int num_kids;
Fl_Widget * const *kids;
if ((num_kids = children()) == 0)
return;
for (kids = array(); num_kids > 0; kids ++, num_kids --)
if ((*kids)->visible())
break;
if (num_kids > 0 && num_kids < children())
value(kids[-1]);
}
//
// 'Fl_Wizard::value()' - Return the current visible child.
//
Fl_Widget *
Fl_Wizard::value()
{
int num_kids;
Fl_Widget * const *kids;
Fl_Widget *kid;
if ((num_kids = children()) == 0)
return ((Fl_Widget *)0);
for (kids = array(), kid = (Fl_Widget *)0; num_kids > 0; kids ++, num_kids --)
{
if ((*kids)->visible())
{
if (kid)
(*kids)->hide();
else
kid = *kids;
}
}
if (!kid)
{
kids --;
kid = *kids;
kid->show();
}
return (kid);
}
//
// 'Fl_Wizard::value()' - Set the visible child.
//
void
Fl_Wizard::value(Fl_Widget *kid)
{
int num_kids;
Fl_Widget * const *kids;
if ((num_kids = children()) == 0)
return;
for (kids = array(); num_kids > 0; kids ++, num_kids --)
{
if (*kids == kid)
{
if (!kid->visible())
kid->show();
}
else
(*kids)->hide();
}
}
//
// End of "$Id: Fl_Wizard.cxx,v 1.1.2.1 2001/08/02 18:39:01 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
#
# "$Id: Makefile,v 1.18.2.14.2.5 2001/08/02 18:15:44 easysw Exp $"
# "$Id: Makefile,v 1.18.2.14.2.6 2001/08/02 18:39:01 easysw Exp $"
#
# Library makefile for the Fast Light Tool Kit (FLTK).
#
@ -82,6 +82,7 @@ CPPFILES = \
Fl_Window_fullscreen.cxx \
Fl_Window_hotspot.cxx \
Fl_Window_iconize.cxx \
Fl_Wizard.cxx \
Fl_abort.cxx \
Fl_add_idle.cxx \
Fl_arg.cxx \
@ -250,5 +251,5 @@ install: $(LIBNAME) $(DSONAME) $(GLLIBNAME) $(GLDSONAME)
ln -s FL $(includedir)/Fl
#
# End of "$Id: Makefile,v 1.18.2.14.2.5 2001/08/02 18:15:44 easysw Exp $".
# End of "$Id: Makefile,v 1.18.2.14.2.6 2001/08/02 18:39:01 easysw Exp $".
#

View File

@ -48,18 +48,33 @@ Fl_Dial.o: ../FL/Fl_Valuator.H ../FL/Fl_Widget.H ../FL/fl_draw.H ../FL/math.h
Fl_Double_Window.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H
Fl_Double_Window.o: ../FL/Fl_Double_Window.H ../FL/Fl_Window.H ../FL/x.H
Fl_Double_Window.o: ../FL/fl_draw.H
Fl_FileBrowser.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/filename.H
Fl_FileChooser.o: ../FL/Fl_Bitmap.H
Fl_FileChooser2.o: ../FL/filename.H ../FL/fl_ask.H ../FL/Enumerations.H
Fl_FileChooser2.o: ../FL/x.H ../FL/Fl_Window.H
Fl_FileIcon.o: ../config.h ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_FileIcon.o: ../FL/Enumerations.H ../FL/filename.H
Fl_Gl_Choice.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Choice.o: ../FL/Fl_Window.H Fl_Gl_Choice.H
Fl_Gl_Overlay.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Overlay.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
Fl_Gl_Window.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Window.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
Fl_FileBrowser.o: ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H
Fl_FileBrowser.o: ../FL/Fl_Browser_.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_FileBrowser.o: ../FL/Enumerations.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
Fl_FileBrowser.o: ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H ../FL/Fl.H
Fl_FileBrowser.o: ../FL/fl_draw.H ../FL/filename.H
Fl_FileChooser.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Enumerations.H
Fl_FileChooser.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_FileChooser.o: ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H
Fl_FileChooser.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
Fl_FileChooser.o: ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H ../FL/Fl.H
Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
Fl_FileChooser.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
Fl_FileChooser.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H
Fl_FileChooser.o: ../FL/fl_ask.H ../FL/Fl_Bitmap.H
Fl_FileChooser2.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Enumerations.H
Fl_FileChooser2.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_FileChooser2.o: ../FL/Fl_FileBrowser.H ../FL/Fl_Browser.H
Fl_FileChooser2.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
Fl_FileChooser2.o: ../FL/Fl_Valuator.H ../FL/Fl_FileIcon.H ../FL/Fl.H
Fl_FileChooser2.o: ../FL/Fl_Button.H ../FL/Fl_Return_Button.H
Fl_FileChooser2.o: ../FL/Fl_Button.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
Fl_FileChooser2.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H
Fl_FileChooser2.o: ../FL/fl_ask.H ../FL/filename.H ../FL/x.H
Fl_FileChooser2.o: ../FL/Fl_Window.H
Fl_FileIcon.o: ../config.h ../FL/Fl_FileIcon.H ../FL/Fl.H
Fl_FileIcon.o: ../FL/Enumerations.H ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_FileIcon.o: ../FL/filename.H
Fl_Group.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Group.H
Fl_Group.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_Group.o: ../FL/fl_draw.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
@ -149,6 +164,8 @@ Fl_Window_fullscreen.o: ../FL/Fl_Window.H
Fl_Window_hotspot.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Window.H
Fl_Window_hotspot.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H
Fl_Window_iconize.o: ../FL/x.H ../FL/Enumerations.H ../FL/Fl_Window.H
Fl_Wizard.o: ../FL/Fl_Wizard.H ../FL/Fl_Group.H ../FL/fl_draw.H
Fl_Wizard.o: ../FL/Enumerations.H
Fl_abort.o: ../FL/Fl.H ../FL/Enumerations.H ../config.h
Fl_add_idle.o: ../FL/Fl.H ../FL/Enumerations.H
Fl_arg.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
@ -205,7 +222,10 @@ fl_engraved_label.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Widget.H
fl_engraved_label.o: ../FL/fl_draw.H
fl_file_chooser.o: ../config.h ../FL/fl_file_chooser.H ../FL/Enumerations.H
fl_file_chooser.o: ../FL/Fl_FileChooser.H ../FL/Fl.H ../FL/Fl_Window.H
fl_file_chooser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Button.H
fl_file_chooser.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_FileBrowser.H
fl_file_chooser.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
fl_file_chooser.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
fl_file_chooser.o: ../FL/Fl_FileIcon.H ../FL/Fl.H ../FL/Fl_Button.H
fl_file_chooser.o: ../FL/Fl_Return_Button.H ../FL/Fl_Button.H
fl_file_chooser.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H ../FL/Fl_Choice.H
fl_file_chooser.o: ../FL/Fl_Menu_.H ../FL/Fl_Menu_Item.H ../FL/fl_ask.H
@ -241,17 +261,16 @@ fl_symbols.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/fl_draw.H
fl_symbols.o: ../FL/Fl_Widget.H
fl_vertex.o: ../FL/fl_draw.H ../FL/Enumerations.H ../FL/x.H ../FL/Fl_Window.H
fl_vertex.o: ../FL/math.h
forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H
forms_compatability.o: ../FL/Fl_Widget.H ../FL/Enumerations.H
forms_compatability.o: ../FL/Fl_Window.H ../FL/fl_draw.H
forms_compatability.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_compatability.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H
forms_compatability.o: ../FL/Fl_Box.H ../FL/Fl_Browser.H ../FL/Fl_Browser_.H
forms_compatability.o: ../FL/Fl_Scrollbar.H ../FL/Fl_Slider.H
forms_compatability.o: ../FL/Fl_Valuator.H ../FL/Fl_Button.H
forms_compatability.o: ../FL/Fl_Light_Button.H ../FL/Fl_Round_Button.H
forms_compatability.o: ../FL/Fl_Check_Button.H ../FL/Fl_Chart.H
forms_compatability.o: ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
forms_compatability.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_compatability.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
forms_compatability.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H
forms_compatability.o: ../FL/Fl_Bitmap.H ../FL/Fl_FormsPixmap.H
forms_compatability.o: ../FL/Fl_Pixmap.H ../FL/Fl_Box.H ../FL/Fl_Browser.H
forms_compatability.o: ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
forms_compatability.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H
forms_compatability.o: ../FL/Fl_Button.H ../FL/Fl_Light_Button.H
forms_compatability.o: ../FL/Fl_Round_Button.H ../FL/Fl_Check_Button.H
forms_compatability.o: ../FL/Fl_Chart.H ../FL/Fl_Choice.H ../FL/Fl_Menu_.H
forms_compatability.o: ../FL/Fl_Menu_Item.H ../FL/Fl_Clock.H
forms_compatability.o: ../FL/Fl_Counter.H ../FL/Fl_Dial.H ../FL/Fl_Free.H
forms_compatability.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H
@ -260,9 +279,9 @@ forms_compatability.o: ../FL/Fl_Input.H ../FL/Fl_Input_.H
forms_compatability.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_compatability.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_compatability.o: ../FL/Fl_Return_Button.H ../FL/Fl_Repeat_Button.H
forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_bitmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/fl_draw.H
forms_bitmap.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_bitmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_bitmap.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
forms_bitmap.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_bitmap.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
forms_bitmap.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
forms_bitmap.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
@ -276,9 +295,9 @@ forms_bitmap.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_bitmap.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_free.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Free.H
forms_free.o: ../FL/Fl_Widget.H
forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_fselect.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/fl_draw.H
forms_fselect.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_fselect.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_fselect.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
forms_fselect.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_fselect.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
forms_fselect.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
forms_fselect.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
@ -290,9 +309,9 @@ forms_fselect.o: ../FL/fl_ask.H ../FL/fl_show_colormap.H ../FL/filename.H
forms_fselect.o: ../FL/fl_file_chooser.H ../FL/Fl_Input.H ../FL/Fl_Input_.H
forms_fselect.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_fselect.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Fl_Group.H ../FL/Fl_Widget.H
forms_pixmap.o: ../FL/Enumerations.H ../FL/Fl_Window.H ../FL/fl_draw.H
forms_pixmap.o: ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_pixmap.o: ../FL/forms.H ../FL/Fl.H ../FL/Enumerations.H
forms_pixmap.o: ../FL/Fl_Group.H ../FL/Fl_Widget.H ../FL/Fl_Window.H
forms_pixmap.o: ../FL/fl_draw.H ../FL/Fl_FormsBitmap.H ../FL/Fl_Bitmap.H
forms_pixmap.o: ../FL/Fl_FormsPixmap.H ../FL/Fl_Pixmap.H ../FL/Fl_Box.H
forms_pixmap.o: ../FL/Fl_Browser.H ../FL/Fl_Browser_.H ../FL/Fl_Scrollbar.H
forms_pixmap.o: ../FL/Fl_Slider.H ../FL/Fl_Valuator.H ../FL/Fl_Button.H
@ -306,6 +325,12 @@ forms_pixmap.o: ../FL/Fl_Menu_Button.H ../FL/Fl_Positioner.H
forms_pixmap.o: ../FL/Fl_Value_Slider.H ../FL/Fl_Timer.H
forms_timer.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Timer.H
forms_timer.o: ../FL/Fl_Widget.H ../FL/fl_draw.H
Fl_Gl_Choice.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Choice.o: ../FL/Fl_Window.H Fl_Gl_Choice.H
Fl_Gl_Overlay.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Overlay.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
Fl_Gl_Window.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/x.H
Fl_Gl_Window.o: ../FL/Fl_Window.H Fl_Gl_Choice.H ../FL/Fl_Gl_Window.H
gl_draw.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/gl.h ../FL/x.H
gl_draw.o: ../FL/Fl_Window.H ../FL/fl_draw.H Fl_Gl_Choice.H Fl_Font.H
gl_start.o: ../config.h ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Window.H