1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/source/forms/CopyParamCustom.cpp
Martin Prikryl b13e2e7c2b #pragma package(smart_init) is not useful out of packages
Source commit: 7635ac3b532214f27ea2b6fe6aa80398c857cfcd
2025-08-23 01:06:48 +02:00

67 lines
2.0 KiB
C++

//---------------------------------------------------------------------------
#include <FormsPCH.h>
#pragma hdrstop
#include "CopyParamCustom.h"
//---------------------------------------------------------------------------
#pragma link "CopyParams"
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
bool __fastcall DoCopyParamCustomDialog(TCopyParamType & CopyParam,
int CopyParamAttrs)
{
bool Result;
TCopyParamCustomDialog * Dialog = new TCopyParamCustomDialog(
GetFormOwner(), CopyParamAttrs, 0);
try
{
Result = Dialog->Execute(CopyParam);
}
__finally
{
delete Dialog;
}
return Result;
}
//---------------------------------------------------------------------------
// Dummy parameter distinguishes the constructor from Object Pascals TForm::CreateNew
__fastcall TCopyParamCustomDialog::TCopyParamCustomDialog(TComponent * Owner,
int CopyParamAttrs, int /*Dummy*/)
: TForm(Owner)
{
UseSystemSettings(this);
CopyParamsFrame->CopyParamAttrs = CopyParamAttrs;
}
//---------------------------------------------------------------------------
bool __fastcall TCopyParamCustomDialog::Execute(TCopyParamType & CopyParam)
{
CopyParamsFrame->Params = CopyParam;
CopyParamsFrame->BeforeExecute();
bool Result = (ShowModal() == DefaultResult(this));
if (Result)
{
CopyParamsFrame->AfterExecute();
CopyParam = CopyParamsFrame->Params;
}
return Result;
}
//---------------------------------------------------------------------------
void __fastcall TCopyParamCustomDialog::FormCloseQuery(TObject * /*Sender*/,
bool & /*CanClose*/)
{
if (ModalResult == DefaultResult(this))
{
ExitActiveControl(this);
}
}
//---------------------------------------------------------------------------
void __fastcall TCopyParamCustomDialog::HelpButtonClick(TObject * /*Sender*/)
{
FormHelp(this);
}
//---------------------------------------------------------------------------