Autor Beitrag
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Sa 27.05.06 01:24 
wenn man mit der Maus über die Icons von Speedbuttons fährt, bleibt die Markierung oft stehen. Ich kenne das schon lange so, aber so langsam stört es mich doch. Wie kann man das ändern? Ich benutze den Flat-Style von den Speedbuttons - außerdem D7 Prof. mit SP1 auf WinXP.

Vermutlich gibt es so einen Thread schon... habe aber jetzt keinen gefunden.

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mo 29.05.06 07:57 
Magst du mal nen Screenshot machen? Meinst du farbliche Markierung(Grauer Glyph) oder das der Style flach ist oder was genau?
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mo 29.05.06 08:34 
ich meine die Markierung, wie wenn man auf ein Icon draufklickt. Wenn man mit der Maus über die Icons drüberfährt, wird das jeweilige Icon unterm Mauspfeil ja hervorgehoben - und oft bleibt die Markierung dann stehen, auch wenn der Mauspfeil nicht mehr über dem Icon ist.

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
aim65
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 312

Win 9x, Win XP
Delphi 3pro, 7PE
BeitragVerfasst: Mo 29.05.06 20:01 
Kann dein Problem hier nicht nachvollziehen. Habe alle möglichen Speedbuttons ausprobiert - Glyph mit und ohne seitlichem Text. Liegt m.E. nicht an Delphi (habs mit D3 und D7 probiert, +XP-SP1).
Ich tippe auf deine Maus. Hast du mal die Einstellungen gecheckt? Andere Mäuse (PS2 oder USB) ausprobiert?
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 29.05.06 20:47 
Aus dem Easy-Helper:
Zitat:

Beim Einsatz der Komponente TSpeedButton im Flat-Style kann es passieren, dass sie sich bei schnellem Überfahren mit der Maus nicht mehr in den Flachzustand zurück begibt. Folgender Code behebt diesen Bug:

In der Unit Buttons.pas müssen unter TSpeedButton.MouseUp diese Zeilen eingefügt werden:

if FDown then FState := bsExclusive;
Repaint;
end;
+ if FFlat and Enabled then
+ begin
+ GetCursorPos(P);
+ FMouseInControl := FindDragTarget(P, True) <> Self;
+ if FMouseInControl and not FDragging then
+ begin
+ FMouseInControl := False;
+ Invalidate;
+ end;
+ end;
end;
end;

Datei Forms.pas in TApplication.DoMouseIdle:

CaptureControl: TControl;
P: TPoint;
+ ParentForm: TCustomForm;
begin
GetCursorPos(P);
Result := FindDragTarget(P, True);
+ if (Result <> nil) and (Result is TGraphicControl) then
+ begin
+ ParentForm := GetParentForm(Result);
+ if ParentForm <> nil then
+ begin
+ P := ParentForm.ScreenToClient(P);
+ if not PtInRect(ParentForm.ClientRect, P) then
+ Result := nil;
+ end;
+ end;
+
if (Result <> nil) and (csDesigning in Result.ComponentState) then
Result := nil;
Anschließend muss die VCL neu kompiliert werden. Wer ohne Packages auskommt, braucht nur die Dateien Buttons.pas und Forms.pas neu kompilieren, da sich nichts am Interface geändert hat:

cd Delphi\Source\VCL
dcc32 -U..\..\Lib\Debug -N..\..\Lib\Debug -R..\..\Lib Forms.pas
dcc32 -U..\..\Lib\Debug -N..\..\Lib\Debug -R..\..\Lib Buttons.pas
dcc32 -$D- -U..\..\Lib -N..\..\Lib -R..\..\Lib Forms.pas
dcc32 -$D- -U..\..\Lib -N..\..\Lib -R..\..\Lib Buttons.pas

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mo 29.05.06 21:43 
danke. Ich werde das in den nächsten Tagen einmal testen ;)

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Sa 17.06.06 16:37 
hm ich starte mein programm mit veränderter buttons.pas (oder baue einen fehler da ein), aber er ändert nichts. Wenn ich einen Fehler einbaue dürfte er doch nicht mehr starten, oder?

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Blawen
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 616
Erhaltene Danke: 33

