mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Extended Fl_Widget::align_ flag from 8 bits to full (unsigned) size for
later extensions (currently all 8 bits are used). Moved the align_ flag to the internal Fl_Label struct (where it should be). There are no API changes, though. I also reordered a few other variables for better alignment, so that there is no size change of Fl_Widget on 32-bit platforms (currently 84 bytes on Windows/32-bit and probably all 32-bit platforms). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7013 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+7
-6
@@ -47,7 +47,6 @@ typedef void (Fl_Callback0)(Fl_Widget*);
|
|||||||
/** Callback type definition passing the widget and a long data value */
|
/** Callback type definition passing the widget and a long data value */
|
||||||
typedef void (Fl_Callback1)(Fl_Widget*, long);
|
typedef void (Fl_Callback1)(Fl_Widget*, long);
|
||||||
|
|
||||||
|
|
||||||
/** This struct stores all information for a text or mixed graphics label.
|
/** This struct stores all information for a text or mixed graphics label.
|
||||||
|
|
||||||
\todo For FLTK 1.3, the Fl_Label type will become a widget by itself. That way
|
\todo For FLTK 1.3, the Fl_Label type will become a widget by itself. That way
|
||||||
@@ -62,14 +61,17 @@ struct FL_EXPORT Fl_Label {
|
|||||||
Fl_Image* image;
|
Fl_Image* image;
|
||||||
/** optional image for a deactivated label */
|
/** optional image for a deactivated label */
|
||||||
Fl_Image* deimage;
|
Fl_Image* deimage;
|
||||||
/** type of label. \see Fl_Labeltype */
|
|
||||||
uchar type;
|
|
||||||
/** label font used in text */
|
/** label font used in text */
|
||||||
Fl_Font font;
|
Fl_Font font;
|
||||||
/** size of label font */
|
/** size of label font */
|
||||||
Fl_Fontsize size;
|
Fl_Fontsize size;
|
||||||
/** text color */
|
/** text color */
|
||||||
Fl_Color color;
|
Fl_Color color;
|
||||||
|
/** alignment of label */
|
||||||
|
Fl_Align align_;
|
||||||
|
/** type of label. \see Fl_Labeltype */
|
||||||
|
uchar type;
|
||||||
|
|
||||||
/** Draws the label aligned to the given box */
|
/** Draws the label aligned to the given box */
|
||||||
void draw(int,int,int,int, Fl_Align) const ;
|
void draw(int,int,int,int, Fl_Align) const ;
|
||||||
void measure(int &w, int &h) const ;
|
void measure(int &w, int &h) const ;
|
||||||
@@ -102,7 +104,6 @@ class FL_EXPORT Fl_Widget {
|
|||||||
uchar type_;
|
uchar type_;
|
||||||
uchar damage_;
|
uchar damage_;
|
||||||
uchar box_;
|
uchar box_;
|
||||||
Fl_Align align_:8;
|
|
||||||
uchar when_;
|
uchar when_;
|
||||||
|
|
||||||
const char *tooltip_;
|
const char *tooltip_;
|
||||||
@@ -329,7 +330,7 @@ public:
|
|||||||
Fl_Align is (typedef'd to be) "unsigned" (int), but Fl_Widget's
|
Fl_Align is (typedef'd to be) "unsigned" (int), but Fl_Widget's
|
||||||
"align_" member variable is a bit field of 8 bits only !
|
"align_" member variable is a bit field of 8 bits only !
|
||||||
*/
|
*/
|
||||||
Fl_Align align() const {return align_;}
|
Fl_Align align() const {return label_.align_;}
|
||||||
|
|
||||||
/** Sets the label alignment.
|
/** Sets the label alignment.
|
||||||
This controls how the label is displayed next to or inside the widget.
|
This controls how the label is displayed next to or inside the widget.
|
||||||
@@ -338,7 +339,7 @@ public:
|
|||||||
\param[in] alignment new label alignment
|
\param[in] alignment new label alignment
|
||||||
\see align(), Fl_Align
|
\see align(), Fl_Align
|
||||||
*/
|
*/
|
||||||
void align(Fl_Align alignment) {align_ = alignment;}
|
void align(Fl_Align alignment) {label_.align_ = alignment;}
|
||||||
|
|
||||||
/** Gets the box type of the widget.
|
/** Gets the box type of the widget.
|
||||||
\return the current box type
|
\return the current box type
|
||||||
|
|||||||
+1
-1
@@ -121,6 +121,7 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
|
|||||||
label_.font = FL_HELVETICA;
|
label_.font = FL_HELVETICA;
|
||||||
label_.size = FL_NORMAL_SIZE;
|
label_.size = FL_NORMAL_SIZE;
|
||||||
label_.color = FL_FOREGROUND_COLOR;
|
label_.color = FL_FOREGROUND_COLOR;
|
||||||
|
label_.align_ = FL_ALIGN_CENTER;
|
||||||
tooltip_ = 0;
|
tooltip_ = 0;
|
||||||
callback_ = default_callback;
|
callback_ = default_callback;
|
||||||
user_data_ = 0;
|
user_data_ = 0;
|
||||||
@@ -130,7 +131,6 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
|
|||||||
box_ = FL_NO_BOX;
|
box_ = FL_NO_BOX;
|
||||||
color_ = FL_GRAY;
|
color_ = FL_GRAY;
|
||||||
color2_ = FL_GRAY;
|
color2_ = FL_GRAY;
|
||||||
align_ = FL_ALIGN_CENTER;
|
|
||||||
when_ = FL_WHEN_RELEASE;
|
when_ = FL_WHEN_RELEASE;
|
||||||
|
|
||||||
parent_ = 0;
|
parent_ = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user