Ejemplo n.º 1
0
 //---------------------------------------------------------------------
 //! @brief Set the text to display.
 //! @param[in] _path The text.
 //---------------------------------------------------------------------
 void Button::setText( std::string const& _text )
 {
     text__ = _text;
     if( button__ && _text.size() < width_str__.size() )
     {
         unsigned int spacer_length = ( width_str__.size() - _text.size() ) / 2;
         std::string spacer;
         for( unsigned int i = 1; i < spacer_length; ++i )
             spacer += " ";
         text_stored__ = "</5/B/U>|" + spacer + _text + spacer + "|";
         setCDKButtonMessage( button__
                            , const_cast< char* >( text_stored__.c_str() ) );
         refreshCDKScreen( cdk_screen__ );
     }
     if( label__ )
         label__->setText( _text );
 }
Ejemplo n.º 2
0
/*
 * This sets multiple attributes of the widget.
 */
void setCDKButton (CDKBUTTON *button, const char *mesg, boolean Box)
{
   setCDKButtonMessage (button, mesg);
   setCDKButtonBox (button, Box);
}