ide: add statusbar component editor

git-svn-id: trunk@14693 -
This commit is contained in:
paul 2008-03-31 00:54:24 +00:00
parent 65d8d6bfdc
commit f58a2b84d9
4 changed files with 74 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -53,6 +53,7 @@ uses
ProjectIntf,
PropEdits,
SrcEditorIntf,
StatusBarPropEdit,
StringsPropEditDlg,
LazStringGridEdit,
TextTools,

View File

@ -150,6 +150,9 @@ resourcestring
// HeaderControl Editor
sccsHCEditSections = 'Sections Editor ...';
// StatusBar Editor
sccsSBEditPanels = 'Panels Editor ...';
// component editors
nbcesAddPage = 'Add page';
nbcesInsertPage = 'Insert page';

View 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.