![]() |
Komponente: Problem mit 2x Aufruf einer Procedure + Variable
Hallo,
sorry wegen dem etwas komischen Titel - aber ich weiss nicht wie man es am besten nenen soll. Also mein Problem: Ich hab folgendes:
Code:
Wenn ich nun das Flag: BT_Custom auswähle dann sehe ich die Meldung.
type
TBalloonTipFlags = (BT_Info, BT_Warning, BT_Error, BT_WinSymbol, BT_Question, BT_FormIcon, BT_Custom); private FBalloonTipFlags: TBalloonTipFlags; published property BalloonTipFlags: TBalloonTipFlags read FBalloonTipFlags write SetBalloonTipFlag default BT_Info; { ... } procedure TTrayIcon.SetBalloonTipFlag(Value : TBalloonTipFlags); begin //Wird aufgerufen wenn sich die Variable "FBalloonTipFlags" ändert FBalloonTipFlags := Value; DoBalloonTipFlags; end; procedure TTrayIcon.DoBalloonTipFlags; begin //Flags case FBalloonTipFlags of //Info BT_Info : FFlagImage.Picture.Icon.Handle := LoadIcon(0, IDI_ASTERISK); //Warnung BT_Warning : FFlagImage.Picture.Icon.Handle := LoadIcon(0, IDI_EXCLAMATION); //Fehler BT_Error : FFlagImage.Picture.Icon.Handle := LoadIcon(0, IDI_HAND); //Windows-Symbol BT_WinSymbol : FFlagImage.Picture.Icon.Handle := LoadIcon(0, IDI_WINLOGO); //Frage BT_Question : FFlagImage.Picture.Icon.Handle := LoadIcon(0, IDI_QUESTION); //Form-Icon BT_FormIcon : FFlagImage.Picture.Icon := Application.Icon; //Eigenes Icon BT_Custom : begin FFlagImage.Picture := FCustomFlagPicture; showmessage('BT_Custom'); end; end; Wenn ich aber jetzt über eine Property ein TPicture auswähle dann wird folgende Procedure ausgeführt:
Code:
Nur bei diesem Code wird die Message in der Procedure "DoBalloonTipFlags" nicht angezeigt, ob (meines Vermutens) die Variable "FBalloonTipFlags" immer noch den Wert "BT_Custom" haben müsste, oder?
procedure TTrayIcon.SetCustomFlagPicture(Value: TPicture);
begin //Wird aufgerufen, wenn sich die Variable "FCustomFlagPicture" ändert FCustomFlagPicture.Assign(Value); DoBalloonTipFlags; end; Was ist daran verkehrt, dass ich beim zweiten mal die Message (die ja nur als test dient) nicht sehe? mfg Helmi |
Re: Komponente: Problem mit 2x Aufruf einer Procedure + Vari
sorry fürs posten
aber hat keine ne Ahnung warum das so ist? |
Re: Komponente: Problem mit 2x Aufruf einer Procedure + Vari
Moin Helmi,
setz mal bei FCustomFlagPicture.Assign(Value) nen Haltepunkt und geh dann mal mit F8, bzw F7(bei DoBalloonTipFlags) weiter... Springt der in die DoBalloonTipFlags-Routine rein? Wird die Message überhaupt erreicht? MfG Stevie |
Re: Komponente: Problem mit 2x Aufruf einer Procedure + Vari
Hallo Stevie,
danke, dein Tip mit dem Haltepunkt hat mir gezeigt, dass das "SetBalloonTipFlag" gar nicht ausgeführt wird. (klar - das Picture wird ja nicht geändert - nur das Bild des Pictures). Ich hab jetzt meine Procedure "DoBalloonTipFlags" in das OnChange des Pictures gesetzt und schon funktionierts. nochmals Danke :thumb: mfg Helmi |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:16 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 by Thomas Breitkreuz