mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-16 07:02:41 +02:00
added View Source (.lfm) menu item to designer popup menu
git-svn-id: trunk@7518 -
This commit is contained in:
parent
cf9646b109
commit
299a0045a9
@ -106,6 +106,7 @@ type
|
|||||||
FOnSetDesigning: TOnSetDesigning;
|
FOnSetDesigning: TOnSetDesigning;
|
||||||
FOnShowOptions: TNotifyEvent;
|
FOnShowOptions: TNotifyEvent;
|
||||||
FOnUnselectComponentClass: TNotifyEvent;
|
FOnUnselectComponentClass: TNotifyEvent;
|
||||||
|
FOnViewLFM: TNotifyEvent;
|
||||||
FOrderSubMenu: TMenuItem;
|
FOrderSubMenu: TMenuItem;
|
||||||
FOrderMoveToFrontMenuItem: TMenuItem;
|
FOrderMoveToFrontMenuItem: TMenuItem;
|
||||||
FOrderMoveToBackMenuItem: TMenuItem;
|
FOrderMoveToBackMenuItem: TMenuItem;
|
||||||
@ -121,6 +122,7 @@ type
|
|||||||
FSnapToGuideLinesOptionMenuItem: TMenuItem;
|
FSnapToGuideLinesOptionMenuItem: TMenuItem;
|
||||||
FTabOrderMenuItem: TMenuItem;
|
FTabOrderMenuItem: TMenuItem;
|
||||||
FTheFormEditor: TCustomFormEditor;
|
FTheFormEditor: TCustomFormEditor;
|
||||||
|
fViewLFMMenuItem: TMenuItem;
|
||||||
|
|
||||||
//hint stuff
|
//hint stuff
|
||||||
FHintTimer : TTimer;
|
FHintTimer : TTimer;
|
||||||
@ -217,6 +219,7 @@ type
|
|||||||
procedure OnSnapToGridOptionMenuClick(Sender: TObject);
|
procedure OnSnapToGridOptionMenuClick(Sender: TObject);
|
||||||
procedure OnShowOptionsMenuItemClick(Sender: TObject);
|
procedure OnShowOptionsMenuItemClick(Sender: TObject);
|
||||||
procedure OnSnapToGuideLinesOptionMenuClick(Sender: TObject);
|
procedure OnSnapToGuideLinesOptionMenuClick(Sender: TObject);
|
||||||
|
procedure OnViewLFMMenuClick(Sender: TObject);
|
||||||
|
|
||||||
// hook
|
// hook
|
||||||
function GetPropertyEditorHook: TPropertyEditorHook; override;
|
function GetPropertyEditorHook: TPropertyEditorHook; override;
|
||||||
@ -311,6 +314,7 @@ type
|
|||||||
write FOnUnselectComponentClass;
|
write FOnUnselectComponentClass;
|
||||||
property OnShowOptions: TNotifyEvent
|
property OnShowOptions: TNotifyEvent
|
||||||
read FOnShowOptions write FOnShowOptions;
|
read FOnShowOptions write FOnShowOptions;
|
||||||
|
property OnViewLFM: TNotifyEvent read FOnViewLFM write FOnViewLFM;
|
||||||
property ShowGrid: boolean read GetShowGrid write SetShowGrid;
|
property ShowGrid: boolean read GetShowGrid write SetShowGrid;
|
||||||
property ShowEditorHints: boolean
|
property ShowEditorHints: boolean
|
||||||
read GetShowEditorHints write SetShowEditorHints;
|
read GetShowEditorHints write SetShowEditorHints;
|
||||||
@ -1995,6 +1999,11 @@ begin
|
|||||||
EnvironmentOptions.SnapToGuideLines:=not EnvironmentOptions.SnapToGuideLines;
|
EnvironmentOptions.SnapToGuideLines:=not EnvironmentOptions.SnapToGuideLines;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDesigner.OnViewLFMMenuClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Assigned(OnViewLFM) then OnViewLFM(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDesigner.OnCopyMenuClick(Sender: TObject);
|
procedure TDesigner.OnCopyMenuClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CopySelection;
|
CopySelection;
|
||||||
@ -2518,6 +2527,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
FPopupMenu.Items.Add(fChangeClassMenuItem);
|
FPopupMenu.Items.Add(fChangeClassMenuItem);
|
||||||
|
|
||||||
|
fViewLFMMenuItem:=TMenuItem.Create(FPopupMenu);
|
||||||
|
with fViewLFMMenuItem do begin
|
||||||
|
Caption:= lisViewSourceLfm;
|
||||||
|
OnClick:=@OnViewLFMMenuClick;
|
||||||
|
end;
|
||||||
|
FPopupMenu.Items.Add(fViewLFMMenuItem);
|
||||||
|
|
||||||
AddSeparator;
|
AddSeparator;
|
||||||
|
|
||||||
// options
|
// options
|
||||||
|
@ -106,7 +106,6 @@ procedure ShowMenuEditor(AMenu: TMenu);
|
|||||||
begin
|
begin
|
||||||
if AMenu=nil then RaiseGDBException('ShowMenuEditor AMenu=nil');
|
if AMenu=nil then RaiseGDBException('ShowMenuEditor AMenu=nil');
|
||||||
if MainMenuEditorForm=nil then begin
|
if MainMenuEditorForm=nil then begin
|
||||||
|
|
||||||
MainMenuEditorForm:=TMainMenuEditorForm.CreateWithMenu(Application,AMenu);
|
MainMenuEditorForm:=TMainMenuEditorForm.CreateWithMenu(Application,AMenu);
|
||||||
end;
|
end;
|
||||||
MainMenuEditorForm.SetMenu(AMenu);
|
MainMenuEditorForm.SetMenu(AMenu);
|
||||||
@ -159,6 +158,7 @@ begin
|
|||||||
for i:=0 to fDesigner.Form.ComponentCount - 1 do
|
for i:=0 to fDesigner.Form.ComponentCount - 1 do
|
||||||
begin
|
begin
|
||||||
CurComponent:=fDesigner.Form.Components[i];
|
CurComponent:=fDesigner.Form.Components[i];
|
||||||
|
debugln('TMainMenuEditorForm.UpdateListOfMenus A ',dbgsName(CurComponent));
|
||||||
if (CurComponent is TMainMenu) or (CurComponent is TPopupMenu) then
|
if (CurComponent is TMainMenu) or (CurComponent is TPopupMenu) then
|
||||||
begin
|
begin
|
||||||
List_menus.Items.Add(CurComponent.Name);
|
List_menus.Items.Add(CurComponent.Name);
|
||||||
@ -303,7 +303,8 @@ end;
|
|||||||
|
|
||||||
{ TMainMenuComponentEditor}
|
{ TMainMenuComponentEditor}
|
||||||
|
|
||||||
constructor TMainMenuComponentEditor.Create(AComponent: TComponent; aDesigner: TComponentEditorDesigner);
|
constructor TMainMenuComponentEditor.Create(AComponent: TComponent;
|
||||||
|
aDesigner: TComponentEditorDesigner);
|
||||||
begin
|
begin
|
||||||
inherited Create(AComponent,ADesigner);
|
inherited Create(AComponent,ADesigner);
|
||||||
fDesigner:=aDesigner;
|
fDesigner:=aDesigner;
|
||||||
|
@ -1214,6 +1214,7 @@ resourcestring
|
|||||||
fdmDeleteSelection='Delete selection';
|
fdmDeleteSelection='Delete selection';
|
||||||
lisChangeClass = 'Change Class';
|
lisChangeClass = 'Change Class';
|
||||||
fdmSnapToGridOption='Option: Snap to grid';
|
fdmSnapToGridOption='Option: Snap to grid';
|
||||||
|
lisViewSourceLfm = 'View Source (.lfm)';
|
||||||
fdmSnapToGuideLinesOption='Option: Snap to guide lines';
|
fdmSnapToGuideLinesOption='Option: Snap to guide lines';
|
||||||
fdmShowOptions='Show Options for form editing';
|
fdmShowOptions='Show Options for form editing';
|
||||||
|
|
||||||
|
16
ide/main.pp
16
ide/main.pp
@ -376,6 +376,7 @@ type
|
|||||||
procedure OnDesignerCloseQuery(Sender: TObject);
|
procedure OnDesignerCloseQuery(Sender: TObject);
|
||||||
procedure OnDesignerRenameComponent(ADesigner: TDesigner;
|
procedure OnDesignerRenameComponent(ADesigner: TDesigner;
|
||||||
AComponent: TComponent; const NewName: string);
|
AComponent: TComponent; const NewName: string);
|
||||||
|
procedure OnDesignerViewLFM(Sender: TObject);
|
||||||
|
|
||||||
// control selection
|
// control selection
|
||||||
procedure OnControlSelectionChanged(Sender: TObject);
|
procedure OnControlSelectionChanged(Sender: TObject);
|
||||||
@ -2504,6 +2505,7 @@ Begin
|
|||||||
OnSetDesigning:=@OnDesignerSetDesigning;
|
OnSetDesigning:=@OnDesignerSetDesigning;
|
||||||
OnShowOptions:=@OnDesignerShowOptions;
|
OnShowOptions:=@OnDesignerShowOptions;
|
||||||
OnUnselectComponentClass:=@OnDesignerUnselectComponentClass;
|
OnUnselectComponentClass:=@OnDesignerUnselectComponentClass;
|
||||||
|
OnViewLFM:=@OnDesignerViewLFM;
|
||||||
ShowEditorHints:=EnvironmentOptions.ShowEditorHints;
|
ShowEditorHints:=EnvironmentOptions.ShowEditorHints;
|
||||||
ShowComponentCaptionHints:=EnvironmentOptions.ShowComponentCaptions;
|
ShowComponentCaptionHints:=EnvironmentOptions.ShowComponentCaptions;
|
||||||
end;
|
end;
|
||||||
@ -10937,6 +10939,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
Procedure TMainIDE.OnSrcNoteBookAddJumpPoint(ACaretXY: TPoint;
|
||||||
ATopLine: integer; APageIndex: integer; DeleteForwardHistory: boolean);
|
ATopLine: integer; APageIndex: integer; DeleteForwardHistory: boolean);
|
||||||
{off $DEFINE VerboseJumpHistory}
|
{off $DEFINE VerboseJumpHistory}
|
||||||
|
Loading…
Reference in New Issue
Block a user