Win XP, Vista, 7
Delphi 5 Prof., BDS 2006 Prof. RAD Studio XE
BeitragVerfasst: Sa 17.06.06 17:45 
user profile iconAmiga-Fan hat folgendes geschrieben:
hm ich starte mein programm mit veränderter buttons.pas (oder baue einen fehler da ein), aber er ändert nichts. Wenn ich einen Fehler einbaue dürfte er doch nicht mehr starten, oder?

Hast Du die Unit neu kompiliert? Ich vermute mal, dass Dein Programm noch immer auf die alte Version zugreift...

_________________
Es kompilert, wir können ausliefern.
Und es kompiliert wieder - das Update ist fertig - bitte 100 Euro ;-)
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Di 22.08.06 22:54 
habe nochmal versucht, den Tipp nachzuvollziehen. Aber sobald ich die VCL in den Suchpfad mit aufnehme, meckert er beim starten (nicht beim kompilieren): Fehler bei Bereichsprüfung in unit IBCustomDataset.

Delphi 7 Professional...

mein vcl-Code, den ich laut Delphi Helper für diesen Cheat ja verändern soll, stimmt übrigens nicht 100%ig mit dem im Delphi-Helper überein (man soll ein paar Zeilen hinzufügen, aber die gezeigten darunter und darüber stimmen nicht mit dem quellcode bei mir überein).

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mi 11.10.06 23:08 
weiß jemand eine Lösung?

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Di 17.10.06 19:48 
ich hatte übersehen, die zeilen mit dcc32 auszuführen. Kenne mich damit nicht aus...

der hack scheint aber nicht zu funktionieren bei mir (beim kompilieren mit dcc32 hat er aber nicht gemeckert). Vielleicht kann mir einer von euch sagen, wie die entsprechenden Dateien der VCL bei euch aussehen? Weil bei mir scheinen die anders zu sein als sie im Delphi Helper beschrieben sind.

Meine Dateien sehen so aus. Und ich sehe da eben eine Abweichung zum Delphi-Helper-Code, also so wie der Code in der VCL aussehen müsste.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
procedure TSpeedButton.MouseUp(Button: TMouseButton; Shift: TShiftState;
  X, Y: Integer);
var
  DoClick: Boolean;
  P:TPoint;
begin
  inherited MouseUp(Button, Shift, X, Y);
  if FDragging then
  begin
    FDragging := False;
    DoClick := (X >= 0) and (X < ClientWidth) and (Y >= 0) and (Y <= ClientHeight);
    if FGroupIndex = 0 then
    begin
      { Redraw face in-case mouse is captured }
      FState := bsUp;
      FMouseInControl := False;
      if DoClick and not (FState in [bsExclusive, bsDown]) then
        Invalidate;
    end
    else
      if DoClick then
      begin
        SetDown(not FDown);
        if FDown then Repaint;
      end
      else
      begin
        if FDown then FState := bsExclusive;
        Repaint;
      end;

    if DoClick then Click;
    UpdateTracking;
  end;
end;

function TApplication.DoMouseIdle: TControl;
var
  CaptureControl: TControl;
  P: TPoint;
begin
  GetCursorPos(P);
  Result := FindDragTarget(P, True);

  CaptureControl := GetCaptureControl;
  if FMouseControl <> Result then
  begin
    if ((FMouseControl <> nil) and (CaptureControl = nil)) or
      ((CaptureControl <> nil) and (FMouseControl = CaptureControl)) then
      FMouseControl.Perform(CM_MOUSELEAVE, 0, 0);
    FMouseControl := Result;
    if ((FMouseControl <> nil) and (CaptureControl = nil)) or
      ((CaptureControl <> nil) and (FMouseControl = CaptureControl)) then
      FMouseControl.Perform(CM_MOUSEENTER, 0, 0);
  end;
end;

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: So 29.10.06 23:07 
hat jemand eine Lösung? Das Problem ist echt nervig. Oder würdet Ihr einen anderen Button-Typ nehmen? Wobei die sind doch bestimmt alle abgeleitet...

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Fr 10.11.06 12:18 
okay hat sich jetzt geklärt. Das Problem tritt verstärkt im Zusammenhang mit XPMenu auf. Komponente Speedbutton explizit von XPMenu ausnehmen (der Namen XPMenu ist eigentlich irreführend), und dann ists besser (nicht ganz erledigt, aber weit besser).

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen