diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2010-04-07 23:17:33 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2010-04-07 23:17:33 +0000 |
| commit | f899c3897d62bd4f3c2d3bcaaf1ac5447ca8d158 (patch) | |
| tree | 98d2c3bbfabae8ba92f3f31c825b4de700b391a1 /src/Fl_Group.cxx | |
| parent | 0fe65e94c98cee0baf9df8d60bef0137f42fdb92 (diff) | |
Added new flags for label alignment: FL_LEFT_TOP, FL_RIGHT_TOP, FL_LEFT_BOTTOM, and FL_RIGHT_BOTTOM align outside labels first to the side, then to the top or botton, filling a gap in possible alignment. Also FL_ALIGN_TEXT_NEXT_TO_IMAGE and FL_ALIGN_IMAGE_NEXT_TO_TEXT which do just that, and finally FL_ALIGN_IMAGE_BACKDROP which renders the image in the background and draws the label on top.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7469 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Group.cxx')
| -rw-r--r-- | src/Fl_Group.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx index a5ca1739b..8f02fcf46 100644 --- a/src/Fl_Group.cxx +++ b/src/Fl_Group.cxx @@ -745,7 +745,23 @@ void Fl_Group::draw_outside_label(const Fl_Widget& widget) const { int Y = widget.y(); int W = widget.w(); int H = widget.h(); - if (a & FL_ALIGN_TOP) { + if ( (a & 0x0f) == FL_ALIGN_LEFT_TOP ) { + a = (a &~0x0f ) | FL_ALIGN_TOP_RIGHT; + X = x(); + W = widget.x()-X-3; + } else if ( (a & 0x0f) == FL_ALIGN_LEFT_BOTTOM ) { + a = (a &~0x0f ) | FL_ALIGN_BOTTOM_RIGHT; + X = x(); + W = widget.x()-X-3; + } else if ( (a & 0x0f) == FL_ALIGN_RIGHT_TOP ) { + a = (a &~0x0f ) | FL_ALIGN_TOP_LEFT; + X = X+W+3; + W = x()+this->w()-X; + } else if ( (a & 0x0f) == FL_ALIGN_RIGHT_BOTTOM ) { + a = (a &~0x0f ) | FL_ALIGN_BOTTOM_LEFT; + X = X+W+3; + W = x()+this->w()-X; + } else if (a & FL_ALIGN_TOP) { a ^= (FL_ALIGN_BOTTOM|FL_ALIGN_TOP); Y = y(); H = widget.y()-Y; |
