mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 17:39:22 +02:00
* Enable close tabs
git-svn-id: trunk@63161 -
This commit is contained in:
parent
c64cd287c5
commit
0b958007c1
@ -261,6 +261,8 @@ object MainForm: TMainForm
|
|||||||
Align = alRight
|
Align = alRight
|
||||||
Images = ILMain
|
Images = ILMain
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
|
OnCloseTabClicked = DoCloseTabClick
|
||||||
|
Options = [nboShowCloseButtons, nboKeyboardTabSwitch]
|
||||||
end
|
end
|
||||||
object SRecent: TSplitter
|
object SRecent: TSplitter
|
||||||
Left = 458
|
Left = 458
|
||||||
|
@ -211,6 +211,7 @@ type
|
|||||||
procedure OpenRecentDatadict(Sender: TObject);
|
procedure OpenRecentDatadict(Sender: TObject);
|
||||||
procedure LVDictsKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure LVDictsKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure MIDataDictClick(Sender: TObject);
|
procedure MIDataDictClick(Sender: TObject);
|
||||||
|
procedure DoCloseTabClick(Sender: TObject);
|
||||||
procedure PMAllPopup(Sender: TObject);
|
procedure PMAllPopup(Sender: TObject);
|
||||||
procedure SaveAsExecute(Sender: TObject);
|
procedure SaveAsExecute(Sender: TObject);
|
||||||
procedure TVAllDblClick(Sender: TObject);
|
procedure TVAllDblClick(Sender: TObject);
|
||||||
@ -224,8 +225,11 @@ type
|
|||||||
procedure AddRecentConnectionList(RC: TRecentConnection; AssumeNew: Boolean);
|
procedure AddRecentConnectionList(RC: TRecentConnection; AssumeNew: Boolean);
|
||||||
procedure AddRecentConnectionTree(RC: TRecentConnection; AssumeNew: Boolean);
|
procedure AddRecentConnectionTree(RC: TRecentConnection; AssumeNew: Boolean);
|
||||||
procedure CheckParams;
|
procedure CheckParams;
|
||||||
|
function CloseConnectionEditor(aTab: TConnectionEditor): TModalResult;
|
||||||
function CloseCurrentConnection: TModalResult;
|
function CloseCurrentConnection: TModalResult;
|
||||||
function CloseCurrentTab(AddCancelClose: Boolean = False): TModalResult;
|
function CloseCurrentTab(AddCancelClose: Boolean = False): TModalResult;
|
||||||
|
function CloseDataEditor(DD: TDataDictEditor; AddCancelClose: Boolean): TModalResult;
|
||||||
|
function CloseTab(aTab : TTabsheet; AddCancelClose: Boolean = False): TModalResult;
|
||||||
procedure DeleteRecentConnection;
|
procedure DeleteRecentConnection;
|
||||||
procedure DeleteRecentDataDict;
|
procedure DeleteRecentDataDict;
|
||||||
procedure DoShowNewConnectionTypes(ParentMenu: TMenuItem);
|
procedure DoShowNewConnectionTypes(ParentMenu: TMenuItem);
|
||||||
@ -1304,41 +1308,57 @@ begin
|
|||||||
Result:=CloseCurrentTab(True)<>mrCancel;
|
Result:=CloseCurrentTab(True)<>mrCancel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TMainForm.CloseCurrentTab(AddCancelClose: Boolean): TModalResult;
|
function TMainForm.CloseCurrentTab(AddCancelClose: Boolean): TModalResult;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If (CurrentEditor<>Nil) then
|
Result:=CloseTab(PCItems.ActivePage,AddCancelClose);
|
||||||
Result:=CloseCurrentEditor(AddCancelClose)
|
end;
|
||||||
else if (CurrentConnection<>Nil) then
|
|
||||||
|
function TMainForm.CloseTab(aTab : TTabsheet; AddCancelClose: Boolean = False): TModalResult;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
CloseCurrentConnection;
|
If (aTab is TDataDictEditor) then
|
||||||
|
Result:=CloseDataEditor(aTab as TDataDictEditor,AddCancelClose)
|
||||||
|
else if (aTab is TConnectionEditor) then
|
||||||
|
Result:=CloseConnectionEditor(aTab as TConnectionEditor)
|
||||||
|
else
|
||||||
Result:=mrOK;
|
Result:=mrOK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TMainForm.CloseConnectionEditor(aTab : TConnectionEditor): TModalResult;
|
||||||
|
|
||||||
|
begin
|
||||||
|
aTab.Frame.DisConnect;
|
||||||
|
Application.ReleaseComponent(aTab);
|
||||||
|
aTab.Free;
|
||||||
|
Result:=mrOK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainForm.CloseCurrentConnection: TModalResult;
|
function TMainForm.CloseCurrentConnection: TModalResult;
|
||||||
|
|
||||||
Var
|
|
||||||
CE : TConnectionEditor;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
CE:=CurrentConnection;
|
if CurrentConnection<>Nil then
|
||||||
CE.Frame.DisConnect;
|
Result:=CloseConnectionEditor(CurrentConnection)
|
||||||
Application.ReleaseComponent(CE);
|
else
|
||||||
CE.Free;
|
|
||||||
Result:=mrOK;
|
Result:=mrOK;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TMainForm.CloseCurrentEditor(AddCancelClose: Boolean): TModalResult;
|
function TMainForm.CloseCurrentEditor(AddCancelClose: Boolean): TModalResult;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=CloseDataEditor(CurrentEditor,AddCancelClose);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TMainForm.CloseDataEditor(DD : TDataDictEditor;AddCancelClose: Boolean): TModalResult;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
DD : TDataDictEditor;
|
|
||||||
Msg : String;
|
Msg : String;
|
||||||
DDF : TRecentDataDict;
|
DDF : TRecentDataDict;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=mrYes;
|
Result:=mrYes;
|
||||||
DD:=CurrentEditor;
|
|
||||||
If (DD=Nil) then
|
If (DD=Nil) then
|
||||||
Exit;
|
Exit;
|
||||||
If DD.Modified then
|
If DD.Modified then
|
||||||
@ -1590,6 +1610,12 @@ begin
|
|||||||
ShowDDImports;
|
ShowDDImports;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.DoCloseTabClick(Sender: TObject);
|
||||||
|
|
||||||
|
begin
|
||||||
|
CloseTab(Sender as TTabSheet,True);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.PMAllPopup(Sender: TObject);
|
procedure TMainForm.PMAllPopup(Sender: TObject);
|
||||||
|
|
||||||
Type
|
Type
|
||||||
|
Loading…
Reference in New Issue
Block a user