RxFPC:RxMDI - add new options rxtoAskCloseAll

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6844 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-04-12 08:54:40 +00:00
parent 3f00c5ff8f
commit af09701e95
9 changed files with 78 additions and 12 deletions

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<AutoCreateForms Value="False"/>
<Title Value="project1"/>
<ResourceType Value="res"/>

View File

@ -13,7 +13,7 @@ object Form1: TForm1
WindowState = wsMaximized
object ToolPanel1: TToolPanel
Left = 0
Height = 32
Height = 36
Top = 0
Width = 613
Items = <
@ -37,7 +37,7 @@ object Form1: TForm1
CustomizeShortCut = False
Align = alTop
BorderWidth = 4
ClientHeight = 32
ClientHeight = 36
ClientWidth = 613
TabOrder = 0
object RxMDICloseButton1: TRxMDICloseButton
@ -47,7 +47,7 @@ object Form1: TForm1
AnchorSideRight.Side = asrBottom
Left = 585
Height = 22
Top = 5
Top = 7
Width = 23
Anchors = [akTop, akRight]
Glyph.Data = {
@ -79,7 +79,7 @@ object Form1: TForm1
Width = 613
Align = alBottom
FlatButton = True
Options = [rxtoMidleClickClose]
Options = [rxtoMidleClickClose, rxtoAskCloseAll]
end
object StatusBar1: TStatusBar
Left = 0
@ -97,8 +97,8 @@ object Form1: TForm1
end
object RxMDIPanel1: TRxMDIPanel
Left = 0
Height = 332
Top = 32
Height = 328
Top = 36
Width = 613
CloseButton = RxMDICloseButton1
TaskPanel = RxMDITasks1
@ -155,6 +155,12 @@ object Form1: TForm1
Caption = 'Close all...'
OnExecute = wndCloseAllExecute
end
object optAskCloseAll: TAction
Category = 'Options'
Caption = 'Ask close all window'
Checked = True
OnExecute = optAskCloseAllExecute
end
end
object MainMenu1: TMainMenu
Left = 408
@ -176,6 +182,9 @@ object Form1: TForm1
object MenuItem11: TMenuItem
Action = optHideCloseButton
end
object MenuItem12: TMenuItem
Action = optAskCloseAll
end
end
object MenuItem3: TMenuItem
Caption = 'MDI forms'

View File

@ -16,6 +16,8 @@ type
Action1: TAction;
Action2: TAction;
Action3: TAction;
MenuItem12: TMenuItem;
optAskCloseAll: TAction;
WindowItems: TMenuItem;
MenuItem13: TMenuItem;
wndCloseAll: TAction;
@ -46,6 +48,7 @@ type
procedure Action2Execute(Sender: TObject);
procedure Action3Execute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure optAskCloseAllExecute(Sender: TObject);
procedure optHideCloseButtonExecute(Sender: TObject);
procedure optMidleMouseClickCloseExecute(Sender: TObject);
procedure optShowInfoLabelExecute(Sender: TObject);
@ -97,6 +100,10 @@ begin
else
RxMDITasks1.Options:=RxMDITasks1.Options - [rxtoMidleClickClose];
if optAskCloseAll.Checked then
RxMDITasks1.Options:=RxMDITasks1.Options + [rxtoAskCloseAll]
else
RxMDITasks1.Options:=RxMDITasks1.Options - [rxtoAskCloseAll];
RxMDIPanel1.HideCloseButton:=optHideCloseButton.Checked; ;
end;
@ -123,6 +130,12 @@ begin
UpdateOptions;
end;
procedure TForm1.optAskCloseAllExecute(Sender: TObject);
begin
optAskCloseAll.Checked:=not optAskCloseAll.Checked;
UpdateOptions;
end;
procedure TForm1.optHideCloseButtonExecute(Sender: TObject);
begin
optHideCloseButton.Checked:=not optHideCloseButton.Checked;

View File

@ -52,6 +52,10 @@ msgstr ""
msgid "Close all except this"
msgstr ""
#: rxconst.scloseallquestion
msgid "Close all window?"
msgstr ""
#: rxconst.scloseallwindows
msgid "Close all windows"
msgstr ""
@ -184,6 +188,10 @@ msgstr "Anterior Mes|"
msgid "Previous Year|"
msgstr "Anterior A?o|"
#: rxconst.squestion
msgid "Question"
msgstr ""
#: rxconst.sreqvalue
msgid "Error. Expected value for field %s."
msgstr ""

View File

@ -60,6 +60,10 @@ msgstr "Zamknij po %d sek."
msgid "Close all except this"
msgstr "Zamknij wszystkie poza tym"
#: rxconst.scloseallquestion
msgid "Close all window?"
msgstr ""
#: rxconst.scloseallwindows
msgid "Close all windows"
msgstr "Zamknij wszystkie okna"
@ -192,6 +196,10 @@ msgstr "Poprzedni miesiąc|"
msgid "Previous Year|"
msgstr "Poprzedni rok|"
#: rxconst.squestion
msgid "Question"
msgstr ""
#: rxconst.sreqvalue
msgid "Error. Expected value for field %s."
msgstr "Błąd. Spodziewano wartości dla pola %s."

View File

@ -60,6 +60,10 @@ msgstr "Будет закрыто через %d секунд"
msgid "Close all except this"
msgstr "Закрыть все окна, за исключением этого"
#: rxconst.scloseallquestion
msgid "Close all window?"
msgstr "Закрыть все окна?"
#: rxconst.scloseallwindows
msgid "Close all windows"
msgstr "Закрыть все окна"
@ -192,6 +196,10 @@ msgstr "Превыдущий месяц|"
msgid "Previous Year|"
msgstr "Превыдущий год|"
#: rxconst.squestion
msgid "Question"
msgstr "Вопрос"
#: rxconst.sreqvalue
msgid "Error. Expected value for field %s."
msgstr "Поле %s. Требуется значение"

View File

@ -61,6 +61,10 @@ msgstr ""
msgid "Close all except this"
msgstr "Закрити всі вікна, за виключенням цього"
#: rxconst.scloseallquestion
msgid "Close all window?"
msgstr ""
#: rxconst.scloseallwindows
msgid "Close all windows"
msgstr "Закрити всі вікна"
@ -195,6 +199,10 @@ msgstr "Попередній місяць|"
msgid "Previous Year|"
msgstr "Попередній місяць|"
#: rxconst.squestion
msgid "Question"
msgstr ""
#: rxconst.sreqvalue
#, fuzzy
#| msgid "Error. Expected value for filed %s."

View File

@ -42,7 +42,7 @@ uses
Classes, SysUtils, Forms, Buttons, Menus, ExtCtrls, Graphics, Controls;
type
TRxMDITaskOption = (rxtoMidleClickClose);
TRxMDITaskOption = (rxtoMidleClickClose, rxtoAskCloseAll);
TRxMDITaskOptions = set of TRxMDITaskOption;
TRxMDIPanelOption = (rxpoCloseF4, rxpoSwithByTab);
@ -203,7 +203,7 @@ type
end;
implementation
uses LResources, rxlclutils, rxconst, LCLType;
uses LResources, rxlclutils, rxconst, LCLType, Dialogs;
{ TRxMDICloseButton }
@ -891,6 +891,7 @@ end;
constructor TRxMDITasks.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FOptions:=[rxtoAskCloseAll, rxtoMidleClickClose];
Caption:='';
FBtnScrollLeft:=TSpeedButton.Create(Self);
@ -1088,7 +1089,14 @@ begin
end;
procedure TRxMDIButton.DoCloseAllMenu(Sender: TObject);
var
B: Boolean;
begin
if rxtoAskCloseAll in FNavPanel.Options then
B:=QuestionDlg(sQuestion, sCloseAllQuestion, mtConfirmation, [mrOk, mrCancel], 0) = mrOK
else
B:=true;
if B then
FNavPanel.DoCloseAll(nil);
end;

View File

@ -41,6 +41,7 @@ const
resourcestring
sQuestion = 'Question';
sBrowse = 'Browse';
sDefaultFilter = 'All files (*.*)|*.*';
sDateDlgTitle = 'Select a Date';
@ -104,7 +105,8 @@ resourcestring
sCloseWindows = 'Close window';
sCloseAllExceptThis = 'Close all except this';
sCloseAllWindows = 'Close all windows';
sErrorLinkedTaskPanel = 'Not assigned task panel';//Нет связанной панели задач';
sErrorLinkedTaskPanel = 'Not assigned task panel';
sCloseAllQuestion = 'Close all window?';
{ TRxDateRangeEdit }
sFirstQuarter = 'First quarter';