1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 03:54:40 +00:00
OpenMW/apps/openmw/mwgui/itemselection.cpp

40 lines
1.0 KiB
C++
Raw Normal View History

#include "itemselection.hpp"
namespace MWGui
{
ItemSelectionDialog::ItemSelectionDialog(const std::string &label, int filter)
: ContainerBase(NULL)
, WindowModal("openmw_itemselection_dialog.layout")
{
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();
}
}