Delphi

When to raise an exception?

时光怂恿深爱的人放手 提交于 2020-01-05 07:16:07
问题 I think this is a "best practice" category question: I have a custom control - some kind of grid that holds some panels. One of the panels is the current active panel (the last one clicked). TMyGrid = class (TSomeKindOfGrid) published property CurrentPanel: TPanel read getCurPanel write setCurPanel; end; My question is: if at a certain point someone asks for the CurrentPanel and the grid is empty, should getCurPanel return a NIL or should it raise an exception? If getCurPanel returns NIL,

TFDMoniFlatFileClientLink irregularly does not trace to file

不羁岁月 提交于 2020-01-05 06:33:44
问题 I have a TFDMoniFlatFileClientLink on a form, filename set to d:\temp\monitor.txt , tracing=true, TFDConnection.Params.MonitorBy=mbFlatFile . This sometimes works and sometimes does not trace anything. No file gets created. Tested with Win7 32-bit app, with design time TFDConnection to either FireBird or Oracle. Delphi Tokyo 10.2.1 What is going on? 回答1: This was a really weird bug: It turns out that the TFDMoniFlatFileClientLink remembers the filename when removed and placed back, then does

TFDMoniFlatFileClientLink irregularly does not trace to file

泄露秘密 提交于 2020-01-05 06:33:18
问题 I have a TFDMoniFlatFileClientLink on a form, filename set to d:\temp\monitor.txt , tracing=true, TFDConnection.Params.MonitorBy=mbFlatFile . This sometimes works and sometimes does not trace anything. No file gets created. Tested with Win7 32-bit app, with design time TFDConnection to either FireBird or Oracle. Delphi Tokyo 10.2.1 What is going on? 回答1: This was a really weird bug: It turns out that the TFDMoniFlatFileClientLink remembers the filename when removed and placed back, then does

TFDMoniFlatFileClientLink irregularly does not trace to file

萝らか妹 提交于 2020-01-05 06:33:07
问题 I have a TFDMoniFlatFileClientLink on a form, filename set to d:\temp\monitor.txt , tracing=true, TFDConnection.Params.MonitorBy=mbFlatFile . This sometimes works and sometimes does not trace anything. No file gets created. Tested with Win7 32-bit app, with design time TFDConnection to either FireBird or Oracle. Delphi Tokyo 10.2.1 What is going on? 回答1: This was a really weird bug: It turns out that the TFDMoniFlatFileClientLink remembers the filename when removed and placed back, then does

Delphi 2007 and Indy 10 using https and SSL

岁酱吖の 提交于 2020-01-05 06:31:09
问题 I've dropped a TIdHTTP and a TIdSSLIOHandlerSocketOpenSSL, set the IOHandler of the IdHTTP to the SSL handler, set the mode of the TIdSSLIOHandlerSocketOpenSSL to sllmClient. And then added the button click event below. The first time I get this error from WhichFailedToLoad. Displayed, the second time I press the button it works. The ssl dll's are in the .exe diretory. The service works fine from the browser and is in production. Why doesn't it work the first time? procedure TForm32

Delphi OS X subclass NSWindow borderless with mouse events

跟風遠走 提交于 2020-01-05 06:01:42
问题 How to create a derived class of NSWindow in delphi firemonkey? I've succeeded in creating a Cocoa window that contains only a webview. (using NSWindow.Wrap, setContentView, orderFront etc) I made it borderless, but the problem is that it does not accept mouse moved events, as described here: Why NSWindow without styleMask:NSTitledWindowMask can not be keyWindow? Is it possible to subclass NSWindow in delphi and override canBecomeKeyWindow? It's not working (compiles, but method not called):

Delphi OS X subclass NSWindow borderless with mouse events

与世无争的帅哥 提交于 2020-01-05 06:00:48
问题 How to create a derived class of NSWindow in delphi firemonkey? I've succeeded in creating a Cocoa window that contains only a webview. (using NSWindow.Wrap, setContentView, orderFront etc) I made it borderless, but the problem is that it does not accept mouse moved events, as described here: Why NSWindow without styleMask:NSTitledWindowMask can not be keyWindow? Is it possible to subclass NSWindow in delphi and override canBecomeKeyWindow? It's not working (compiles, but method not called):

How can you tell if a TJvDockServer Form is unpinned or pinned?

独自空忆成欢 提交于 2020-01-05 05:55:25
问题 I was just wondering if anybody knew how to determine if a TJvDockServer Form is pinned or unpinned easily. The only way I've been able to do so is by checking if a parent form is a TJvDockVSPopupPanel via... ancestor := GetAncestors(Self, 3); if (ancestor is TJvDockTabHostForm) then if ancestor.Parent <> nil then begin if ancestor.Parent is TJvDockVSPopupPanel then begin // Code here end; end; and getAncestors is... function GetAncestors(Control : TControl; AncestorLevel : integer) :

Delphi iOS - no .ipa file generated - unable to install library (e800080)

夙愿已清 提交于 2020-01-05 05:49:09
问题 So I am following this Delphi guide on app store submission: http://docwiki.embarcadero.com/RADStudio/XE4/en/Deploying_Your_iOS_Application_for_Submission_to_the_App_Store So in section Generate an Application Archive File for Your Application it states it should generate an .ipa file in my project directory + scratch directory on Mac. But it does not as far as I can tell. Instead I get an able about Delphi unable to install library using the paramaters defined in my profile. I have attached

“Listener” for detect changes on mouse icon

雨燕双飞 提交于 2020-01-05 05:40:28
问题 I seen here a code that retrieves the current icon of mouse as string, but this code had uses a TTimer for make it. So, i want know if exist some event (Listener) for detect these change on mouse cursor icon. Below is code that uses a TTimer : const HighCursor = 13; type TForm1 = class(TForm) Timer1: TTimer; Label1: TLabel; procedure FormCreate(Sender: TObject); procedure Timer1Timer(Sender: TObject); private FCursorHandles: array [0..HighCursor] of HCURSOR; public end; var Form1: TForm1;