~ubuntu-branches/ubuntu/wily/ifrit/wily

« back to all changes in this revision

Viewing changes to shells/base/ibgwidgetareasubject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2009-09-13 14:53:24 UTC
  • mfrom: (1.1.11 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090913145324-084ivqvf29arkc1b
Tags: 3.3.2-1
* New upstream release.
* Bump Standards-Version to 3.8.3.  No changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*=========================================================================
2
 
 
3
 
  Program:   Ionization FRont Interactive Tool (IFRIT)
4
 
  Language:  C++
5
 
 
6
 
 
7
 
Copyright (c) 2002-2006 Nick Gnedin 
8
 
All rights reserved.
9
 
 
10
 
This file may be distributed and/or modified under the terms of the
11
 
GNU General Public License version 2 as published by the Free Software
12
 
Foundation and appearing in the file LICENSE.GPL included in the
13
 
packaging of this file.
14
 
 
15
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
16
 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
 
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
19
 
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
 
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
 
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
 
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 
 
26
 
=========================================================================*/
 
1
/*=========================================================================
 
2
 
 
3
  Program:   Ionization FRont Interactive Tool (IFRIT)
 
4
  Language:  C++
 
5
 
 
6
 
 
7
Copyright (c) 2002-2006 Nick Gnedin 
 
8
All rights reserved.
 
9
 
 
10
This file may be distributed and/or modified under the terms of the
 
11
GNU General Public License version 2 as published by the Free Software
 
12
Foundation and appearing in the file LICENSE.GPL included in the
 
13
packaging of this file.
 
14
 
 
15
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 
16
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
17
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
18
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
 
19
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 
20
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
21
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
22
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 
23
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
24
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
25
 
 
26
=========================================================================*/
27
27
 
28
28
 
29
29
#include "iconfigure.h"
41
41
#include "iarraytemplate.h"
42
42
 
43
43
 
 
44
using namespace iParameter;
 
45
 
 
46
 
44
47
//
45
48
//  WidgetDisplayAreaSubject class
46
49
//
108
111
ibgWidgetDrawAreaSubject::ibgWidgetDrawAreaSubject(iggWidgetDrawArea *owner, bool interactive) : ibgWidgetSubject(owner)
109
112
{
110
113
        mBackgroundColor = iColor(255,255,255);
111
 
        mCurrentMode = mPaintMode = _Undefined;
 
114
        mCurrentMode = mPaintMode = DrawMode::All;
112
115
 
113
116
        mInPaint = false;
114
117
        mDrawOwner = owner;
143
146
}
144
147
 
145
148
 
146
 
void ibgWidgetDrawAreaSubject::RequestPainting(Mode pm)
 
149
void ibgWidgetDrawAreaSubject::RequestPainting(int pm)
147
150
{
148
 
        mPaintMode = pm;
149
 
        this->RequestPaintingBody();
 
151
        if(DrawMode::IsValid(pm))
 
152
        {
 
153
                mPaintMode = pm;
 
154
                this->RequestPaintingBody();
 
155
        }
150
156
}
151
157
 
152
158
 
155
161
        if(mInPaint) return;
156
162
        mInPaint = true;
157
163
 
158
 
        if(mPaintMode==_Undefined || mPaintMode==_Background)
 
164
        if(mPaintMode==DrawMode::All || mPaintMode==DrawMode::Background)
159
165
        {
160
 
                this->Begin(_Background,true);
 
166
                this->Begin(DrawMode::Background,true);
161
167
                mDrawOwner->DrawBackground();
162
168
                this->End();
163
169
        }
164
170
 
165
 
        if(mPaintMode==_Undefined || mPaintMode==_Foreground)
 
171
        if(mPaintMode==DrawMode::All || mPaintMode==DrawMode::Foreground)
166
172
        {
167
 
                this->Begin(_Foreground,false);
 
173
                this->Begin(DrawMode::Foreground,false);
168
174
                mDrawOwner->DrawForeground();
169
175
                this->End();
170
176
        }