Delphi

Setting Label and StaticText Color property problem - Delphi 2009

青春壹個敷衍的年華 提交于 2021-01-28 20:50:29
问题 When I set the Label 's color e.g. on value clRed , the red on it only blink for a while. The color property still has clRed value, but in fact it has default clBtnFace color. Screenshot discribes the problem better. 回答1: Set Transparent to False. :-) Edit: assuming it's a TLabel, as shown in the screenshot. 回答2: Do you mean a TLabel or a TPanel ? Your screenshot shows a label, but it should work for both components. Make sure that the ParentColor property is set to false . 来源: https:/

Adding non class functions to generic TArray class

和自甴很熟 提交于 2021-01-28 20:35:59
问题 In System.Generics.Collections , the TArray type has class functions only. For example: class procedure Sort<T>(var Values: array of T); overload; static; This implies the only accepted syntax is the following: var Arr : TArray<integer>; begin SetLength(Arr, 2); Arr[0] := 5; Arr[1] := 3; TArray.Sort<integer>(Arr); end; I would like to define an object's function in order to sort the values of the generic array using the following syntax: var Arr : TArray<integer>; begin SetLength(Arr, 2); Arr

Why do I get the error Missing implementation of interface method in Delphi XE2?

落花浮王杯 提交于 2021-01-28 19:24:24
问题 Consider the following code: uses {... } ComObj, ShlObj; type TContextMenu = class(TComObject, IShellExtInit, IContextMenu) private {(*} const GUID: TGUID = '{99D8B139-0855-4C5D-95E7-BC8EC6254B3D}'; {*)} private FCmdCount: LongWord; FDm: Tdm_ContextMenu; protected function IShellExtInit.Initialize = IShellExtInit_Initialize; function IShellExtInit_Initialize(_pidlFolder: PItemIDList; _lpdobj: IDataObject; _HKeyProgID: HKEY): HResult; stdcall; function QueryContextMenu(_Menu: HMENU; _indexMenu

Returning records in Delphi-Mocks

眉间皱痕 提交于 2021-01-28 17:35:32
问题 I would like to, using Delphi-Mocks, mock a class with a function returning a record. TValue and my record are reported as incompatible types. Is there any way I can do this with WillExecute or any other way? 回答1: Found out: myMock.Setup.WillReturnDefault('function_name', TValue.From(rec_variable)); 来源: https://stackoverflow.com/questions/34987688/returning-records-in-delphi-mocks

How do I pass a context inside a loop into a TTask.IFuture in Delphi?

别说谁变了你拦得住时间么 提交于 2021-01-28 12:44:36
问题 I have a set of tasks to perform they are in an array. I want to loop through the array and launch a task for each. The following example is trivial (calculating squares) to demonstrate the issue. program FutureSquares; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Threading, System.Classes; const nums: array[0..9] of Integer = (1,2,3,4,5,6,7,8,9,10); var i, contextIndex: Integer; f: array[0..9] of ITask; answer, futureAnswer: Integer; matchDisplay: string; futureFunc: TFunc

Delphi - is it possible to disable Delphi's lazy loading of forms?

假如想象 提交于 2021-01-28 12:16:36
问题 I've heard that the Delphi application uses "lazy loading", deferring the loading of form components until they are actually referenced. It was mentioned in another post - "That's why we changed TPageControl to be lazy-load - the Delphi IDE's options dialog was taking too long to load!" I assume this applies to applications created with Delphi as well, but I can't find any mention of lazy loading in the VCL sources, suggesting maybe it's called something else if it does exist. In cases where

How to detect specific (timeout) errors for THTTPReqResp SOAP requests?

 ̄綄美尐妖づ 提交于 2021-01-28 11:39:27
问题 In Delphi Tokyo 10.2.x a ESOAPHTTPException was an Exception descendant with a StatusCode property set in the creator: ESOAPHTTPException = class(Exception) private FStatusCode: Integer; public {$IF CompilerVersion <= 15.0} constructor Create(const Msg: string; SCode: Integer = 0); {$ELSE} constructor Create(const Msg: string; SCode: Integer = 0; Dummy: Integer = 0); {$IFEND} constructor CreateFmt(const Msg: string; const Args: array of const; SCode: Integer = 0; Dummy: Integer = 0); property

Delphi开发工具DevExpress VCL 2021年新版首发(附高速下载)

痞子三分冷 提交于 2021-01-28 11:34:44
DevExpress VCL Controls 是Devexpress公司旗下最老牌的用户界面套包,所包含的控件有:数据录入、图表、数据分析、导航、布局等。该控件能帮助您创建优异的用户体验,提供高影响力的业务解决方案,并利用您现有的VCL技能为未来构建下一代应用程序。 DevExpress VCL v20.2.4正式版下载 具体更新内容如下: 此列表包括v20.2.4中已解决的所有问题。 ExpressBars Suite T964153 - Ribbon Form - 如果Style属性设置为rs2007和rs2010以外的值,并且表单的DisableAero属性设置为False,则功能区控件的组和选项卡没有分隔符 T960957 - TdxCustomStatusBar后代不会缩放基于当前DPI由文本面板的PanelStyle.ImageIndex属性指定的图像 ExpressDocking Library T963411 - 拖放操作可以取消停靠并放置停靠面板,以便其右边缘或底边缘不在屏幕上 ExpressEditors Library T959802 - TcxButton - 如果在隐藏按钮上方/下方的控件并将SpeedButtonOptions.Transparent属性设置为True时开始,淡入淡出动画会产生绘画瑕疵 T966644 -

How to change the default name of new components

穿精又带淫゛_ 提交于 2021-01-28 11:32:08
问题 Delphi sets the name of components when you add them to a form. The first TButton will be named "Button1" the second "Button2" and so on. A while ago I discovered by accident that you can change this "prefix". Staying with TButton I changed it to "btn" so TButtons will be named "btn1", "btn2" and so on. Now I want to change some more component prefixes but unfortunately I forgot how to do this. It could be some functionality of GExperts. Anybody to the rescue? Just if it is important: I'm

How to test the type of an Objective-c Object ? something similar to is with Object?

我只是一个虾纸丫 提交于 2021-01-28 11:22:21
问题 How to test the type of an Objective-c Object ? something similar to is with TObject? To cast we have wrap but I don't find how to test 回答1: I remembered that I'm actually using object_getClass in my own code :-) This is an example from DW.Notifications.iOS.pas : if request.trigger.isKindOfClass(objc_getClass('UNPushNotificationTrigger')) then 来源: https://stackoverflow.com/questions/59070640/how-to-test-the-type-of-an-objective-c-object-something-similar-to-is-with-obj