added View Source (.lfm) menu item to designer popup menu

git-svn-id: trunk@7518 -
This commit is contained in:
mattias 2005-08-17 11:47:40 +00:00
parent cf9646b109
commit 299a0045a9
4 changed files with 36 additions and 2 deletions

View File

@ -106,6 +106,7 @@ type
FOnSetDesigning: TOnSetDesigning;
FOnShowOptions: TNotifyEvent;
FOnUnselectComponentClass: TNotifyEvent;
FOnViewLFM: TNotifyEvent;
FOrderSubMenu: TMenuItem;
FOrderMoveToFrontMenuItem: TMenuItem;
FOrderMoveToBackMenuItem: TMenuItem;
@ -121,6 +122,7 @@ type
FSnapToGuideLinesOptionMenuItem: TMenuItem;
FTabOrderMenuItem: TMenuItem;
FTheFormEditor: TCustomFormEditor;
fViewLFMMenuItem: TMenuItem;
//hint stuff
FHintTimer : TTimer;
@ -217,6 +219,7 @@ type
procedure OnSnapToGridOptionMenuClick(Sender: TObject);
procedure OnShowOptionsMenuItemClick(Sender: TObject);
procedure OnSnapToGuideLinesOptionMenuClick(Sender: TObject);
procedure OnViewLFMMenuClick(Sender: TObject);
// hook
function GetPropertyEditorHook: TPropertyEditorHook; override;
@ -311,6 +314,7 @@ type
write FOnUnselectComponentClass;
property OnShowOptions: TNotifyEvent
read FOnShowOptions write FOnShowOptions;
property OnViewLFM: TNotifyEvent read FOnViewLFM write FOnViewLFM;
property ShowGrid: boolean read GetShowGrid write SetShowGrid;
property ShowEditorHints: boolean
read GetShowEditorHints write SetShowEditorHints;
@ -1995,6 +1999,11 @@ begin
EnvironmentOptions.SnapToGuideLines:=not EnvironmentOptions.SnapToGuideLines;
end;
procedure TDesigner.OnViewLFMMenuClick(Sender: TObject);
begin
if Assigned(OnViewLFM) then OnViewLFM(Self);
end;
procedure TDesigner.OnCopyMenuClick(Sender: TObject);
begin
CopySelection;
@ -2518,6 +2527,13 @@ begin
end;
FPopupMenu.Items.Add(fChangeClassMenuItem);
fViewLFMMenuItem:=TMenuItem.Create(FPopupMenu);
with fViewLFMMenuItem do begin
Caption:= lisViewSourceLfm;
OnClick:=@OnViewLFMMenuClick;
end;
FPopupMenu.Items.Add(fViewLFMMenuItem);
AddSeparator;
// options

View File

@ -106,7 +106,6 @@ procedure ShowMenuEditor(AMenu: TMenu);
begin
if AMenu=nil then RaiseGDBException('ShowMenuEditor AMenu=nil');
if MainMenuEditorForm=nil then begin
MainMenuEditorForm:=TMainMenuEditorForm.CreateWithMenu(Application,AMenu);
end;
MainMenuEditorForm.SetMenu(AMenu);
@ -159,6 +158,7 @@ begin
for i:=0 to fDesigner.Form.ComponentCount - 1 do
begin
CurComponent:=fDesigner.Form.Components[i];
debugln('TMainMenuEditorForm.UpdateListOfMenus A ',dbgsName(CurComponent));
if (CurComponent is TMainMenu) or (CurComponent is TPopupMenu) then
begin
List_menus.Items.Add(CurComponent.Name);
@ -303,7 +303,8 @@ end;
{ TMainMenuComponentEditor}
constructor TMainMenuComponentEditor.Create(AComponent: TComponent; aDesigner: TComponentEditorDesigner);
constructor TMainMenuComponentEditor.Create(AComponent: TComponent;
aDesigner: TComponentEditorDesigner);
begin
inherited Create(AComponent,ADesigner);
fDesigner:=aDesigner;

View File

@ -1214,6 +1214,7 @@ resourcestring
fdmDeleteSelection='Delete selection';
lisChangeClass = 'Change Class';
fdmSnapToGridOption='Option: Snap to grid';
lisViewSourceLfm = 'View Source (.lfm)';
fdmSnapToGuideLinesOption='Option: Snap to guide lines';
fdmShowOptions='Show Options for form editing';

View File

@ -376,6 +376,7 @@ type
procedure OnDesignerCloseQuery(Sender: TObject);
procedure OnDesignerRenameComponent(ADesigner: TDesigner;
AComponent: TComponent; const NewName: string);
procedure OnDesignerViewLFM(Sender: TObject);
// control selection
procedure OnControlSelectionChanged(Sender: TObject);
@ -2504,6 +2505,7 @@ Begin
OnSetDesigning:=@OnDesignerSetDesigning;
OnShowOptions:=@OnDesignerShowOptions;
OnUnselectComponentClass:=@OnDesignerUnselectComponentClass;
OnViewLFM:=@OnDesignerViewLFM;
ShowEditorHints:=EnvironmentOptions.ShowEditorHints;
ShowComponentCaptionHints:=EnvironmentOptions.ShowComponentCaptions;
end;
@ -10937,6 +10939,20 @@ begin
end;
end;
procedure TMainIDE.OnDesignerViewLFM(Sender: TObject);
var
ADesigner: TDesigner;
ASrcEdit: TSourceEditor;
AnUnitInfo: TUnitInfo;
begin
ADesigner:=TDesigner(Sender);
GetDesignerUnit(ADesigner,ASrcEdit,AnUnitInfo);
debugln('TMainIDE.OnDesignerViewLFM ',AnUnitInfo.Filename);
OnDesignerCloseQuery(Sender);
DoOpenEditorFile(ChangeFileExt(AnUnitInfo.Filename,'.lfm'),
AnUnitInfo.EditorIndex+1,[]);
end;
Procedure TMainIDE.OnSrcNoteBookAddJumpPoint(ACaretXY: TPoint;
ATopLine: integer; APageIndex: integer; DeleteForwardHistory: boolean);
{off $DEFINE VerboseJumpHistory}