2012-08-26 08:52:06 +00:00
|
|
|
#include "itemselection.hpp"
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
|
2013-04-10 18:46:21 +00:00
|
|
|
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter)
|
2012-08-26 08:52:06 +00:00
|
|
|
: ContainerBase(NULL)
|
2013-04-10 18:46:21 +00:00
|
|
|
, WindowModal("openmw_itemselection_dialog.layout")
|
2012-08-26 08:52:06 +00:00
|
|
|
{
|
|
|
|
mFilter = filter;
|
|
|
|
|
|
|
|
MyGUI::ScrollView* itemView;
|
|
|
|
MyGUI::Widget* containerWidget;
|
|
|
|
getWidget(containerWidget, "Items");
|
|
|
|
getWidget(itemView, "ItemView");
|
|
|
|
setWidgets(containerWidget, itemView);
|
|
|
|
|
|
|
|
MyGUI::TextBox* l;
|
|
|
|
getWidget(l, "Label");
|
|
|
|
l->setCaptionWithReplacing (label);
|
|
|
|
|
|
|
|
MyGUI::Button* cancelButton;
|
|
|
|
getWidget(cancelButton, "CancelButton");
|
|
|
|
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ItemSelectionDialog::onCancelButtonClicked);
|
|
|
|
|
|
|
|
center();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ItemSelectionDialog::onSelectedItemImpl(MWWorld::Ptr item)
|
|
|
|
{
|
|
|
|
eventItemSelected(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ItemSelectionDialog::onCancelButtonClicked(MyGUI::Widget* sender)
|
|
|
|
{
|
|
|
|
eventDialogCanceled();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|