forked from eu07/maszyna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton.h
61 lines (56 loc) · 1.35 KB
/
Button.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#ifndef ButtonH
#define ButtonH
#include "Model3d.h"
#include "QueryParserComp.hpp"
class TButton
{ // animacja dwustanowa, w³¹cza jeden z dwóch submodeli (jednego z nich mo¿e nie byæ)
private:
TSubModel *pModelOn, *pModelOff; // submodel dla stanu za³¹czonego i wy³¹czonego
bool bOn;
int iFeedbackBit; // Ra: bit informacji zwrotnej, do wyprowadzenia na pulpit
void Update();
public:
TButton();
~TButton();
void Clear(int i = -1);
inline void FeedbackBitSet(int i)
{
iFeedbackBit = 1 << i;
};
inline void Turn(bool to)
{
bOn = to;
Update();
};
inline void TurnOn()
{
bOn = true;
Update();
};
inline void TurnOff()
{
bOn = false;
Update();
};
inline void Switch()
{
bOn = !bOn;
Update();
};
inline bool Active()
{
return (pModelOn) || (pModelOff);
};
void Init(AnsiString asName, TModel3d *pModel, bool bNewOn = false);
void Load(TQueryParserComp *Parser, TModel3d *pModel1, TModel3d *pModel2 = NULL);
};
//---------------------------------------------------------------------------
#endif