Author: matt
Date: 2010-03-31 09:48:48 -0700 (Wed, 31 Mar 2010)
New Revision: 7383
Log:
Ported Label Types. hello 1, 2, and 3 compile for OS X.
Modified:
branches/branch-3.0/FL/Enumerations.H
branches/branch-3.0/FL/Fl_Widget.H
branches/branch-3.0/fltk/Style.h
branches/branch-3.0/fltk/Widget.h
branches/branch-3.0/fltk3/Enumerations.H
branches/branch-3.0/fltk3/Fl_Menu_Item.H
branches/branch-3.0/fltk3/Widget.h
branches/branch-3.0/fltk3/forms.H
branches/branch-3.0/fltk3/run.h
branches/branch-3.0/src/Fl_Bitmap.cxx
branches/branch-3.0/src/Fl_Button.cxx
branches/branch-3.0/src/Fl_File_Icon.cxx
branches/branch-3.0/src/Fl_Image.cxx
branches/branch-3.0/src/Fl_Menu.cxx
branches/branch-3.0/src/Fl_Multi_Label.cxx
branches/branch-3.0/src/Fl_Pixmap.cxx
branches/branch-3.0/src/Fl_Widget.cxx
branches/branch-3.0/src/Fl_Window.cxx
branches/branch-3.0/src/Fl_cocoa.mm
branches/branch-3.0/src/Fl_get_system_colors.cxx
branches/branch-3.0/src/Fl_mac.cxx
branches/branch-3.0/src/Fl_win32.cxx
branches/branch-3.0/src/Fl_x.cxx
branches/branch-3.0/src/fl_engraved_label.cxx
branches/branch-3.0/src/fl_labeltype.cxx
branches/branch-3.0/src/print_panel.cxx
branches/branch-3.0/test/hello.cxx
Modified: branches/branch-3.0/FL/Enumerations.H
===================================================================
--- branches/branch-3.0/FL/Enumerations.H 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/FL/Enumerations.H 2010-03-31 16:48:48 UTC (rev
7383)
@@ -231,25 +231,21 @@
return (Fl_Boxtype)((b%4<2)?b:(b+2));
}
+#endif
+
enum Fl_Labeltype {
- FL_NORMAL_LABEL = 0,
- FL_NO_LABEL,
- _FL_SHADOW_LABEL,
- _FL_ENGRAVED_LABEL,
- _FL_EMBOSSED_LABEL,
- _FL_MULTI_LABEL,
- _FL_ICON_LABEL,
- _FL_IMAGE_LABEL,
- FL_FREE_LABELTYPE
+ FL_NORMAL_LABEL = fltk3::NORMAL_LABEL,
+ FL_NO_LABEL = fltk3::NO_LABEL,
+ FL_SHADOW_LABEL = fltk3::SHADOW_LABEL,
+ FL_ENGRAVED_LABEL = fltk3::ENGRAVED_LABEL,
+ FL_EMBOSSED_LABEL = fltk3::EMBOSSED_LABEL,
+ FL_MULTI_LABEL = fltk3::MULTI_LABEL,
+ FL_ICON_LABEL = fltk3::ICON_LABEL,
+ FL_IMAGE_LABEL = fltk3::IMAGE_LABEL,
+ FL_FREE_LABELTYPE = fltk3::FREE_LABELTYPE
};
-#define FL_SYMBOL_LABEL FL_NORMAL_LABEL
-extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL();
-#define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL()
-extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL();
-#define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL()
-extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
-#define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
+#if 0
typedef unsigned Fl_Align;
const Fl_Align FL_ALIGN_CENTER = (Fl_Align)0;
Modified: branches/branch-3.0/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0/FL/Fl_Widget.H 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/FL/Fl_Widget.H 2010-03-31 16:48:48 UTC (rev 7383)
@@ -175,8 +175,8 @@
void copy_label(const char *new_label);
void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value =
b;}
#endif
- Fl_Labeltype labeltype() const { return _p->labeltype(); }
- void labeltype(Fl_Labeltype a) { _p->labeltype(a); }
+ Fl_Labeltype labeltype() const { return (Fl_Labeltype)_p->labeltype(); }
+ void labeltype(Fl_Labeltype a) { _p->labeltype((fltk3::Labeltype)a); }
Fl_Color labelcolor() const { return _p->labelcolor(); }
void labelcolor(Fl_Color c) { _p->labelcolor(c); }
Fl_Font labelfont() const { return _p->labelfont(); }
Modified: branches/branch-3.0/fltk/Style.h
===================================================================
--- branches/branch-3.0/fltk/Style.h 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/fltk/Style.h 2010-03-31 16:48:48 UTC (rev 7383)
@@ -110,10 +110,10 @@
-class LabelType;
/*
The values below are currently emulated. In a future version of FLTK3, we
really should port the FLTK2 way of handling labeltypes to FLTK3.
+class LabelType;
extern FL_API LabelType* const NO_LABEL;
extern FL_API LabelType* const NORMAL_LABEL;
extern FL_API LabelType* const SYMBOL_LABEL; // same as NORMAL_LABEL
@@ -121,8 +121,16 @@
extern FL_API LabelType* const ENGRAVED_LABEL;
extern FL_API LabelType* const EMBOSSED_LABEL;
*/
-const enum Fl_Labeltype SHADOW_LABEL = FL_SHADOW_LABEL;
-
+ enum LabelType {
+ NO_LABEL = fltk3::NO_LABEL,
+ NORMAL_LABEL = fltk3::NORMAL_LABEL,
+ SYMBOL_LABEL = fltk3::NORMAL_LABEL,
+ SHADOW_LABEL = fltk3::SHADOW_LABEL,
+ ENGRAVED_LABEL = fltk3::ENGRAVED_LABEL,
+ EMBOSSED_LABEL = fltk3::EMBOSSED_LABEL
+ };
+
+
class Style;
class FL_API Style {
Modified: branches/branch-3.0/fltk/Widget.h
===================================================================
--- branches/branch-3.0/fltk/Widget.h 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/fltk/Widget.h 2010-03-31 16:48:48 UTC (rev 7383)
@@ -246,7 +246,7 @@
#endif
// Port to 3: void labeltype(LabelType*) ;
- void labeltype(Fl_Labeltype t) { _p->labeltype(t); }
+ void labeltype(LabelType t) { _p->labeltype((fltk3::Labeltype)t); }
#if 0
void color(Color) ;
Modified: branches/branch-3.0/fltk3/Enumerations.H
===================================================================
--- branches/branch-3.0/fltk3/Enumerations.H 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/fltk3/Enumerations.H 2010-03-31 16:48:48 UTC (rev
7383)
@@ -576,44 +576,29 @@
/*...@}*/ // group: Box Types
+namespace fltk3 {
+
/**
The labeltype() method sets the type of the label.
The following standard label types are included:
- \todo The doxygen comments are incomplete, and some labeltypes
- are starting with an underscore. Also, there are three
- external functions undocumented (yet):
- - fl_define_FL_SHADOW_LABEL()
- - fl_define_FL_ENGRAVED_LABEL()
- - fl_define_FL_EMBOSSED_LABEL()
+ \todo The doxygen comments are incomplete.
*/
-enum Fl_Labeltype { // labeltypes:
- FL_NORMAL_LABEL = 0, ///< draws the text (0)
- FL_NO_LABEL, ///< does nothing
- _FL_SHADOW_LABEL, ///< draws a drop shadow under the text
- _FL_ENGRAVED_LABEL, ///< draws edges as though the text is engraved
- _FL_EMBOSSED_LABEL, ///< draws edges as thought the text is raised
- _FL_MULTI_LABEL, ///< ?
- _FL_ICON_LABEL, ///< draws the icon associated with the text
- _FL_IMAGE_LABEL, ///< ?
-
- FL_FREE_LABELTYPE ///< first free labeltype to use for creating
own labeltypes
+enum Labeltype { // labeltypes:
+ NORMAL_LABEL = 0, ///< draws the text (0)
+ NO_LABEL, ///< does nothing
+ SHADOW_LABEL, ///< draws a drop shadow under the text
+ ENGRAVED_LABEL, ///< draws edges as though the text is engraved
+ EMBOSSED_LABEL, ///< draws edges as thought the text is raised
+ MULTI_LABEL, ///< ?
+ ICON_LABEL, ///< draws the icon associated with the text
+ IMAGE_LABEL, ///< ?
+ FREE_LABELTYPE ///< first free labeltype to use for creating own
labeltypes
};
+
+} //namespace fltk3
-/**
- Sets the current label type end return its corresponding Fl_Labeltype
value.
- @{
-*/
-#define FL_SYMBOL_LABEL FL_NORMAL_LABEL
-extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL();
-#define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL()
-extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL();
-#define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL()
-extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
-#define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
-/** @} */
-
/** \name Alignment Flags */
/*...@{*/
/** Flags to control the label alignment.
Modified: branches/branch-3.0/fltk3/Fl_Menu_Item.H
===================================================================
--- branches/branch-3.0/fltk3/Fl_Menu_Item.H 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/fltk3/Fl_Menu_Item.H 2010-03-31 16:48:48 UTC (rev
7383)
@@ -157,23 +157,23 @@
void label(const char* a) {text=a;}
/** See const char* Fl_Menu_Item::label() const */
- void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
+ void label(fltk3::Labeltype a,const char* b) {labeltype_ = a; text = b;}
/**
A labeltype identifies a routine that draws the label of the
widget. This can be used for special effects such as emboss, or to use
the label() pointer as another form of data such as a bitmap.
- The value FL_NORMAL_LABEL prints the label as text.
+ The value fltk3::NORMAL_LABEL prints the label as text.
*/
- Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;}
+ fltk3::Labeltype labeltype() const {return (fltk3::Labeltype)labeltype_;}
/**
A labeltype identifies a routine that draws the label of the
widget. This can be used for special effects such as emboss, or to use
the label() pointer as another form of data such as a bitmap.
- The value FL_NORMAL_LABEL prints the label as text.
+ The value fltk3::NORMAL_LABEL prints the label as text.
*/
- void labeltype(Fl_Labeltype a) {labeltype_ = a;}
+ void labeltype(fltk3::Labeltype a) {labeltype_ = a;}
/**
This color is passed to the labeltype routine, and is typically the
Modified: branches/branch-3.0/fltk3/Widget.h
===================================================================
--- branches/branch-3.0/fltk3/Widget.h 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/fltk3/Widget.h 2010-03-31 16:48:48 UTC (rev 7383)
@@ -73,7 +73,7 @@
Fl_Color color;
/** alignment of label */
Fl_Align align_;
- /** type of label. \see Fl_Labeltype */
+ /** type of label. \see fltk3::Labeltype */
uchar type;
/** Draws the label aligned to the given box */
@@ -440,25 +440,25 @@
void copy_label(const char *new_label);
/** Shortcut to set the label text and type in one call.
- \see label(const char *), labeltype(Fl_Labeltype)
+ \see label(const char *), labeltype(fltk3::Labeltype)
*/
- void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value =
b;}
+ void label(fltk3::Labeltype a, const char* b) {label_.type = a; label_.value
= b;}
/** Gets the label type.
\return the current label type.
- \see Fl_Labeltype
+ \see fltk3::Labeltype
*/
- Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;}
+ fltk3::Labeltype labeltype() const {return (fltk3::Labeltype)label_.type;}
/** Sets the label type.
The label type identifies the function that draws the label of the
widget.
This is generally used for special effects such as embossing or for
using
the label() pointer as another form of data such as an icon. The value
- FL_NORMAL_LABEL prints the label as plain text.
+ fltk3::NORMAL_LABEL prints the label as plain text.
\param[in] a new label type
- \see Fl_Labeltype
+ \see fltk3::Labeltype
*/
- void labeltype(Fl_Labeltype a) {label_.type = a;}
+ void labeltype(fltk3::Labeltype a) {label_.type = a;}
/** Gets the label color.
The default color is FL_FOREGROUND_COLOR.
Modified: branches/branch-3.0/fltk3/forms.H
===================================================================
--- branches/branch-3.0/fltk3/forms.H 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/fltk3/forms.H 2010-03-31 16:48:48 UTC (rev 7383)
@@ -129,9 +129,9 @@
#define fltk3::TIMESBOLDITALIC_STYLE fltk3::TIMES_BOLD_ITALIC
// hacks to change the labeltype() when passed to fl_set_object_lstyle():
-#define FL_SHADOW_STYLE (FL_SHADOW_LABEL<<8)
-#define FL_ENGRAVED_STYLE (FL_ENGRAVED_LABEL<<8)
-#define FL_EMBOSSED_STYLE (FL_EMBOSSED_LABEL<<0)
+#define FL_SHADOW_STYLE (fltk3::SHADOW_LABEL<<8)
+#define FL_ENGRAVED_STYLE (fltk3::ENGRAVED_LABEL<<8)
+#define FL_EMBOSSED_STYLE (fltk3::EMBOSSED_LABEL<<0)
// size values are different from XForms, match older Forms:
#define FL_TINY_SIZE 8
@@ -211,7 +211,7 @@
/* forms lib font indexes must be byte sized - extract correct byte from style
word */
inline void fl_set_object_lstyle(fltk3::Widget* o,int a) {
- o->labelfont((Fl_Font)(a&0xff)); o->labeltype((Fl_Labeltype)(a>>8));}
+ o->labelfont((Fl_Font)(a&0xff)); o->labeltype((fltk3::Labeltype)(a>>8));}
inline void fl_set_object_lcol(fltk3::Widget* o, Fl_Color a)
{o->labelcolor(a);}
#define fl_set_object_lcolor fl_set_object_lcol
inline void fl_set_object_lalign(fltk3::Widget* o, Fl_Align a) {o->align(a);}
Modified: branches/branch-3.0/fltk3/run.h
===================================================================
--- branches/branch-3.0/fltk3/run.h 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/fltk3/run.h 2010-03-31 16:48:48 UTC (rev 7383)
@@ -785,9 +785,9 @@
/** @} */
// labeltypes:
- extern void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
+ extern void
set_labeltype(fltk3::Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
/** Sets the functions to call to draw and measure a specific labeltype. */
- extern void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined
?
+ extern void set_labeltype(fltk3::Labeltype, fltk3::Labeltype from); // is it
defined ?
// boxtypes:
extern Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
Modified: branches/branch-3.0/src/Fl_Bitmap.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Bitmap.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Bitmap.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -366,8 +366,8 @@
}
void Fl_Bitmap::label(Fl_Menu_Item* m) {
- fltk3::set_labeltype(_FL_IMAGE_LABEL, labeltype, measure);
- m->label(_FL_IMAGE_LABEL, (const char*)this);
+ fltk3::set_labeltype(fltk3::IMAGE_LABEL, labeltype, measure);
+ m->label(fltk3::IMAGE_LABEL, (const char*)this);
}
Fl_Image *Fl_Bitmap::copy(int W, int H) {
Modified: branches/branch-3.0/src/Fl_Button.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Button.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Button.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -72,7 +72,7 @@
if (type() == FL_HIDDEN_BUTTON) return;
Fl_Color col = value() ? selection_color() : color();
draw_box(value() ? (down_box()?down_box():fl_down(box())) : box(), col);
- if (labeltype() == FL_NORMAL_LABEL && value()) {
+ if (labeltype() == fltk3::NORMAL_LABEL && value()) {
Fl_Color c = labelcolor();
labelcolor(fl_contrast(c, col));
draw_label();
Modified: branches/branch-3.0/src/Fl_File_Icon.cxx
===================================================================
--- branches/branch-3.0/src/Fl_File_Icon.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_File_Icon.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -458,8 +458,7 @@
*/
void Fl_File_Icon::label(fltk3::Widget *w) // I - Widget to label
{
- fltk3::set_labeltype(_FL_ICON_LABEL, labeltype, 0);
- w->label(_FL_ICON_LABEL, (const char*)this);
+ w->label(fltk3::ICON_LABEL, (const char*)this);
}
@@ -486,7 +485,12 @@
if (icon) icon->draw(x, y, w, h, (Fl_Color)(o->color));
}
+void fl_icon_label(const Fl_Label *o,int x,int y,int w,int h,Fl_Align a)
+{
+ Fl_File_Icon::labeltype(o, x, y, w, h, a);
+}
+
//
// End of "$Id$".
//
Modified: branches/branch-3.0/src/Fl_Image.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Image.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Image.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -127,8 +127,8 @@
instead.
*/
void Fl_Image::label(Fl_Menu_Item* m) {
- fltk3::set_labeltype(_FL_IMAGE_LABEL, labeltype, measure);
- m->label(_FL_IMAGE_LABEL, (const char*)this);
+ fltk3::set_labeltype(fltk3::IMAGE_LABEL, labeltype, measure);
+ m->label(fltk3::IMAGE_LABEL, (const char*)this);
}
void
@@ -549,8 +549,8 @@
}
void Fl_RGB_Image::label(Fl_Menu_Item* m) {
- fltk3::set_labeltype(_FL_IMAGE_LABEL, labeltype, measure);
- m->label(_FL_IMAGE_LABEL, (const char*)this);
+ fltk3::set_labeltype(fltk3::IMAGE_LABEL, labeltype, measure);
+ m->label(fltk3::IMAGE_LABEL, (const char*)this);
}
Modified: branches/branch-3.0/src/Fl_Menu.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Menu.cxx 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/src/Fl_Menu.cxx 2010-03-31 16:48:48 UTC (rev 7383)
@@ -270,7 +270,7 @@
clear_border();
set_menu_window();
menu = L;
- if (L->labelcolor_ || fltk3::scheme() || L->labeltype_ > FL_NO_LABEL)
clear_overlay();
+ if (L->labelcolor_ || fltk3::scheme() || L->labeltype_ > fltk3::NO_LABEL)
clear_overlay();
}
menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
@@ -349,7 +349,7 @@
}
}
}
- if (m->labelcolor_ || fltk3::scheme() || m->labeltype_ > FL_NO_LABEL)
clear_overlay();
+ if (m->labelcolor_ || fltk3::scheme() || m->labeltype_ > fltk3::NO_LABEL)
clear_overlay();
}
shortcutWidth = hotKeysw;
if (selected >= 0 && !Wp) X -= W/2;
Modified: branches/branch-3.0/src/Fl_Multi_Label.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Multi_Label.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Multi_Label.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -33,7 +33,7 @@
#include <fltk3/Fl_Menu_Item.H>
#include <fltk3/Fl_Multi_Label.H>
-static void multi_labeltype(
+void fl_multi_labeltype(
const Fl_Label* o, int x, int y, int w, int h, Fl_Align a)
{
Fl_Multi_Label* b = (Fl_Multi_Label*)(o->value);
@@ -53,7 +53,7 @@
}
// measurement is only correct for left-to-right appending...
-static void multi_measure(const Fl_Label* o, int& w, int& h) {
+void fl_multi_measure(const Fl_Label* o, int& w, int& h) {
Fl_Multi_Label* b = (Fl_Multi_Label*)(o->value);
Fl_Label local = *o;
local.value = b->labela;
@@ -66,13 +66,11 @@
}
void Fl_Multi_Label::label(fltk3::Widget* o) {
- fltk3::set_labeltype(_FL_MULTI_LABEL, multi_labeltype, multi_measure);
- o->label(_FL_MULTI_LABEL, (const char*)this);
+ o->label(fltk3::MULTI_LABEL, (const char*)this);
}
void Fl_Multi_Label::label(Fl_Menu_Item* o) {
- fltk3::set_labeltype(_FL_MULTI_LABEL, multi_labeltype, multi_measure);
- o->label(_FL_MULTI_LABEL, (const char*)this);
+ o->label(fltk3::MULTI_LABEL, (const char*)this);
}
//
Modified: branches/branch-3.0/src/Fl_Pixmap.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Pixmap.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Pixmap.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -235,8 +235,8 @@
}
void Fl_Pixmap::label(Fl_Menu_Item* m) {
- fltk3::set_labeltype(_FL_IMAGE_LABEL, labeltype, Fl_Image::measure);
- m->label(_FL_IMAGE_LABEL, (const char*)this);
+ fltk3::set_labeltype(fltk3::IMAGE_LABEL, labeltype, Fl_Image::measure);
+ m->label(fltk3::IMAGE_LABEL, (const char*)this);
}
void Fl_Pixmap::copy_data() {
Modified: branches/branch-3.0/src/Fl_Widget.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Widget.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Widget.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -117,7 +117,7 @@
label_.value = L;
label_.image = 0;
label_.deimage = 0;
- label_.type = FL_NORMAL_LABEL;
+ label_.type = fltk3::NORMAL_LABEL;
label_.font = fltk3::HELVETICA;
label_.size = FL_NORMAL_SIZE;
label_.color = FL_FOREGROUND_COLOR;
Modified: branches/branch-3.0/src/Fl_Window.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Window.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_Window.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -44,11 +44,11 @@
type(FL_WINDOW);
box(FL_FLAT_BOX);
if (fltk3::scheme_bg_) {
- labeltype(FL_NORMAL_LABEL);
+ labeltype(fltk3::NORMAL_LABEL);
align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
image(fltk3::scheme_bg_);
} else {
- labeltype(FL_NO_LABEL);
+ labeltype(fltk3::NO_LABEL);
}
i = 0;
xclass_ = 0;
Modified: branches/branch-3.0/src/Fl_cocoa.mm
===================================================================
--- branches/branch-3.0/src/Fl_cocoa.mm 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/src/Fl_cocoa.mm 2010-03-31 16:48:48 UTC (rev 7383)
@@ -2294,10 +2294,10 @@
void fltk3::Window::show() {
image(fltk3::scheme_bg_);
if (fltk3::scheme_bg_) {
- labeltype(FL_NORMAL_LABEL);
+ labeltype(fltk3::NORMAL_LABEL);
align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
} else {
- labeltype(FL_NO_LABEL);
+ labeltype(fltk3::NO_LABEL);
}
Fl_Tooltip::exit(this);
if (!shown() || !i) {
Modified: branches/branch-3.0/src/Fl_get_system_colors.cxx
===================================================================
--- branches/branch-3.0/src/Fl_get_system_colors.cxx 2010-03-31 16:21:56 UTC
(rev 7382)
+++ branches/branch-3.0/src/Fl_get_system_colors.cxx 2010-03-31 16:48:48 UTC
(rev 7383)
@@ -411,7 +411,7 @@
// Set (or clear) the background tile for all windows...
for (win = first_window(); win; win = next_window(win)) {
- win->labeltype(scheme_bg_ ? FL_NORMAL_LABEL : FL_NO_LABEL);
+ win->labeltype(scheme_bg_ ? fltk3::NORMAL_LABEL : fltk3::NO_LABEL);
win->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
win->image(scheme_bg_);
win->redraw();
Modified: branches/branch-3.0/src/Fl_mac.cxx
===================================================================
--- branches/branch-3.0/src/Fl_mac.cxx 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/src/Fl_mac.cxx 2010-03-31 16:48:48 UTC (rev 7383)
@@ -2374,10 +2374,10 @@
void fltk3::Window::show() {
image(fltk3::scheme_bg_);
if (fltk3::scheme_bg_) {
- labeltype(FL_NORMAL_LABEL);
+ labeltype(fltk3::NORMAL_LABEL);
align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
} else {
- labeltype(FL_NO_LABEL);
+ labeltype(fltk3::NO_LABEL);
}
Fl_Tooltip::exit(this);
if (!shown() || !i) {
Modified: branches/branch-3.0/src/Fl_win32.cxx
===================================================================
--- branches/branch-3.0/src/Fl_win32.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/Fl_win32.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -1766,10 +1766,10 @@
void fltk3::Window::show() {
image(fltk3::scheme_bg_);
if (fltk3::scheme_bg_) {
- labeltype(FL_NORMAL_LABEL);
+ labeltype(fltk3::NORMAL_LABEL);
align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
} else {
- labeltype(FL_NO_LABEL);
+ labeltype(fltk3::NO_LABEL);
}
Fl_Tooltip::exit(this);
if (!shown()) {
Modified: branches/branch-3.0/src/Fl_x.cxx
===================================================================
--- branches/branch-3.0/src/Fl_x.cxx 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/src/Fl_x.cxx 2010-03-31 16:48:48 UTC (rev 7383)
@@ -1719,10 +1719,10 @@
void fltk3::Window::show() {
image(fltk3::scheme_bg_);
if (fltk3::scheme_bg_) {
- labeltype(FL_NORMAL_LABEL);
+ labeltype(fltk3::NORMAL_LABEL);
align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
} else {
- labeltype(FL_NO_LABEL);
+ labeltype(fltk3::NO_LABEL);
}
Fl_Tooltip::exit(this);
if (!shown()) {
Modified: branches/branch-3.0/src/fl_engraved_label.cxx
===================================================================
--- branches/branch-3.0/src/fl_engraved_label.cxx 2010-03-31 16:21:56 UTC
(rev 7382)
+++ branches/branch-3.0/src/fl_engraved_label.cxx 2010-03-31 16:48:48 UTC
(rev 7383)
@@ -48,14 +48,14 @@
if (align & FL_ALIGN_CLIP) fl_pop_clip();
}
-static void fl_shadow_label(
+void fl_shadow_label(
const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
static int data[2][3] = {{2,2,FL_DARK3},{0,0,0}};
innards(o, X, Y, W, H, align, data, 2);
}
-static void fl_engraved_label(
+void fl_engraved_label(
const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
static int data[7][3] = {
@@ -65,7 +65,7 @@
innards(o, X, Y, W, H, align, data, 7);
}
-static void fl_embossed_label(
+void fl_embossed_label(
const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
static int data[7][3] = {
@@ -75,18 +75,6 @@
innards(o, X, Y, W, H, align, data, 7);
}
-Fl_Labeltype fl_define_FL_SHADOW_LABEL() {
- fltk3::set_labeltype(_FL_SHADOW_LABEL, fl_shadow_label, 0);
- return _FL_SHADOW_LABEL;
-}
-Fl_Labeltype fl_define_FL_ENGRAVED_LABEL() {
- fltk3::set_labeltype(_FL_ENGRAVED_LABEL, fl_engraved_label, 0);
- return _FL_ENGRAVED_LABEL;
-}
-Fl_Labeltype fl_define_FL_EMBOSSED_LABEL() {
- fltk3::set_labeltype(_FL_EMBOSSED_LABEL, fl_embossed_label, 0);
- return _FL_EMBOSSED_LABEL;
-}
//
// End of "$Id$".
Modified: branches/branch-3.0/src/fl_labeltype.cxx
===================================================================
--- branches/branch-3.0/src/fl_labeltype.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/fl_labeltype.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -35,9 +35,17 @@
#include <fltk3/fl_draw.H>
#include <fltk3/Fl_Image.H>
-void
-fl_no_label(const Fl_Label*,int,int,int,int,Fl_Align) {}
+extern void fl_shadow_label(const Fl_Label*,int,int,int,int,Fl_Align);
+extern void fl_engraved_label(const Fl_Label*,int,int,int,int,Fl_Align);
+extern void fl_embossed_label(const Fl_Label*,int,int,int,int,Fl_Align);
+extern void fl_icon_label(const Fl_Label*,int,int,int,int,Fl_Align);
+extern void fl_multi_measure(const Fl_Label* o, int& w, int& h);
+extern void fl_multi_labeltype(const Fl_Label* o, int x, int y, int w, int h,
Fl_Align a);
+
+
+void fl_no_label(const Fl_Label*,int,int,int,int,Fl_Align) {}
+
void
fl_normal_label(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
{
@@ -61,21 +69,28 @@
static Fl_Label_Draw_F* table[MAX_LABELTYPE] = {
fl_normal_label,
fl_no_label,
- fl_normal_label, // _FL_SHADOW_LABEL,
- fl_normal_label, // _FL_ENGRAVED_LABEL,
- fl_normal_label, // _FL_EMBOSSED_LABEL,
- fl_no_label, // _FL_MULTI_LABEL,
- fl_no_label, // _FL_ICON_LABEL,
- // FL_FREE_LABELTYPE+n:
+ fl_shadow_label,
+ fl_engraved_label,
+ fl_embossed_label,
+ fl_multi_labeltype,
+ fl_icon_label,
+ // fltk3:FREE_LABELTYPE+n:
fl_no_label, fl_no_label, fl_no_label,
fl_no_label, fl_no_label, fl_no_label,
fl_no_label, fl_no_label, fl_no_label
};
-static Fl_Label_Measure_F* measure[MAX_LABELTYPE];
+static Fl_Label_Measure_F* measure[MAX_LABELTYPE] = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ fl_multi_measure,
+};
/** Sets the functions to call to draw and measure a specific labeltype. */
-void fltk3::set_labeltype(Fl_Labeltype t,Fl_Label_Draw_F*
f,Fl_Label_Measure_F*m)
+void fltk3::set_labeltype(fltk3::Labeltype t,Fl_Label_Draw_F*
f,Fl_Label_Measure_F*m)
{
table[t] = f; measure[t] = m;
}
Modified: branches/branch-3.0/src/print_panel.cxx
===================================================================
--- branches/branch-3.0/src/print_panel.cxx 2010-03-31 16:21:56 UTC (rev
7382)
+++ branches/branch-3.0/src/print_panel.cxx 2010-03-31 16:48:48 UTC (rev
7383)
@@ -142,8 +142,8 @@
}
static Fl_Menu_Item menu_print_page_size[] = {
- {"Letter", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
- {"A4", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
+ {"Letter", 0, 0, 0, 0, fltk3::NORMAL_LABEL, 0, 14, 0},
+ {"A4", 0, 0, 0, 0, fltk3::NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0}
};
Modified: branches/branch-3.0/test/hello.cxx
===================================================================
--- branches/branch-3.0/test/hello.cxx 2010-03-31 16:21:56 UTC (rev 7382)
+++ branches/branch-3.0/test/hello.cxx 2010-03-31 16:48:48 UTC (rev 7383)
@@ -37,7 +37,7 @@
box->box(FL_UP_BOX);
box->labelfont(BOLD+ITALIC);
box->labelsize(36);
- box->labeltype(FL_SHADOW_LABEL);
+ box->labeltype(SHADOW_LABEL);
window->end();
window->show(argc, argv);
return fltk3::run();
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit