Autor Beitrag
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Fr 13.08.04 10:49 
Hallo Forum,

wenn der Benutzer auf einen Button (z.B. Beenden) einen Doppelklick macht, schließt sich das jeweilige Formular. Liegt im Formular darunter, dass ja jetzt aktiviert wird, an der gleichen Stelle auch ein Button, wird hier ein onClick Ereignis ausgelöst. :?

Gibt es eine elegante Lösung dies zu umgehen? Ich möchte nämlich nicht alle Knöpfe verschieben, die zufällig in unterschiedlichen Formularen übereinander liegen können. :wink:

Vielen Dank,
Gruß Jens.
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Fr 13.08.04 10:52 
Welcher User isn so bescheuert?

Na jut, setz halt im OnShow-Event vom drunterliegenden Form für 1 Sekunde alle Buttons auf Enabled := False;

_________________
Ha! Es compiliert! Wir können ausliefern!
Aton Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Fr 13.08.04 12:19 
Hallo neojones,

neojones hat folgendes geschrieben:
Na jut, setz halt im OnShow-Event vom drunterliegenden Form für 1 Sekunde alle Buttons auf Enabled := False;


Das Programm ist schon langsam genug. :(

Gibt es noch eine andere Möglichkeit?

Danke,
Gruß Jens.
Inferno
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Fr 13.08.04 12:44 
haste mal probiert die form vom beende zu deaktivieren und danach wieder zu aktivieren quasi so etwa:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm2.ButtonOnClick(...); //ist deine procedure die das obenligende formular, hier als Form2, schließt
begin
  Form1.Enabled := False;  // Formular welches darunter liegt deaktivieren
  Form2.Close;
  Form1.Enabled := True;  // Formular welches darunter liegt wieder aktivieren  
end;


habs ned getestet, aber vielleicht gehts ja :)

mfg
Inferno

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Fr 13.08.04 12:47 
also ein paar disable befehle wird der rechner doch wohl noch ausführen können. auf die 0,000000001 sekunden verzögerung kommt es doch nun auch nichtm mehr an *GG*

ansonsten: buttons anders platzieren oder ne sicherheitsabfrage per messagedialog einbauen.

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
Aton Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Fr 13.08.04 13:41 
@Inferno:

Eigentlich eine gute Idee. Ich baue das nächste Formular aber erst danach auf :shock: :

etwa so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TMainForm.X;
begin
  TForm1.Create(...);
  TForm1.ShowModal;
  TForm1.Free;

  TForm2.Create(...);
  TForm2.ShowModal;
  TForm2.Free;
end;

procedure TForm1.ButtonClick(Sender: TObject);
begin
  ...
  Close;
end;


Das heißt Form2 gibt's noch gar nicht. Trotzdem erhält es die Mousebotschaft die auf Form1 geklickt wurde.

Gruß Jens.
Inferno
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Fr 13.08.04 14:34 
Hm na das is ja komisch :roll:

Aber mal was anderes, warum machst du überhaupt einen Doppelklick auf nen Button :?:
die funzen doch unter windows auch mit einem klick :lol:

hm was könnte man da machen, is ne dumme sache, haste mal nen delay gesetzt (muss ja keine sek sein) das sollte sich auch ned so auf deine app auswirken.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TMainForm.X;
begin
  TForm1.Create(...);
  TForm1.ShowModal;
  TForm1.Free;

  TForm2.Create(...);
  TForm2.ShowModal;
  TForm2.Free;
end;

procedure TForm1.ButtonClick(Sender: TObject);
begin
  ...
  delay(500);
  Close;
end;


ansonsten weiß ich im mom nix weiter.

mfg
Inferno
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Fr 13.08.04 14:41 
patrick hat folgendes geschrieben:
ansonsten: buttons anders platzieren oder ne sicherheitsabfrage per messagedialog einbauen.

Das find ich eine gute Idee. Und das Programm wird sicher nicht durch einen Disable Befehl spürbar langsamer *gg*

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Aton Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mi 18.08.04 13:43 
Gibt es vielleicht die Möglich bei onCreate des neuen Formulars den "Mauspuffer" zu löschen bzw. alle Mausklickbotschaften von Windows bis zu diesem Zeitpunkt abzufangen?

Danke,
Gruß Jens.
Inferno
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Mi 18.08.04 14:06 
hm naja was den "MousePuffer" angeht, hab ich keine ahnung aber schau mal unter TMouse.Capture nach. Vielleicht kannste damit was anfangen ;)

mfg
Inferno

hab eben was gefunden

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Busmouse\Parameters

MouseDataQueueSize

da steht schonmal die größe des Mauspuffers, eventuell kann man da was machen.

noch ne änderung
----------------
Bei mir stehts in:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Mouclass\Parameters

Such am besten nach "MouseDataQueueSize" ;)