AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Galgenmännchen

Offene Frage von "Tomislav"
Ein Thema von Tomislav · begonnen am 1. Dez 2005 · letzter Beitrag vom 3. Dez 2005
Antwort Antwort
Seite 4 von 5   « Erste     234 5   
Benutzerbild von gordon freeman
gordon freeman

Registriert seit: 28. Jun 2003
Ort: Gelsenkirchen
337 Beiträge
 
Delphi 2005 Personal
 
#31

Re: Galgenmännchen

  Alt 2. Dez 2005, 14:11
Du solltest dich mal mit PaintBox.OnrePaint oder so befassen. Die PaintBox zeichnet bei dir das ganze wahrscheinlich nur 1 Mal. Es muss ja ber immer gezeichnet werden, wenn das Fenster verdeckt ist. Also hau den ganzen Code zum zeichnen in die OnPaint deiner Paintbox rein.

P.S. Häng doch das nächste mal den Code bitte als Anhang dran, da scrollt man sich ja die Finger wund
  Mit Zitat antworten Zitat
tigerman33

Registriert seit: 30. Jul 2005
Ort: München
423 Beiträge
 
Delphi 2005 Professional
 
#32

Re: Galgenmännchen

  Alt 2. Dez 2005, 14:26
Ich zitiere mich mal selbst:
Zitat von tigerman33:
Zeichnen tut ers vermute ich mal schon. Aber beim nächsten Neuzeichnen der Paintbox wird alles wieder übergepinselt, deswegen ist nichts zu sehen. Sieh dir dazu mal das Delphi-Referenz durchsuchenOnPaint-Ereignis an.

Wenn du selbst auf dem Canvas rumzeichnest, bist du auch selbst dafür verantwortlich, dass bei jedem Neuzeichnen der Paintbox bzw des Controls auf dessen Canvas du malst auch deine eigene Grafik wieder ausgegeben wird.
Christian
Der Computer hilft mir, Probleme zu lösen, die ich ohne Computer nicht hätte.
  Mit Zitat antworten Zitat
Tomislav

Registriert seit: 1. Dez 2005
34 Beiträge
 
#33

Re: Galgenmännchen

  Alt 2. Dez 2005, 15:46
mit on paint geht es auch nicht richtig
da macht er zeichenfehler
  Mit Zitat antworten Zitat
Tomislav

Registriert seit: 1. Dez 2005
34 Beiträge
 
#34

Re: Galgenmännchen

  Alt 2. Dez 2005, 16:08
Delphi-Quellcode:
procedure TForm1.PBP1OnPaint(Sender: TObject);
begin
  if
 (lblFehler1.Caption = '0')
 then
  begin
   with PBP1.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    end;
  end;

 if
 (lblFehler1.Caption = '1')
 then
 begin
   with PBP1.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    xx1.x := 20;
    xx1.y := x.y;
    xx2.x := 20;
    xx2.y := 10;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    moveto(xx1.x, xx1.y);
    lineto(xx2.x, xx2.y);
    end;
 end;
end;
was muss ich machen?
  Mit Zitat antworten Zitat
tigerman33

Registriert seit: 30. Jul 2005
Ort: München
423 Beiträge
 
Delphi 2005 Professional
 
#35

Re: Galgenmännchen

  Alt 2. Dez 2005, 16:13
Also zumindest in deinem letzten Code tauchte lblFehler nicht auf. Generell solltest du solche Abfragen über die Caption vermeiden, das ist nicht besonders elegant. Mach lieber eine Boolean-Variable für deine Abfrage.

Zu deinem konkreten Problem würde ich mal vermuten, dass entweder lblFehler.Caption weder '1' noch '0' ist, oder du deine Paintbox wieder auf invisible gestellt hast.
Christian
Der Computer hilft mir, Probleme zu lösen, die ich ohne Computer nicht hätte.
  Mit Zitat antworten Zitat
Tomislav

Registriert seit: 1. Dez 2005
34 Beiträge
 
#36

Re: Galgenmännchen

  Alt 3. Dez 2005, 00:43
es ist nicht invisible
guckt es euch an
www.spvgg-hadamar-tt.de/Spiel.zip
  Mit Zitat antworten Zitat
tigerman33

Registriert seit: 30. Jul 2005
Ort: München
423 Beiträge
 
Delphi 2005 Professional
 
#37

Re: Galgenmännchen

  Alt 3. Dez 2005, 01:04
Da gibt's nicht viel zum angucken, es fehlt nämlich der Sourcecode...

//edit:
von dem ich vorschlagen würde, dass du ihn einfach mal anhängst.
Christian
Der Computer hilft mir, Probleme zu lösen, die ich ohne Computer nicht hätte.
  Mit Zitat antworten Zitat
Tomislav

Registriert seit: 1. Dez 2005
34 Beiträge
 
#38

Re: Galgenmännchen

  Alt 3. Dez 2005, 09:05
