AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Die Delphi-IDE IOTA-Editor mit sowas wie einem OnChange-Handler?
Thema durchsuchen
Ansicht
Themen-Optionen

IOTA-Editor mit sowas wie einem OnChange-Handler?

Ein Thema von r29d43 · begonnen am 10. Mai 2021 · letzter Beitrag vom 10. Mai 2021
 
r29d43

Registriert seit: 18. Jan 2007
289 Beiträge
 
Delphi 10.4 Sydney
 
#5

AW: IOTA-Editor mit sowas wie einem OnChange-Handler?

  Alt 10. Mai 2021, 19:00
Ja, super, danke! Funktioniert!

Ich habe das jetzt mal etwas minimalistisch so abgeleitet/hergeleitet (ausgehend von stahli's TViewPaintNotifier)

Delphi-Quellcode:
unit EditServiceNotifer;

interface

uses
  ToolsAPI, Winapi.Windows, System.Types, Vcl.Graphics, System.Classes, DockForm;

type
  TEditNotifierHelper = class(TInterfacedObject, IOTANotifier, INTAEditServicesNotifier)
  private
  public
    constructor Create;
    destructor Destroy; override;
  public
    // INTAEditServicesNotifier
    procedure WindowShow(const EditWindow: INTAEditWindow; Show, LoadedFromDesktop: Boolean);
    procedure WindowNotification(const EditWindow: INTAEditWindow; Operation: TOperation);
    procedure WindowActivated(const EditWindow: INTAEditWindow);
    procedure WindowCommand(const EditWindow: INTAEditWindow; Command, Param: Integer; var Handled: Boolean);
    procedure EditorViewActivated(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
    procedure EditorViewModified(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
    procedure DockFormVisibleChanged(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    procedure DockFormUpdated(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    procedure DockFormRefresh(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    // IOTANotifier
    procedure AfterSave;
    procedure BeforeSave;
    procedure Destroyed;
    procedure Modified;
  end;

procedure Register;
procedure RemoveNotifier;

implementation

uses
  System.SysUtils, Vcl.Dialogs, System.Generics.Collections, readEditorCode_Unit;


var
  NotifierIndex : integer = -1;


procedure Register;
var
  Services: IOTAEditorServices;
begin
  Services := BorlandIDEServices as IOTAEditorServices;
  NotifierIndex := Services.AddNotifier(TEditNotifierHelper.Create);
end;


procedure RemoveNotifier;
var
  Services: IOTAEditorServices;
begin
  if NotifierIndex <> -1 then
  begin
    Services := BorlandIDEServices as IOTAEditorServices;
    Services.RemoveNotifier(NotifierIndex);
    NotifierIndex := -1;
  end;
end;



{ TEditNotifierHelper }

constructor TEditNotifierHelper.Create; // Handler funktioniert
begin

end;

destructor TEditNotifierHelper.Destroy;
begin
  inherited;
end;

//==============================================================================
// INTAEditServicesNotifier -Handler

    procedure TEditNotifierHelper.WindowShow(const EditWindow: INTAEditWindow; Show, LoadedFromDesktop: Boolean);
    begin

    end;

    procedure TEditNotifierHelper.WindowNotification(const EditWindow: INTAEditWindow; Operation: TOperation);
    begin

    end;

    procedure TEditNotifierHelper.WindowActivated(const EditWindow: INTAEditWindow);
    begin

    end;

    procedure TEditNotifierHelper.WindowCommand(const EditWindow: INTAEditWindow; Command, Param: Integer; var Handled: Boolean);
    begin

    end;

    procedure TEditNotifierHelper.EditorViewActivated(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
    begin

    end;

    procedure TEditNotifierHelper.EditorViewModified(const EditWindow: INTAEditWindow; const EditView: IOTAEditView);
    begin
      Winapi.Windows.beep(1000,100); // Handler funktioniert ! ! ! ! !
    end;

    procedure TEditNotifierHelper.DockFormVisibleChanged(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    begin

    end;

    procedure TEditNotifierHelper.DockFormUpdated(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    begin

    end;

    procedure TEditNotifierHelper.DockFormRefresh(const EditWindow: INTAEditWindow; DockForm: TDockableForm);
    begin

    end;

//==============================================================================

procedure TEditNotifierHelper.AfterSave;
begin

end;

procedure TEditNotifierHelper.BeforeSave;
begin

end;

procedure TEditNotifierHelper.Destroyed;
begin

end;

procedure TEditNotifierHelper.Modified;
begin

end;



initialization


finalization

  RemoveNotifier;

end.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:14 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz