~macslow/nux/nux.fix-839476

« back to all changes in this revision

Viewing changes to Nux/SpinBox.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 22:11:16 UTC
  • Revision ID: neil.patel@canonical.com-20100901221116-4hb351fcg6s5nka0
Initial Nux integration

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 SPINBOX_H
 
24
#define SPINBOX_H
 
25
 
 
26
#include "IntegerValidator.h"
 
27
#include "SpinBox_Logic.h"
 
28
 
 
29
NAMESPACE_BEGIN_GUI
 
30
 
 
31
class SpinBox: public SpinBox_Logic
 
32
{
 
33
public:
 
34
    SpinBox(int Value = 0, int Step = 1, int MinValue = 0, int MaxValue = 100);
 
35
    ~SpinBox();
 
36
 
 
37
    virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
 
38
    virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
 
39
    virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
 
40
    virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
 
41
 
 
42
    virtual void ImplementIncrementBtn();
 
43
    virtual void ImplementDecrementBtn();
 
44
    virtual void ImplementValidateEntry();
 
45
 
 
46
    void SetValue(int value);
 
47
    int GetValue() const;
 
48
    void SetStep(int i);
 
49
    int GetStep() const;
 
50
    int GetMinValue() const;
 
51
    int GetMaxValue() const;
 
52
    void SetRange(int MinValue, int Maxvalue);
 
53
 
 
54
    sigc::signal<void, const weaksmptr(SpinBox) > sigIncrement;
 
55
    sigc::signal<void, const weaksmptr(SpinBox) > sigDecrement;
 
56
    sigc::signal<void, const weaksmptr(SpinBox) > sigValueChanged;
 
57
    sigc::signal<void, int> sigValue;
 
58
 
 
59
protected:
 
60
    void InitializeWidgets();
 
61
    void InitializeLayout();
 
62
    void DestroyLayout();
 
63
 
 
64
private:
 
65
    smptr(HLayout) hlayout;
 
66
    smptr(VLayout) vlayout;
 
67
 
 
68
    IntegerValidator m_IntValidator;
 
69
    int m_iValue;
 
70
    int m_Step;
 
71
};
 
72
 
 
73
NAMESPACE_END_GUI
 
74
 
 
75
#endif // SPINBOX_H