Autor Beitrag
Speed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: Fr 30.12.05 12:33 
Hallo, :wave:

ich hab auf ein Canvas eines Panels gezeichnet und will jetzt je nach Position der Maus einen anderen Hint anzeigen. Das Problem dabei ist das updaten, also, das es sofort ändert und bei er neuen Position anzeigt.
Habs jetzt so gemacht dass ich erst Application.HideHint aufrufe, dann den Hint ändere. Aber wie kann ich ihn dann sofort wieder anzeigen und auch an der neuen Mausposition??? OK, is so vielleicht net grad der beste Weg, vielleicht wisst ihr ja was besseres.

Greetz Speed
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 30.12.05 12:43 
Erst suchen, dann fragen:
www.delphi-forum.de/...6&highlight=hint
Opa
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Fr 30.12.05 12:47 
Versuche das mal
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  private
    procedure AppOnIdle(Sender: TObject; var Done: boolean);

procedure TMain.FormCreate(Sender: TObject);
begin
  Application.OnIdle := AppOnIdle;
end;

procedure TMain.AppOnIdle(Sender: TObject; var Done: boolean);
begin
  Done := true;//wichtig
  //hier dein Update
end;

MFG

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 30.12.05 12:59 
Hallo,

wie wäre es damit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.HintPause:=50;
end;

procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  case X of
      10..20 : begin
               Panel1.Hint := '10..20';
               end;
      30..40 : begin
               Panel1.Hint := '30..40';
               end;
  else
    Application.CancelHint;
  end;
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Speed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: Fr 30.12.05 14:01 
Hy @ all,

Danke erstmal...
Klappt jetzt wunderbar. Das einzige was ich falsch hatte war das HideHint. Dafür hab ich jetzt einfach CancelHint genommen->jetzt klappts.

@ Fabian W.:
OK, ich bin noch net so lang wie du hier im Forum, aber lang genug um selbst zu wissen, dass man erst mal die Suche benutzt. Und stell dir mal vor, dass hab ich sogar gemacht. :twisted: Aber wenn ich was gescheites gefunden hätte, dann hätt' ich das hier net gepostet. Trotzdem Danke. :wink:

MFG Speed
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 30.12.05 15:38 
user profile iconSpeed hat folgendes geschrieben:
@ Fabian W.:
OK, ich bin noch net so lang wie du hier im Forum, aber lang genug um selbst zu wissen, dass man erst mal die Suche benutzt. Und stell dir mal vor, dass hab ich sogar gemacht. :twisted: Aber wenn ich was gescheites gefunden hätte, dann hätt' ich das hier net gepostet. Trotzdem Danke. :wink:
Tschuldige wollte nich schroff wirken ;-)
N8Falter74
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D7 Prof
BeitragVerfasst: Do 09.02.06 14:08 
Hallo

ich hatte auch genau dieses Problem, bei mir haben die Beispiele allerdings nicht richtig funktioniert. Das kann aber auch an der Komponente gelegen haben?!

Ich habe das jetzt bei mir so gelöst:

ausblenden Delphi-Quelltext
1:
2:
3:
// im MouseMove Event der Komponente
  testkompo.hint := 'Test Hint';
  Application.ActivateHint(Mouse.CursorPos);

Sowie ich nun die Maus über der Komponente bewege, wird automatisch der Hint an der
jeweiligen Maus-Position angezeigt. (Er folgt der Maus!)

grüße
Sebastian