|
|
@ -52,7 +52,7 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
|
|
void ContainerWindow::onItemSelected(int index)
|
|
|
|
void ContainerWindow::onItemSelected(int index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mDragAndDrop->mIsOnDragAndDrop && mModel)
|
|
|
|
if (mDragAndDrop->mIsOnDragAndDrop)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
dropItem();
|
|
|
|
dropItem();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -82,12 +82,15 @@ namespace MWGui
|
|
|
|
dialog->eventOkClicked.clear();
|
|
|
|
dialog->eventOkClicked.clear();
|
|
|
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem);
|
|
|
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mModel)
|
|
|
|
else
|
|
|
|
dragItem (NULL, count);
|
|
|
|
dragItem (NULL, count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ContainerWindow::dragItem(MyGUI::Widget* sender, int count)
|
|
|
|
void ContainerWindow::dragItem(MyGUI::Widget* sender, int count)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!mModel)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (!onTakeItem(mModel->getItem(mSelectedItem), count))
|
|
|
|
if (!onTakeItem(mModel->getItem(mSelectedItem), count))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -96,6 +99,9 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
|
|
void ContainerWindow::dropItem()
|
|
|
|
void ContainerWindow::dropItem()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!mModel)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
bool success = mModel->onDropItem(mDragAndDrop->mItem.mBase, mDragAndDrop->mDraggedCount);
|
|
|
|
bool success = mModel->onDropItem(mDragAndDrop->mItem.mBase, mDragAndDrop->mDraggedCount);
|
|
|
|
|
|
|
|
|
|
|
|
if (success)
|
|
|
|
if (success)
|
|
|
@ -104,7 +110,7 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
|
|
void ContainerWindow::onBackgroundSelected()
|
|
|
|
void ContainerWindow::onBackgroundSelected()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mDragAndDrop->mIsOnDragAndDrop && mModel)
|
|
|
|
if (mDragAndDrop->mIsOnDragAndDrop)
|
|
|
|
dropItem();
|
|
|
|
dropItem();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|