Author: mordante
Date: Wed Oct 1 08:27:43 2008
New Revision: 29798
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29798&view=rev
Log:
Add a wrap paramater to the canvas.
This change is needed so the control can tell the text in the canvas
which wrapping method to use. Changes to the control will follow later.
Modified:
trunk/src/gui/widgets/canvas.cpp
Modified: trunk/src/gui/widgets/canvas.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/canvas.cpp?rev=29798&r1=29797&r2=29798&view=diff
==============================================================================
--- trunk/src/gui/widgets/canvas.cpp (original)
+++ trunk/src/gui/widgets/canvas.cpp Wed Oct 1 08:27:43 2008
@@ -127,6 +127,15 @@
* on the widget.
* text_maximum_height unsigned The maximum height available for the
text
* on the widget.
+ * text_wrap_mode int When the text doesn't fit in the
+ * available width there are serveral ways
+ * to fix that. This variable holds the
+ * best method. (NOTE this is a 'hidden'
+ * variable meant to copy state from a
+ * widget to its canvas so there's no
+ * reason to use this variable and thus
+ * it's values are not listed and might
+ * change without further notice.)
[EMAIL PROTECTED]
*
* Note when drawing the valid coordinates are:<br>
@@ -805,7 +814,12 @@
set_font_style(font_style_).
set_foreground_colour(colour_).
set_maximum_width(maximum_width_(variables)).
- set_maximum_height(maximum_height_(variables));
+ set_maximum_height(maximum_height_(variables)).
+ set_ellipse_mode(variables.has_key("text_wrap_mode")
+ ? static_cast<PangoEllipsizeMode>
+
(variables.query_value("text_wrap_mode").as_int())
+ : PANGO_ELLIPSIZE_END);
+
surface surf = text_renderer.render();
game_logic::map_formula_callable local_variables(variables);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits