AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi 7: ActionBand Glyph Schatten

Ein Thema von sebhen · begonnen am 21. Sep 2006
Antwort Antwort
sebhen

Registriert seit: 21. Sep 2006
1 Beiträge
 
Delphi 7 Professional
 
#1

Delphi 7: ActionBand Glyph Schatten

  Alt 21. Sep 2006, 19:14
Meine Konfiguration:

Delphi 7
+ Update 1
+ 19151_delphi_7.0_actionbands_patch_all_languages


Mein Problem:

Ich setze in einer Anwendung eine ActionToolBar ein. Auf der Toolbar befindet sich ein Button mit einem Image aus einer ImageList. Wird das Programm unter Windows XP SP 2 ausgeführt, wird anstatt einem Schatten des Button-Images ein Viereck angezeigt. Die Darstellung unter Windows XP SP 1 sowie Windows 2000 ist dagegend in Ordnung.

Kennt jemand das Problem und hat ein Lösung?

Danke im Vorraus

Sebastian


Edit (Lösung):

Nachdem ich in den Quellen von TurboDelphi wo der Fehler nicht aufritt nachgesehen habe hier die Lösung.

In der Datei XPActnCtrls.pas muss in der Prozedur TXPStyleButton.DrawGlyph(const Location: TPoint) folgende Änderung gemacht werden:

Delphi-Quellcode:
procedure TXPStyleButton.DrawGlyph(const Location: TPoint);
var
  OldBrushColor: TColor;
  SelBmp: TBitmap;
  NewLocation: TPoint;
  ActionList: TCustomActionList;
begin
  NewLocation := Location;
  if not ActionBar.DesignMode and MouseInControl and
     not IsChecked and Enabled and ActionClient.HasGlyph then
  begin
    OldBrushColor := Canvas.Brush.Color;
    SelBmp := TBitmap.Create;
    try
      ActionList := ActionClient.Action.ActionList;
      if ActionList.Images.GetBitmap(ActionClient.ImageIndex, SelBmp) then
      begin
        Canvas.Brush.Color := GetShadowColor(ActionBar.ColorMap.SelectedColor);
        SelBmp.Width := ActionList.Images.Width;
        SelBmp.Height := ActionList.Images.Width;
        ActionList.Images.Draw(SelBmp.Canvas, 0, 0, ActionClient.ImageIndex, dsNormal, itMask); // Eingefüge Zeile
        DrawState(Canvas.Handle, Canvas.Brush.Handle, nil, SelBmp.Handle, 0,
          NewLocation.X + 1, NewLocation.Y + 1, 0, 0, DST_BITMAP or DSS_MONO);
      end;
    finally
      SelBmp.Free;
      Canvas.Brush.Color := OldBrushColor;
    end;
    if not IsChecked then
    begin
      Dec(NewLocation.X);
      Dec(NewLocation.Y);
    end;
  end;
  if not (csDesigning in ComponentState) and ((FState = bsDown) and not IsChecked)
     and IsMouseButtonPressed then
  begin
    Inc(NewLocation.X);
    Inc(NewLocation.Y);
  end;
  inherited DrawGlyph(NewLocation);
end;
Angehängte Dateien
Dateityp: zip actionbandtest_453.zip (303,0 KB, 20x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort


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 15:09 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