????
  Mit Zitat antworten Zitat
tigerman33

Registriert seit: 30. Jul 2005
Ort: München
423 Beiträge
 
Delphi 2005 Professional
 
#39

Re: Galgenmännchen

  Alt 3. Dez 2005, 11:30
In dem zipfile ist nur die exe und die txt. Wie sollen wir denn den Fehler in deinem Code finden, wenn du den Code nicht da mit reinpackst?
Wenn du den nicht auf dieser Webseite zur Verfügung stellen willst, kannst du ihn ja einfach als Anhang (!) hier im Forum posten.(Ganz unten über dem Button "Vorschau").
Christian
Der Computer hilft mir, Probleme zu lösen, die ich ohne Computer nicht hätte.
  Mit Zitat antworten Zitat
Tomislav

Registriert seit: 1. Dez 2005
34 Beiträge
 
#40

Re: Galgenmännchen

  Alt 3. Dez 2005, 11:33
Delphi-Quellcode:
procedure TForm1.Spieler1(Sender: TObject);
begin
 if
 (RBP1.Checked = true) and (lblString1.Caption = A) and (lblString2.Caption = B) and (lblString3.Caption = C) and (lblString4.Caption = D) and (lblString5.Caption = E) and (lblString6.Caption = F) and (lblString7.Caption = G) and (lblString8.Caption = H) and (lblString9.Caption = I) and (lblString10.Caption = J) and (lblString11.Caption = K) and (lblString12.Caption = L)
 then
 begin
 Application.MessageBox('Spieler 1 hat gewonnen!','Gewinner');
 btnWortwahlClick(Sender);
 end;

 if
 (Antwort = A) or (Antwort = B) or (Antwort = C) or (Antwort = D) or (Antwort = E) or (Antwort = F) or (Antwort = G) or (Antwort = H) or (Antwort = I) or (Antwort = J) or (Antwort = K) or (Antwort = L)
 then
 begin
 end
 else
 begin
 RBP1.Checked := false;
 RBP2.Checked := true;
 Application.MessageBox('Leider ist dieser Buchstabe nicht dabei! Spieler 2 ist an der Reihe!','!!!');
 aa := StrToInt(lblFehler1.Caption);
 aa := aa+1;
 lblFehler1.Caption := IntToStr(aa);
 end;
end;

procedure TForm1.Spieler2(Sender: TObject);
begin
 if
 (RBP2.Checked = true) and (lblString1.Caption = A) and (lblString2.Caption = B) and (lblString3.Caption = C) and (lblString4.Caption = D) and (lblString5.Caption = E) and (lblString6.Caption = F) and (lblString7.Caption = G) and (lblString8.Caption = H) and (lblString9.Caption = I) and (lblString10.Caption = J) and (lblString11.Caption = K) and (lblString12.Caption = L)
 then
 begin
 Application.MessageBox('Spieler 2 hat gewonnen!','Gewinner');
 btnWortwahlClick(Sender);
 end;

 if
 (Antwort = A) or (Antwort = B) or (Antwort = C) or (Antwort = D) or (Antwort = E) or (Antwort = F) or (Antwort = G) or (Antwort = H) or (Antwort = I) or (Antwort = J) or (Antwort = K) or (Antwort = L)
 then
 begin
 end
 else
 begin
 RBP2.Checked := false;
 RBP1.Checked := true;
 Application.MessageBox('Leider ist dieser Buchstabe nicht dabei! Spieler 1 ist an der Reihe!','!!!');
 bb := StrToInt(lblFehler2.Caption);
 bb := bb+1;
 lblFehler2.Caption := IntToStr(bb);
 end;

end;

procedure TForm1.PBP2OnPaint(Sender: TObject);
begin

 if
 (lblFehler2.Caption = '0')
 then
  begin
   with PBP2.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    end;
  end;


 if
 (lblFehler2.Caption = '1')
 then
  begin
   with PBP2.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    xx1.x := 20;
    xx1.y := x.y;
    xx2.x := 20;
    xx2.y := 10;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    moveto(xx1.x, xx1.y);
    lineto(xx2.x, xx2.y);
    end;
  end;
end;

procedure TForm1.PBP1OnPaint(Sender: TObject);
begin
  if
 (lblFehler1.Caption = '0')
 then
  begin
   with PBP1.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    end;
  end;

 if
 (lblFehler1.Caption = '1')
 then
 begin
   with PBP1.canvas do
    begin
    x.x := 5;
    x.y := 65;
    y.x := 65;
    y.y := x.y;
    xx1.x := 20;
    xx1.y := x.y;
    xx2.x := 20;
    xx2.y := 10;
    moveto(x.x, x.y);
    lineto(y.x, y.y);
    moveto(xx1.x, xx1.y);
    lineto(xx2.x, xx2.y);
    end;
 end;
end;

end.
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

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 11:20 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