Alvin wrote:

> imacarthur wrote:
> 
>> Alvin,
>> 
>> That looks nice, and works OK on this mac. Code is pretty compact too!
>> 
>> Also - I meant to post before, about your image_label demo; that also
>> seems to work well on this mac, but the right hand image box claims
>> to have an attribute set as "ALIGN_TEXT_OVER_IMAGE" but what I
>> actually see is the image over the text. Is this expected?
>> 
>> Cheers,
> 
> I tried that image_label demo on another openSUSE machine and I think I
> know what you are talking about. Are you seeing Tux on the right-handside
> and the text on the left, but centred. Also, the last
> line, "FL_IMAGE_TEXT_OVER_IMAGE", is cut off at the left and appears to be
> behind Tux?
> 

Ugh, sent message before I was done.

The FL_ALIGN_TEXT_OVER_IMAGE flag normally means that the text is written
above the image. Instead of creating a new flag (e.g. or something like
that), I reused the FL_ALIGN_TEXT_OVER_IMAGE. Since, with FL_NORMAL_LABEL,
the FL_ALIGN_TEXT_OVER_IMAGE changes the order of the image and text, I
figured it would make sense that that flag would change the order of the
inlined image and text. So, in the case of FL_NORMAL_IMAGE_LABEL,
FL_ALIGN_TEXT_OVER_IMAGE indicates that the image should be to the right of
the text, instead of to the left.

As for the text appearing behind Tux (or Tux drawn over the text), what
happened is that the area for rendering the text is the blank area to the
left of Tux (for ~FL_ALIGN_TEXT_OVER_IMAGE, the area to the right of the
image). However, since the as line is really one long word, the
FL_ALIGN_WRAP does not apply. This is a case where FL_ALIGN_HYPHENATE would
be useful.

Here's some poor ascii art displaying the areas:

By default (align(Fl_Align) not called):

Image is on the left and centred vertically.
All the FL_ALIGN_ enums (excl.FL_ALIGN_TEXT_OVER_IMAGE) apply to the TEXT
only. IMAGE will always be on the left

+-------------------+
|           *       |
| ********* *       |
| * IMAGE * *  TEXT |
| ********* *       |
|           *       |
+-------------------+


With FL_ALIGN_TEXT_OVER_IMAGE set:

Image is on the right and centred vertically.
All the FL_ALIGN_ enums (excl.FL_ALIGN_TEXT_OVER_IMAGE) apply to the TEXT
only. IMAGE will always be on the right.

+-------------------+
|       *           |
|       * ********* |
|  TEXT * * IMAGE * |
|       * ********* |
|       *           |
+-------------------+

When the text is drawn, it's drawn within the bounding box defined by the
TEXT area.

Also, fl_inline_image_measure() returns the width and height for the
bounding box that surrounds the TEXT and IMAGE areas.

Does that make sense? 

-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to