LogSettings.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //---------------------------------------------------------------------------
  2. #ifndef LogSettingsH
  3. #define LogSettingsH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <ExtCtrls.hpp>
  10. #include <Mask.hpp>
  11. #include <ComboEdit.hpp>
  12. #include <UpDownEdit.hpp>
  13. #include <WinInterface.h>
  14. //---------------------------------------------------------------------------
  15. class TLoggingFrame : public TFrame
  16. {
  17. __published:
  18. TCheckBox *LoggingCheck;
  19. TGroupBox *LoggingGroup;
  20. TLabel *LogWindowLinesText;
  21. TCheckBox *LogToFileCheck;
  22. TFilenameEdit *LogFileNameEdit;
  23. TCheckBox *LogShowWindowCheck;
  24. TRadioButton *LogWindowCompleteButton;
  25. TRadioButton *LogWindowLinesButton;
  26. TUpDownEdit *LogWindowLinesEdit;
  27. TPanel *LogFilePanel;
  28. TRadioButton *LogFileAppendButton;
  29. TRadioButton *LogFileOverwriteButton;
  30. TLabel *LogProtocolLabel;
  31. TComboBox *LogProtocolCombo;
  32. TStaticText *LogFileNameHintText;
  33. void __fastcall LogToFileCheckChange(TObject *Sender);
  34. void __fastcall DataChange(TObject *Sender);
  35. void __fastcall LogFileNameEditBeforeDialog(TObject *Sender,
  36. AnsiString &Name, bool &Action);
  37. void __fastcall LogFileNameEditAfterDialog(TObject *Sender,
  38. AnsiString &Name, bool &Action);
  39. void __fastcall LogFileNameEditCreateEditDialog(TObject *Sender,
  40. TFileDialogKind DialogKind, TOpenDialog *&Dialog);
  41. private:
  42. bool FEnableLogWindow;
  43. AnsiString FBeforeDialogPath;
  44. AnsiString __fastcall GetDefaultLogFileName();
  45. void __fastcall SetEnableLogWindow(bool value);
  46. public:
  47. __fastcall TLoggingFrame(TComponent* Owner);
  48. void __fastcall LoadConfiguration();
  49. void __fastcall SaveConfiguration();
  50. void __fastcall Init();
  51. __property AnsiString DefaultLogFileName = { read = GetDefaultLogFileName };
  52. __property bool EnableLogWindow = { read = FEnableLogWindow, write = SetEnableLogWindow };
  53. protected:
  54. void __fastcall UpdateControls();
  55. };
  56. //---------------------------------------------------------------------------
  57. extern PACKAGE TLoggingFrame *LoggingFrame;
  58. //---------------------------------------------------------------------------
  59. #endif