|
|
@@ -182,6 +182,10 @@ bool __fastcall TRightsFrame::DirectoriesXEffective()
|
|
|
//---------------------------------------------------------------------------
|
|
|
void __fastcall TRightsFrame::UpdateControls()
|
|
|
{
|
|
|
+ if (!OctalEdit->Focused())
|
|
|
+ {
|
|
|
+ UpdateOctalEdit();
|
|
|
+ }
|
|
|
Color = (FPopup ? clWindow : clBtnFace);
|
|
|
DirectoriesXCheck->Visible = AllowAddXToDirectories;
|
|
|
EnableControl(DirectoriesXCheck,
|
|
|
@@ -263,6 +267,7 @@ void __fastcall TRightsFrame::SetEnabled(bool Value)
|
|
|
//---------------------------------------------------------------------------
|
|
|
void __fastcall TRightsFrame::ForceUpdate()
|
|
|
{
|
|
|
+ UpdateOctalEdit();
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
bool __fastcall TRightsFrame::HasFocus()
|
|
|
@@ -418,6 +423,10 @@ void __fastcall TRightsFrame::SetPopup(bool value)
|
|
|
{
|
|
|
FPopup = value;
|
|
|
Visible = !FPopup;
|
|
|
+
|
|
|
+ CloseButton->Visible = value;
|
|
|
+ CloseButton->Cancel = value;
|
|
|
+ CloseButton->Default = value;
|
|
|
}
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
@@ -629,3 +638,74 @@ void __fastcall TRightsFrame::FrameContextPopup(TObject * Sender,
|
|
|
MenuPopup(Sender, MousePos, Handled);
|
|
|
}
|
|
|
//---------------------------------------------------------------------------
|
|
|
+void __fastcall TRightsFrame::UpdateByOctal()
|
|
|
+{
|
|
|
+ if (!OctalEdit->Text.IsEmpty())
|
|
|
+ {
|
|
|
+ TRights R = Rights;
|
|
|
+ R.Octal = OctalEdit->Text;
|
|
|
+ Rights = R;
|
|
|
+ }
|
|
|
+ UpdateControls();
|
|
|
+ OctalEdit->Modified = false;
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|
|
|
+void __fastcall TRightsFrame::UpdateOctalEdit()
|
|
|
+{
|
|
|
+ TRights R = Rights;
|
|
|
+ OctalEdit->Text = R.IsUndef ? UnicodeString() : R.Octal;
|
|
|
+ OctalEdit->Modified = false;
|
|
|
+ OctalEdit->SelectAll();
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|
|
|
+void __fastcall TRightsFrame::OctalEditChange(TObject *)
|
|
|
+{
|
|
|
+ if (OctalEdit->Modified && OctalEdit->Text.Length() >= 3)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ UpdateByOctal();
|
|
|
+ }
|
|
|
+ catch(...)
|
|
|
+ {
|
|
|
+ OctalEdit->Modified = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|
|
|
+void __fastcall TRightsFrame::OctalEditExit(TObject *)
|
|
|
+{
|
|
|
+ if (!Visible)
|
|
|
+ {
|
|
|
+ // should happen only if popup is closed by esc key
|
|
|
+ DebugAssert(Popup);
|
|
|
+
|
|
|
+ // cancel changes
|
|
|
+ ForceUpdate();
|
|
|
+ }
|
|
|
+ else if (OctalEdit->Modified)
|
|
|
+ {
|
|
|
+ // Now the text in OctalEdit is almost necessarily invalid, otherwise
|
|
|
+ // OctalEditChange would have already cleared Modified flag
|
|
|
+ try
|
|
|
+ {
|
|
|
+ UpdateByOctal();
|
|
|
+ }
|
|
|
+ catch(...)
|
|
|
+ {
|
|
|
+ OctalEdit->SelectAll();
|
|
|
+ OctalEdit->SetFocus();
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ UpdateControls();
|
|
|
+ }
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|
|
|
+void __fastcall TRightsFrame::CloseButtonClick(TObject *)
|
|
|
+{
|
|
|
+ CloseUp();
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------------
|