~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to Nux/SpinBoxDouble.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-11-18 19:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101118191732-rn35790vekj6o4my
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 
12
 * License for more details.
 
13
 *
 
14
 * You should have received a copy of both the GNU Lesser General Public
 
15
 * License version 3 along with this program.  If not, see
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef SPINBOXDOUBLE_H
 
24
#define SPINBOXDOUBLE_H
 
25
 
 
26
#include "EditTextBox.h"
 
27
 
 
28
namespace nux
 
29
{
 
30
 
 
31
  class SpinBoxDouble: public SpinBox_Logic
 
32
  {
 
33
  public:
 
34
    SpinBoxDouble (double Value = 0, double Step = 1, double MinValue = 0, double MaxValue = 100);
 
35
    ~SpinBoxDouble();
 
36
 
 
37
    virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
 
38
    virtual void Draw (GraphicsEngine &GfxContext, bool force_draw);
 
39
    virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw);
 
40
    virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw);
 
41
 
 
42
    virtual void ImplementIncrementBtn();
 
43
    virtual void ImplementDecrementBtn();
 
44
    virtual void ImplementValidateEntry();
 
45
 
 
46
    void SetValue (double value);
 
47
    double GetValue() const;
 
48
    void SetStep (double i);
 
49
    double GetStep() const;
 
50
    double GetMinValue() const;
 
51
    double GetMaxValue() const;
 
52
    void SetRange (double MinValue, double Maxvalue);
 
53
 
 
54
    sigc::signal<void, SpinBoxDouble * > sigIncrement;
 
55
    sigc::signal<void, SpinBoxDouble * > sigDecrement;
 
56
    sigc::signal<void, SpinBoxDouble * > sigValueChanged;
 
57
    sigc::signal<void, double> sigValue;
 
58
 
 
59
  protected:
 
60
    void InitializeWidgets();
 
61
    void InitializeLayout();
 
62
    void DestroyLayout();
 
63
 
 
64
  private:
 
65
    HLayout    *m_hlayout;
 
66
    VLayout    *m_vlayout;
 
67
 
 
68
    DoubleValidator m_DoubleValidator;
 
69
    double m_Value;
 
70
    double m_Step;
 
71
  };
 
72
 
 
73
}
 
74
 
 
75
#endif // SPINBOXDOUBLE_H