2
* Copyright 2010 Inalogic Inc.
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.
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.
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/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
23
#ifndef SPINBOX_LOGIC_H
24
#define SPINBOX_LOGIC_H
26
#include "EditTextBox.h"
32
class SpinBox_Logic: public View
35
SpinBox_Logic (NUX_FILE_LINE_PROTO);
36
virtual ~SpinBox_Logic();
38
virtual long ProcessEvent (IEvent &ievent, long TraverseInfo, long ProcessEventInfo) = 0;
39
virtual void Draw (GraphicsEngine &GfxContext, bool force_draw) = 0;
40
virtual void DrawContent (GraphicsEngine &GfxContext, bool force_draw) = 0;
41
virtual void PostDraw (GraphicsEngine &GfxContext, bool force_draw) = 0;
44
void RecvMouseMove (int x, int y, unsigned long button_flags, unsigned long key_flags);
45
void RecvIncrement (int x, int y, unsigned long button_flags, unsigned long key_flags);
46
void RecvDecrement (int x, int y, unsigned long button_flags, unsigned long key_flags);
47
void TimerSpinUpBtn (void *v);
48
void TimerSpinDownBtn (void *v);
49
void RecvMouseDrag (int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
50
void RecvMouseEnter (int x, int y, unsigned long button_flags, unsigned long key_flags);
51
void RecvMouseLeave (int x, int y, unsigned long button_flags, unsigned long key_flags);
53
The spinner buttons need to be redrawn when they are released.
54
Their color may have changed when the mouse down was initiated.
55
This receiver is going to initiate the redraw of the whole SpinBox_Logic.
57
void RecvSpinnerMouseUp (int x, int y, unsigned long button_flags, unsigned long key_flags);
58
void RecvStartKeyboardFocus (EditTextBox *textbox);
59
void RecvEndKeyboardFocus (EditTextBox *textbox);
60
void RecvEscapeKeyboardFocus (EditTextBox *textbox);
61
void RecvEditChange (EditTextBox *textbox);
62
void RecvValidateEntry (EditTextBox *textbox);
64
virtual void ImplementIncrementBtn() = 0;
65
virtual void ImplementDecrementBtn() = 0;
66
virtual void ImplementValidateEntry() = 0;
70
sigc::signal<void> sigClick;
71
sigc::signal<void> sigIncrement;
72
sigc::signal<void> sigDecrement;
73
sigc::signal<void> sigValueChanged;
74
sigc::signal<void, int> sigIntValueChanged;
77
void InitializeWidgets();
78
void InitializeLayout();
82
EditTextBox *m_EditLine;
83
CoreArea *m_SpinnerUpBtn;
84
CoreArea *m_SpinnerDownBtn;
86
TimerFunctor *m_UpTimerCallback;
87
TimerFunctor *m_DownTimerCallback;
88
TimerHandle m_UpTimerHandler;
89
TimerHandle m_DownTimerHandler;
94
#endif // SPINBOX_LOGIC_H