Logo Search packages:      
Sourcecode: ktechlab version File versions  Download package

Button * CIWidgetMgr::addButton ( const QString &  id,
const QRect &  pos,
const QString &  display,
bool  toggle = false 
) [inherited]

Essentially the same as addDisplayText, but displays a button with text on it. The virtual functions buttonPressed( const QString &id ) and buttonReleased( const QString &id ) are called as appropriate with button id

Definition at line 111 of file ciwidgetmgr.cpp.

References CNItem::updateAttachedPositioning(), and Button::widget().

Referenced by ECRotoSwitch::ECRotoSwitch().

{
      WidgetMap::iterator it;
      
      Button *button = new Button( id, p_cnItem, toggle, pos, p_canvas );
      (dynamic_cast<QButton*>(button->widget()))->setText(display);
      
      it = m_widgetMap.find(id);
      if ( it == m_widgetMap.end() )
      {
            m_widgetMap[id] = button;
      }
      else
      {
            kdWarning() << "CIWidgetMgr::addButton: Attempting to re-add button with same id as previous"<<endl;
            delete it.data();
            it.data() = button;
      }
      
      p_cnItem->updateAttachedPositioning();
      return button;
}


Generated by  Doxygen 1.6.0   Back to index