mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 13:29:35 +02:00
IDE: Move the "all component tabs" speedbutton into tabsheet
git-svn-id: trunk@42793 -
This commit is contained in:
parent
53705de2e3
commit
40664e7c02
@ -38,7 +38,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Controls, Forms, Graphics, ComCtrls, Buttons, FileUtil, Menus,
|
||||
LResources, AVL_Tree, PropEdits, FormEditingIntf, LazIDEIntf, IDEProcs, LCLProc,
|
||||
LResources, AVL_Tree, PropEdits, FormEditingIntf, LazIDEIntf, IDEProcs, LCLProc, ExtCtrls,
|
||||
{$IFDEF CustomIDEComps}
|
||||
CustomIDEComps,
|
||||
{$ENDIF}
|
||||
@ -67,11 +67,7 @@ type
|
||||
procedure PopupMenuPopup(Sender: TObject);
|
||||
private
|
||||
fComponents: TAVLTree; // tree of TRegisteredComponent sorted for componentclass
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
FPageControl: TExtendedTabControl;
|
||||
{$ELSE}
|
||||
FPageControl: TPageControl;
|
||||
{$ENDIF}
|
||||
fNoteBookNeedsUpdate: boolean;
|
||||
FOnOpenPackage: TNotifyEvent;
|
||||
FOnOpenUnit: TNotifyEvent;
|
||||
@ -81,11 +77,7 @@ type
|
||||
fUnregisteredIcon: TCustomBitmap;
|
||||
fSelectButtonIcon: TCustomBitmap;
|
||||
fUpdatingPageControl: boolean;
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
procedure SetPageControl(const AValue: TExtendedTabControl);
|
||||
{$ELSE}
|
||||
procedure SetPageControl(const AValue: TPageControl);
|
||||
{$ENDIF}
|
||||
procedure SelectionToolClick(Sender: TObject);
|
||||
procedure ComponentBtnMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
@ -124,11 +116,7 @@ type
|
||||
const RegisterProc: RegisterUnitComponentProc); override;
|
||||
procedure UpdateVisible; override;
|
||||
public
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
property PageControl: TExtendedTabControl read FPageControl write SetPageControl;
|
||||
{$ELSE}
|
||||
property PageControl: TPageControl read FPageControl write SetPageControl;
|
||||
{$ENDIF}
|
||||
property SelectionMode: TComponentSelectionMode read FSelectionMode write FSelectionMode;
|
||||
property OnOpenPackage: TNotifyEvent read FOnOpenPackage write FOnOpenPackage;
|
||||
property OnOpenUnit: TNotifyEvent read FOnOpenUnit write FOnOpenUnit;
|
||||
@ -255,11 +243,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
procedure TComponentPalette.SetPageControl(const AValue: TExtendedTabControl);
|
||||
{$ELSE}
|
||||
procedure TComponentPalette.SetPageControl(const AValue: TPageControl);
|
||||
{$ENDIF}
|
||||
var
|
||||
MenuItem: TMenuItem;
|
||||
begin
|
||||
@ -384,11 +368,7 @@ begin
|
||||
// select button
|
||||
if (FSelected<>nil) and (FPageControl<>nil) then begin
|
||||
TSpeedButton(FSelected.Button).Down:=true;
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
FPageControl.ActivePage:=TExtendedTabSheet(FSelected.Page.PageComponent);
|
||||
{$ELSE}
|
||||
FPageControl.ActivePage:=TTabSheet(FSelected.Page.PageComponent);
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -662,11 +642,7 @@ end;
|
||||
|
||||
procedure TComponentPalette.UpdateNoteBookButtons;
|
||||
var
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
OldActivePage: TExtendedTabSheet;
|
||||
{$ELSE}
|
||||
OldActivePage: TTabSheet;
|
||||
{$ENDIF}
|
||||
|
||||
procedure RemoveUnneededPage(aSheet: TCustomPage);
|
||||
var
|
||||
@ -697,6 +673,8 @@ var
|
||||
var
|
||||
CurPageIndex: Integer;
|
||||
CurScrollBox: TScrollBox;
|
||||
PanelRight: TPanel;
|
||||
BtnRight: TSpeedButton;
|
||||
begin
|
||||
if not aCompPage.Visible then Exit;
|
||||
if aCompPage.PageComponent=nil then begin
|
||||
@ -712,6 +690,26 @@ var
|
||||
VertScrollBar.Increment := ComponentPaletteBtnHeight;
|
||||
Parent := aCompPage.PageComponent;
|
||||
end;
|
||||
PanelRight := TPanel.Create(aCompPage.PageComponent);
|
||||
with PanelRight do
|
||||
begin
|
||||
Align := alRight;
|
||||
Caption := '';
|
||||
BevelOuter := bvNone;
|
||||
Width := 20;
|
||||
Visible := True; // EnvironmentOptions.IDESpeedButtonsVisible;
|
||||
Parent := aCompPage.PageComponent;
|
||||
end;
|
||||
BtnRight:=TSpeedButton.Create(aCompPage.PageComponent);
|
||||
with BtnRight do
|
||||
begin
|
||||
LoadGlyphFromLazarusResource('SelCompPage');
|
||||
Flat := True;
|
||||
SetBounds(2,1,16,16);
|
||||
Hint := 'Click to Select Palette Page';
|
||||
OnClick := @MainIDE.SelComponentPageButtonClick;
|
||||
Parent := PanelRight;
|
||||
end;
|
||||
end else begin
|
||||
// move to the right position
|
||||
CurPageIndex := aCompPage.PageComponent.PageIndex;
|
||||
|
57
ide/main.pp
57
ide/main.pp
@ -436,7 +436,7 @@ type
|
||||
// ComponentPalette events
|
||||
procedure ComponentPaletteClassSelected(Sender: TObject);
|
||||
// Copied from CodeTyphon
|
||||
procedure SelComponentPageButtonClick(Sender: TObject);
|
||||
procedure SelComponentPageButtonClick(Sender: TObject); override;
|
||||
|
||||
// SourceNotebook events
|
||||
procedure OnSrcNoteBookActivated(Sender: TObject);
|
||||
@ -2012,18 +2012,6 @@ begin
|
||||
AutoSize := true;
|
||||
Visible := EnvironmentOptions.IDESpeedButtonsVisible;
|
||||
end;
|
||||
// Panel on right side of component palette
|
||||
MainIDEBar.pnlRightSpeedButtons := TPanel.Create(OwningComponent);
|
||||
with MainIDEBar.pnlRightSpeedButtons do
|
||||
begin
|
||||
Name := 'pnlRightSpeedButtons';
|
||||
Parent := MainIDEBar;
|
||||
Align := alRight;
|
||||
Caption := '';
|
||||
BevelOuter := bvNone;
|
||||
Width := 17;
|
||||
Visible := EnvironmentOptions.IDESpeedButtonsVisible;
|
||||
end;
|
||||
|
||||
MainIDEBar.tbViewDebug := CreateToolBar('tbViewDebug');
|
||||
MainIDEBar.tbStandard := CreateToolBar('tbStandard');
|
||||
@ -2057,24 +2045,6 @@ begin
|
||||
MainIDEBar.BuildModeSpeedButton.Style:=tbsDropDown;
|
||||
MainIDEBar.BuildModeSpeedButton.DropdownMenu:=MainIDEBar.SetBuildModePopupMenu;
|
||||
MainIDEBar.SetBuildModePopupMenu.OnPopup := @SetBuildModePopupMenuPopup;
|
||||
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
MainIDEBar.pnlRightSpeedButtons.Hide;
|
||||
{$ELSE}
|
||||
MainIDEBar.pnlRightSpeedButtons.Hide;
|
||||
// Copied from CodeTyphon
|
||||
MainIDEBar.SelComponentPageButton:=TSpeedButton.Create(MainIDEBar.pnlRightSpeedButtons);
|
||||
with MainIDEBar.SelComponentPageButton do
|
||||
begin
|
||||
Name := 'PalettePageSelectBtn';
|
||||
Parent := MainIDEBar.tbStandard;
|
||||
LoadGlyphFromLazarusResource('SelCompPage');
|
||||
Flat := True;
|
||||
SetBounds(1,31,16,16);
|
||||
Hint := 'Click to Select Palette Page';
|
||||
OnClick := @SelComponentPageButtonClick;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TMainIDE.SetupDialogs;
|
||||
@ -2089,34 +2059,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.SetupComponentPalette;
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
var
|
||||
Btn: TExtendedTabToolButton;
|
||||
{$ENDIF}
|
||||
begin
|
||||
// Component palette
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
MainIDEBar.ComponentPageControl := TExtendedTabControl.Create(OwningComponent);
|
||||
|
||||
MainIDEBar.SelComponentPageButton:=TSpeedButton.Create(MainIDEBar.pnlRightSpeedButtons);
|
||||
with MainIDEBar.SelComponentPageButton do
|
||||
begin
|
||||
Btn := TExtendedTabToolButton.Create(OwningComponent);
|
||||
Btn.Style := tbsButton;
|
||||
Btn.Caption := '';
|
||||
Btn.Hint := 'Click to Select Palette Page';
|
||||
Btn.OnClick := @SelComponentPageButtonClick;
|
||||
MainIDEBar.ComponentPageControl.ShowToolBar := tsRight;
|
||||
MainIDEBar.ComponentPageControl.ToolBar.EdgeBorders := [];
|
||||
MainIDEBar.ComponentPageControl.ToolBar.AcceptButton(Btn);
|
||||
|
||||
MainIDEBar.ComponentPageControl.ToolBar.Images := TImageList.Create(OwningComponent);
|
||||
MainIDEBar.ComponentPageControl.ToolBar.Images.AddLazarusResource('SelCompPage');
|
||||
Btn.ImageIndex := 0;
|
||||
end;
|
||||
{$ELSE}
|
||||
MainIDEBar.ComponentPageControl := TPageControl.Create(OwningComponent);
|
||||
{$ENDIF}
|
||||
with MainIDEBar.ComponentPageControl do begin
|
||||
Name := 'ComponentPageControl';
|
||||
Align := alClient;
|
||||
|
@ -73,7 +73,6 @@ type
|
||||
StepIntoSpeedButton : TToolButton;
|
||||
StepOverSpeedButton : TToolButton;
|
||||
StepOutSpeedButton : TToolButton;
|
||||
pnlRightSpeedButtons : TPanel;
|
||||
|
||||
NewUnitFormPopupMenu : TPopupMenu;
|
||||
NewUFSetDefaultMenuItem: TMenuItem;
|
||||
@ -368,12 +367,7 @@ type
|
||||
//itmHelpTools: TIDEMenuSection;
|
||||
|
||||
// component palette
|
||||
{$IFDEF NEW_MAIN_IDE_TABS}
|
||||
ComponentPageControl: TExtendedTabControl;
|
||||
{$ELSE}
|
||||
ComponentPageControl: TPageControl;
|
||||
{$ENDIF}
|
||||
SelComponentPageButton: TSpeedButton;
|
||||
GlobalMouseSpeedButton: TSpeedButton;
|
||||
private
|
||||
FOldWindowState: TWindowState;
|
||||
|
@ -200,6 +200,10 @@ type
|
||||
|
||||
procedure FindInFilesPerDialog(AProject: TProject); override;
|
||||
procedure FindInFiles(AProject: TProject; const FindText: string); override;
|
||||
|
||||
// Copied from CodeTyphon
|
||||
procedure SelComponentPageButtonClick(Sender: TObject); virtual; abstract;
|
||||
|
||||
public
|
||||
property ToolStatus: TIDEToolStatus read FToolStatus write SetToolStatus;
|
||||
property WindowMenuActiveForm: TCustomForm read FWindowMenuActiveForm write FWindowMenuActiveForm;
|
||||
|
Loading…
Reference in New Issue
Block a user