![]() |
Incompatible types: 'TMouseButton' and 'TGLMouseButton'
Hi,
ich habe ein kleines Problem und hänge da gedanklich gerade fest... Ich habe folgende Procedur:
Delphi-Quellcode:
Button bezieht sich auf TMouseButton in Controls.pas.
procedure TSpiel.GLSceneViewer_SpielMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin //Konsole.Visible:= not Konsole.visible; case iModus of 0:begin if Button = mbLeft then {linke maustaste} begin [...] mbLeft ist leider erneut in GLCrossPlatform.pas unter TGLMouseButton (GLScene) definiert. Zitat:
Gruß, Dorian |
Re: Incompatible types: 'TMouseButton' and 'TGLMouseButton'
Hallo!
Zitat:
Delphi-Quellcode:
if Button = Controls.mbLeft then {linke maustaste}
{ .. } |
Re: Incompatible types: 'TMouseButton' and 'TGLMouseButton'
Das hab ich schon versucht:
Zitat:
|
Re: Incompatible types: 'TMouseButton' and 'TGLMouseButton'
Hallo Dorian,
beim Versuch, eine Namensüberdeckung zu umgehen, bist du wahrscheinlich über die nächste gestolpert. Controls[] ist ein Array in TWinControl, das alle Controls enthält, die das WinControl als Parent haben. Du könntest zunächst versuchen, die Reihenfolge der betroffenen Units (Controls und GLCrossPlatform) in der USES-Anweisung zu ändern. Möglicherweise führt diese Maßnahme aber zu anderen Fehlermeldungen. Eine Lösung deines Problems könnte dann darin bestehen, außerhalb(!) der Methoden eine Konstante zu definieren und diese in der Methode zu verwenden:
Delphi-Quellcode:
Gruß Hawkeye
const
mb_Left = Controls.mbLeft; procedure TSpiel.GLSceneViewer_SpielMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin //Konsole.Visible:= not Konsole.visible; case iModus of 0:begin if Button = mb_Left then {linke maustaste} begin [...] |
Re: Incompatible types: 'TMouseButton' and 'TGLMouseButton'
Danke Hawkeye, das war die Lösung.
Gruß, Dorian |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:26 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