mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-15 00:59:46 +01: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 -
145 lines
3.3 KiB
ObjectPascal
145 lines
3.3 KiB
ObjectPascal
{
|
|
This file is part of the Free Pascal run time library.
|
|
Copyright (c) 2014 by Maciej Izak (hnb)
|
|
member of the Free Sparta development team (http://freesparta.com)
|
|
|
|
Copyright(c) 2004-2014 DaThoX
|
|
|
|
It contains the Free Pascal generics library
|
|
|
|
See the file COPYING.FPC, 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.
|
|
|
|
**********************************************************************}
|
|
|
|
unit Generics.Helpers;
|
|
|
|
{$MODE DELPHI}{$H+}
|
|
{$MODESWITCH TYPEHELPERS}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils;
|
|
|
|
type
|
|
{ TValueAnsiStringHelper }
|
|
|
|
TValueAnsiStringHelper = record helper for AnsiString
|
|
function ToLower: AnsiString; inline;
|
|
end;
|
|
|
|
{ TValuewideStringHelper }
|
|
|
|
TValueWideStringHelper = record helper for WideString
|
|
function ToLower: WideString; inline;
|
|
end;
|
|
|
|
{ TValueUnicodeStringHelper }
|
|
|
|
TValueUnicodeStringHelper = record helper for UnicodeString
|
|
function ToLower: UnicodeString; inline;
|
|
end;
|
|
|
|
{ TValueShortStringHelper }
|
|
|
|
TValueShortStringHelper = record helper for ShortString
|
|
function ToLower: ShortString; inline;
|
|
end;
|
|
|
|
{ TValueUTF8StringHelper }
|
|
|
|
TValueUTF8StringHelper = record helper for UTF8String
|
|
function ToLower: UTF8String; inline;
|
|
end;
|
|
|
|
{ TValueRawByteStringHelper }
|
|
|
|
TValueRawByteStringHelper = record helper for RawByteString
|
|
function ToLower: RawByteString; inline;
|
|
end;
|
|
|
|
{ TValueUInt32Helper }
|
|
|
|
TValueUInt32Helper = record helper for UInt32
|
|
class function GetSignMask: UInt32; static; inline;
|
|
class function GetSizedSignMask(ABits: Byte): UInt32; static; inline;
|
|
class function GetBitsLength: Byte; static; inline;
|
|
|
|
const
|
|
SIZED_SIGN_MASK: array[1..32] of UInt32 = (
|
|
$80000000, $C0000000, $E0000000, $F0000000, $F8000000, $FC000000, $FE000000, $FF000000,
|
|
$FF800000, $FFC00000, $FFE00000, $FFF00000, $FFF80000, $FFFC0000, $FFFE0000, $FFFF0000,
|
|
$FFFF8000, $FFFFC000, $FFFFE000, $FFFFF000, $FFFFF800, $FFFFFC00, $FFFFFE00, $FFFFFF00,
|
|
$FFFFFF80, $FFFFFFC0, $FFFFFFE0, $FFFFFFF0, $FFFFFFF8, $FFFFFFFC, $FFFFFFFE, $FFFFFFFF);
|
|
BITS_LENGTH = 32;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TRawDataStringHelper }
|
|
|
|
function TValueAnsiStringHelper.ToLower: AnsiString;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueWideStringHelper }
|
|
|
|
function TValueWideStringHelper.ToLower: WideString;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueUnicodeStringHelper }
|
|
|
|
function TValueUnicodeStringHelper.ToLower: UnicodeString;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueShortStringHelper }
|
|
|
|
function TValueShortStringHelper.ToLower: ShortString;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueUTF8StringHelper }
|
|
|
|
function TValueUTF8StringHelper.ToLower: UTF8String;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueRawByteStringHelper }
|
|
|
|
function TValueRawByteStringHelper.ToLower: RawByteString;
|
|
begin
|
|
Result := LowerCase(Self);
|
|
end;
|
|
|
|
{ TValueUInt32Helper }
|
|
|
|
class function TValueUInt32Helper.GetSignMask: UInt32;
|
|
begin
|
|
Result := $80000000;
|
|
end;
|
|
|
|
class function TValueUInt32Helper.GetSizedSignMask(ABits: Byte): UInt32;
|
|
begin
|
|
Result := SIZED_SIGN_MASK[ABits];
|
|
end;
|
|
|
|
class function TValueUInt32Helper.GetBitsLength: Byte;
|
|
begin
|
|
Result := BITS_LENGTH;
|
|
end;
|
|
|
|
end.
|
|
|