1
0

Rights.h 4.9 KB

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