AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

About-Dialog in Komponente

Ein Thema von FriFra · begonnen am 3. Okt 2003 · letzter Beitrag vom 3. Okt 2003
Antwort Antwort
Benutzerbild von FriFra
FriFra

Registriert seit: 19. Apr 2003
1.291 Beiträge
 
Delphi 2005 Professional
 
#1

About-Dialog in Komponente

  Alt 3. Okt 2003, 14:29
Wie kann ich einen About Dialog in meine Komponente einbauen?
Miniaturansicht angehängter Grafiken
kompoabout.jpg  
Elektronische Bauelemente funktionieren mit Rauch. Kommt der Rauch raus, geht das Bauteil nicht mehr.
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: About-Dialog in Komponente

  Alt 3. Okt 2003, 14:32
Dazu musst Du einen Hier im Forum suchenProperty and Editor bauen. Eine Basisanleitung findest Du hier:

http://www.delphipraxis.net/viewtopic.php?t=6916

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von FriFra
FriFra

Registriert seit: 19. Apr 2003
1.291 Beiträge
 
Delphi 2005 Professional
 
#3

Re: About-Dialog in Komponente

  Alt 3. Okt 2003, 15:31
Ich habe es jetzt hinbekommen

Allerdings funktioniert es nur in Delphi7... Delphi5 und 6 kennen DesignEditors und DesignIntf nicht! Was kann man da tun?

Die Variants ist kein grosses Problem, da man die über entspr. Compilerschalter übergehen kann.

Delphi-Quellcode:
unit GetLocalMail;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
  Dialogs, StdCtrls, Registry, IniFiles, ActiveX, ShlObj, shellApi,
  ComCtrls, ComObj, DesignEditors, DesignIntf;

const
  COMP_VERSION = '1.0';

type
  TAboutGetLocalMail = class(TPropertyEditor)
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
  end;
  TGetLocalMail = class(TComponent)
  private
    { Private-Deklarationen }
    fAbout: TAboutGetLocalMail;
    B_IFN: boolean;
    B_LN: boolean;
    B_OL: boolean;
    B_NS: boolean;
    B_OP: boolean;
    procedure SetIFN(const Value: boolean);
    procedure SetLN(const Value: boolean);
    procedure SetOL(const Value: boolean);
    procedure SetNS(const Value: boolean);
    procedure SetOP(const Value: boolean);
    procedure GetNotesMail;
    procedure GetOutlookMail;
    procedure GetNetscapeMail;
    procedure GetOperaMail;
    procedure GetMail;
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    Mails: TStringList;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    { Published-Deklarationen }
    property About: TAboutGetLocalMail read fAbout write fAbout;
    property IncludeFullname: boolean read B_IFN write SetIFN default True;
    property LotusNotes: boolean read B_LN write SetLN default False;
    property Outlook: boolean read B_OL write SetOL default True;
    property Netscape: boolean read B_NS write SetNS default True;
    property Opera: Boolean read B_OP write SetOP default True;

    procedure SetDefauls;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterPropertyEditor(TypeInfo(TAboutGetLocalMail), TGetLocalMail, 'ABOUT',
    TAboutGetLocalMail);
  RegisterComponents('FriFra', [TGetLocalMail]);
end;

procedure TAboutGetLocalMail.Edit;
begin
  //Aboutdialog anzeigen
  MessageDlg('TGetLocalMail Version ' + COMP_VERSION + #13#13 +
    'Copyright 2003 by M. Fritzsche'#13'http://www.frifra.de', mtInformation,
    [mbOK], 0);
end;

function TAboutGetLocalMail.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog, paReadOnly];
end;

function TAboutGetLocalMail.GetValue: string;
begin
  Result := 'Version ' + COMP_VERSION;
end;

constructor TGetLocalMail.Create(AOwner: TComponent);
begin
  inherited;
  Mails := TStringList.Create;
  SetDefauls;
end;

destructor TGetLocalMail.Destroy;
begin
  Mails.Free;
  inherited;
end;

procedure TGetLocalMail.SetIFN(const Value: boolean);
begin
  B_IFN := Value;
  GetMail;
end;

procedure TGetLocalMail.SetLN(const Value: boolean);
begin
  B_LN := Value;
  GetMail;
end;

procedure TGetLocalMail.SetOL(const Value: boolean);
begin
  B_OL := Value;
  GetMail;
end;

procedure TGetLocalMail.SetNS(const Value: boolean);
begin
  B_NS := Value;
  GetMail;
end;

procedure TGetLocalMail.SetOP(const Value: boolean);
begin
  B_OP := Value;
  GetMail;
end;

{ B E G I N N - Lotus Notes }

procedure TGetLocalMail.GetNotesMail;
begin
  Mails.Add('dummy@dummy.org');
end;
{ E N D E - Lotus Notes }

{ B E G I N N - Outlook und Outlook Express }

procedure TGetLocalMail.GetOutlookMail;
begin
  Mails.Add('dummy@dummy.org');
end;
{ E N D E - Outlook und Outlook Express }

{ B E G I N N - Netscape }

procedure TGetLocalMail.GetNetscapeMail;
begin
  Mails.Add('dummy@dummy.org');
end;
{ E N D E - Netscape }

{ B E G I N N - Opera 5-7 }

procedure TGetLocalMail.GetOperaMail;
begin
  Mails.Add('dummy@dummy.org');
end;
{ E N D E - Opera 5-7 }

{ B E G I N N - Alle ausgeben }

procedure TGetLocalMail.GetMail;
begin
  Mails.Clear;
  if B_LN = True then
    GetNotesMail;
  if B_OL = True then
    GetOutlookMail;
  if B_NS = True then
    GetNetscapeMail;
  if B_OP = True then
    GetOperaMail;
end;
{ E N D E - Alle Mailadressen ausgeben }

procedure TGetLocalMail.SetDefauls;
begin
  B_IFN := True;
  B_LN := False;
  B_OL := True;
  B_NS := True;
  B_OP := True;
  GetMail;
end;

end.
Elektronische Bauelemente funktionieren mit Rauch. Kommt der Rauch raus, geht das Bauteil nicht mehr.
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#4

Re: About-Dialog in Komponente

  Alt 3. Okt 2003, 15:33
Auch mit einem Compilerschalter ersetzen. In den früheren Versionen waren die in der Unit dsgnintf zusammengefasst.

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#5

Re: About-Dialog in Komponente

  Alt 3. Okt 2003, 15:34
Btw, für About nur read definieren, write ist wohl reichlich unnötig

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von FriFra
FriFra

Registriert seit: 19. Apr 2003
1.291 Beiträge
 
Delphi 2005 Professional
 
#6

Re: About-Dialog in Komponente

  Alt 3. Okt 2003, 19:32
So, jetzt hatte ich ein neues Problem...

Vielleicht findet ja jemand den Fehler:
http://www.delphipraxis.net/internal...?p=78041#78041
Elektronische Bauelemente funktionieren mit Rauch. Kommt der Rauch raus, geht das Bauteil nicht mehr.
  Mit Zitat antworten Zitat
Antwort Antwort


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 09:41 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz