1
/*=========================================================================
3
Program: Ionization FRont Interactive Tool (IFRIT)
7
Copyright (c) 2002-2006 Nick Gnedin
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.
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.
26
=========================================================================*/
1
/*=========================================================================
3
Program: Ionization FRont Interactive Tool (IFRIT)
7
Copyright (c) 2002-2006 Nick Gnedin
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.
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.
26
=========================================================================*/
29
29
#include "iconfigure.h"
421
422
a = x/dx + attMin;
422
aMin = rc->GetMin(mCurRange);
423
aMax = rc->GetMax(mCurRange);
423
aMin = rc->GetStretchedMin(mCurRange);
424
aMax = rc->GetStretchedMax(mCurRange);
424
425
if(isMax) aMax = a; else aMin = a;
425
rc->SetRange(mCurRange,aMin,aMax);
426
rc->SetRange(mCurRange,rc->ResetStretch(aMin),rc->ResetStretch(aMax));
427
428
if(mCurRange != oldCurRange)
429
430
mParent->SetCurrentRange(mCurRange);
432
mSubject->RequestPainting(ibgWidgetDrawAreaSubject::_Foreground);
434
if(b == _MouseRightButton) this->OnRender(); else if(!mRenderButton->IsEnabled()) mRenderButton->Enable(true);
433
if(mExtra != 0) mExtra->DisplayNumbers(rc->ResetStretch(aMin),rc->ResetStretch(aMax));
435
mSubject->RequestPainting(DrawMode::Foreground);
439
if(b == MouseButton::RightButton) this->OnRender(); else if(!mRenderButton->IsEnabled()) mRenderButton->Enable(true);
438
443
void Area::OnRemoveRange()
440
445
mParent->OnRemoveRange();
441
mSubject->RequestPainting(ibgWidgetDrawAreaSubject::_Foreground);
446
mSubject->RequestPainting(DrawMode::Foreground);
442
447
if(!mRenderButton->IsEnabled()) mRenderButton->Enable(true);
445
450
void Area::OnReset()
447
452
mParent->OnReset();
448
mSubject->RequestPainting(ibgWidgetDrawAreaSubject::_Foreground);
453
mSubject->RequestPainting(DrawMode::Foreground);
449
454
if(!mRenderButton->IsEnabled()) mRenderButton->Enable(true);