mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 23:52:31 +02:00

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 -
118 lines
3.1 KiB
ObjectPascal
118 lines
3.1 KiB
ObjectPascal
{
|
|
*****************************************************************************
|
|
See the file COPYING.modifiedLGPL.txt, included in this distribution,
|
|
for details about the license.
|
|
*****************************************************************************
|
|
|
|
Author: Maciej Izak
|
|
|
|
DaThoX 2004-2015
|
|
FreeSparta.com
|
|
}
|
|
|
|
unit SpartaAPI;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, Forms, Controls;
|
|
|
|
type
|
|
ISTADesignTimeUtil = interface
|
|
['{E135BF89-AFA9-402A-9663-4F1536C7717A}']
|
|
function GetRoot: TPersistent;
|
|
procedure SetRoot(ARoot: TPersistent);
|
|
|
|
property Root: TPersistent read GetRoot write SetRoot;
|
|
end;
|
|
|
|
// Sparta Tools API
|
|
ISTAMainDesignTimeUtil = interface(ISTADesignTimeUtil)
|
|
['{53491607-D285-4050-9064-C764EB8E59B9}']
|
|
function GetShowNonVisualComponents: Boolean;
|
|
property ShowNonVisualComponents: Boolean read GetShowNonVisualComponents;
|
|
end;
|
|
|
|
ISTANonVisualComponentsUtil = interface(ISTADesignTimeUtil)
|
|
['{A181688F-572E-4724-AAF1-575B979A1EC2}']
|
|
function GetShowNonVisualComponents: Boolean;
|
|
property ShowNonVisualComponents: Boolean read GetShowNonVisualComponents;
|
|
end;
|
|
|
|
ISTAExtendedDesignTimeUtil = interface(ISTADesignTimeUtil)
|
|
['{1F484121-2295-4847-BFD9-A77C643EA3A7}']
|
|
// TODO OnShow
|
|
// TODO OnHide
|
|
// TODO UpdateRoot
|
|
// TODO FreeOnStrongHide...? free mem for some utils
|
|
procedure RefreshValues;
|
|
|
|
procedure SetParent(AWinCtrl: TWinControl);
|
|
function GetParent: TWinControl;
|
|
procedure SetVisible(AValue: Boolean);
|
|
function GetVisible: Boolean;
|
|
|
|
property Visible: Boolean read GetVisible write SetVisible;
|
|
property Parent: TWinControl read GetParent write SetParent;
|
|
end;
|
|
|
|
TSTADesignTimeUtil = class
|
|
|
|
end;
|
|
|
|
TSTADesignTimeUtilClass = class of TSTADesignTimeUtil;
|
|
|
|
TEDTU = class
|
|
public
|
|
class function AvailableForRoot(ARoot: TPersistent): Boolean; virtual; abstract;
|
|
class function CreateEDTUForRoot(TheOwner: TComponent; ARoot: TPersistent): ISTAExtendedDesignTimeUtil; virtual; abstract;
|
|
class function GlyphName: string; virtual; abstract;
|
|
end;
|
|
|
|
TEDTUClass = class of TEDTU;
|
|
|
|
{ TSTADesignTimeUtilsManager }
|
|
|
|
TSTADesignTimeUtilsManager = class
|
|
protected
|
|
function GetEDTUCount: Integer; virtual;
|
|
function GetEDTU(Index: Integer): TEDTUClass; virtual; abstract;
|
|
public
|
|
function CreateMainDTU(AParent, AAddons: TWinControl): ISTAMainDesignTimeUtil; virtual;
|
|
procedure RegisterEDTU(AEDTUClass: TEDTUClass); virtual;
|
|
procedure UnregisterEDTU(AEDTUClass: TEDTUClass); virtual;
|
|
property EDTUCount: Integer read GetEDTUCount;
|
|
property EDTU[Index: Integer]: TEDTUClass read GetEDTU;
|
|
end;
|
|
|
|
var
|
|
DTUManager: TSTADesignTimeUtilsManager = nil;
|
|
|
|
implementation
|
|
|
|
{ TSTADesignTimeUtilsManager }
|
|
|
|
function TSTADesignTimeUtilsManager.GetEDTUCount: Integer;
|
|
begin
|
|
Result := 0;
|
|
end;
|
|
|
|
function TSTADesignTimeUtilsManager.CreateMainDTU(AParent, AAddons: TWinControl
|
|
): ISTAMainDesignTimeUtil;
|
|
begin
|
|
Result := nil;
|
|
end;
|
|
|
|
procedure TSTADesignTimeUtilsManager.RegisterEDTU(AEDTUClass: TEDTUClass);
|
|
begin
|
|
end;
|
|
|
|
procedure TSTADesignTimeUtilsManager.UnregisterEDTU(AEDTUClass: TEDTUClass);
|
|
begin
|
|
end;
|
|
|
|
end.
|
|
|