Rights.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. //---------------------------------------------------------------------------
  2. #ifndef RightsH
  3. #define RightsH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <Buttons.hpp>
  10. #include <RemoteFiles.h>
  11. #include <ActnList.hpp>
  12. #include <ImgList.hpp>
  13. #include <Menus.hpp>
  14. #include "GrayedCheckBox.hpp"
  15. //---------------------------------------------------------------------------
  16. class TRightsFrame : public TFrame
  17. {
  18. __published:
  19. TLabel *GroupLabel;
  20. TLabel *OthersLabel;
  21. TLabel *OwnerLabel;
  22. TGrayedCheckBox *OwnerReadCheck;
  23. TGrayedCheckBox *OwnerWriteCheck;
  24. TGrayedCheckBox *OwnerExecuteCheck;
  25. TGrayedCheckBox *GroupReadCheck;
  26. TGrayedCheckBox *GroupWriteCheck;
  27. TGrayedCheckBox *GroupExecuteCheck;
  28. TGrayedCheckBox *OthersReadCheck;
  29. TGrayedCheckBox *OthersWriteCheck;
  30. TGrayedCheckBox *OthersExecuteCheck;
  31. TCheckBox *DirectoriesXCheck;
  32. TSpeedButton *OwnerButton;
  33. TSpeedButton *GroupButton;
  34. TSpeedButton *OthersButton;
  35. TPopupMenu *RightsPopup;
  36. TMenuItem *Norights1;
  37. TMenuItem *Defaultrights1;
  38. TMenuItem *Allrights1;
  39. TMenuItem *Leaveasis1;
  40. TActionList *RightsActions;
  41. TAction *NoRightsAction;
  42. TAction *DefaultRightsAction;
  43. TAction *AllRightsAction;
  44. TAction *LeaveRightsAsIsAction;
  45. TImageList *RightsImages;
  46. TMenuItem *N1;
  47. TAction *CopyTextAction;
  48. TAction *CopyOctalAction;
  49. TAction *PasteAction;
  50. TMenuItem *CopyAsText1;
  51. TMenuItem *CopyAsOctal1;
  52. TMenuItem *Paste1;
  53. void __fastcall ControlChange(TObject *Sender);
  54. void __fastcall RightsButtonsClick(TObject *Sender);
  55. void __fastcall RightsActionsExecute(TBasicAction *Action,
  56. bool &Handled);
  57. void __fastcall RightsActionsUpdate(TBasicAction *Action, bool &Handled);
  58. void __fastcall RightsPopupPopup(TObject *Sender);
  59. void __fastcall FrameContextPopup(TObject *Sender, TPoint &MousePos,
  60. bool &Handled);
  61. private:
  62. bool FAllowAddXToDirectories;
  63. TNotifyEvent FOnChange;
  64. bool FPopup;
  65. TWinControl * FPopupParent;
  66. TButton * FDefaultButton;
  67. TButton * FCancelButton;
  68. bool FPopingContextMenu;
  69. AnsiString FAddXToDirectoriesSuffix;
  70. bool FInitialized;
  71. void __fastcall CycleRights(int Group);
  72. bool __fastcall GetAddXToDirectories();
  73. bool __fastcall GetAllowUndef();
  74. TCheckBox * __fastcall GetChecks(TRights::TRight Right);
  75. TRights __fastcall GetRights();
  76. TRights::TState __fastcall GetStates(TRights::TRight Right);
  77. void __fastcall SetAddXToDirectories(bool value);
  78. void __fastcall SetAllowAddXToDirectories(bool value);
  79. void __fastcall SetAllowUndef(bool value);
  80. void __fastcall SetRights(const TRights & value);
  81. void __fastcall SetStates(TRights::TRight Right, TRights::TState value);
  82. AnsiString __fastcall GetText();
  83. void __fastcall SetText(AnsiString value);
  84. public:
  85. virtual __fastcall ~TRightsFrame();
  86. __fastcall TRightsFrame(TComponent* Owner);
  87. void __fastcall DropDown();
  88. void __fastcall CloseUp();
  89. __property bool AddXToDirectories = { read = GetAddXToDirectories, write = SetAddXToDirectories };
  90. __property bool AllowAddXToDirectories = { read = FAllowAddXToDirectories, write = SetAllowAddXToDirectories };
  91. __property bool AllowUndef = { read = GetAllowUndef, write = SetAllowUndef };
  92. __property TCheckBox * Checks[TRights::TRight Right] = { read = GetChecks };
  93. __property TNotifyEvent OnChange = { read = FOnChange, write = FOnChange };
  94. __property TRights Rights = { read = GetRights, write = SetRights };
  95. __property AnsiString Text = { read = GetText, write = SetText };
  96. __property bool Popup = { read = FPopup, write = SetPopup };
  97. __property TWinControl * PopupParent = { read = FPopupParent, write = FPopupParent };
  98. protected:
  99. void __fastcall DoChange();
  100. virtual void __fastcall UpdateControls();
  101. virtual void __fastcall SetEnabled(bool Value);
  102. virtual void __fastcall ForceUpdate();
  103. virtual void __fastcall CreateParams(TCreateParams & Params);
  104. virtual void __fastcall CreateWnd();
  105. virtual void __fastcall Dispatch(void * Message);
  106. void __fastcall CMCancelMode(TCMCancelMode & Message);
  107. void __fastcall CMDialogKey(TCMDialogKey & Message);
  108. void __fastcall WMContextMenu(TWMContextMenu & Message);
  109. bool __fastcall IsAncestor(TControl * Control, TControl * Ancestor);
  110. DYNAMIC void __fastcall DoExit();
  111. virtual void __fastcall SetPopup(bool value);
  112. void __fastcall DoCloseUp();
  113. bool __fastcall HasFocus();
  114. bool __fastcall DirectoriesXEffective();
  115. __property TRights::TState States[TRights::TRight Right] = { read = GetStates, write = SetStates };
  116. };
  117. //---------------------------------------------------------------------------
  118. #endif