forked from ja7ude/MMANA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComLib2.cpp
52 lines (46 loc) · 1.06 KB
/
ComLib2.cpp
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
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "ComLib2.h"
//---------------------------------------------------------------------------
///----------------------------------------------------------------
/// CAidSpinƒNƒ‰ƒX
void CAidSpin::SetControl(TUpDown *pS, TControl *pC, double val, double min, double max, double dw)
{
pSpin->Associate = pCtrl;
pSpin = pS;
pCtrl = pC;
Val = val;
Min = min;
Max = max;
DW = dw;
pSpin->Associate = NULL;
}
void CAidSpin::Init(void)
{
pSpin->Position = 50;
pCtrl->Text = StrDbl(Val);
}
void CAidSpin::OnClick(TUDBtnType Button)
{
double d = Min;
if( Calc(d, pCtrl->Text.c_str()) != TRUE ){
d = Min;
}
if( d < Min ) d = Min;
if( d > Max ) d = Max;
if( Button == btNext ){
d += DW;
}
else if( Button == btPrev ){
d -= DW;
}
if( d < Min ) d = Min;
if( d > Max ) d = Max;
pCtrl->Text = StrDbl(d);
}
void CAidSpin::OnChanging(void)
{
pSpin->Position = 50;
}
//---------------------------------------------------------------------------