diff options
author | pixel <pixel> | 2005-12-01 13:48:12 +0000 |
---|---|---|
committer | pixel <pixel> | 2005-12-01 13:48:12 +0000 |
commit | 6f594ad00a07365eec68e16d338151dde23bb648 (patch) | |
tree | 07771966502e5b02c26f0f8414467d1dd78cd70b /lib/shape.cc | |
parent | c492bb95a2bb8f739b7c0a061090b9ad4549c975 (diff) |
Lots of fixes and adds in mogltk:
-) fixed a compilation bug in the engine.h file (widget cyclic dependancy)
-) fixed font system so to have unsigned chars instead of chars
-) updated the shaper system so to have different fonts to print
-) updated the widgets with:
-) new methods: center, set_viewport, delete_me
-) Label now has a font
-) MsgBox now has a font
-) InputText widget added
-) InputDialog message box added
-) fixed a bug in the engine causing unwanted mouse move events
-) fixed a bug in the various lists of widgets (.clear != .empty)
Diffstat (limited to 'lib/shape.cc')
-rw-r--r-- | lib/shape.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/shape.cc b/lib/shape.cc index a7ed137..7a3312a 100644 --- a/lib/shape.cc +++ b/lib/shape.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: shape.cc,v 1.19 2004-11-27 21:48:03 pixel Exp $ */ +/* $Id: shape.cc,v 1.20 2005-12-01 13:48:12 pixel Exp $ */ #include <math.h> #include <limits.h> @@ -831,30 +831,30 @@ void mogltk::shape::window(int x1, int y1, int x2, int y2, const String & title, LEAVE; } -void mogltk::shape::text(int x, int y, const String & text, ColorP textcolor, align_t align) { - int tsize = SystemFont->singletextsize(text); +void mogltk::shape::text(int x, int y, const String & text, ColorP textcolor, align_t align, mogltk::font * _font) { + int tsize = _font->singletextsize(text); switch (align) { case LEFT: - SystemFont->putcursor(x, y); + _font->putcursor(x, y); break; case CENTER: - SystemFont->putcursor(x - (tsize / 2), y); + _font->putcursor(x - (tsize / 2), y); break; case RIGHT: - SystemFont->putcursor(x - tsize, y); + _font->putcursor(x - tsize, y); break; } - SystemFont->setcolor(textcolor); - SystemFont->setshadow(0); - SystemFont->printf(text); + _font->setcolor(textcolor); + _font->setshadow(0); + _font->printf("%s", text.to_charp()); } void mogltk::shape::text3d(int x, int y, const String & atext, ColorP textcolor, ColorP shade1, ColorP shade2, - align_t align, bool bevel) { + align_t align, bool bevel, mogltk::font * _font) { ENTER; - SystemFont->setwspace(1); + _font->setwspace(1); if (!bevel) { text(x - 1, y - 1, atext, shade2, align); text(x + 1, y + 1, atext, shade1, align); @@ -863,7 +863,7 @@ void mogltk::shape::text3d(int x, int y, const String & atext, ColorP textcolor, text(x + 1, y + 1, atext, shade2, align); } text(x, y, atext, textcolor, align); - SystemFont->setwspace(0); + _font->setwspace(0); LEAVE; } |