~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to libs/libmythui/mythuispinbox.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2009-09-29 01:33:23 UTC
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: james.westby@ubuntu.com-20090929013323-e6d2b5bzpg4t3t3x
Tags: upstream-0.22.0~trunk22101
ImportĀ upstreamĀ versionĀ 0.22.0~trunk22101

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#include <QCoreApplication>
7
7
 
8
8
MythUISpinBox::MythUISpinBox(MythUIType *parent, const QString &name)
9
 
              : MythUIButtonList(parent, name), m_hasTemplate(false)
 
9
              : MythUIButtonList(parent, name), m_hasTemplate(false),
 
10
                m_moveAmount(0)
10
11
{
11
12
}
12
13
 
14
15
{
15
16
}
16
17
 
17
 
void MythUISpinBox::SetRange(int low, int high, int step)
 
18
void MythUISpinBox::SetRange(int low, int high, int step, uint pageMultiple)
18
19
{
19
20
    if ((high == low) || step == 0)
20
21
        return;
21
22
 
 
23
    m_moveAmount = pageMultiple;
 
24
    
22
25
    bool reverse = false;
23
26
    int value = low;
24
27
    
79
82
    return true;
80
83
}
81
84
 
 
85
bool MythUISpinBox::MoveDown(MovementUnit unit, uint amount)
 
86
{
 
87
    bool handled = false;
 
88
    if ((unit == MovePage) && m_moveAmount)
 
89
        handled = MythUIButtonList::MoveDown(MoveByAmount, m_moveAmount);
 
90
    else
 
91
        handled = MythUIButtonList::MoveDown(unit, amount);
 
92
 
 
93
    return handled;
 
94
}
 
95
 
 
96
bool MythUISpinBox::MoveUp(MovementUnit unit, uint amount)
 
97
{
 
98
    bool handled = false;
 
99
    if ((unit == MovePage) && m_moveAmount)
 
100
        handled = MythUIButtonList::MoveUp(MoveByAmount, m_moveAmount);
 
101
    else
 
102
        handled = MythUIButtonList::MoveUp(unit, amount);
 
103
 
 
104
    return handled;
 
105
}
 
106
 
82
107
void MythUISpinBox::CreateCopy(MythUIType *parent)
83
108
{
84
109
    MythUISpinBox *spinbox = new MythUISpinBox(parent, objectName());