Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Ribbon in Frame - Zugriffsverletzung (https://www.delphipraxis.net/147328-ribbon-frame-zugriffsverletzung.html)

semo 5. Feb 2010 20:51


Ribbon in Frame - Zugriffsverletzung
 
Ich habe mehrere von der Oberfläche her ähnlich aufgebaute Tools und verwende dort einen Frame.
Nun dachte ich mir: ich teste mal das Ribbon Control und platzierte dieses in den Frame.

Nun kommt es beim Starten des Programms zu einer Zugriffsverletzung in der Unit Ribbon.pas:

Delphi-Quellcode:
procedure TCustomRibbon.SetParent(AParent: TWinControl);
begin
  if not (csDesigning in ComponentState) then
  begin
    if (FParentForm <> nil) and Assigned(FParentWndProc) then
      FParentForm.WindowProc := FParentWndProc;
  end;
  inherited;
  // AParent ist in diesem Fall der Frame auf dem das Ribbon control platziert ist
  if AParent <> nil then
  begin
    // hier ist das Problem: FParentForm ist nach dem Aufruf von GetParentForm = nil
    FParentForm := GetParentForm(AParent);
    if not (csDesigning in ComponentState) then
    begin
      if UseCustomFrame then
      begin
        // hier dann die Zugriffsverletzung
        FParentWndProc := FParentForm.WindowProc;
        FParentForm.WindowProc := CustomFrameWndProc;
        FCustomFrameSupported := True;
      end;
    end;
    if FParentForm is TForm then
      FScaleFactor := TForm(FParentForm).PixelsPerInch / 96;
  end;
end;
Ich habe noch keine weiteren Gruppen, Tabs oder sonstigen Controls auf dem Ribbon Control platziert.
Auch habe ich keinen ActionManager zugewiesen.

PS:
Ich nutze Delphi 2009.
Ich teste dies später mal mit Delphi 2010, das installiert derzeit noch.

semo 6. Feb 2010 09:42

Re: Ribbon in Frame - Zugriffsverletzung
 
Okay, beim Droppen eines Ribbon Controls auf einen Frame in Delphi 2010 erscheint sofort folgende Fehlermeldung:
Zitat:

Die Markierung besagt, dass TRibbon Formularvererbung und Frames nicht unterstützt und deswegen nicht in einem Frame verwendet werden kann.

semo 7. Feb 2010 11:05

Re: Ribbon in Frame - Zugriffsverletzung
 
Dieser Beitrag wäre doch dann was für das Forum Delphi Bugs?


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:41 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