changed buttons in AdvancedSearchItem

note bug #1223, though: current "minus" image is in fact an X
This commit is contained in:
fgerlits 2005-07-01 10:20:02 +00:00
parent 42fc60fa70
commit ba8ed9f566
9 changed files with 51 additions and 22 deletions

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.24 $ Version : $Revision: 1.25 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -92,7 +92,7 @@ class ZebraTreeView;
* </code></pre> * </code></pre>
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.24 $ * @version $Revision: 1.25 $
*/ */
class WidgetFactory : class WidgetFactory :
virtual public Configurable virtual public Configurable
@ -106,7 +106,7 @@ class WidgetFactory :
/** /**
* The types of available image buttons. * The types of available image buttons.
*/ */
typedef enum { deleteButton, plusButton, typedef enum { deleteButton, plusButton, minusButton,
smallPlayButton, smallPauseButton, smallStopButton, smallPlayButton, smallPauseButton, smallStopButton,
hugePlayButton, hugePlayButton,
cuePlayButton, cueStopButton, cuePlayButton, cueStopButton,

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.28 $ Version : $Revision: 1.29 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -116,6 +116,16 @@ static const std::string plusButtonPassiveName = "imageButton/plus.png";
*/ */
static const std::string plusButtonRollName = "imageButton/plusRoll.png"; static const std::string plusButtonRollName = "imageButton/plusRoll.png";
/**
* The name of the passive image for the minus button.
*/
static const std::string minusButtonPassiveName = "imageButton/minus.png";
/**
* The name of the rollover image for the minus button.
*/
static const std::string minusButtonRollName = "imageButton/minusRoll.png";
/** /**
* The name of the passive image for the small play button. * The name of the passive image for the small play button.
*/ */
@ -535,6 +545,11 @@ WidgetFactory :: createButton(ImageButtonType type) throw ()
rollImage = loadImage(plusButtonRollName); rollImage = loadImage(plusButtonRollName);
break; break;
case minusButton:
passiveImage = loadImage(minusButtonPassiveName);
rollImage = loadImage(minusButtonRollName);
break;
case smallPlayButton: case smallPlayButton:
passiveImage = loadImage(smallPlayButtonPassiveName); passiveImage = loadImage(smallPlayButtonPassiveName);
rollImage = loadImage(smallPlayButtonRollName); rollImage = loadImage(smallPlayButtonRollName);

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.3 $ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchEntry.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchEntry.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -70,7 +70,7 @@ AdvancedSearchEntry :: AdvancedSearchEntry(
getBundle() )); getBundle() ));
pack_start(*searchOptionsBox, Gtk::PACK_SHRINK, 5); pack_start(*searchOptionsBox, Gtk::PACK_SHRINK, 5);
searchOptionsBox->signal_add_new().connect(sigc::mem_fun(*this, searchOptionsBox->signalAddNew().connect(sigc::mem_fun(*this,
&AdvancedSearchEntry::onAddNewCondition )); &AdvancedSearchEntry::onAddNewCondition ));
} }
@ -87,8 +87,6 @@ AdvancedSearchEntry :: onAddNewCondition(void) throw ()
getBundle() )); getBundle() ));
pack_start(*searchOptionsBox, Gtk::PACK_SHRINK, 5); pack_start(*searchOptionsBox, Gtk::PACK_SHRINK, 5);
searchOptionsBox->signal_add_new().connect(sigc::mem_fun(*this,
&AdvancedSearchEntry::onAddNewCondition ));
searchOptionsBox->show_all_children(); searchOptionsBox->show_all_children();
searchOptionsBox->show(); searchOptionsBox->show();
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchItem.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchItem.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -88,14 +88,16 @@ AdvancedSearchItem :: AdvancedSearchItem(
valueEntry = Gtk::manage(wf->createEntryBin()); valueEntry = Gtk::manage(wf->createEntryBin());
pack_start(*valueEntry, Gtk::PACK_EXPAND_WIDGET, 5); pack_start(*valueEntry, Gtk::PACK_EXPAND_WIDGET, 5);
plusButton = Gtk::manage(wf->createButton(WidgetFactory::plusButton)); if (isFirst) {
pack_start(*plusButton, Gtk::PACK_SHRINK, 5); plusButton = Gtk::manage(wf->createButton(WidgetFactory::plusButton));
pack_start(*plusButton, Gtk::PACK_SHRINK, 5);
if (!isFirst) { plusButton->signal_clicked().connect(sigc::mem_fun(*this,
closeButton = Gtk::manage(wf->createButton(WidgetFactory::deleteButton)); &AdvancedSearchItem::onPlusButtonClicked ));
} else {
closeButton = Gtk::manage(wf->createButton(WidgetFactory::minusButton));
closeButton->signal_clicked().connect(sigc::mem_fun(*this, closeButton->signal_clicked().connect(sigc::mem_fun(*this,
&AdvancedSearchItem::destroy_ )); &AdvancedSearchItem::destroy_ ));
pack_start(*closeButton, Gtk::PACK_SHRINK, 5); pack_start(*closeButton, Gtk::PACK_SHRINK, 5);
} }
} }

View file

@ -22,7 +22,7 @@
Author : $Author: fgerlits $ Author : $Author: fgerlits $
Version : $Revision: 1.2 $ Version : $Revision: 1.3 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchItem.h,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/AdvancedSearchItem.h,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -73,7 +73,7 @@ using namespace LiveSupport::Widgets;
* A single search input field. * A single search input field.
* *
* @author $Author: fgerlits $ * @author $Author: fgerlits $
* @version $Revision: 1.2 $ * @version $Revision: 1.3 $
*/ */
class AdvancedSearchItem : public Gtk::HBox, class AdvancedSearchItem : public Gtk::HBox,
public LocalizedObject public LocalizedObject
@ -112,6 +112,20 @@ class AdvancedSearchItem : public Gtk::HBox,
*/ */
ImageButton * closeButton; ImageButton * closeButton;
/**
* A signal object emitted when the plus button is pressed.
*/
sigc::signal<void> signalAddNewObject;
/**
* Event handler for the Plus button getting clicked.
*/
void
onPlusButtonClicked() throw ()
{
signalAddNew().emit();
}
public: public:
@ -158,12 +172,12 @@ class AdvancedSearchItem : public Gtk::HBox,
/** /**
* The signal proxy for pressing the add new condition button. * The signal proxy for pressing the add new condition button.
* *
* @return the signal_activate() proxy of the Plus button. * @return a signal emitted when the Plus button is clicked.
*/ */
Glib::SignalProxy0<void> sigc::signal<void>
signal_add_new(void) throw () signalAddNew(void) throw ()
{ {
return plusButton->signal_clicked(); return signalAddNewObject;
} }
}; };

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB