RxFPC:new options for RxMDI. See demo. thx user rtn from freepascal.ru

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6128 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2018-01-12 10:28:22 +00:00
parent 210853a090
commit a906dbdc1d
12 changed files with 407 additions and 57 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/> <Version Value="11"/>
<General> <General>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
@ -23,9 +23,10 @@
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<local> <FormatVersion Value="2"/>
<FormatVersion Value="1"/> <Modes Count="1">
</local> <Mode0 Name="default"/>
</Modes>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectSession> <ProjectSession>
<Version Value="9"/> <Version Value="11"/>
<BuildModes Active="Default"/> <BuildModes Active="Default"/>
<Units Count="6"> <Units Count="13">
<Unit0> <Unit0>
<Filename Value="project1.lpr"/> <Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos X="43" Y="10"/> <CursorPos X="43" Y="10"/>
<UsageCount Value="22"/> <UsageCount Value="25"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="unit1.pas"/> <Filename Value="unit1.pas"/>
@ -19,9 +19,9 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/> <UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<TopLine Value="41"/> <TopLine Value="72"/>
<CursorPos X="34" Y="67"/> <CursorPos X="70" Y="89"/>
<UsageCount Value="22"/> <UsageCount Value="25"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit1> </Unit1>
@ -35,7 +35,7 @@
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<TopLine Value="3"/> <TopLine Value="3"/>
<CursorPos X="6" Y="11"/> <CursorPos X="6" Y="11"/>
<UsageCount Value="22"/> <UsageCount Value="25"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="unit3.pas"/> <Filename Value="unit3.pas"/>
@ -46,7 +46,7 @@
<UnitName Value="Unit3"/> <UnitName Value="Unit3"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos Y="19"/> <CursorPos Y="19"/>
<UsageCount Value="22"/> <UsageCount Value="25"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="unit4.pas"/> <Filename Value="unit4.pas"/>
@ -57,7 +57,7 @@
<UnitName Value="Unit4"/> <UnitName Value="Unit4"/>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
<CursorPos X="32" Y="8"/> <CursorPos X="32" Y="8"/>
<UsageCount Value="22"/> <UsageCount Value="25"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="../../rxmdi.pas"/> <Filename Value="../../rxmdi.pas"/>
@ -67,24 +67,183 @@
<CursorPos Y="711"/> <CursorPos Y="711"/>
<UsageCount Value="11"/> <UsageCount Value="11"/>
</Unit5> </Unit5>
<Unit6>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<UnitName Value="RxMDI"/>
<EditorIndex Value="1"/>
<TopLine Value="262"/>
<CursorPos X="24" Y="281"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit6>
<Unit7>
<Filename Value="../../../../lcl/buttons.pp"/>
<UnitName Value="Buttons"/>
<EditorIndex Value="-1"/>
<TopLine Value="219"/>
<CursorPos Y="304"/>
<UsageCount Value="10"/>
</Unit7>
<Unit8>
<Filename Value="/home/install/source/fpcsrc/rtl/objpas/classes/classesh.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="1854"/>
<CursorPos X="14" Y="1905"/>
<UsageCount Value="10"/>
</Unit8>
<Unit9>
<Filename Value="../../../../lcl/controls.pp"/>
<UnitName Value="Controls"/>
<EditorIndex Value="-1"/>
<TopLine Value="176"/>
<CursorPos X="44" Y="195"/>
<UsageCount Value="10"/>
</Unit9>
<Unit10>
<Filename Value="../../rxcontrols/RxMDICloseIcon.lrs"/>
<EditorIndex Value="-1"/>
<UsageCount Value="10"/>
</Unit10>
<Unit11>
<Filename Value="../../rxtools/rxconst.pas"/>
<EditorIndex Value="2"/>
<TopLine Value="96"/>
<CursorPos X="3" Y="112"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit11>
<Unit12>
<Filename Value="/home/install/source/fpcsrc/rtl/objpas/classes/reader.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="771"/>
<CursorPos X="53" Y="789"/>
<UsageCount Value="10"/>
</Unit12>
</Units> </Units>
<JumpHistory Count="4" HistoryIndex="3"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="unit1.pas"/> <Filename Value="unit1.pas"/>
<Caret Line="74" Column="26" TopLine="44"/> <Caret Line="117" Column="44" TopLine="80"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="unit1.pas"/> <Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="75" Column="26" TopLine="45"/> <Caret Line="161" Column="15" TopLine="143"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="unit1.pas"/> <Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="82" Column="26" TopLine="47"/> <Caret Line="432" Column="3" TopLine="427"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="unit1.pas"/> <Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="67" Column="34" TopLine="56"/> <Caret Line="160" Column="15" TopLine="142"/>
</Position4> </Position4>
<Position5>
<Filename Value="unit1.pas"/>
<Caret Line="117" Column="44" TopLine="80"/>
</Position5>
<Position6>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="161" Column="15" TopLine="143"/>
</Position6>
<Position7>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="439" Column="31" TopLine="408"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
<Caret Line="117" Column="44" TopLine="89"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
<Caret Line="103" Column="3" TopLine="89"/>
</Position9>
<Position10>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="160" Column="15" TopLine="142"/>
</Position10>
<Position11>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="415" Column="31" TopLine="410"/>
</Position11>
<Position12>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="877" TopLine="851"/>
</Position12>
<Position13>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
</Position13>
<Position14>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="283" Column="56" TopLine="252"/>
</Position14>
<Position15>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="177" Column="85" TopLine="141"/>
</Position15>
<Position16>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="302" Column="3" TopLine="299"/>
</Position16>
<Position17>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="145" Column="15" TopLine="128"/>
</Position17>
<Position18>
<Filename Value="unit1.pas"/>
<Caret Line="108" Column="55" TopLine="89"/>
</Position18>
<Position19>
<Filename Value="unit1.pas"/>
<Caret Line="110" Column="55" TopLine="91"/>
</Position19>
<Position20>
<Filename Value="unit1.pas"/>
<Caret Line="118" TopLine="91"/>
</Position20>
<Position21>
<Filename Value="unit1.pas"/>
<Caret Line="119" Column="12" TopLine="92"/>
</Position21>
<Position22>
<Filename Value="unit1.pas"/>
<Caret Line="53" Column="15" TopLine="35"/>
</Position22>
<Position23>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="283" Column="5" TopLine="275"/>
</Position23>
<Position24>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="146" Column="17" TopLine="137"/>
</Position24>
<Position25>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="142" Column="8" TopLine="133"/>
</Position25>
<Position26>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="147" Column="20" TopLine="141"/>
</Position26>
<Position27>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="312" Column="33" TopLine="301"/>
</Position27>
<Position28>
<Filename Value="../../rxcontrols/rxmdi.pas"/>
<Caret Line="281" Column="24" TopLine="262"/>
</Position28>
<Position29>
<Filename Value="unit1.pas"/>
<Caret Line="91" Column="58" TopLine="72"/>
</Position29>
<Position30>
<Filename Value="unit1.pas"/>
<Caret Line="89" Column="70" TopLine="72"/>
</Position30>
</JumpHistory> </JumpHistory>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0" ActiveMode="default"/>
</RunParams>
</ProjectSession> </ProjectSession>
</CONFIG> </CONFIG>

View File

@ -1,33 +1,35 @@
object Form1: TForm1 object Form1: TForm1
Left = 527 Left = 527
Height = 423 Height = 435
Top = 222 Top = 222
Width = 581 Width = 613
Caption = 'MainForm' Caption = 'MainForm'
ClientHeight = 400 ClientHeight = 407
ClientWidth = 581 ClientWidth = 613
Menu = MainMenu1 Menu = MainMenu1
OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.1' LCLVersion = '1.9.0.0'
WindowState = wsMaximized WindowState = wsMaximized
object ToolPanel1: TToolPanel object ToolPanel1: TToolPanel
Left = 0 Left = 0
Height = 31 Height = 31
Top = 0 Top = 0
Width = 581 Width = 613
Items = <> Items = <>
Options = [] Options = []
CustomizeShortCut = False
Align = alTop Align = alTop
BorderWidth = 4 BorderWidth = 4
ClientHeight = 31 ClientHeight = 31
ClientWidth = 581 ClientWidth = 613
TabOrder = 0 TabOrder = 0
object RxMDICloseButton1: TRxMDICloseButton object RxMDICloseButton1: TRxMDICloseButton
AnchorSideTop.Control = ToolPanel1 AnchorSideTop.Control = ToolPanel1
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = ToolPanel1 AnchorSideRight.Control = ToolPanel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 553 Left = 585
Height = 22 Height = 22
Top = 4 Top = 4
Width = 23 Width = 23
@ -56,30 +58,41 @@ object Form1: TForm1
object RxMDITasks1: TRxMDITasks object RxMDITasks1: TRxMDITasks
Left = 0 Left = 0
Height = 25 Height = 25
Top = 356 Top = 360
Width = 581 Width = 613
Align = alBottom Align = alBottom
FlatButton = True
Options = [rxtoMidleClickClose]
end end
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 19 Height = 22
Top = 381 Top = 385
Width = 581 Width = 613
Panels = <> Panels = <
item
Width = 100
end
item
Width = 150
end>
SimplePanel = False
end end
object RxMDIPanel1: TRxMDIPanel object RxMDIPanel1: TRxMDIPanel
Left = 0 Left = 0
Height = 325 Height = 329
Top = 31 Top = 31
Width = 581 Width = 613
CloseButton = RxMDICloseButton1 CloseButton = RxMDICloseButton1
TaskPanel = RxMDITasks1 TaskPanel = RxMDITasks1
Align = alClient Align = alClient
BevelOuter = bvLowered BevelOuter = bvLowered
HideCloseButton = False
OnChangeCurrentChild = RxMDIPanel1ChangeCurrentChild
end end
object ActionList1: TActionList object ActionList1: TActionList
left = 440 Left = 440
top = 72 Top = 72
object sysClose: TAction object sysClose: TAction
Category = 'System' Category = 'System'
Caption = 'Close' Caption = 'Close'
@ -100,16 +113,46 @@ object Form1: TForm1
Caption = 'New single MDI form' Caption = 'New single MDI form'
OnExecute = Action3Execute OnExecute = Action3Execute
end end
object optShowInfoLabel: TAction
Category = 'Options'
Caption = 'Show info label'
Checked = True
OnExecute = optShowInfoLabelExecute
end
object optMidleMouseClickClose: TAction
Category = 'Options'
Caption = 'Midle mouse button close form'
Checked = True
OnExecute = optMidleMouseClickCloseExecute
end
object optHideCloseButton: TAction
Category = 'Options'
Caption = 'Hide close button'
Checked = True
OnExecute = optHideCloseButtonExecute
end
end end
object MainMenu1: TMainMenu object MainMenu1: TMainMenu
left = 408 Left = 408
top = 72 Top = 72
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
Caption = 'System' Caption = 'System'
object MenuItem2: TMenuItem object MenuItem2: TMenuItem
Action = sysClose Action = sysClose
end end
end end
object MenuItem8: TMenuItem
Caption = 'Options'
object MenuItem9: TMenuItem
Action = optShowInfoLabel
end
object MenuItem10: TMenuItem
Action = optMidleMouseClickClose
end
object MenuItem11: TMenuItem
Action = optHideCloseButton
end
end
object MenuItem3: TMenuItem object MenuItem3: TMenuItem
Caption = 'MDI forms' Caption = 'MDI forms'
object MenuItem4: TMenuItem object MenuItem4: TMenuItem
@ -129,7 +172,7 @@ object Form1: TForm1
object Timer1: TTimer object Timer1: TTimer
Interval = 500 Interval = 500
OnTimer = Timer1Timer OnTimer = Timer1Timer
left = 451 Left = 451
top = 117 Top = 117
end end
end end

View File

@ -16,6 +16,12 @@ type
Action1: TAction; Action1: TAction;
Action2: TAction; Action2: TAction;
Action3: TAction; Action3: TAction;
MenuItem11: TMenuItem;
optHideCloseButton: TAction;
MenuItem10: TMenuItem;
optMidleMouseClickClose: TAction;
MenuItem9: TMenuItem;
optShowInfoLabel: TAction;
MenuItem1: TMenuItem; MenuItem1: TMenuItem;
MenuItem2: TMenuItem; MenuItem2: TMenuItem;
MenuItem3: TMenuItem; MenuItem3: TMenuItem;
@ -23,6 +29,7 @@ type
MenuItem5: TMenuItem; MenuItem5: TMenuItem;
MenuItem6: TMenuItem; MenuItem6: TMenuItem;
MenuItem7: TMenuItem; MenuItem7: TMenuItem;
MenuItem8: TMenuItem;
sysClose: TAction; sysClose: TAction;
ActionList1: TActionList; ActionList1: TActionList;
MainMenu1: TMainMenu; MainMenu1: TMainMenu;
@ -35,10 +42,15 @@ type
procedure Action1Execute(Sender: TObject); procedure Action1Execute(Sender: TObject);
procedure Action2Execute(Sender: TObject); procedure Action2Execute(Sender: TObject);
procedure Action3Execute(Sender: TObject); procedure Action3Execute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure optHideCloseButtonExecute(Sender: TObject);
procedure optMidleMouseClickCloseExecute(Sender: TObject);
procedure optShowInfoLabelExecute(Sender: TObject);
procedure RxMDIPanel1ChangeCurrentChild(Sender: TRxMDIPanel; AForm: TForm);
procedure sysCloseExecute(Sender: TObject); procedure sysCloseExecute(Sender: TObject);
procedure Timer1Timer(Sender: TObject); procedure Timer1Timer(Sender: TObject);
private private
{ private declarations } procedure UpdateOptions;
public public
{ public declarations } { public declarations }
end; end;
@ -62,12 +74,23 @@ end;
procedure TForm1.Timer1Timer(Sender: TObject); procedure TForm1.Timer1Timer(Sender: TObject);
begin begin
if Assigned(ActiveControl) then if Assigned(ActiveControl) then
StatusBar1.SimpleText:=ActiveControl.Caption StatusBar1.Panels[0].Text:=ActiveControl.Caption
else else
StatusBar1.SimpleText:='<NONE>' StatusBar1.Panels[0].Text:='<NONE>'
; ;
end; end;
procedure TForm1.UpdateOptions;
begin
RxMDICloseButton1.ShowInfoLabel:=optShowInfoLabel.Checked;
if optMidleMouseClickClose.Checked then
RxMDITasks1.Options:=RxMDITasks1.Options + [rxtoMidleClickClose]
else
RxMDITasks1.Options:=RxMDITasks1.Options - [rxtoMidleClickClose];
RxMDIPanel1.HideCloseButton:=optHideCloseButton.Checked;
end;
procedure TForm1.Action1Execute(Sender: TObject); procedure TForm1.Action1Execute(Sender: TObject);
begin begin
RxMDIPanel1.ChildWindowsCreate(Form2, TForm2); RxMDIPanel1.ChildWindowsCreate(Form2, TForm2);
@ -86,5 +109,38 @@ begin
RxMDIPanel1.ChildWindowsAdd(Form4); RxMDIPanel1.ChildWindowsAdd(Form4);
end; end;
procedure TForm1.FormCreate(Sender: TObject);
begin
UpdateOptions;
end;
procedure TForm1.optHideCloseButtonExecute(Sender: TObject);
begin
optHideCloseButton.Checked:=not optHideCloseButton.Checked;
UpdateOptions;
end;
procedure TForm1.optMidleMouseClickCloseExecute(Sender: TObject);
begin
optMidleMouseClickClose.Checked:=not optMidleMouseClickClose.Checked;
UpdateOptions;
end;
procedure TForm1.optShowInfoLabelExecute(Sender: TObject);
begin
optShowInfoLabel.Checked:=not optShowInfoLabel.Checked;
UpdateOptions;
end;
procedure TForm1.RxMDIPanel1ChangeCurrentChild(Sender: TRxMDIPanel; AForm: TForm
);
begin
if Assigned(AForm) then
StatusBar1.Panels[1].Text:=AForm.Caption
else
StatusBar1.Panels[1].Text:='<NONE>'
;
end;
end. end.

View File

@ -79,6 +79,10 @@ msgstr "Destino"
msgid "Source" msgid "Source"
msgstr "Fuente" msgstr "Fuente"
#: rxconst.serrorlinkedtaskpanel
msgid "Not assigned task panel"
msgstr ""
#: rxconst.sexptcontrolnotfound #: rxconst.sexptcontrolnotfound
msgid "Control not found in validate %s." msgid "Control not found in validate %s."
msgstr "" msgstr ""

View File

@ -77,6 +77,10 @@ msgstr ""
msgid "Source" msgid "Source"
msgstr "" msgstr ""
#: rxconst.serrorlinkedtaskpanel
msgid "Not assigned task panel"
msgstr ""
#: rxconst.sexptcontrolnotfound #: rxconst.sexptcontrolnotfound
msgid "Control not found in validate %s." msgid "Control not found in validate %s."
msgstr "" msgstr ""

View File

@ -77,6 +77,10 @@ msgstr "Выбор"
msgid "Source" msgid "Source"
msgstr "Источник" msgstr "Источник"
#: rxconst.serrorlinkedtaskpanel
msgid "Not assigned task panel"
msgstr ""
#: rxconst.sexptcontrolnotfound #: rxconst.sexptcontrolnotfound
msgid "Control not found in validate %s." msgid "Control not found in validate %s."
msgstr "Элемент управления не найден в валидаторе %s" msgstr "Элемент управления не найден в валидаторе %s"

View File

@ -90,6 +90,10 @@ msgstr "Призначення"
msgid "Source" msgid "Source"
msgstr "Джерело" msgstr "Джерело"
#: rxconst.serrorlinkedtaskpanel
msgid "Not assigned task panel"
msgstr ""
#: rxconst.sexptcontrolnotfound #: rxconst.sexptcontrolnotfound
msgid "Control not found in validate %s." msgid "Control not found in validate %s."
msgstr "Елемент управління не знайдений в валідаторі %s" msgstr "Елемент управління не знайдений в валідаторі %s"

View File

@ -38,9 +38,14 @@ uses
Classes, SysUtils, Forms, Buttons, Menus, ExtCtrls, Graphics, Controls; Classes, SysUtils, Forms, Buttons, Menus, ExtCtrls, Graphics, Controls;
type type
TRxMDITaskOption = (rxtoMidleClickClose);
TRxMDITaskOptions = set of TRxMDITaskOption;
TRxMDIPanel = class; TRxMDIPanel = class;
TRxMDITasks = class; TRxMDITasks = class;
TRxMDIPanelChangeCurrentChild = procedure (Sender:TRxMDIPanel; AForm:TForm) of object;
{ TRxMDIButton } { TRxMDIButton }
TRxMDIButton = class(TSpeedButton) TRxMDIButton = class(TSpeedButton)
@ -60,6 +65,7 @@ type
FMenu:TPopupMenu; FMenu:TPopupMenu;
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
protected protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public public
constructor CreateButton(AOwner:TRxMDITasks; AForm:TForm); constructor CreateButton(AOwner:TRxMDITasks; AForm:TForm);
@ -75,6 +81,7 @@ type
FBtnScrollLeft:TSpeedButton; FBtnScrollLeft:TSpeedButton;
FBtnScrollRigth:TSpeedButton; FBtnScrollRigth:TSpeedButton;
FMainPanel: TRxMDIPanel; FMainPanel: TRxMDIPanel;
FOptions: TRxMDITaskOptions;
function GetFlatButton: boolean; function GetFlatButton: boolean;
procedure SetFlatButton(AValue: boolean); procedure SetFlatButton(AValue: boolean);
procedure UpdateScrollBtnStatus; procedure UpdateScrollBtnStatus;
@ -98,6 +105,7 @@ type
property ShowHint; property ShowHint;
property ParentShowHint; property ParentShowHint;
property FlatButton:boolean read GetFlatButton write SetFlatButton; property FlatButton:boolean read GetFlatButton write SetFlatButton;
property Options:TRxMDITaskOptions read FOptions write FOptions;
end; end;
{ TRxMDICloseButton } { TRxMDICloseButton }
@ -107,6 +115,8 @@ type
FInfoLabel:TBoundLabel; FInfoLabel:TBoundLabel;
FLabelSpacing:integer; FLabelSpacing:integer;
FMDIPanel:TRxMDIPanel; FMDIPanel:TRxMDIPanel;
FShowInfoLabel: boolean;
procedure SetShowInfoLabel(AValue: boolean);
protected protected
procedure SetParent(AParent: TWinControl); override; procedure SetParent(AParent: TWinControl); override;
procedure Loaded; override; procedure Loaded; override;
@ -120,6 +130,7 @@ type
property Anchors; property Anchors;
property Glyph; property Glyph;
property Flat; property Flat;
property ShowInfoLabel:boolean read FShowInfoLabel write SetShowInfoLabel default true;
end; end;
{ TRxMDIPanel } { TRxMDIPanel }
@ -128,14 +139,18 @@ type
private private
FCurrentChildWindow: TForm; FCurrentChildWindow: TForm;
FCloseButton: TRxMDICloseButton; FCloseButton: TRxMDICloseButton;
FHideCloseButton: boolean;
FOnChangeCurrentChild: TRxMDIPanelChangeCurrentChild;
FTaskPanel: TRxMDITasks; FTaskPanel: TRxMDITasks;
procedure SetCurrentChildWindow(AValue: TForm); procedure SetCurrentChildWindow(AValue: TForm);
procedure navCloseButtonClick(Sender: TObject); procedure navCloseButtonClick(Sender: TObject);
procedure SetHideCloseButton(AValue: boolean);
procedure SetRxMDICloseButton(AValue: TRxMDICloseButton); procedure SetRxMDICloseButton(AValue: TRxMDICloseButton);
procedure SetTaskPanel(AValue: TRxMDITasks); procedure SetTaskPanel(AValue: TRxMDITasks);
function MDIButtonByForm(AForm:TForm):TRxMDIButton; function MDIButtonByForm(AForm:TForm):TRxMDIButton;
procedure HideCurrentWindow; procedure HideCurrentWindow;
procedure ScreenEventRemoveForm(Sender: TObject; Form: TCustomForm); procedure ScreenEventRemoveForm(Sender: TObject; Form: TCustomForm);
procedure DoOnChangeCurrentChild(AForm:TForm);
protected protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Loaded; override; procedure Loaded; override;
@ -159,6 +174,8 @@ type
property BevelOuter; property BevelOuter;
property ShowHint; property ShowHint;
property ParentShowHint; property ParentShowHint;
property HideCloseButton:boolean read FHideCloseButton write SetHideCloseButton;
property OnChangeCurrentChild:TRxMDIPanelChangeCurrentChild read FOnChangeCurrentChild write FOnChangeCurrentChild;
end; end;
implementation implementation
@ -167,6 +184,14 @@ uses LResources, rxlclutils, rxconst;
{ TRxMDICloseButton } { TRxMDICloseButton }
procedure TRxMDICloseButton.SetShowInfoLabel(AValue: boolean);
begin
if FShowInfoLabel=AValue then Exit;
FShowInfoLabel:=AValue;
if Assigned(FInfoLabel) then
FInfoLabel.Visible:=FShowInfoLabel;
end;
procedure TRxMDICloseButton.SetParent(AParent: TWinControl); procedure TRxMDICloseButton.SetParent(AParent: TWinControl);
begin begin
inherited SetParent(AParent); inherited SetParent(AParent);
@ -232,6 +257,7 @@ begin
if FInfoLabel<>nil then exit; if FInfoLabel<>nil then exit;
FInfoLabel := TBoundLabel.Create(Self); FInfoLabel := TBoundLabel.Create(Self);
FInfoLabel.ControlStyle := FInfoLabel.ControlStyle + [csNoDesignSelectable]; FInfoLabel.ControlStyle := FInfoLabel.ControlStyle + [csNoDesignSelectable];
FInfoLabel.Visible:=FShowInfoLabel;
end; end;
constructor TRxMDICloseButton.Create(AOwner: TComponent); constructor TRxMDICloseButton.Create(AOwner: TComponent);
@ -239,6 +265,7 @@ begin
inherited Create(AOwner); inherited Create(AOwner);
// FLabelPosition := lpAbove; // FLabelPosition := lpAbove;
FLabelSpacing := 6; FLabelSpacing := 6;
FShowInfoLabel:=true;
CreateInternalLabel; CreateInternalLabel;
Glyph:=LoadLazResBitmapImage('RxMDICloseIcon'); Glyph:=LoadLazResBitmapImage('RxMDICloseIcon');
end; end;
@ -251,6 +278,9 @@ begin
if Assigned(FCloseButton) then if Assigned(FCloseButton) then
begin begin
FCloseButton.Enabled:=Assigned(FCurrentChildWindow); FCloseButton.Enabled:=Assigned(FCurrentChildWindow);
if FHideCloseButton then
FCloseButton.Visible:=FCloseButton.Enabled;
if FCloseButton.Enabled then if FCloseButton.Enabled then
FCloseButton.FInfoLabel.Caption:=FCurrentChildWindow.Caption FCloseButton.FInfoLabel.Caption:=FCurrentChildWindow.Caption
else else
@ -270,6 +300,19 @@ begin
end; end;
end; end;
procedure TRxMDIPanel.SetHideCloseButton(AValue: boolean);
begin
if FHideCloseButton=AValue then Exit;
FHideCloseButton:=AValue;
if Assigned(FCloseButton) then
if FHideCloseButton then
FCloseButton.Visible:=FCloseButton.Enabled
else
FCloseButton.Visible:=true;
end;
procedure TRxMDIPanel.SetRxMDICloseButton(AValue: TRxMDICloseButton); procedure TRxMDIPanel.SetRxMDICloseButton(AValue: TRxMDICloseButton);
begin begin
if FCloseButton=AValue then Exit; if FCloseButton=AValue then Exit;
@ -340,6 +383,12 @@ begin
end; end;
end; end;
procedure TRxMDIPanel.DoOnChangeCurrentChild(AForm: TForm);
begin
if Assigned(FOnChangeCurrentChild) then
FOnChangeCurrentChild(Self, AForm);
end;
procedure TRxMDIPanel.Notification(AComponent: TComponent; Operation: TOperation procedure TRxMDIPanel.Notification(AComponent: TComponent; Operation: TOperation
); );
begin begin
@ -382,7 +431,7 @@ procedure TRxMDIPanel.ChildWindowsAdd(F: TForm);
var var
B:TRxMDIButton; B:TRxMDIButton;
begin begin
Assert(Assigned(TaskPanel), 'Нет связанной панели задач'); Assert(Assigned(TaskPanel), sErrorLinkedTaskPanel);
HideCurrentWindow; HideCurrentWindow;
F.BorderStyle:=bsNone; F.BorderStyle:=bsNone;
F.Align:=alClient; F.Align:=alClient;
@ -392,7 +441,7 @@ begin
Application.MainForm.ActiveControl:=F; Application.MainForm.ActiveControl:=F;
B:=TRxMDIButton.CreateButton(TaskPanel, F); B:=TRxMDIButton.CreateButton(TaskPanel, F);
DoOnChangeCurrentChild(F);
end; end;
procedure TRxMDIPanel.ChildWindowsCreate(var AForm; FC: TFormClass); procedure TRxMDIPanel.ChildWindowsCreate(var AForm; FC: TFormClass);
@ -406,7 +455,11 @@ begin
ChildWindowsAdd(FForm); ChildWindowsAdd(FForm);
end end
else else
ShowWindow(FForm) begin
ShowWindow(FForm);
DoOnChangeCurrentChild(FForm);
end;
end; end;
procedure TRxMDIPanel.ChildWindowsUpdateCaption(F: TForm); procedure TRxMDIPanel.ChildWindowsUpdateCaption(F: TForm);
@ -587,8 +640,14 @@ procedure TRxMDITasks.Notification(AComponent: TComponent; Operation: TOperation
); );
begin begin
inherited Notification(AComponent, Operation); inherited Notification(AComponent, Operation);
if (AComponent = FMainPanel) and (Operation = opRemove) then if (Operation = opRemove) then
FMainPanel := nil begin
if (AComponent = FMainPanel) then
FMainPanel := nil
else
if (AComponent is TRxMDIButton) then
Invalidate;
end;
end; end;
constructor TRxMDITasks.Create(TheOwner: TComponent); constructor TRxMDITasks.Create(TheOwner: TComponent);
@ -721,7 +780,6 @@ procedure TRxMDIButton.DoCloseMenu(Sender: TObject);
begin begin
if Assigned(FNavForm) then if Assigned(FNavForm) then
FNavForm.Close; FNavForm.Close;
// Application.ProcessMessages;
end; end;
procedure TRxMDIButton.DoCloseAllMenu(Sender: TObject); procedure TRxMDIButton.DoCloseAllMenu(Sender: TObject);
@ -777,6 +835,20 @@ begin
Application.ReleaseComponent(Self); Application.ReleaseComponent(Self);
end; end;
procedure TRxMDIButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
begin
inherited MouseDown(Button, Shift, X, Y);
if Button = mbMiddle then
begin
if Assigned(Owner) then
begin
if rxtoMidleClickClose in (Owner as TRxMDITasks).Options then
DoCloseMenu(Self);
end;
end;
end;
procedure TRxMDIButton.Notification(AComponent: TComponent; procedure TRxMDIButton.Notification(AComponent: TComponent;
Operation: TOperation); Operation: TOperation);
begin begin
@ -813,6 +885,9 @@ begin
FNavPanel.FMainPanel.CurrentChildWindow:=NavForm; FNavPanel.FMainPanel.CurrentChildWindow:=NavForm;
if Assigned(FActiveControl) and FActiveControl.HandleObjectShouldBeVisible then if Assigned(FActiveControl) and FActiveControl.HandleObjectShouldBeVisible then
FActiveControl.SetFocus; FActiveControl.SetFocus;
if Assigned(FNavPanel.FMainPanel) then
FNavPanel.FMainPanel.DoOnChangeCurrentChild(FNavForm);
end; end;
Down:=true; Down:=true;
end; end;

View File

@ -5513,7 +5513,6 @@ end;
procedure TRxDBGrid.FFilterListEditorOnChange(Sender: TObject); procedure TRxDBGrid.FFilterListEditorOnChange(Sender: TObject);
begin begin
FFilterListEditor.Hide; FFilterListEditor.Hide;
// if FFilterListEditor.mod
with TRxColumn(Columns[Columns.RealIndex(FFilterListEditor.Col)]).Filter do with TRxColumn(Columns[Columns.RealIndex(FFilterListEditor.Col)]).Filter do
begin begin
if (FFilterListEditor.Text = EmptyValue) then if (FFilterListEditor.Text = EmptyValue) then
@ -5523,7 +5522,7 @@ begin
State:=rxfsEmpty;} State:=rxfsEmpty;}
end end
else else
if (FFilterListEditor.Text = AllValue) or (FFilterListEditor.Text = '') then if (FFilterListEditor.Text = AllValue) {or (FFilterListEditor.Text = '')} then
begin begin
ClearFilter; ClearFilter;
State:=rxfsAll; State:=rxfsAll;

View File

@ -106,9 +106,10 @@ resourcestring
sExptControlNotFound = 'Control not found in validate %s.'; sExptControlNotFound = 'Control not found in validate %s.';
{ RxMDI } { RxMDI }
sCloseWindows = 'Close window'; sCloseWindows = 'Close window';
sCloseAllExceptThis = 'Close all except this'; sCloseAllExceptThis = 'Close all except this';
sCloseAllWindows = 'Close all windows'; sCloseAllWindows = 'Close all windows';
sErrorLinkedTaskPanel = 'Not assigned task panel';//Нет связанной панели задач';
{ TRxDateRangeEdit } { TRxDateRangeEdit }
sFirstQuarter = 'First quarter'; sFirstQuarter = 'First quarter';