CopyParamCustom.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <Common.h>
  5. #include <TextsWin.h>
  6. #include <GUIConfiguration.h>
  7. #include <GUITools.h>
  8. #include <Tools.h>
  9. #include "CopyParamCustom.h"
  10. #include "VCLCommon.h"
  11. //---------------------------------------------------------------------------
  12. #pragma package(smart_init)
  13. #pragma link "CopyParams"
  14. #pragma resource "*.dfm"
  15. //---------------------------------------------------------------------------
  16. bool __fastcall DoCopyParamCustomDialog(TCopyParamType & CopyParam,
  17. int CopyParamAttrs)
  18. {
  19. bool Result;
  20. TCopyParamCustomDialog * Dialog = new TCopyParamCustomDialog(
  21. Application, CopyParamAttrs, 0);
  22. try
  23. {
  24. Result = Dialog->Execute(CopyParam);
  25. }
  26. __finally
  27. {
  28. delete Dialog;
  29. }
  30. return Result;
  31. }
  32. //---------------------------------------------------------------------------
  33. // Dummy parameter distinguishes the constructor from Object Pascals TForm::CreateNew
  34. __fastcall TCopyParamCustomDialog::TCopyParamCustomDialog(TComponent * Owner,
  35. int CopyParamAttrs, int /*Dummy*/)
  36. : TForm(Owner)
  37. {
  38. UseSystemSettings(this);
  39. CopyParamsFrame->Direction = pdAll;
  40. CopyParamsFrame->CopyParamAttrs = CopyParamAttrs;
  41. }
  42. //---------------------------------------------------------------------------
  43. bool __fastcall TCopyParamCustomDialog::Execute(TCopyParamType & CopyParam)
  44. {
  45. CopyParamsFrame->Params = CopyParam;
  46. CopyParamsFrame->BeforeExecute();
  47. bool Result = (ShowModal() == mrOk);
  48. if (Result)
  49. {
  50. CopyParamsFrame->AfterExecute();
  51. CopyParam = CopyParamsFrame->Params;
  52. }
  53. return Result;
  54. }
  55. //---------------------------------------------------------------------------
  56. void __fastcall TCopyParamCustomDialog::FormCloseQuery(TObject * /*Sender*/,
  57. bool & /*CanClose*/)
  58. {
  59. if (ModalResult != mrCancel)
  60. {
  61. ExitActiveControl(this);
  62. }
  63. }
  64. //---------------------------------------------------------------------------
  65. void __fastcall TCopyParamCustomDialog::HelpButtonClick(TObject * /*Sender*/)
  66. {
  67. FormHelp(this);
  68. }
  69. //---------------------------------------------------------------------------