~ubuntu-branches/ubuntu/vivid/mygui/vivid

« back to all changes in this revision

Viewing changes to Tools/EditorFramework/Dialog.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard, Bret Curtis, Scott Howard
  • Date: 2014-09-18 17:57:48 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140918175748-dd8va78mvpw1jbes
Tags: 3.2.1-1
[ Bret Curtis ]
* Updated license for majority of files from LGPL to Expat (MIT)

[ Scott Howard ]
* New upstream release
* Updated patch to add build option for system GLEW libraries
* All patches accepted upstream except shared_libraries.patch
* Bumped SONAME due to dropped symbols, updated *.symbols and package
  names
* Updated license of debian/* to Expat with permission of all authors
* Don't install Doxygen autogenerated md5 and map files (thanks
  lintian)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
        @file
 
3
        @author         Albert Semenov
 
4
        @date           08/2008
 
5
*/
 
6
 
 
7
#include "Precompiled.h"
 
8
#include "Dialog.h"
 
9
#include "DialogManager.h"
 
10
 
 
11
namespace tools
 
12
{
 
13
 
 
14
        Dialog::Dialog() :
 
15
                mModal(false),
 
16
                mRootWidget(nullptr)
 
17
        {
 
18
        }
 
19
 
 
20
        Dialog::~Dialog()
 
21
        {
 
22
        }
 
23
 
 
24
        void Dialog::doModal()
 
25
        {
 
26
                MYGUI_ASSERT(mModal != true, "Already modal mode");
 
27
                mModal = true;
 
28
 
 
29
                MyGUI::InputManager::getInstance().addWidgetModal(mRootWidget);
 
30
                MyGUI::LayerManager::getInstance().upLayerItem(mRootWidget);
 
31
 
 
32
                onDoModal();
 
33
 
 
34
                mRootWidget->setVisible(true);
 
35
 
 
36
                DialogManager::getInstance()._addDialog(this);
 
37
        }
 
38
 
 
39
        void Dialog::endModal()
 
40
        {
 
41
                MYGUI_ASSERT(mModal != false, "Already modal mode");
 
42
                mModal = false;
 
43
 
 
44
                mRootWidget->setVisible(false);
 
45
 
 
46
                MyGUI::InputManager::getInstance().removeWidgetModal(mRootWidget);
 
47
                DialogManager::getInstance()._removeDialog(this);
 
48
 
 
49
                onEndModal();
 
50
        }
 
51
 
 
52
        void Dialog::setDialogRoot(MyGUI::Widget* _root)
 
53
        {
 
54
                mRootWidget = _root;
 
55
        }
 
56
 
 
57
        bool Dialog::isDialogModal()
 
58
        {
 
59
                return mModal;
 
60
        }
 
61
 
 
62
}