目录
深入Delphi FMX从FMX.Types开始(一、原理)
一、FMX.Types中那些个有用的东西(倒序),你们记着晃一眼及时用哟
1.003、Caret及其光标闪烁相关(2071、872行次), TFlasherInterval = -1..1000;
1.004、Screen屏幕显示区域和边界相关(2048行次)
1.005、TFmxObject及泛型的枚举过滤器相关(2014行次)
1.006、全局的系统空闲消息类相关(2045行次),你可以用它去实现系统空闲消息的发布、订阅和监听
1.007、移除字符串中的&符号但保留原始位置及格式相关(2010行次)
1.008、提供debug调试消息的静态方法日志输出相关(1940行次)
1.009、元素为TAlignLayout的全局布局TAnchors数组变量,已枚举各种可能的情况进行赋值(1836行次),可用于遍历或枚举
1.011、忽略ARC引用计数并强制释放对象:将AObject赋值为nil,从内存地址中清除(1829行次)
1.012、判断并捕获FMX应用的句柄是否有效相关(1826行次), TFmxHandle = THandle; THandle = NativeUInt; Result := (Hnd <> 0);
1.013、FMX文字语言及翻译类相关(1496、1784及1802行次)
1.014、动态计算并部署FMX对象Align布局的相关方法(1790行次)
1.015、动态维护StyleLookup的相关方法(1773行次)
1.016、FMX中的TPixelFormat像素格式、颜色及其转化的相关方法(1756行次)
1.017、FMX中的持久类TPersistent相关的维护接口(1700行次)
1.018、FMX中的TGuillotineBinPack矩形区域截取类相关(1594行次)
1.019、FMX中的线条的索引及长短的捕获类相关(1566行次)
1.020、FMX内置的TTimer毫秒计时器及其计时接口服务相关(1530行次)
1.021、FMX的弹出菜单PopupMenu相关(1243行次)
1.022、FMX的TTabList类及其接口相关(1219、676行次)
1.023、通过StyleName快速访问FMX对象的相关类(1034行次)
1.024、TEnumProcResult枚举过程结果的全局枚举类型(1031行次)
1.025、FMX对象TFmxObject相关类(1053行次)
1.026、FMX对象列表类TFmxObjectList及其子对象TFmxChildrenList的枚举列表类、FMX对象间的比较匿名函数的参照全局类(1053行次)
1.027、FMX对象的位置、纵横比、旋转的外观转化的本地持久类(967行次)
1.031、FMX对象及其子对象重新布局接口IAlignRoot(549行次)
1.032、FMX对象的IRoot祖先根节点接口(524行次)
1.034、FMX控件的行为的释放通知接口(430行次),比如焦点等等各种事件
1.035、FMX的其它与布局和显示相关的基础常量和枚举类型(193、74行次)
深入Delphi FMX从FMX.Types开始(一、原理)
Delphi中System.Types和FMX.Types和Androidapi.JNI.JavaTypes等平台属性的对应关系:
Androidapi.JNI.JavaTypes等平台属性======》FMX.Types======》System.Types====》System.TypInfo
一、FMX.Types中那些个有用的东西(倒序),你们记着晃一眼及时用哟
1.001、虚拟键盘相关(2083、572行次)
type TShowVirtualKeyboard = procedure (const Displayed: boolean; const Caret: TCustomCaret; var VirtualKeyboardState: TVirtualKeyboardStates); procedure RegisterShowVKProc(const ShowVirtualKeyboard: TShowVirtualKeyboard); type TKeyKind = (Usual, Functional, Unknown); TKeyKindHelper = record helper for TKeyKind
TVirtualKeyboardType = (Default, NumbersAndPunctuation, NumberPad, PhonePad, Alphabet, URL, NamePhonePad, EmailAddress, DecimalNumberPad); TVirtualKeyboardTypeHelper = record helper for TVirtualKeyboardType const vktDefault = TVirtualKeyboardType.Default deprecated 'Use TVirtualKeyboardType.Default'; vktNumbersAndPunctuation = TVirtualKeyboardType.NumbersAndPunctuation deprecated 'Use TVirtualKeyboardType.NumbersAndPunctuation'; vktNumberPad = TVirtualKeyboardType.NumberPad deprecated 'Use TVirtualKeyboardType.NumberPad'; vktPhonePad = TVirtualKeyboardType.PhonePad deprecated 'Use TVirtualKeyboardType.PhonePad'; vktAlphabet = TVirtualKeyboardType.Alphabet deprecated 'Use TVirtualKeyboardType.Alphabet'; vktURL = TVirtualKeyboardType.URL deprecated 'Use TVirtualKeyboardType.URL'; vktNamePhonePad = TVirtualKeyboardType.NamePhonePad deprecated 'Use TVirtualKeyboardType.NamePhonePad'; vktEmailAddress = TVirtualKeyboardType.EmailAddress deprecated 'Use TVirtualKeyboardType.EmailAddress'; end; TVirtualKeyboardState = (AutoShow, Visible, Error, Transient); TVirtualKeyboardStateHelper = record helper for TVirtualKeyboardState const vksAutoShow = TVirtualKeyboardState.AutoShow deprecated 'Use TVirtualKeyboardState.AutoShow'; vksVisible = TVirtualKeyboardState.Visible deprecated 'Use TVirtualKeyboardState.Visible'; vksError = TVirtualKeyboardState.Error deprecated 'Use TVirtualKeyboardState.Error'; vksTransient = TVirtualKeyboardState.Transient deprecated 'Use TVirtualKeyboardState.Transient'; end; TVirtualKeyboardStates = set of TVirtualKeyboardState; TReturnKeyType = (Default, Done, Go, Next, Search, Send); TReturnKeyTypeHelper = record helper for TReturnKeyType const rktDefault = TReturnKeyType.Default deprecated 'Use TReturnKeyType.Default'; rktDone = TReturnKeyType.Done deprecated 'Use TReturnKeyType.Done'; rktGo = TReturnKeyType.Go deprecated 'Use TReturnKeyType.Go'; rktNext = TReturnKeyType.Next deprecated 'Use TReturnKeyType.Next'; rktSearch = TReturnKeyType.Search deprecated 'Use TReturnKeyType.Search'; rktSend = TReturnKeyType.Send deprecated 'Use TReturnKeyType.Send'; end; IVirtualKeyboardControl = interface ['{-97FC-4C30-A880-AB6CD351A6C4}'] procedure SetKeyboardType(Value: TVirtualKeyboardType); function GetKeyboardType: TVirtualKeyboardType; property KeyboardType: TVirtualKeyboardType read GetKeyboardType write SetKeyboardType; // procedure SetReturnKeyType(Value: TReturnKeyType); function GetReturnKeyType: TReturnKeyType; property ReturnKeyType: TReturnKeyType read GetReturnKeyType write SetReturnKeyType; // function IsPassword: Boolean; end;
1.002、共享内容个克隆缓存中的属性相关(2090行次)
var SharedContext: TRttiContext; ClonePropertiesCache: TDictionary
>;
1.003、Caret及其光标闪烁相关(2071、872行次), TFlasherInterval = -1..1000;
/// Registers the flasher class for the TCustomCaret object specified /// in the CaretClass parameter. procedure RegisterFlasherClass(const FlasherClass: TFmxObjectClass; const CaretClass: TCaretClass); /// Returns the class of a flasher registered for the TCustomCaret /// object specified in the CaretClass parameter. function FlasherClass(const CaretClass: TCaretClass): TFmxObjectClass; /// Returns the flasher object registered for the TCustomCaret object /// specified in the CaretClass parameter. function Flasher(const CaretClass: TCaretClass): TFmxObject; /// Checks whether a flasher is registered for the TCustomCaret object /// specified in the CaretClass parameter. function AssignedFlasher(const CaretClass: TCaretClass): boolean;
TCaretDisplayChanged = procedure (Sender: TCustomCaret; const VirtualKeyboardState: TVirtualKeyboardStates) of object; TCaretClass = class of TCustomCaret; TCustomCaret = class (TPersistent) private [Weak]FOwner: TFMXObject; FIControl: IControl; FVisible: Boolean; FDisplayed: Boolean; FTemporarilyHidden: Boolean; FChanged: Boolean; FUpdateCount: Integer; FOnDisplayChanged: TCaretDisplayChanged; FColor: TAlphaColor; FDefaultColor: TAlphaColor; FPos: TPointF; FSize: TSizeF; FInterval: TFlasherInterval; FReadOnly: Boolean; procedure SetColor(const Value: TAlphaColor); procedure SetPos(const Value: TPointF); procedure SetSize(const Value: TSizeF); procedure SetTemporarilyHidden(const Value: boolean); procedure SetVisible(const Value: Boolean); procedure SetInterval(const Value: TFlasherInterval); procedure SetReadOnly(const Value: boolean); procedure StartTimer; function GetWidth: Word; procedure SetWidth(const Value: Word); function GetFlasher: IFlasher; procedure SetDefaultColor(const Value: TAlphaColor); protected function GetOwner: TPersistent; override; procedure DoDisplayChanged(const VirtualKeyboardState: TVirtualKeyboardStates); virtual; procedure DoUpdateFlasher; virtual; public constructor Create(const AOwner: TFMXObject); virtual; destructor Destroy; override; procedure Assign(Source: TPersistent); override; /// /// hide the caret /// procedure Hide; virtual; /// /// if possible (CanShow = True and Visible = True), the caret show. /// procedure Show; virtual; /// /// This method is performed after changing the Displayed /// property Pos: TPointF read FPos write SetPos; property Size: TSizeF read FSize write SetSize; property Color: TAlphaColor read FColor write SetColor default TAlphaColorRec.Null; property DefaultColor: TAlphaColor read FDefaultColor write SetDefaultColor; property Interval: TFlasherInterval read FInterval write SetInterval default 0; property Owner: TFMXObject read FOwner; property Control: IControl read FIControl; procedure BeginUpdate; procedure EndUpdate; class function FlasherName: string; virtual; abstract; property UpdateCount: integer read FUpdateCount; /// /// The update of the "Flasher", if UpdateCount = 0. /// procedure UpdateFlasher; /// /// This property controls the visibility of a caret, for the control in which the input focus. /// property Visible: Boolean read FVisible write SetVisible; /// /// The function returns true, if the control is visible, enabled, /// has the input focus and it in an active form /// function CanShow: Boolean; virtual; /// /// This property is set to True, after the successful execution of /// method Show, and is set to False after method Hide /// property Displayed: Boolean read FDisplayed; /// /// If this property is 'true', the blinking control is invisible /// and does not take values of Visible, Displayed. /// When you change the properties, methods DoShow, DoHide, DoDisplayChanged not met. /// property TemporarilyHidden: boolean read FTemporarilyHidden write SetTemporarilyHidden; /// /// Blinking visual component is displayed. /// Usually this line, having a thickness of one or two pixels. /// property Flasher: IFlasher read GetFlasher; property ReadOnly: boolean read FReadOnly write SetReadOnly; property Width: Word read GetWidth write SetWidth default 0; property OnDisplayChanged: TCaretDisplayChanged read FOnDisplayChanged write FOnDisplayChanged; end;
1.004、Screen屏幕显示区域和边界相关(2048行次)
TDisplay = record
1.005、TFmxObject及泛型的枚举过滤器相关(2014行次)
type TEnumerableFilter
= class(TEnumerable
) public constructor Create(const FullEnum: TEnumerable
; SelfDestruct: Boolean = False; const Pred: TPredicate
= nil); class function Filter(const Src: TEnumerable
; const Predicate: TPredicate
= nil): TEnumerableFilter
; type TFilterEnumerator = class(TEnumerator
) public constructor Create(const Enumerable: TEnumerable
; const Cleanup: TEnumerableFilter
; const Pred: TPredicate
); destructor Destroy; override; property Current: T read GetCurrent; function MoveNext: Boolean; end; end;
1.006、全局的系统空闲消息类相关(2045行次),你可以用它去实现系统空闲消息的发布、订阅和监听
TIdleMessage = class(System.Messaging.TMessage)
1.007、移除字符串中的&符号但保留原始位置及格式相关(2010行次)
//但保留原始位置及格式 function DelAmp(const AText: string): string
1.008、提供debug调试消息的静态方法日志输出相关(1940行次)
{ Debugging } type /// Provides static methods for debug messages. Log = class abstract public type /// A conversion function used to convert array elements in ArrayToString TToStringFunc = reference to function(const AObject: TObject): string; /// A timestamp of specific point in procedure execution. TLogMarks are used by Log.Trace. /// See Trace and TLogToken. TLogMark = record /// A short message Msg: string; /// Timestamp Time: TDateTime; end; /// A token received in Trace callback. Token can be used to mark specific points in time during /// procedure execution. Use Mark(Message) to mark specific moment in time. Marks will be printed /// in sequence with their elapsed times in Trace output. TLogToken = class public /// Mark time during timed execution of a procedure. procedure Mark(const Msg: string); /// Get a mark at Index. property MarkAt[const Index: Integer]: TLogMark read GetMarkAt; /// Count of accumulated Marks. property Count: Integer read GetCount; end; public /// Log a debug message. Same arguments as Format. class procedure d(const Fmt: string; const Args: array of const); overload; /// Log a simple debug message. class procedure d(const Msg: string); overload; inline; /// Log a debug message with Tag, object data of Instance, Method that invokes the logger and message Msg. /// class procedure d(const Tag: string; const Instance: TObject; const Method, Msg: string); overload; inline; /// Log a debug message with Tag, object data of Instance and a message Msg class procedure d(const Tag: string; const Instance: TObject; const Msg: string); overload; inline; /// Log a time stamp with message Msg class procedure TimeStamp(const Msg: string); overload; /// Perform a timed execution of Func and print execution times, return function result. /// Proc receives a parameter TLogToken which can be used to mark specific points where timestamps should be taken /// in addition to complete procedure time. class function Trace
(const Tag: string; const Func: TFunc
; const Threshold: Integer = -1): TResult; overload; ///
A convenience variant of Trace
when token is not needed.
class function Trace
(const Tag: string; const Func: TFunc
; const Threshold: Integer = -1): TResult; overload; ///
A convenience variant of Trace
for procedures.
class procedure Trace(const Tag: string; const Proc: TProc
; const Threshold: Integer = -1); overload; ///
A convenience variant of Trace
for procedures when token is not needed.
class procedure Trace(const Tag: string; const Proc: TProc; const Threshold: Integer = -1); overload; ///
Get a basic string representation of an object, consisting of ClassName and its pointer class function ObjToString(const Instance: TObject): string; ///
Get a string representation of array using MakeStr function to convert individual elements. class function ArrayToString(const AArray: TEnumerable
; const MakeStr: TToStringFunc): string; overload; ///
Get a string representation of array using TObject.ToString to convert individual elements. class function ArrayToString(const AArray: TEnumerable
): string; overload; ///
转储导出指定的TFmxObject及其所有子对象字符串Dump complete TFmxObject with all its children. class procedure DumpFmxObject(const AObject: TFmxObject; const Nest: Integer = 0); end;
1.009、元素为TAlignLayout的全局布局TAnchors数组变量,已枚举各种可能的情况进行赋值(1836行次),可用于遍历或枚举
var AnchorAlign: array [TAlignLayout] of TAnchors
1.010、注册FMX类为持久类相关(1831行次)
procedure RegisterFmxClasses(const RegClasses: array of TPersistentClass); overload; procedure RegisterFmxClasses(const RegClasses: array of TPersistentClass; const GroupClasses: array of TPersistentClass); overload;
1.011、忽略ARC引用计数并强制转化变量对象AObject为可持久对象TObject并释放AObject:将AObject的指针赋值为nil,从内存地址中清除(1829行次)
procedure DisposeOfAndNil(var AObject);
1.012、判断并捕获FMX应用的句柄是否有效相关(1826行次), TFmxHandle = THandle; THandle = NativeUInt; Result := (Hnd <> 0);
function IsHandleValid(Hnd: TFmxHandle): Boolean;
1.013、FMX文字语言及翻译类相关(1496、1784及1802行次)
{ TLang } TLang = class(TFmxObject) private //.......... protected { vcl } //.......... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure AddLang(const AName: string); procedure LoadFromFile(const AFileName: string); procedure SaveToFile(const AFileName: string); property Original: TStrings read FOriginal; property Resources: TStrings read FResources; property LangStr[const Index: string]: TStrings read GetLangStr; published property AutoSelect: Boolean read FAutoSelect write FAutoSelect default True; property FileName: string read FFileName write FFileName; property StoreInForm: Boolean read FStoreInForm write FStoreInForm default True; property Lang: string read FLang write SetLang; end; { Lang } procedure LoadLangFromFile(const AFileName: string); procedure LoadLangFromStrings(const AStr: TStrings); procedure ResetLang; type TCustomTranslateProc = function(const AText: string): string; var CustomTranslateProc: TCustomTranslateProc; { This function use to collect string which can be translated. Just place this function at Application start. } procedure CollectLangStart; procedure CollectLangFinish; { This function return Strings with collected text } function CollectLangStrings: TStrings; function Translate(const AText: string): string; function TranslateText(const AText: string): string;
1.014、动态计算并部署FMX对象Align布局的相关方法(1790行次)
{ Align } procedure ArrangeControl(const Control: IAlignableObject; AAlign: TAlignLayout; const AParentWidth, AParentHeight: Single; const ALastWidth, ALastHeight: Single; var R: TRectF); procedure AlignObjects(const AParent: TFmxObject; APadding: TBounds; AParentWidth, AParentHeight: Single; var ALastWidth, ALastHeight: Single; var ADisableAlign: Boolean); procedure RecalcAnchorRules(const Parent : TFmxObject; Anchors : TAnchors; const BoundsRect : TRectF; var AOriginalParentSize:TPointF; var AAnchorOrigin:TPointF; var AAnchorRules:TPointF); procedure RecalcControlOriginalParentSize(const Parent: TFmxObject; ComponentState : TComponentState; const Anchoring: Boolean; var AOriginalParentSize : TPointF);
1.015、动态维护StyleLookup的相关方法(1773行次)
{ Resources } type TCustomFindStyleResource = function(const AStyleLookup: string; const Clone: Boolean = False): TFmxObject of object; procedure AddCustomFindStyleResource(const ACustomProc: TCustomFindStyleResource); procedure RemoveCustomFindStyleResource(const ACustomProc: TCustomFindStyleResource); procedure AddResource(const AObject: TFmxObject); procedure RemoveResource(const AObject: TFmxObject); function FindStyleResource(const AStyleLookup: string; const Clone: Boolean = False): TFmxObject;
1.016、FMX中的TPixelFormat像素格式、颜色及其转化的相关方法(1756行次)
{ Pixel Formats } function PixelToFloat4(Input: Pointer; InputFormat: TPixelFormat): TAlphaColorF; procedure Float4ToPixel(const Input: TAlphaColorF; Output: Pointer; OutputFormat: TPixelFormat); function PixelToAlphaColor(Input: Pointer; InputFormat: TPixelFormat): TAlphaColor; procedure AlphaColorToPixel(Input: TAlphaColor; Output: Pointer; OutputFormat: TPixelFormat); procedure ScanlineToAlphaColor(Input: Pointer; Output: PAlphaColor; PixelCount: Integer; InputFormat: TPixelFormat); procedure AlphaColorToScanline(Input: PAlphaColor; Output: Pointer; PixelCount: Integer; OutputFormat: TPixelFormat); procedure ChangePixelFormat(const AInput: Pointer; const AOutput: Pointer; const APixelCount: Integer; const AInputFormat, AOutputFormat: TPixelFormat); function PixelFormatToString(Format: TPixelFormat): string; function FindClosestPixelFormat(Format: TPixelFormat; const FormatList: TPixelFormatList): TPixelFormat;
1.017、FMX中的持久类TPersistent相关的维护接口(1700行次)
///Provider a persistent object for the designer. A different TPersistent can be routed into the /// designer using this interface. This can be used to expose properties of non-controls in the /// Object Inspector. IPersistentProvider = interface ['{B0B03758-A2F5-49B9-9A39-C2C2405B2EAD}'] ///Return the provided persistent function GetPersistent: TPersistent; end; ///Shim is a representative of a visual non-control object in the Designer. The shim needs to implement /// this interface in order to let the Designer know about its bounding rectangles. /// IPersistentShim = interface ['{B6F815C7-BFD1-489D-A661-0CD4639EC920}'] ///Return bounding rectangle of shim. function GetBoundsRect: TRect; end; ///Extension of TPersistent directly exposed to the Designer. IDesignablePersistent = interface ['{4A-9060-4F3C-92D7-C123B04601D4}'] ///GetDesignParent should return a TPersistent known to the designer, e.g. its parent TControl. function GetDesignParent: TPersistent; ///Bounding rectangle representing this TPersistent in the designer function GetBoundsRect: TRect; /// /// Bind this persistent with its shim, thus enabling GetBoundsRect without using the host. /// Example: TItemAppearanceProperties as IDesignablePersistent are bound to the TListItemShim /// Their counterpart FmxReg.TListViewObjectsProperties are bound to the same TListItemShim /// procedure Bind(AShim: IPersistentShim); /// /// Unbind this persistent. The implementation would normally clear its reference to IPersistentShim. /// procedure Unbind; ///True if this TPersistent is currently in Design mode and wants the Designer to create ///IItem for itself. function BeingDesigned: Boolean; end; ///Interface for TPersistent to receive bounding rectangle changes from the Designer. IMovablePersistent = interface ['{A86F9221-09E9-40A7-AF0E-5C3EB859C297}'] /// Set bounds rectangle. procedure SetBoundsRect(const AValue: TRect); end; ///Interface that allows binding a TPersistent with a TreeView Sprig in StructureView ISpriggedPersistent = interface
1.018、FMX中的TGuillotineBinPack矩形区域截取类相关(1594行次)
{ TGuillotineBinPack } TFreeChoiceHeuristic = (BestAreaFit, BestShortSideFit, BestLongSideFit, WorstAreaFit, WorstShortSideFit, WorstLongSideFit); TSplitMethodHeuristic = (ShorterLeftoverAxis, LongerLeftoverAxis, MinimizeArea, MaximizeArea, ShorterAxis, LongerAxis); TGuillotineBinPack = class private //.......... public constructor Create; overload; constructor Create(const ASize: TPoint); overload; destructor Destroy; override; procedure Init(const ASize: TPoint); procedure MergeFreeList; function Insert(const NodeSize: TPoint; const Merge: Boolean = True; const FreeChoice: TFreeChoiceHeuristic = TFreeChoiceHeuristic.BestAreaFit; const SplitMethod: TSplitMethodHeuristic = TSplitMethodHeuristic.MinimizeArea): TRect; property Size: TPoint read FSize; property Occupancy: Single read GetOccupancy; property SupportsRectangleInversion: Boolean read FSupportsRectangleInversion write FSupportsRectangleInversion; end;
1.019、FMX中的线条的索引及长短的捕获类相关(1566行次)
{ TLineInfo } PLineMetric = ^TLineMetric; TLineMetric = record Index: integer; Len: integer; end; TLineMetricInfo = class protected //......... public constructor Create; destructor Destroy; override; procedure Clear; virtual; property Count: integer read GetCount write SetCount; property Metrics[ind: integer]: PLineMetric read GetMetrics; end;
1.020、FMX内置的TTimer毫秒计时器及其计时接口服务相关(1530行次)
{ TTimer } TTimerProc = procedure of object; IFMXTimerService = interface(IInterface) ['{856E938B-FF7B-4E13-85D4-3414A6A9FF2F}'] function CreateTimer(Interval: Integer; TimerFunc: TTimerProc): TFmxHandle; function DestroyTimer(Timer: TFmxHandle): Boolean; function GetTick: Double; end; TTimer = class(TFmxObject)
const cIdNoTimer: TFmxHandle = TFmxHandle(-1);
1.021、FMX的弹出菜单PopupMenu相关(1243行次)
{ TCustomPopupMenu } TCustomPopupMenu = class(TFmxObject) private [Weak] FPopupComponent: TComponent; FOnPopup: TNotifyEvent; protected procedure DoPopup; virtual; property OnPopup: TNotifyEvent read FOnPopup write FOnPopup; public procedure Popup(X, Y: Single); virtual; abstract; property PopupComponent: TComponent read FPopupComponent write FPopupComponent; end;
1.022、FMX的TTabList类及其接口相关(1219、676行次)
TTabList = class(TAggregatedObject, ITabList) strict private //......... protected //......... public constructor Create(const TabStopController: ITabStopController); destructor Destroy; override; procedure Clear; procedure Add(const TabStop: IControl); virtual; procedure Remove(const TabStop: IControl); virtual; procedure Update(const TabStop: IControl; const NewValue: TTabOrder); function IndexOf(const TabStop: IControl): Integer; virtual; function GetCount: Integer; virtual; function GetItem(const Index: Integer): IControl; virtual; function GetTabOrder(const TabStop: IControl): TTabOrder; function FindNextTabStop(const Current: IControl; const MoveForward: Boolean; const Climb: Boolean): IControl; end; TTabListClass = class of TTabList;
ITabList = interface ['{80C67BA2-3064-4d90-A8E1-B00028CA670E}'] procedure Add(const TabStop: IControl); procedure Remove(const TabStop: IControl); procedure Update(const TabStop: IControl; const NewValue: TTabOrder); function GetTabOrder(const TabStop: IControl): TTabOrder; function GetCount: Integer; function GetItem(const Index: Integer): IControl; function FindNextTabStop(const Current: IControl; const MoveForward: Boolean; const Climb: Boolean): IControl; property Count: Integer read GetCount; end; ITabStopController = interface ['{E7D2E0C5-EA3B-40bd-B728-5E4BB264EFC1}'] function GetTabList: ITabList; property TabList: ITabList read GetTabList; end;
1.023、通过StyleName快速访问FMX对象的相关类(1034行次)
/// Index for getting fast access to nested objects by
StyleName
. TStyleIndexer = class private //..... public constructor Create(const AStyle: TFmxObject); destructor Destroy; override; /// Marks index for lazy update. procedure NeedRebuild; /// Updates index, if it's required only. procedure RebuildIfNeeded; /// Finds style object by specified
StyleLookup
value and returns object in
AObject
. function FindStyleObject(const AStyleLookup: string; var AObject: TFmxObject): Boolean; /// Clears index. procedure Clear; end;
1.024、TEnumProcResult枚举过程结果的全局枚举类型(1031行次)
TEnumProcResult = (Continue, Discard, Stop);
1.025、FMX对象TFmxObject相关类(1053行次)
{ TFmxObject } TEnumProcResult = (Continue, Discard, Stop); /// Index for getting fast access to nested objects by
StyleName
. TStyleIndexer = class end; TFmxObject = class(TComponent, IFreeNotification, IActionClient) public type /// Determines the current state of the object ///
CallingFreeNotify - state is set before sending notifications in
BeforeDestruction method. /// See also
IFreeNotification
///
CallingRelease - state is set in
Release method
/// TObjectState = set of (CallingFreeNotify, CallingRelease) deprecated 'Support to this state will be removed'; strict private //.......... private //.......... protected //.......... public function GetParentComponent: TComponent; override; function HasParent: Boolean; override; protected //.......... public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure BeforeDestruction; override; procedure Release; virtual; deprecated 'Support for this method will be removed'; function Released: Boolean; deprecated 'Support for this method will be removed'; /// Describes the current state of this instance. Indicates that a component needs to avoid certain /// actions.
See also
TComponent.ComponentState
function ObjectState: TObjectState; deprecated 'Support for this funcionality will be removed'; procedure SetRoot(ARoot: IRoot); { design } procedure SetDesign(Value: Boolean; SetChildren: Boolean = True); { clone } function Clone(const AOwner: TComponent): TFmxObject; { childs } procedure AddObject(const AObject: TFmxObject); procedure InsertObject(Index: Integer; const AObject: TFmxObject); procedure RemoveObject(const AObject: TFmxObject); overload; procedure RemoveObject(Index: Integer); overload; function ContainsObject(AObject: TFmxObject): Boolean; virtual; procedure Exchange(const AObject1, AObject2: TFmxObject); virtual; procedure DeleteChildren; function IsChild(AObject: TFmxObject): Boolean; virtual; procedure BringChildToFront(const Child: TFmxObject); procedure SendChildToBack(const Child: TFmxObject); procedure BringToFront; virtual; procedure SendToBack; virtual; procedure AddObjectsToList(const AList: TFmxObjectList); procedure Sort(Compare: TFmxObjectSortCompare); virtual; /// Loops through the children of this object, and runs the specified procedure once per object as the first parameter in each call. procedure EnumObjects(const Proc: TFunc
); { animation property } procedure AnimateFloat(const APropertyName: string; const NewValue: Single; Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure AnimateFloatDelay(const APropertyName: string; const NewValue: Single; Duration: Single = 0.2; Delay: Single = 0.0; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure AnimateFloatWait(const APropertyName: string; const NewValue: Single; Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure AnimateInt(const APropertyName: string; const NewValue: Integer; Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure AnimateIntWait(const APropertyName: string; const NewValue: Integer; Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure AnimateColor(const APropertyName: string; NewValue: TAlphaColor; Duration: Single = 0.2; AType: TAnimationType = TAnimationType.In; AInterpolation: TInterpolationType = TInterpolationType.Linear); deprecated 'Use FMX.Ani.TAnimator instead'; procedure StopPropertyAnimation(const APropertyName: string); { notify } procedure AddFreeNotify(const AObject: IFreeNotification); procedure RemoveFreeNotify(const AObject: IFreeNotification); { resource } function FindStyleResource(const AStyleLookup: string; const AClone: Boolean = False): TFmxObject; overload; virtual; { } property Root: IRoot read FRoot; property Stored: Boolean read FStored write SetStored; { tags } property TagObject: TObject read FTagObject write FTagObject; property TagFloat: Single read FTagFloat write FTagFloat; property TagString: string read FTagString write FTagString; { children } property ChildrenCount: Integer read GetChildrenCount; property Children: TFmxChildrenList read FChildrenList; property Data: TValue read GetData write SetData; property Parent: TFmxObject read FParent write SetParent; property Index: Integer read GetIndex write SetIndex; property ActionClient: boolean read GetActionClient; published property StyleName: string read FStyleName write SetStyleName; end; TTabList = class(TAggregatedObject, ITabList) end; TTabListClass = class of TTabList;
1.026、FMX对象列表类TFmxObjectList及其子对象TFmxChildrenList的枚举列表类、FMX对象间的比较匿名函数的参照全局类(1053行次)
TFmxObjectSortCompare = reference to function (Left, Right: TFmxObject): Integer; TFmxObjectList = TList
; TFmxChildrenList = class(TEnumerable
) strict private //...... protected //...... public constructor Create(const AChildren: TFmxObjectList); destructor Destroy; override; property Count: Integer read GetChildCount; function IndexOf(const Obj: TFmxObject): Integer; virtual; property Items[Index: Integer]: TFmxObject read GetChild; default; end;
1.027、FMX对象的位置、纵横比、旋转的外观转化的本地持久类(967行次)
{ TTransform } TTransform = class(TPersistent) private //...... protected //...... public constructor Create; virtual; destructor Destroy; override; procedure Assign(Source: TPersistent); override; property Matrix: TMatrix read FMatrix; property OnChanged: TNotifyEvent read FOnChanged write FOnChanged; published property Position: TPosition read FPosition write SetPosition; property Scale: TPosition read FScale write SetScale; property RotationAngle: Single read FRotationAngle write SetRotationAngle; property RotationCenter: TPosition read FRotationCenter write FRotationCenter; end;
1.028、FMX曲线类TSpline(699行次)
TSpline = class(TObject) private //......... public constructor Create(const Polygon: TPolygon); destructor Destroy; override; procedure SplineXY(const t: Single; var X, Y: Single); end;
1.029、FMX中Items类型等容器接口(669行次)
IItemsContainer = interface ['{100B2F87-5DCB-4699-B751-BE82A}'] function GetItemsCount: Integer; function GetItem(const AIndex: Integer): TFmxObject; function GetObject: TFmxObject; end;
IContainerObject = interface ['{DE635E60-CB00-4741-92BB-3B8F1F29A67C}'] function GetContainerWidth: Single; function GetContainerHeight: Single; property ContainerWidth: single read GetContainerWidth; property ContainerHeight: single read GetContainerHeight; end;
1.030、FMX原生控件的句柄接口(555行次)
INativeControl = interface ['{3E6F1A17-BAE3-456C-8551-5F6EA92EEE32}'] function GetHandle: TFmxHandle; procedure SetHandle(const Value: TFmxHandle); function GetHandleSupported: boolean; property HandleSupported: boolean read GetHandleSupported; property Handle: TFmxHandle read GetHandle write SetHandle; end;
1.031、FMX对象及其子对象重新布局接口IAlignRoot(549行次)
IAlignRoot = interface ['{86DF30A6-0394-4a0e-8722-1F2CDB242CE8}'] procedure Realign; procedure ChildrenAlignChanged; end;
1.032、FMX对象的IRoot祖先根节点接口(524行次)
IRoot = interface ['{7F7BB7B0-5932-49dd-9D35-712B2BA5D8EF}'] procedure AddObject(const AObject: TFmxObject); procedure InsertObject(Index: Integer; const AObject: TFmxObject); procedure RemoveObject(const AObject: TFmxObject); overload; procedure RemoveObject(Index: Integer); overload; procedure BeginInternalDrag(const Source: TObject; const ABitmap: TObject); function GetActiveControl: IControl; procedure SetActiveControl(const AControl: IControl); function GetCaptured: IControl; procedure SetCaptured(const Value: IControl); function GetFocused: IControl; procedure SetFocused(const Value: IControl); function NewFocusedControl(const Value: IControl): IControl; function GetHovered: IControl; procedure SetHovered(const Value: IControl); function GetObject: TFmxObject; function GetBiDiMode: TBiDiMode; { access } property Captured: IControl read GetCaptured write SetCaptured; property Focused: IControl read GetFocused write SetFocused; property Hovered: IControl read GetHovered write SetHovered; property BiDiMode: TBiDiMode read GetBiDiMode; end;
1.033、FMX对象嵌套的内容捕获接口(407行次)
IContent = interface ['{96E89B94-2AD6-4AD3-A07C-92E66B2E6BC8}'] function GetParent: TFmxObject; function GetObject: TFmxObject; function GetChildrenCount: Integer; property Parent: TFmxObject read GetParent; property ChildrenCount: Integer read GetChildrenCount; procedure Changed; end;
1.034、FMX控件的行为的释放通知接口(430行次),比如焦点等等各种事件
IControl = interface(IFreeNotificationBehavior) ['{7318D022-D048-49DE-BF55-C5C36A2AD1AC}'] function GetObject: TFmxObject; procedure SetFocus; function GetIsFocused: Boolean; function GetCanFocus: Boolean; function GetCanParentFocus: Boolean; function GetEnabled: Boolean; function GetAbsoluteEnabled: Boolean; function GetPopupMenu: TCustomPopupMenu; function EnterChildren(AObject: IControl): Boolean; function ExitChildren(AObject: IControl): Boolean; procedure DoEnter; procedure DoExit; procedure DoActivate; procedure DoDeactivate; procedure DoMouseEnter; procedure DoMouseLeave; function ShowContextMenu(const ScreenPosition: TPointF): Boolean; function ScreenToLocal(P: TPointF): TPointF; function LocalToScreen(P: TPointF): TPointF; function ObjectAtPoint(P: TPointF): IControl; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure MouseMove(Shift: TShiftState; X, Y: Single); procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure MouseWheel(Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); procedure MouseClick(Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); procedure KeyUp(var Key: Word; var KeyChar: WideChar; Shift: TShiftState); procedure Tap(const Point: TPointF); procedure DialogKey(var Key: Word; Shift: TShiftState); procedure AfterDialogKey(var Key: Word; Shift: TShiftState); function FindTarget(P: TPointF; const Data: TDragObject): IControl; procedure DragEnter(const Data: TDragObject; const Point: TPointF); procedure DragOver(const Data: TDragObject; const Point: TPointF; var Operation: TDragOperation); procedure DragDrop(const Data: TDragObject; const Point: TPointF); procedure DragLeave; procedure DragEnd; function CheckForAllowFocus: Boolean; procedure Repaint; function GetDragMode: TDragMode; procedure SetDragMode(const ADragMode: TDragMode); procedure BeginAutoDrag; function GetParent: TFmxObject; function GetLocked: Boolean; function GetVisible: Boolean; procedure SetVisible(const Value: Boolean); function GetHitTest: Boolean; function GetCursor: TCursor; function GetInheritedCursor: TCursor; function GetDesignInteractive: Boolean; function GetAcceptsControls: Boolean; procedure SetAcceptsControls(const Value: Boolean); procedure BeginUpdate; procedure EndUpdate; function GetTabStopController: ITabStopController; function GetTabStop: Boolean; procedure SetTabStop(const TabStop: Boolean); /// This method returns true if the control has an available hint to display. function HasHint: Boolean; /// If HasHint is true, this method is invoked in order to know if the control has an available /// string to swho as hint. function GetHintString: string; /// If HasHint is true, this method is invoked in order to know if the control has a custom hint /// object to manage the hint display. This usually returns an instance of THint to allow the form to manage /// it. function GetHintObject: TObject; { access } property AbsoluteEnabled: Boolean read GetAbsoluteEnabled; property Cursor: TCursor read GetCursor; property InheritedCursor: TCursor read GetInheritedCursor; property DragMode: TDragMode read GetDragMode write SetDragMode; property DesignInteractive: Boolean read GetDesignInteractive; property Enabled: Boolean read GetEnabled; property Parent: TFmxObject read GetParent; property Locked: Boolean read GetLocked; property HitTest: Boolean read GetHitTest; property PopupMenu: TCustomPopupMenu read GetPopupMenu; property Visible: Boolean read GetVisible write SetVisible; property AcceptsControls: Boolean read GetAcceptsControls write SetAcceptsControls; property IsFocused: Boolean read GetIsFocused; property TabStop: Boolean read GetTabStop write SetTabStop; end;
IFreeNotificationBehavior = interface ['{83F052C5-8696-4AFA-88F5-DCDFEF005480}'] procedure AddFreeNotify(const AObject: IFreeNotification); procedure RemoveFreeNotify(const AObject: IFreeNotification); end;
1.035、FMX的其它与布局和显示相关的基础常量和枚举类型(193、74行次)
TPixelFormat = (None, RGB, RGBA, BGR, BGRA, RGBA16, BGR_565, BGRA4, BGR4, BGR5_A1, BGR5, BGR10_A2, RGB10_A2, L, LA, LA4, L16, A, R16F, RG16F, RGBA16F, R32F, RG32F, RGBA32F); TPixelFormatList = TList
; const PixelFormatBytes: array[TPixelFormat] of Integer = ({ None } 0, { RGB } 4, { RGBA } 4, { BGR } 4, { BGRA } 4, { RGBA16 } 8, { BGR_565 } 2, { BGRA4 } 2, { BGR4 } 2, { BGR5_A1 } 2, { BGR5 } 2, { BGR10_A2 } 4, { RGB10_A2 } 4, { L } 1, { LA } 2, { LA4 } 1, { L16 } 2, { A } 1, { R16F } 2, { RG16F } 4, { RGBA16F } 8, { R32F } 4, { RG32F } 8, { RGBA32F } 16); NullRect: TRectF = (Left: 0; Top: 0; Right: 0; Bottom: 0); AllCorners: TCorners = [TCorner.TopLeft, TCorner.TopRight, TCorner.BottomLeft, TCorner.BottomRight]; AllSides: TSides = [TSide.Top, TSide.Left, TSide.Bottom, TSide.Right]; ClosePolygon: TPointF = (X: $FFFF; Y: $FFFF) deprecated 'Non-closed polygons are not supported.'; ///
A special polygon point marker typically used for converting paths to polygons and vice-versa, /// usually indicating path closure. For the rendering methods, this marker has no meaning and the actual /// interpretation may be platform-dependent. PolygonPointBreak: TPointF = (X: $FFFFFF; Y: $FFFFFF); AllStyledSettings: TStyledSettings = [TStyledSetting.Family, TStyledSetting.Size, TStyledSetting.Style, TStyledSetting.FontColor, TStyledSetting.Other]; DefaultStyledSettings: TStyledSettings = [TStyledSetting.Family, TStyledSetting.Size, TStyledSetting.Style, TStyledSetting.FontColor]; InvalidSize : TSizeF = (cx: -1; cy: -1); AlignmentToTTextAlign: array [TAlignment] of TTextAlign = (TTextAlign.Leading, TTextAlign.Trailing, TTextAlign.Center);
type TOSPlatform = (Windows, OSX, iOS, Android, Linux); TPointArray = array [0..0] of TPointF; TLongByteArray = array [0..MaxInt - 1] of Byte; PLongByteArray = ^TLongByteArray;
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/208389.html原文链接:https://javaforall.net
