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

« back to all changes in this revision

Viewing changes to Demos/Demo_Gui/ColourWindowCellView.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           01/2009
5
 
*/
6
 
#include "Precompiled.h"
7
 
#include "ColourWindowCellView.h"
8
 
 
9
 
namespace demo
10
 
{
11
 
 
12
 
        void ColourWindowCellView::getCellDimension(MyGUI::Widget* _sender, MyGUI::IntCoord& _coord, bool _drop)
13
 
        {
14
 
                _coord.set(0, 0, _sender->getClientCoord().width, 20);
15
 
        }
16
 
 
17
 
        ColourWindowCellView::ColourWindowCellView(MyGUI::Widget* _parent) :
18
 
                wraps::BaseCellView<ColourWindowCellData*>("ColourWindowCellView.layout", _parent)
19
 
        {
20
 
                mMainWidget->setCoord(0, 0, _parent->getWidth(), _parent->getHeight());
21
 
                mMainWidget->setAlign(MyGUI::Align::Stretch);
22
 
 
23
 
                assignWidget(mText, "Text");
24
 
                assignWidget(mColour, "Colour");
25
 
        }
26
 
 
27
 
        void ColourWindowCellView::update(const MyGUI::IBDrawItemInfo& _info, ColourWindowCellData* _data)
28
 
        {
29
 
                if (_info.update)
30
 
                {
31
 
                        mText->setCaption(_data->getName());
32
 
                        mColour->setColour(_data->getColour());
33
 
                }
34
 
 
35
 
                if (_info.active)
36
 
                {
37
 
                        mText->setTextColour(MyGUI::Colour::White);
38
 
                }
39
 
                else
40
 
                {
41
 
                        mText->setTextColour(MyGUI::Colour::Black);
42
 
                }
43
 
 
44
 
                if (_info.select)
45
 
                {
46
 
                        mColour->setVisible(true);
47
 
                }
48
 
                else
49
 
                {
50
 
                        mColour->setVisible(false);
51
 
                }
52
 
        }
53
 
 
54
 
} // namespace demo
 
1
/*!
 
2
        @file
 
3
        @author         Albert Semenov
 
4
        @date           01/2009
 
5
*/
 
6
#include "Precompiled.h"
 
7
#include "ColourWindowCellView.h"
 
8
 
 
9
namespace demo
 
10
{
 
11
 
 
12
        void ColourWindowCellView::getCellDimension(MyGUI::Widget* _sender, MyGUI::IntCoord& _coord, bool _drop)
 
13
        {
 
14
                _coord.set(0, 0, _sender->getClientCoord().width, 20);
 
15
        }
 
16
 
 
17
        ColourWindowCellView::ColourWindowCellView(MyGUI::Widget* _parent) :
 
18
                wraps::BaseCellView<ColourWindowCellData*>("ColourWindowCellView.layout", _parent)
 
19
        {
 
20
                mMainWidget->setCoord(0, 0, _parent->getWidth(), _parent->getHeight());
 
21
                mMainWidget->setAlign(MyGUI::Align::Stretch);
 
22
 
 
23
                assignWidget(mText, "Text");
 
24
                assignWidget(mColour, "Colour");
 
25
        }
 
26
 
 
27
        void ColourWindowCellView::update(const MyGUI::IBDrawItemInfo& _info, ColourWindowCellData* _data)
 
28
        {
 
29
                if (_info.update)
 
30
                {
 
31
                        mText->setCaption(_data->getName());
 
32
                        mColour->setColour(_data->getColour());
 
33
                }
 
34
 
 
35
                if (_info.active)
 
36
                {
 
37
                        mText->setTextColour(MyGUI::Colour::White);
 
38
                }
 
39
                else
 
40
                {
 
41
                        mText->setTextColour(MyGUI::Colour::Black);
 
42
                }
 
43
 
 
44
                if (_info.select)
 
45
                {
 
46
                        mColour->setVisible(true);
 
47
                }
 
48
                else
 
49
                {
 
50
                        mColour->setVisible(false);
 
51
                }
 
52
        }
 
53
 
 
54
} // namespace demo