diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2008-04-23 19:09:28 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2008-04-23 19:09:28 +0000 |
| commit | 7c8f5cc888725d061bcae9d0d5c53ff912639ac4 (patch) | |
| tree | 407d6027b29f1cf30a4a56bd72d2ddb79fd37709 /FL | |
| parent | 88c0d727aa89b650611ce8c677d4ed26e2fc1f4a (diff) | |
First attempt at consistently using Fl_Font as a type for the font index and Fl_Font_Size as a type to measure font height (or rather size).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6113 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Enumerations.H | 49 | ||||
| -rw-r--r-- | FL/Fl_Browser_.H | 11 | ||||
| -rw-r--r-- | FL/Fl_Chart.H | 11 | ||||
| -rw-r--r-- | FL/Fl_Counter.H | 11 | ||||
| -rw-r--r-- | FL/Fl_File_Browser.H | 4 | ||||
| -rw-r--r-- | FL/Fl_File_Chooser.H | 8 | ||||
| -rw-r--r-- | FL/Fl_Help_Dialog.H | 4 | ||||
| -rw-r--r-- | FL/Fl_Help_View.H | 33 | ||||
| -rw-r--r-- | FL/Fl_Input_.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Input_Choice.H | 8 | ||||
| -rw-r--r-- | FL/Fl_Menu_.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Menu_Item.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Spinner.H | 8 | ||||
| -rw-r--r-- | FL/Fl_Text_Display.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Tooltip.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Value_Input.H | 6 | ||||
| -rw-r--r-- | FL/Fl_Value_Output.H | 12 | ||||
| -rw-r--r-- | FL/Fl_Value_Slider.H | 11 | ||||
| -rw-r--r-- | FL/Fl_Widget.H | 12 | ||||
| -rw-r--r-- | FL/fl_ask.H | 6 | ||||
| -rw-r--r-- | FL/fl_draw.H | 10 | ||||
| -rw-r--r-- | FL/forms.H | 2 |
22 files changed, 138 insertions, 128 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 647a89bdf..2744e10c0 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -287,30 +287,33 @@ enum Fl_Align { // align() values FL_ALIGN_NOWRAP = 0 // for back compatability }; -enum Fl_Font { // standard fonts - FL_HELVETICA = 0, - FL_HELVETICA_BOLD, - FL_HELVETICA_ITALIC, - FL_HELVETICA_BOLD_ITALIC, - FL_COURIER, - FL_COURIER_BOLD, - FL_COURIER_ITALIC, - FL_COURIER_BOLD_ITALIC, - FL_TIMES, - FL_TIMES_BOLD, - FL_TIMES_ITALIC, - FL_TIMES_BOLD_ITALIC, - FL_SYMBOL, - FL_SCREEN, - FL_SCREEN_BOLD, - FL_ZAPF_DINGBATS, - - FL_FREE_FONT = 16, // first one to allocate - FL_BOLD = 1, // add this to helvetica, courier, or times - FL_ITALIC = 2 // add this to helvetica, courier, or times -}; +typedef unsigned int Fl_Font; +typedef unsigned int Fl_Font_Size; + +// standard fonts +const Fl_Font FL_HELVETICA = 0; +const Fl_Font FL_HELVETICA_BOLD = 1; +const Fl_Font FL_HELVETICA_ITALIC = 2; +const Fl_Font FL_HELVETICA_BOLD_ITALIC = 3; +const Fl_Font FL_COURIER = 4; +const Fl_Font FL_COURIER_BOLD = 5; +const Fl_Font FL_COURIER_ITALIC = 6; +const Fl_Font FL_COURIER_BOLD_ITALIC = 7; +const Fl_Font FL_TIMES = 8; +const Fl_Font FL_TIMES_BOLD = 9; +const Fl_Font FL_TIMES_ITALIC = 10; +const Fl_Font FL_TIMES_BOLD_ITALIC = 11; +const Fl_Font FL_SYMBOL = 12; +const Fl_Font FL_SCREEN = 13; +const Fl_Font FL_SCREEN_BOLD = 14; +const Fl_Font FL_ZAPF_DINGBATS = 15; + +const Fl_Font FL_FREE_FONT = 16; // first one to allocate +const Fl_Font FL_BOLD = 1; // add this to helvetica, courier, or times +const Fl_Font FL_ITALIC = 2; // add this to helvetica, courier, or times + +extern FL_EXPORT Fl_Font_Size FL_NORMAL_SIZE; -extern FL_EXPORT int FL_NORMAL_SIZE; enum Fl_Color { // standard colors // These are used as default colors in widgets and altered as necessary diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index 663eca55e..2a31ef3be 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -53,7 +53,8 @@ class FL_EXPORT Fl_Browser_ : public Fl_Group { int offset_; // how far down top_ item the real_position is int max_width; // widest object seen so far uchar has_scrollbar_; // which scrollbars are enabled - uchar textfont_, textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; void* top_; // which item scrolling position is in void* selection_; // which is selected (except for FL_MULTI_BROWSER) @@ -131,10 +132,10 @@ public: BOTH_ALWAYS = 7 }; - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned n) {textcolor_ = n;} diff --git a/FL/Fl_Chart.H b/FL/Fl_Chart.H index d337d0d67..5246bb6ae 100644 --- a/FL/Fl_Chart.H +++ b/FL/Fl_Chart.H @@ -59,7 +59,8 @@ class FL_EXPORT Fl_Chart : public Fl_Widget { FL_CHART_ENTRY *entries; double min,max; uchar autosize_; - uchar textfont_,textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; protected: void draw(); @@ -76,10 +77,10 @@ public: void size(int W, int H) { Fl_Widget::size(W, H); } int maxsize() const {return maxnumb;} void maxsize(int); - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned n) {textcolor_ = n;} uchar autosize() const {return autosize_;} diff --git a/FL/Fl_Counter.H b/FL/Fl_Counter.H index 23f63661e..2c0781094 100644 --- a/FL/Fl_Counter.H +++ b/FL/Fl_Counter.H @@ -40,7 +40,8 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator { - uchar textfont_, textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; double lstep_; uchar mouseobj; @@ -60,10 +61,10 @@ public: void lstep(double a) {lstep_ = a;} void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;} void step(double a) {Fl_Valuator::step(a);} - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned s) {textcolor_ = s;} diff --git a/FL/Fl_File_Browser.H b/FL/Fl_File_Browser.H index 9dcf0a058..68ff3c4dc 100644 --- a/FL/Fl_File_Browser.H +++ b/FL/Fl_File_Browser.H @@ -67,8 +67,8 @@ public: int load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort); - uchar textsize() const { return (Fl_Browser::textsize()); }; - void textsize(uchar s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); }; + Fl_Font_Size textsize() const { return Fl_Browser::textsize(); }; + void textsize(Fl_Font_Size s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); }; int filetype() const { return (filetype_); }; void filetype(int t) { filetype_ = t; }; diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H index 8d52d4ea3..0659f55d0 100644 --- a/FL/Fl_File_Chooser.H +++ b/FL/Fl_File_Chooser.H @@ -150,10 +150,10 @@ public: int shown(); void textcolor(Fl_Color c); Fl_Color textcolor(); - void textfont(uchar f); - uchar textfont(); - void textsize(uchar s); - uchar textsize(); + void textfont(Fl_Font f); + Fl_Font textfont(); + void textsize(Fl_Font_Size s); + Fl_Font_Size textsize(); void type(int t); int type(); void * user_data() const; diff --git a/FL/Fl_Help_Dialog.H b/FL/Fl_Help_Dialog.H index 7bd84d58e..05de23d7a 100644 --- a/FL/Fl_Help_Dialog.H +++ b/FL/Fl_Help_Dialog.H @@ -74,8 +74,8 @@ public: void resize(int xx, int yy, int ww, int hh); void show(); void show(int argc, char **argv); - void textsize(uchar s); - uchar textsize(); + void textsize(Fl_Font_Size s); + Fl_Font_Size textsize(); void topline(const char *n); void topline(int n); void value(const char *f); diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index 5f4d9d3f9..9a07f0c72 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -103,8 +103,8 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget bgcolor_, // Background color textcolor_, // Text color linkcolor_; // Link color - uchar textfont_, // Default font for text - textsize_; // Default font size + Fl_Font textfont_; // Default font for text + Fl_Font_Size textsize_; // Default font size const char *value_; // HTML text value int nblocks_, // Number of blocks/paragraphs @@ -112,7 +112,8 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget Fl_Help_Block *blocks_; // Blocks int nfonts_; // Number of fonts in stack - uchar fonts_[100][2]; // Font stack + Fl_Font fonts_[100]; // Font stack + Fl_Font_Size font_sizes_[100]; // Font Size stack Fl_Help_Func *link_; // Link transform function @@ -164,15 +165,15 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget int get_length(const char *l); int handle(int); - void initfont(uchar &f, uchar &s) { nfonts_ = 0; - fl_font(f = fonts_[0][0] = textfont_, - s = fonts_[0][1] = textsize_); } - void pushfont(uchar f, uchar s) { if (nfonts_ < 99) nfonts_ ++; - fl_font(fonts_[nfonts_][0] = f, - fonts_[nfonts_][1] = s); } - void popfont(uchar &f, uchar &s) { if (nfonts_ > 0) nfonts_ --; - fl_font(f = fonts_[nfonts_][0], - s = fonts_[nfonts_][1]); } + void initfont(Fl_Font &f, Fl_Font_Size &s) { nfonts_ = 0; + fl_font(f = fonts_[0] = textfont_, + s = font_sizes_[0] = textsize_); } + void pushfont(Fl_Font f, Fl_Font_Size s) { if (nfonts_ < 99) nfonts_ ++; + fl_font(fonts_[nfonts_] = f, + font_sizes_[nfonts_] = s); } + void popfont(Fl_Font &f, Fl_Font_Size &s) { if (nfonts_ > 0) nfonts_ --; + fl_font(f = fonts_[nfonts_], + s = font_sizes_[nfonts_]); } void hv_draw(const char *t, int x, int y); char begin_selection(); @@ -198,10 +199,10 @@ public: void size(int W, int H) { Fl_Widget::size(W, H); } void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; } Fl_Color textcolor() const { return (defcolor_); } - void textfont(uchar f) { textfont_ = f; format(); } - uchar textfont() const { return (textfont_); } - void textsize(uchar s) { textsize_ = s; format(); } - uchar textsize() const { return (textsize_); } + void textfont(Fl_Font f) { textfont_ = f; format(); } + Fl_Font textfont() const { return (textfont_); } + void textsize(Fl_Font_Size s) { textsize_ = s; format(); } + Fl_Font_Size textsize() const { return (textsize_); } const char *title() { return (title_); } void topline(const char *n); void topline(int); diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H index 985d74f99..79038b277 100644 --- a/FL/Fl_Input_.H +++ b/FL/Fl_Input_.H @@ -61,8 +61,8 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget { int shortcut_; uchar erase_cursor_only; - uchar textfont_; - uchar textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; unsigned cursor_color_; @@ -123,10 +123,10 @@ public: int shortcut() const {return shortcut_;} void shortcut(int s) {shortcut_ = s;} - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned n) {textcolor_ = n;} Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;} diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index 3c2c22f96..ccb223fc1 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -166,16 +166,16 @@ public: void textcolor(Fl_Color c) { inp_->textcolor(c); } - uchar textfont() const { + Fl_Font textfont() const { return (inp_->textfont()); } - void textfont(uchar f) { + void textfont(Fl_Font f) { inp_->textfont(f); } - uchar textsize() const { + Fl_Font_Size textsize() const { return (inp_->textsize()); } - void textsize(uchar s) { + void textsize(Fl_Font_Size s) { inp_->textsize(s); } const char* value() const { diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index f404816f4..eeba5b1f2 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -42,8 +42,8 @@ protected: uchar alloc; uchar down_box_; - uchar textfont_; - uchar textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; public: @@ -80,10 +80,10 @@ public: const char *text() const {return value_ ? value_->text : 0;} const char *text(int i) const {return menu_[i].text;} - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar c) {textfont_=c;} - uchar textsize() const {return textsize_;} - void textsize(uchar c) {textsize_=c;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font c) {textfont_=c;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size c) {textsize_=c;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned c) {textcolor_=c;} diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index 2d7bc0ad9..f0d78096c 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -58,8 +58,8 @@ struct FL_EXPORT Fl_Menu_Item { void *user_data_; int flags; uchar labeltype_; - uchar labelfont_; - uchar labelsize_; + Fl_Font labelfont_; + Fl_Font_Size labelsize_; unsigned labelcolor_; // advance N items, skipping submenus: @@ -77,10 +77,10 @@ struct FL_EXPORT Fl_Menu_Item { void labeltype(Fl_Labeltype a) {labeltype_ = a;} Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;} void labelcolor(unsigned a) {labelcolor_ = a;} - Fl_Font labelfont() const {return (Fl_Font)labelfont_;} - void labelfont(uchar a) {labelfont_ = a;} - uchar labelsize() const {return labelsize_;} - void labelsize(uchar a) {labelsize_ = a;} + Fl_Font labelfont() const {return labelfont_;} + void labelfont(Fl_Font a) {labelfont_ = a;} + Fl_Font_Size labelsize() const {return labelsize_;} + void labelsize(Fl_Font_Size a) {labelsize_ = a;} Fl_Callback_p callback() const {return callback_;} void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;} void callback(Fl_Callback* c) {callback_=c;} diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index 9f76ad73e..0bdcb616a 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -192,16 +192,16 @@ class Fl_Spinner : public Fl_Group void textcolor(Fl_Color c) { input_.textcolor(c); } - uchar textfont() const { + Fl_Font textfont() const { return (input_.textfont()); } - void textfont(uchar f) { + void textfont(Fl_Font f) { input_.textfont(f); } - uchar textsize() const { + Fl_Font_Size textsize() const { return (input_.textsize()); } - void textsize(uchar s) { + void textsize(Fl_Font_Size s) { input_.textsize(s); } uchar type() const { return (input_.type()); } diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H index fa7f0d0c4..380e994e0 100644 --- a/FL/Fl_Text_Display.H +++ b/FL/Fl_Text_Display.H @@ -122,10 +122,10 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group { int shortcut() const {return shortcut_;} void shortcut(int s) {shortcut_ = s;} - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned n) {textcolor_ = n;} @@ -285,8 +285,8 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group { int shortcut_; - uchar textfont_; - uchar textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; // The following are not presently used from the original NEdit code, diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H index e9c363ccc..cd8f20886 100644 --- a/FL/Fl_Tooltip.H +++ b/FL/Fl_Tooltip.H @@ -46,10 +46,10 @@ public: static Fl_Widget* current() {return widget_;} static void current(Fl_Widget*); - static int font() { return font_; } - static int size() { return size_; } - static void font(int i) { font_ = i; } - static void size(int s) { size_ = s; } + static Fl_Font font() { return font_; } + static Fl_Font_Size size() { return size_; } + static void font(Fl_Font i) { font_ = i; } + static void size(Fl_Font_Size s) { size_ = s; } static void color(unsigned c) { color_ = c; } static Fl_Color color() { return (Fl_Color)color_; } static void textcolor(unsigned c) { textcolor_ = c; } @@ -65,8 +65,8 @@ private: static int enabled_; static unsigned color_; static unsigned textcolor_; - static int font_; - static int size_; + static Fl_Font font_; + static Fl_Font_Size size_; static Fl_Widget* widget_; }; diff --git a/FL/Fl_Value_Input.H b/FL/Fl_Value_Input.H index 3e0110040..550e318d9 100644 --- a/FL/Fl_Value_Input.H +++ b/FL/Fl_Value_Input.H @@ -51,9 +51,9 @@ public: void shortcut(int s) {input.shortcut(s);} Fl_Font textfont() const {return input.textfont();} - void textfont(uchar s) {input.textfont(s);} - uchar textsize() const {return input.textsize();} - void textsize(uchar s) {input.textsize(s);} + void textfont(Fl_Font s) {input.textfont(s);} + Fl_Font_Size textsize() const {return input.textsize();} + void textsize(Fl_Font_Size s) {input.textsize(s);} Fl_Color textcolor() const {return input.textcolor();} void textcolor(unsigned n) {input.textcolor(n);} Fl_Color cursor_color() const {return input.cursor_color();} diff --git a/FL/Fl_Value_Output.H b/FL/Fl_Value_Output.H index 866664be3..63db55564 100644 --- a/FL/Fl_Value_Output.H +++ b/FL/Fl_Value_Output.H @@ -33,7 +33,9 @@ #endif class FL_EXPORT Fl_Value_Output : public Fl_Valuator { - uchar textfont_, textsize_, soft_; + Fl_Font textfont_; + Fl_Font_Size textsize_; + uchar soft_; unsigned textcolor_; public: int handle(int); @@ -43,10 +45,10 @@ public: void soft(uchar s) {soft_ = s;} uchar soft() const {return soft_;} - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned s) {textcolor_ = s;} }; diff --git a/FL/Fl_Value_Slider.H b/FL/Fl_Value_Slider.H index 3b4d1b4c3..31bb749a7 100644 --- a/FL/Fl_Value_Slider.H +++ b/FL/Fl_Value_Slider.H @@ -31,16 +31,17 @@ #include "Fl_Slider.H" class FL_EXPORT Fl_Value_Slider : public Fl_Slider { - uchar textfont_, textsize_; + Fl_Font textfont_; + Fl_Font_Size textsize_; unsigned textcolor_; public: void draw(); int handle(int); Fl_Value_Slider(int x,int y,int w,int h, const char *l = 0); - Fl_Font textfont() const {return (Fl_Font)textfont_;} - void textfont(uchar s) {textfont_ = s;} - uchar textsize() const {return textsize_;} - void textsize(uchar s) {textsize_ = s;} + Fl_Font textfont() const {return textfont_;} + void textfont(Fl_Font s) {textfont_ = s;} + Fl_Font_Size textsize() const {return textsize_;} + void textsize(Fl_Font_Size s) {textsize_ = s;} Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(unsigned s) {textcolor_ = s;} }; diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index 0fee9f311..5df8d0e16 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -45,8 +45,8 @@ struct FL_EXPORT Fl_Label { Fl_Image* image; Fl_Image* deimage; uchar type; - uchar font; - uchar size; + Fl_Font font; + Fl_Font_Size size; unsigned color; void draw(int,int,int,int, Fl_Align) const ; void measure(int&, int&) const ; @@ -136,10 +136,10 @@ public: void labeltype(Fl_Labeltype a) {label_.type = a;} Fl_Color labelcolor() const {return (Fl_Color)label_.color;} void labelcolor(unsigned a) {label_.color=a;} - Fl_Font labelfont() const {return (Fl_Font)label_.font;} - void labelfont(uchar a) {label_.font=a;} - uchar labelsize() const {return label_.size;} - void labelsize(uchar a) {label_.size=a;} + Fl_Font labelfont() const {return label_.font;} + void labelfont(Fl_Font a) {label_.font=a;} + Fl_Font_Size labelsize() const {return label_.size;} + void labelsize(Fl_Font_Size a) {label_.size=a;} Fl_Image* image() {return label_.image;} void image(Fl_Image* a) {label_.image=a;} void image(Fl_Image& a) {label_.image=&a;} diff --git a/FL/fl_ask.H b/FL/fl_ask.H index 3ddc3d33a..7ce12409d 100644 --- a/FL/fl_ask.H +++ b/FL/fl_ask.H @@ -63,9 +63,9 @@ FL_EXPORT const char *fl_password(const char *label, const char *deflt = 0, ...) FL_EXPORT Fl_Widget *fl_message_icon(); extern FL_EXPORT Fl_Font fl_message_font_; -extern FL_EXPORT unsigned char fl_message_size_; -inline void fl_message_font(unsigned char f,unsigned char s) { - fl_message_font_ = (Fl_Font)f; fl_message_size_ = s;} +extern FL_EXPORT Fl_Font_Size fl_message_size_; +inline void fl_message_font(Fl_Font f, Fl_Font_Size s) { + fl_message_font_ = f; fl_message_size_ = s;} // pointers you can use to change FLTK to a foreign language: extern FL_EXPORT const char* fl_no; diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 509826ef4..99a3e984a 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -136,11 +136,11 @@ FL_EXPORT double fl_transform_dy(double x, double y); FL_EXPORT void fl_transformed_vertex(double x, double y); // current font: -FL_EXPORT void fl_font(int face, int size); -extern FL_EXPORT int fl_font_; -inline int fl_font() {return fl_font_;} -extern FL_EXPORT int fl_size_; -inline int fl_size() {return fl_size_;} +FL_EXPORT void fl_font(Fl_Font face, Fl_Font_Size size); +extern FL_EXPORT Fl_Font fl_font_; +inline Fl_Font fl_font() {return fl_font_;} +extern FL_EXPORT Fl_Font_Size fl_size_; +inline Fl_Font_Size fl_size() {return fl_size_;} // information you can get about the current font: FL_EXPORT int fl_height(); // using "size" should work ok diff --git a/FL/forms.H b/FL/forms.H index d82966e13..5c77363e4 100644 --- a/FL/forms.H +++ b/FL/forms.H @@ -209,7 +209,7 @@ inline void fl_reset_focus_object(Fl_Widget* o) {Fl::focus(o);} inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);} inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->labelsize(s);} inline void fl_set_object_lstyle(Fl_Widget* o,int a) { - o->labelfont((uchar)a); o->labeltype((Fl_Labeltype)(a>>8));} + o->labelfont((Fl_Font)a); o->labeltype((Fl_Labeltype)(a>>8));} inline void fl_set_object_lcol(Fl_Widget* o, unsigned a) {o->labelcolor(a);} #define fl_set_object_lcolor fl_set_object_lcol inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) {o->align(a);} |
