lazarus/components/sparta/toolsapi/source/designmenus.pas
hnb d53cfa9c28 Merged revision(s) 51414, 51448-51450, 51468, 51473, 51477, 51480, 51483, 51486, 51511, 51543-51544, 51638, 52714, 52725-52727 from branches/free-sparta:
sparta: initial commit of "compilable" new sparta package - smart form editor. !NOTE: not for daily usage.
........
sparta: Initial conception for package for MDI: sparta_MDI. Base for sparta_DockedFormEditor package.
........
sparta: Generics.Collections library ( sync with https://github.com/dathox/generics.collections SHA fda586932bd80ef58c08f8ebf5a24316ca4ccca5)
........
sparta: smart form editor adjustment for new sparta_MDI
........
sparta: new class "TFormImpl" for MDI solution (created from TDesignedFormImpl). 
........
sparta: 
-MDI form container "TFormContainer"
-New IResizeFrame interface to handle MDI form moving
-New frame TfrFormBackgroundForMDI
........
sparta: sparta_MDI package modifications:
-new class TMultiplyResizer to menage MDI desktop
-more generic resizer: TAbstractResizer. Base for IDE resizer and TMultiplyResizer
-more advanced IResizeFrame interface


........
sparta: 
-DockedFormEditor adjustment for latest changes in mdi package
-small changes in mdi (visibility of methods).
-OnModified method for IResizeFrame

........
sparta: MDI
-simulate MDI forms order for TMultiplyResizer
-property DesignedForm: IDesignedForm for IResizeFrame
........
sparta:
-IMPORTANT! pixel perfect form resizing (fix for problems for controls with align alLeft, alRight etc on design form).
-Fix problem for windows: wrong design design window width (a little bigger than designed size) TFormImpl.SetRealBounds -> AdjustSize
........
sparta: mdi bug fix for AV in TMultiplyResizer
........
Fix compilation for FPC 3.0 (TRect changes in FPC 3.1 trunk)
........
sparta: Cannot resize the docked form designer, issue #29380 patch from Anthony Walter. Thanks!
........
sparta ToolsAPI: Delphi compatible ToolsAPI/DesignIDE interface at XE2 level (proxy for IDEIntf). Initial commit (no functionality yet), just interfaces and classes without implementation:

designeditors.pas:
-TComponentEditor

designintf.pas:
-Interfaces: IEventInfo, IClass, IActivatable, IDesignObject, IDesignPersistent, IDesignerSelections, IDesigner60, IDesigner70, IDesigner80, IDesigner100, IDesigner, IComponentEditor
-TBaseComponentEditor
-RegisterComponentEditor

designmenus.pas:
-Interfaces: IMenuItems, IMenu, IMainMenu, IPopupMenu, IMenuItem

 
 


........
when form is removed we need to remove all handlers located in collections FFormsStack and FForms. Necessary to avoid AV.
........
sparta: more correct and simpler calculation of form border for Windows
........
sparta: 
  * Fix for loop error for resize. Highly visible problem for docked forms/frames with Align=alClient. 
  * New THookFrame class as new meta class for Frames.
........
updated lpl
........

git-svn-id: trunk@52728 -
2016-07-20 10:40:03 +00:00

113 lines
3.8 KiB
ObjectPascal

unit DesignMenus;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
type
IMenuItem = interface;
IMenuItems = interface
['{C9CC6C38-C96A-4514-8D6F-1D121727BFAF}']
function GetItem(Index: Integer): IMenuItem;
function SameAs(const AItem: IUnknown): Boolean;
function Find(const ACaption: WideString): IMenuItem;
function FindByName(const AName: string): IMenuItem;
function Count: Integer;
property Items[Index: Integer]: IMenuItem read GetItem;
procedure Clear;
function AddItem(const ACaption: WideString; AShortCut: TShortCut;
AChecked, AEnabled: Boolean; AOnClick: TNotifyEvent = nil;
hCtx: THelpContext = 0; const AName: string = ''): IMenuItem; overload;
function AddItem(AAction: TBasicAction;
const AName: string = ''): IMenuItem; overload;
function InsertItem(const ACaption: WideString;
AShortCut: TShortCut; AChecked, AEnabled: Boolean; AOnClick: TNotifyEvent = nil;
hCtx: THelpContext = 0; const AName: string = ''): IMenuItem; overload;
function InsertItem(Index: Integer; const ACaption: WideString;
AShortCut: TShortCut; AChecked, AEnabled: Boolean; AOnClick: TNotifyEvent = nil;
hCtx: THelpContext = 0; const AName: string = ''): IMenuItem; overload;
function InsertItem(AAction: TBasicAction;
const AName: string = ''): IMenuItem; overload;
function InsertItem(Index: Integer; AAction: TBasicAction;
const AName: string = ''): IMenuItem; overload;
function AddLine(const AName: string = ''): IMenuItem;
function InsertLine(const AName: string = ''): IMenuItem; overload;
function InsertLine(Index: Integer; const AName: string = ''): IMenuItem; overload;
end;
IMenu = interface
['{0993FAE4-17E2-4EB7-81DF-26634D7F9E16}']
function Items: IMenuItems;
end;
IMainMenu = interface(IMenu)
['{5D137DC1-73F4-48CB-8351-E14A369AE924}']
end;
IPopupMenu = interface(IMenu)
['{E2E9ED8C-4D54-482B-AC62-23F1CEBFE414}']
procedure Popup(X, Y: Integer);
function PopupComponent: TComponent;
end;
IMenuItem = interface(IMenuItems)
['{DAF029E1-9592-4B07-A450-A10056A2B9B5}']
function GetCaption: WideString;
procedure SetCaption(const ACaption: WideString);
function GetChecked: Boolean;
procedure SetChecked(AChecked: Boolean);
function GetEnabled: Boolean;
procedure SetEnabled(AEnabled: Boolean);
function GetGroupIndex: Byte;
procedure SetGroupIndex(AGroupIndex: Byte);
function GetHelpContext: THelpContext;
procedure SetHelpContext(AHelpContext: THelpContext);
function GetHint: string;
procedure SetHint(const AHint: string);
function GetRadioItem: Boolean;
procedure SetRadioItem(ARadioItem: Boolean);
function GetShortCut: TShortCut;
procedure SetShortCut(AShortCut: TShortCut);
function GetTag: LongInt;
procedure SetTag(AValue: LongInt);
function GetVisible: Boolean;
procedure SetVisible(AVisible: Boolean);
// public
function Name: TComponentName;
function MenuIndex: Integer;
function Parent: IMenuItem;
function HasParent: Boolean;
function IsLine: Boolean;
property Caption: WideString read GetCaption write SetCaption;
property Checked: Boolean read GetChecked write SetChecked;
property Enabled: Boolean read GetEnabled write SetEnabled;
property GroupIndex: Byte read GetGroupIndex write SetGroupIndex;
property HelpContext: THelpContext read GetHelpContext write SetHelpContext;
property Hint: string read GetHint write SetHint;
property RadioItem: Boolean read GetRadioItem write SetRadioItem;
property ShortCut: TShortCut read GetShortCut write SetShortCut;
property Tag: LongInt read GetTag write SetTag;
property Visible: Boolean read GetVisible write SetVisible;
end;
implementation
end.