@@ -101,6 +101,29 @@ void Screen::clear() {
101101 _label.empty ();
102102}
103103
104+ void Screen::drawLabel () {
105+ if (_label.length ()) {
106+ MAExtent screenSize = maGetScrSize ();
107+ int screenW = EXTENT_X (screenSize);
108+ int screenH = EXTENT_Y (screenSize);
109+ int w = _charWidth * (_label.length () + 2 );
110+ int h = _charHeight + 2 ;
111+ int top = screenH - h;
112+ int left = (screenW - w) / 2 ;
113+ int textY = top + ((h - _charHeight) / 2 );
114+
115+ maSetColor (0xbfbfbf );
116+ maFillRect (left, top, w, h);
117+ maSetColor (0xe5e5e5 );
118+ maLine (left, top, left + w, top);
119+ maSetColor (0x737373 );
120+ maLine (left, top + h - 1 , left + w, top + h - 1 );
121+ maLine (left + w, top + 1 , left + w, top + h - 1 );
122+ maSetColor (0x403c44 );
123+ maDrawText (left + _charWidth, textY, _label.c_str (), _label.length ());
124+ }
125+ }
126+
104127void Screen::drawShape (Shape *rect) {
105128 if (rect != NULL &&
106129 rect->_y >= _scrollY &&
@@ -164,27 +187,7 @@ void Screen::drawOverlay(bool vscroll) {
164187 }
165188 }
166189
167- // display the label
168- if (_label.length ()) {
169- MAExtent screenSize = maGetScrSize ();
170- int screenW = EXTENT_X (screenSize);
171- int screenH = EXTENT_Y (screenSize);
172- int w = _charWidth * (_label.length () + 2 );
173- int h = _charHeight + 2 ;
174- int top = screenH - h;
175- int left = (screenW - w) / 2 ;
176- int textY = top + ((h - _charHeight) / 2 );
177-
178- maSetColor (0xbfbfbf );
179- maFillRect (left, top, w, h);
180- maSetColor (0xe5e5e5 );
181- maLine (left, top, left + w, top);
182- maSetColor (0x737373 );
183- maLine (left, top + h - 1 , left + w, top + h - 1 );
184- maLine (left + w, top + 1 , left + w, top + h - 1 );
185- maSetColor (0x403c44 );
186- maDrawText (left + _charWidth, textY, _label.c_str (), _label.length ());
187- }
190+ drawLabel ();
188191}
189192
190193void Screen::drawInto (bool background) {
0 commit comments