diff options
Diffstat (limited to 'doc/fltk-problems.doc')
-rw-r--r-- | doc/fltk-problems.doc | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/doc/fltk-problems.doc b/doc/fltk-problems.doc index 6f20c44d..df4f1f14 100644 --- a/doc/fltk-problems.doc +++ b/doc/fltk-problems.doc @@ -26,10 +26,8 @@ Current problems: <li> There is the problem, that fltk::font always returns a font, the required one, or a replacements. The latter is not wanted in all cases, e.g. when several fonts are tested. Perhaps, this could be - solved by searching in the font list. - -<li> In dw::fltk::FltkFont::FltkFont, fltk::measure does not seem to work - for the calculation of dw::core::style::Font::xHeight. + solved by searching in the font list. <i>[This was true of fltk2. + What is the state of font handling now with fltk-1.3?]</i> <li> Distinction between italics and oblique would be nice (dw::fltk::FltkFont::FltkFont). @@ -38,7 +36,7 @@ Current problems: <h2>dw::fltk::ui::FltkCheckButtonResource</h2> -Groups of fltk::RadioButton must be added to one fltk::Group, which is +Groups of Fl_Radio_Button must be added to one Fl_Group, which is not possible in this context. There are two alternatives: <ol> @@ -58,7 +56,7 @@ be used. Then, it is for X necessary to use GCs with clipping masks. <h2>dw::fltk::ui::ComplexButton</h2> -Unfortunately, FLTK does not provide a button with Group as parent, so +Unfortunately, FLTK does not provide a button with Fl_Group as parent, so that children may be added to the button. dw::fltk::ui::ComplexButton does exactly this, and is, in an ugly way, a modified copy of the FLTK button. @@ -70,7 +68,7 @@ If the files do not compile, it may be useful to create a new one from the FLTK source: <ol> -<li> Copy fltk/Button.h from FLTK to dw/fltkcomplexbutton.hh and +<li> Copy Fl_Button.H from FLTK to dw/fltkcomplexbutton.hh and src/Button.cxx to dw/fltkcomplexbutton.cc. <li> In both files, rename "Button" to "ComplexButton". Automatic replacing @@ -120,17 +118,15 @@ at the beginning and at the end. Most important, the base class is changed: \code --#ifndef fltk_Widget_h --#include "Widget.h" --#endif -+#include <fltk/Group.h> +-#include "FL/Fl_Widget.H" ++#include <FL/Fl_Group.H> \endcode and \code --class FL_API ComplexButton : public Widget { -+class ComplexButton: public ::fltk::Group +-class FL_API ComplexButton : public Fl_Widget { ++class ComplexButton: public Fl_Group +{ \endcode @@ -148,12 +144,10 @@ First, \#include's: \code - #include <fltk/events.h> - #include <fltk/damage.h> --#include <fltk/ComplexButton.h> // <fltk/Button.h> formerly - #include <fltk/Group.h> - #include <fltk/Box.h> - #include <stdlib.h> + #include <FL/Fl.H> +-#include <FL/ComplexButton.h> // <FL/Fl_Button.H> formerly + #include <FL/Fl_Group.H> + #include <FL/Fl_Window.H> + +#include "fltkcomplexbutton.hh" \endcode @@ -162,33 +156,23 @@ Second, namespaces: \code +using namespace dw::fltk::ui; - using namespace fltk; \endcode -Since the base class is now Group, the constructor must be changed: +Since the base class is now Fl_Group, the constructor must be changed: \code --ComplexButton::ComplexButton(int x,int y,int w,int h, const char *l) : Widget(x,y,w,h,l) { +-ComplexButton::ComplexButton(int x,int y,int w,int h, const char *l) : Fl_Widget(x,y,w,h,l) { +ComplexButton::ComplexButton(int x,int y,int w,int h, const char *l) : -+ Group(x,y,w,h,l) ++ Fl_Group(x,y,w,h,l) +{ \endcode -At the end of the constructor, - -\code -+ type (NORMAL); - } -\endcode - -must be added (I've forgotten, what this is for). - Finally, the button must draw its children (end of dw::fltk::ui::ComplexButton::draw()): \code + -+ for (int i = 0; i < children (); i++) ++ for (int i = children () - 1; i >= 0; i--) + draw_child (*child (i)); } \endcode |