Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/07/19 in Posts

  1. @Uwe Raabe The file is read-only. So unfortunately, the EditorViewModified event will never be triggered. I got it to work. Here is a high level overview of how it works, in case it might be of help to someone else: I react to the INTAEditServicesNotifier.EditorViewModified event. This is triggered whenever a new editor window is activated. Here I can easily detect whether the source file is read only or not, using EditView.Buffer.IsReadOnly. The trickiest part was then getting the handle of the editor control window (TEditControl). The Open Tools Api provides no functionality for that. It does provide you with the IDE's TCustomForm though (INTAEditWindow.Form). With the form you can find the editor control by searching for a child component with ClassName = 'TEditControl' and ComponentName = 'Editor'. Instead of working with a Windows Hook, I just added a handler for Application.OnMessage. procedure TEditorNotifier.ApplicationEventsMessage(var Msg: tagMSG; var Handled: Boolean); begin if (Msg.message = WM_KEYDOWN) and (FEditControl.Handle = Msg.hwnd) then begin // magic happens... end; if not Handled and Assigned(FPreviousMessageEvent) then FPreviousMessageEvent(Msg, Handled); end;
  2. Bill Meyer

    Linux Support on Pro Edition

    Linux is free, not Delphi. If people want to pay for Delphi to build software for Linux, let 'em. So long as Delphi Pro is not free, I don't see that it is "work for nothing".
  3. Primož Gabrijelčič

    OnTerminated never triggers

    By debugging, of course. Although, I have to admit, it had me quite stumped for a while. A bit of logging proves that service start and stop both come from the same thread (the first number is the thread id): 8996|ServiceCreate 8996|Servizio attivato porta = 8889 17284|ServiceStart 8996|Got message 1024 8996|Keep Alive 8996|Got message 1024 8996|Keep Alive 17284|A try to stop task... 6456|Sending COmniTaskMsg_Terminated 17284|FRunner.ExitCode = 0 17284|ServiceStop 8996|Got Terminated 8996|OnTaskTerminated? 8996 is the main service thread, 17284 is the service control thread, 6456 is the thread running the background task. 
  4. Leif Uneus

    Forked VSCode for Delphi

    The Delphi IDE known as Galileo (.NET inspired) has 15+ years on its neck. The tools to build and support the IDE is somewhat outdated and the Rio IDE is the first attempt in years to remove old dependencies.
  5. uligerhardt

    Anon methods passed as event handlers?

    No, that's why I'm talking about class methods. You can use them like this: type TMyEventHandler = class public class procedure OnError(const AMessage: string); end; Something.OnError := TMyEventHandler.OnError; The method has to be non-static to provide the needed Self parameter.
  6. ertank

    How to run iOS app on physical iPhone

    I should have mentioned that I am trying to run FCMRevisited demo project from latest KastriFree repository against iPhoneOS12.2 64Bits as is (without making necessary adjustments). I just now tried a very simple project and that worked just fine. App installed on the iPhone and run OK. After that I realize that I am trying to deploy a project that needs some adjustments before even trying to compile. Doing what's necessary I could deploy my app on the iPhone. Thank you.
  7. Why don't you use MultiPaste in the first place and let it add the comma after each line. Then you end up with only one remaining error for the semicolon at the last line.
  8. Stefan Glienke

    Initialize local variables at declaration

    https://quality.embarcadero.com/issues/?jql=text ~ "inline variable" and affectedVersion in ("10.3 Rio"%2C "10.3 Rio Release 1") and status not in (Resolved%2C Closed)
  9. Stefan Glienke

    Directions for ARC Memory Management

    The difference is the implementation, why put something into TObject which is then turned off for everything unless I need it. This is already the case for TMonitor which is kinda arguable. Putting the RefCount field into every single object instance only wastes memory. So if you are for explicit opt-in it not being part of TObject itself is way better. So if we get records that are not running through InitRecord, CopyRecord and FinalizeRecord but directly call their constructor/destructor/copy operator you get rid of all that overhead and don't need records wrapping interfaces (no heapallocation needed as well). If we then possibly also get a way to do operator lifting/hoisting we get rid of the current need to write .Value when accessing the stored value (which is why I wrote IShared<T> where you don't have to).
×