diff -aur alterator-browser-qt-2.6/widgets.cc alterator-browser-qt-2.6.avm/widgets.cc --- alterator-browser-qt-2.6/widgets.cc 2006-02-22 18:49:23 +0300 +++ alterator-browser-qt-2.6.avm/widgets.cc 2006-03-08 19:17:54 +0300 @@ -293,12 +293,20 @@ void alListBox::registerEvent(const QString& name) { if ("on-select" == name) - connect(wnd_,SIGNAL( itemSelectionChanged() ),SLOT(onSelect())); + connect(wnd_,SIGNAL( currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*) ), + SLOT( onSelection(QTreeWidgetItem*,QTreeWidgetItem*) )); +} + +void alListBox::onSelection(QTreeWidgetItem* current, QTreeWidgetItem*) +{ + int newIndex = wnd_->indexOfTopLevelItem(current); + currentIndex = newIndex; + emitEvent(id_,"on-select"); } QString alListBox::postData() const { - return QString(" (current . ") + QString::number(wnd_->indexOfTopLevelItem(wnd_->currentItem())) +" )"; + return QString(" (current . ") + QString::number(currentIndex) +" )"; } void alComboBox::setAttr(const QString& name,const QString& value) diff -aur alterator-browser-qt-2.6/widgets.hh alterator-browser-qt-2.6.avm/widgets.hh --- alterator-browser-qt-2.6/widgets.hh 2006-02-22 18:34:11 +0300 +++ alterator-browser-qt-2.6.avm/widgets.hh 2006-03-08 19:13:50 +0300 @@ -211,9 +211,11 @@ class alListBox: public alWidgetPre { + Q_OBJECT + int currentIndex; public: alListBox(const QString& id,const QString& parent): - alWidgetPre(id,parent) + alWidgetPre(id,parent), currentIndex(0) { wnd_->setAlternatingRowColors(true); //setings to be compatible with QListView @@ -225,6 +227,8 @@ void setAttr(const QString& name,const QString& value); void registerEvent(const QString&); QString postData() const ; +public slots: + void onSelection(QTreeWidgetItem* current, QTreeWidgetItem*); }; class alComboBox: public alWidgetPre