mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 01:19:29 +02:00
ide: add statusbar component editor
git-svn-id: trunk@14693 -
This commit is contained in:
parent
65d8d6bfdc
commit
f58a2b84d9
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2261,6 +2261,7 @@ ideintf/packageintf.pas svneol=native#text/pascal
|
||||
ideintf/projectintf.pas svneol=native#text/pascal
|
||||
ideintf/propedits.pp svneol=native#text/pascal
|
||||
ideintf/srceditorintf.pas svneol=native#text/pascal
|
||||
ideintf/statusbarpropedit.pp svneol=native#text/pascal
|
||||
ideintf/stringspropeditdlg.lfm svneol=native#text/plain
|
||||
ideintf/stringspropeditdlg.lrs svneol=native#text/plain
|
||||
ideintf/stringspropeditdlg.pas svneol=native#text/plain
|
||||
|
@ -53,6 +53,7 @@ uses
|
||||
ProjectIntf,
|
||||
PropEdits,
|
||||
SrcEditorIntf,
|
||||
StatusBarPropEdit,
|
||||
StringsPropEditDlg,
|
||||
LazStringGridEdit,
|
||||
TextTools,
|
||||
|
@ -150,6 +150,9 @@ resourcestring
|
||||
// HeaderControl Editor
|
||||
sccsHCEditSections = 'Sections Editor ...';
|
||||
|
||||
// StatusBar Editor
|
||||
sccsSBEditPanels = 'Panels Editor ...';
|
||||
|
||||
// component editors
|
||||
nbcesAddPage = 'Add page';
|
||||
nbcesInsertPage = 'Insert page';
|
||||
|
69
ideintf/statusbarpropedit.pp
Normal file
69
ideintf/statusbarpropedit.pp
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
*****************************************************************************
|
||||
* *
|
||||
* See the file COPYING.modifiedLGPL, included in this distribution, *
|
||||
* for details about the copyright. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* *
|
||||
*****************************************************************************
|
||||
|
||||
Property editor for TStatusBar objects
|
||||
|
||||
}
|
||||
unit StatusBarPropEdit;
|
||||
|
||||
{$MODE OBJFPC}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, ComCtrls, PropEdits, ComponentEditors, ObjInspStrConsts;
|
||||
|
||||
type
|
||||
{ TStatusBarComponentEditor }
|
||||
|
||||
TStatusBarComponentEditor = class(TComponentEditor)
|
||||
public
|
||||
procedure ExecuteVerb(Index: Integer); override;
|
||||
function GetVerb(Index: Integer): string; override;
|
||||
function GetVerbCount: Integer; override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
{ TStatusBarComponentEditor }
|
||||
|
||||
procedure TStatusBarComponentEditor.ExecuteVerb(Index: Integer);
|
||||
var
|
||||
Hook: TPropertyEditorHook;
|
||||
AStatusBar: TStatusBar;
|
||||
begin
|
||||
if Index = 0 then
|
||||
begin
|
||||
GetHook(Hook);
|
||||
AStatusBar := GetComponent as TStatusBar;
|
||||
EditCollection(AStatusBar, AStatusBar.Panels, 'Panels');
|
||||
if Assigned(Hook) then Hook.Modified(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TStatusBarComponentEditor.GetVerb(Index: Integer): string;
|
||||
begin
|
||||
Result := '';
|
||||
if Index = 0 then Result := sccsSBEditPanels;
|
||||
end;
|
||||
|
||||
function TStatusBarComponentEditor.GetVerbCount: Integer;
|
||||
begin
|
||||
Result := 1;
|
||||
end;
|
||||
|
||||
initialization
|
||||
//Register a component editor for TStatusBar
|
||||
RegisterComponentEditor(TStatusBar, TStatusBarComponentEditor);
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user