Ticket #3903: libmyth-widgetproperties-30082007.diff

File libmyth-widgetproperties-30082007.diff, 2.1 KB (added by Matthew Wire <devel@…>, 14 years ago)
  • libs/libmyth/settings.h

     
    401401    void setSelectionMode(MythListBox::SelectionMode mode);
    402402    void setCurrentItem(int i) { if (widget) widget->setCurrentItem(i); }
    403403    void setCurrentItem(const QString& str)  { if (widget) widget->setCurrentItem(str); }
     404    int currentItem() { if (widget) return widget->currentItem();
     405                            else return -1; }
    404406
    405407    virtual void setEnabled(bool b);
    406408
     
    481483    virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent,
    482484                                  const char* widgetName = 0);
    483485    virtual void setEnabled(bool b);
     486   
     487    bool isChecked() { if (widget) return widget->isChecked();
     488                            else return false; }
    484489protected:
    485490    MythCheckBox *widget;
    486491};
     
    660665                       special_value_text), TransientStorage() { }
    661666};
    662667
     668class MPUBLIC TransListBoxSetting :
     669    public ListBoxSetting, public TransientStorage
     670{
     671  public:
     672    TransListBoxSetting() : ListBoxSetting(this), TransientStorage() { }
     673};
     674
    663675///////////////////////////////////////////////////////////////////////////////
    664676
    665677class MPUBLIC HostSlider : public SliderSetting, public HostDBStorage
  • libs/libmyth/mythwidgets.h

     
    321321    MythCheckBox(const QString &text, QWidget* parent = 0, const char* name = 0):
    322322        QCheckBox(text, parent, name) {};
    323323    void setHelpText(QString help) { helptext = help; }
     324    bool isChecked() { return QCheckBox::isChecked(); }
    324325
    325326  signals:
    326327    void changeHelpText(QString);
     
    375376    virtual void keyPressEvent(QKeyEvent* e);
    376377
    377378    void setHelpText(QString help) { helptext = help; }
     379   
     380    int currentItem() { return QListBox::currentItem(); }
    378381
    379382  protected:
    380383    void focusInEvent(QFocusEvent *e);