mirror of
https://github.com/n5ac/mmvari.git
synced 2025-12-06 04:12:03 +01:00
146 lines
5.2 KiB
C++
146 lines
5.2 KiB
C++
|
|
//Copyright+LGPL
|
|||
|
|
|
|||
|
|
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
|||
|
|
// Copyright 2000-2013 Makoto Mori, Nobuyuki Oba
|
|||
|
|
//-----------------------------------------------------------------------------------------------------------------------------------------------
|
|||
|
|
// This file is part of MMVARI.
|
|||
|
|
|
|||
|
|
// MMVARI 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.
|
|||
|
|
|
|||
|
|
// MMVARI 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 "RMenuDlg.h"
|
|||
|
|
#include "Main.h"
|
|||
|
|
//---------------------------------------------------------------------
|
|||
|
|
#pragma resource "*.dfm"
|
|||
|
|
//TRMenuDialog *RMenuDialog;
|
|||
|
|
static LPCSTR g_help={
|
|||
|
|
"<EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h\r\n"
|
|||
|
|
"\r\n"
|
|||
|
|
"\\$##... ##=00-FF, <20><><EFBFBD>M<EFBFBD><4D><EFBFBD>镡<EFBFBD><E995A1><EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD><67>16<31>i<EFBFBD><69><EFBFBD>Œ<EFBFBD><C592>`<60><><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
" (<28><>:\\$FE55AA -> FEh,55h,AAh)\r\n"
|
|||
|
|
"\\x## ##=00-FF, <20><><EFBFBD>M<EFBFBD><4D><EFBFBD><EFBFBD><EFBFBD>P<EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD><67>16<31>i<EFBFBD><69><EFBFBD>Œ<EFBFBD><C592>`<60><><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
" (<28><>:\\xFE\\x55\\xAA -> FEh, 55h, AAh)\r\n"
|
|||
|
|
"\\w## ##=00-99, <20>f<EFBFBD>B<EFBFBD><42><EFBFBD>C<EFBFBD><43><EFBFBD>Ԃ<EFBFBD>10ms<6D>P<EFBFBD>ʂ<EFBFBD>10<31>i<EFBFBD><69><EFBFBD>Œ<EFBFBD><C592>`<60><><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
" (<28><>:\\w05 -> wait 50ms)\r\n"
|
|||
|
|
"\\r <09>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD>b<EFBFBD>W<EFBFBD><57><EFBFBD>^<5E>[<5B><><EFBFBD>𑗐M<F0919790><4D><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
"\\n <09><><EFBFBD>C<EFBFBD><43><EFBFBD>t<EFBFBD>B<EFBFBD>[<5B>h<EFBFBD>𑗐M<F0919790><4D><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
"\\c.... <09>ȍ~<7E>͂<EFBFBD><CD82>ׂăR<C483><52><EFBFBD><EFBFBD><EFBFBD>g\r\n"
|
|||
|
|
"\\\\ '\\'<27><><EFBFBD><EFBFBD><EFBFBD>𑗐M<F0919790><4D><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
"<EFBFBD><EFBFBD><EFBFBD>̑<EFBFBD> <09><><EFBFBD>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𑗐M<F0919790><4D><EFBFBD><EFBFBD>\r\n"
|
|||
|
|
"\r\n"
|
|||
|
|
"##<23>̑<EFBFBD><CC91><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>xx<78><78><EFBFBD>L<EFBFBD>q<EFBFBD><71><EFBFBD><EFBFBD><EFBFBD>ƁA<C681><41><EFBFBD>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD>xx<78><78><EFBFBD>̓{<7B>b<EFBFBD>N<EFBFBD>X<EFBFBD>Œ<EFBFBD><C592>`<60><><EFBFBD><EFBFBD>16<31>i<EFBFBD><69><EFBFBD>ɒu<C992><75><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B\r\n"
|
|||
|
|
"<EFBFBD><EFBFBD><EFBFBD>̕ϊ<EFBFBD><EFBFBD><EFBFBD>ICOM<EFBFBD>̋@<40><><EFBFBD>A<EFBFBD>h<EFBFBD><68><EFBFBD>X<EFBFBD><58><EFBFBD>w<EFBFBD>肷<EFBFBD><E882B7><EFBFBD>ꍇ<EFBFBD>Ɏg<C98E>p<EFBFBD><70><EFBFBD>܂<EFBFBD><DC82>B\r\n"
|
|||
|
|
" <09><>:\\$FEFExxE01C0001FD <09>ixx<78>̕<EFBFBD><CC95><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>`<60><><EFBFBD>e<EFBFBD>ɒu<C992><75><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>j"
|
|||
|
|
};
|
|||
|
|
static LPCSTR g_helpeng={
|
|||
|
|
" This command sends a radio command to the rig. It will work for any rig. Use the following keyword to specify byte data in hexadecimal number.\r\n"
|
|||
|
|
"\r\n"
|
|||
|
|
"\\$##... ##=00-FF, Specify the byte data string in the hexadecimal format\r\n"
|
|||
|
|
" (Example: \\$FE55AA -> $FE,$55,$AA)\r\n"
|
|||
|
|
" ICOM CI-V address can be expressed by xx\r\n"
|
|||
|
|
"\\x## ##=00-FF, Specify one byte in the hexadecimal format\r\n"
|
|||
|
|
" (Example: \\xFE\\x55\\xAA -> $FE, $55, $AA)\r\n"
|
|||
|
|
"\\w## ##=00-99, Specify the delay time\r\n"
|
|||
|
|
" (Example: \\w05 -> wait 50ms)\r\n"
|
|||
|
|
"\\r Send a carriage return\r\n"
|
|||
|
|
"\\n Send a line feed\r\n"
|
|||
|
|
"\\c.... Comment\r\n"
|
|||
|
|
"\\\\ '\\' send character\r\n"
|
|||
|
|
"Others Send the character as is"
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//---------------------------------------------------------------------
|
|||
|
|
__fastcall TRMenuDialog::TRMenuDialog(TComponent* AOwner)
|
|||
|
|
: TForm(AOwner)
|
|||
|
|
{
|
|||
|
|
FormStyle = ((TForm *)AOwner)->FormStyle;
|
|||
|
|
Font->Name = ((TForm *)AOwner)->Font->Name;
|
|||
|
|
Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
|||
|
|
|
|||
|
|
if( sys.m_MsgEng ){
|
|||
|
|
LH->Font->Name = "Arial";
|
|||
|
|
LH->Font->Charset = ((TForm *)AOwner)->Font->Charset;
|
|||
|
|
|
|||
|
|
L1->Caption = "Caption";
|
|||
|
|
L2->Caption = "Command";
|
|||
|
|
Caption = "Edit menu";
|
|||
|
|
SBDel->Caption = "Delete this menu";
|
|||
|
|
SBIns->Caption = "Insert this menu";
|
|||
|
|
CancelBtn->Caption = "Cancel";
|
|||
|
|
LH->Caption = g_helpeng;
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
LH->Caption = g_help;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------
|
|||
|
|
void __fastcall TRMenuDialog::UpdateUI(void)
|
|||
|
|
{
|
|||
|
|
if( SBIns->Visible ){
|
|||
|
|
SBIns->Enabled = MainVARI->m_nRadioMenu < RADIOMENUMAX;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------
|
|||
|
|
int __fastcall TRMenuDialog::Execute(AnsiString &strTTL, AnsiString &strCMD, int fAdd)
|
|||
|
|
{
|
|||
|
|
if( fAdd ){
|
|||
|
|
Caption = sys.m_MsgEng ? "Add menu" : "<EFBFBD><EFBFBD><EFBFBD>j<EFBFBD><EFBFBD><EFBFBD>[<5B>̒lj<CC92>";
|
|||
|
|
SBDel->Visible = FALSE;
|
|||
|
|
SBIns->Visible = FALSE;
|
|||
|
|
}
|
|||
|
|
ETTL->Text = strTTL;
|
|||
|
|
ECMD->Text = strCMD;
|
|||
|
|
UpdateUI();
|
|||
|
|
int r = ShowModal();
|
|||
|
|
strTTL = ETTL->Text;
|
|||
|
|
strCMD = ECMD->Text;
|
|||
|
|
return r;
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------
|
|||
|
|
void __fastcall TRMenuDialog::SBDelClick(TObject *Sender)
|
|||
|
|
{
|
|||
|
|
ModalResult = 1024;
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------------
|
|||
|
|
void __fastcall TRMenuDialog::SBInsClick(TObject *Sender)
|
|||
|
|
{
|
|||
|
|
ModalResult = 1025;
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------------
|
|||
|
|
void __fastcall TRMenuDialog::SBRefClick(TObject *Sender)
|
|||
|
|
{
|
|||
|
|
TOpenDialog *pBox = new TOpenDialog(this);
|
|||
|
|
pBox->Options >> ofCreatePrompt;
|
|||
|
|
pBox->Options << ofFileMustExist;
|
|||
|
|
if( sys.m_MsgEng ){
|
|||
|
|
pBox->Title = "Open command file";
|
|||
|
|
pBox->Filter = "Command files(*.rcm)|*.rcm|";
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
pBox->Title = "<EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>`<60>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD><4A>";
|
|||
|
|
pBox->Filter = "<EFBFBD>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>`<60>t<EFBFBD>@<40>C<EFBFBD><43>(*.rcm)|*.rcm|";
|
|||
|
|
}
|
|||
|
|
pBox->FileName = "";
|
|||
|
|
pBox->DefaultExt = "rcm";
|
|||
|
|
pBox->InitialDir = sys.m_BgnDir;
|
|||
|
|
if( pBox->Execute() == TRUE ){
|
|||
|
|
ECMD->Text = pBox->FileName.c_str();
|
|||
|
|
}
|
|||
|
|
delete pBox;
|
|||
|
|
}
|
|||
|
|
//---------------------------------------------------------------------------
|
|||
|
|
|