forked from n5ac/mmsstv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCtrBtn.cpp
123 lines (114 loc) · 4.55 KB
/
CtrBtn.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//Copyright+LGPL
//-----------------------------------------------------------------------------------------------------------------------------------------------
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
//-----------------------------------------------------------------------------------------------------------------------------------------------
// This file is part of MMSSTV.
// MMSSTV is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// MMSSTV is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public License along with MMTTY. If not, see
// <http://www.gnu.org/licenses/>.
//-----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "CtrBtn.h"
#include "Main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//TCtrBtnWnd *CtrBtnWnd;
//---------------------------------------------------------------------------
__fastcall TCtrBtnWnd::TCtrBtnWnd(TComponent* Owner)
: TForm(Owner)
{
Font->Name = sys.m_WinFontName;
Font->Charset = sys.m_WinFontCharset;
if( MsgEng ){
SBRXStop->Caption = "Stop RX";
SBLock->Caption = "Lock RX";
// SBSync->Caption = "ReSync";
SBHist->Caption = "CopyHist";
SBTX->Caption = "TX(F9)";
}
SBSync->Caption = Mmsstv->KRFS->Caption;
AlignView.EntryControl(SBRXStop, this, SBRXStop->Font);
AlignView.EntryControl(SBLock, this, SBLock->Font);
AlignView.EntryControl(SBSync, this, SBSync->Font);
AlignView.EntryControl(SBHist, this, SBHist->Font);
AlignView.EntryControl(SBTX, this, SBTX->Font);
SBTX->OnMouseDown = Mmsstv->SBTXMouseDown;
// Caption = "";
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::UpdateBtn(void)
{
if( Mmsstv->pDem->m_Sync ){
SBRXStop->Enabled = TRUE;
SBSync->Enabled = (SSTVSET.m_Mode != smAVT) ? TRUE : FALSE;
}
else {
SBRXStop->Enabled = (Mmsstv->pDem->m_SyncMode != -1) ? FALSE : TRUE;
SBSync->Enabled = FALSE;
SBRXStop->Down = SBRXStop->Enabled;
}
SBLock->Down = Mmsstv->SBLK->Down;
SBHist->Enabled = Mmsstv->SBWHist->Enabled && !Mmsstv->pDem->m_Sync;
SBTX->Down = Mmsstv->SBTX->Down;
if( sys.m_Repeater ) SBTX->Update();
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::SBRXStopClick(TObject *Sender)
{
Mmsstv->RxAutoPush(TRUE);
UpdateBtn();
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::SBHistClick(TObject *Sender)
{
Mmsstv->SBWHistClick(NULL);
if( Mmsstv->pSound->m_Tx && !Mmsstv->SBTune->Down && Mmsstv->SBUseTemp->Down ){
MultProc();
Mmsstv->SBUseTemp->Down = FALSE;
Mmsstv->SBUseTempClick(NULL);
}
UpdateBtn();
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::SBTXClick(TObject *Sender)
{
Mmsstv->AdjustPage(pgTX);
Mmsstv->SBTX->Down = Mmsstv->SBTX->Down ? FALSE : TRUE;
Mmsstv->SBTXClick(NULL);
UpdateBtn();
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
Mmsstv->FormKeyDown(Sender, Key, Shift);
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::FormKeyUp(TObject *Sender, WORD &Key,
TShiftState Shift)
{
Mmsstv->FormKeyUp(Sender, Key, Shift);
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::FormResize(TObject *Sender)
{
AlignView.NewAlign(this);
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::SBLockClick(TObject *Sender)
{
Mmsstv->SBLK->Down = SBLock->Down;
Mmsstv->SBLKClick(NULL);
}
//---------------------------------------------------------------------------
void __fastcall TCtrBtnWnd::SBSyncClick(TObject *Sender)
{
Mmsstv->KRFSClick(NULL);
}
//---------------------------------------------------------------------------