Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#3

Re: Menü falsche spalte/zeile

  Alt 10. Mär 2007, 12:36
Zitat von TonyR:
Irgendwie habe ich keine Ahnung, was das sein soll...
Hast du schon mal alle Eigenschaften dieses PopUps durchgesehen, ob da irgendwas verstellt ist?
Das sieht ja nicht aus wie das Standard-PopUp... was ist das für ein Ding?

Edit: das muss ja irgendwie daran liegen, dass es ein Untermenü hat... gibt es also irgendeine Einstellung für Untermenüs im PopUp?
Ja ist ein ownerdraw.

Hat aber nichts damit zu tun das Vismodule nicht direkt unter Preferences steht.
Und darum geht es mir ja.

Dachte das man wie in VB den eintag um eins nach rechts schieben kann damit es unter Prefences steht und nicht zuweit links.

begin
EDIT:

hab noch ein PIc mit angehängt wie es original ausschaut.
end EDIT:

begin
EDIT2:


Hier ist die procedure ...
Scheint das da ein eintrag für das Submenüitem fehlt.
Leider ist diese nicht von mir daher weiss ich nicht was da fehlen könnte.

Delphi-Quellcode:
procedure TVisForm.AdvDrawMenuItem(Sender: TObject; ACanvas: TCanvas;
  ARect: TRect; State: TOwnerDrawState);
var
  mi: TMenuItem;
  r: TRect;
  bm: TBitmap;
begin
  mi := Sender as TMenuItem;

  with ACanvas do
  begin
    Brush.Color := clWindow;
    FillRect(ARect);

    Brush.Color := clBtnFace;
    Windows.CopyRect(r, ARect);
    r.Right := 22;
    FillRect(r);
    if (odSelected in State) and (mi.Enabled) then
    begin
      Pen.Color := RGB(49,105,198);
      Brush.Color := RGB(198,211,239);
      Rectangle(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
    end;

    if mi.IsLine then
    begin
      MoveTo(ARect.Left+25, ARect.Top+(ARect.Bottom-ARect.Top) div 2);
      LineTo(ARect.Right, PenPos.Y);
      Exit; {return;}
    end;

    { Adjust rect for the glyph, and move it a bit if selected }
    r.Left := ARect.Left+4;
    r.Top := ARect.Top+3;
    if mi.Enabled and ((odSelected in State) or mi.Checked) then
      InflateRect(r, +1, +1);


    { Draw glyph from associated ImageList/Bitmap }
    if ((mi.ImageIndex >= 0) and (mi.GetImageList <> nil))
       or (not mi.Bitmap.Empty) then
    begin
      if mi.Checked then
      begin
        Pen.Color := RGB(49,105,198);
        Brush.Color := RGB(198,211,239);
        Rectangle(ARect.Left+1, ARect.Top+1, ARect.Left-1+22, ARect.Bottom-1);
      end;
      { Draw glyph stored in Bitmap property... }
      if not mi.Bitmap.Empty then
        Draw(r.Left, r.Top, mi.Bitmap)
      else
        mi.GetImageList.Draw(ACanvas, r.Left, r.Top, mi.ImageIndex, mi.Enabled);
    end;

    if mi.Checked and (mi.ImageIndex < 0) then
    begin
      bm := TBitmap.Create;
      bm.Handle := LoadBitmap(0, PChar(OBM_CHECK));
      Pen.Color := RGB(49,105,198);
      Brush.Color := RGB(198,211,239);
      Rectangle(ARect.Left+1, ARect.Top+1, ARect.Left-1+22, ARect.Bottom-1);
      Draw(ARect.Left+5, ARect.Top+3, bm);
      bm.Destroy;
    end;

    { Draw menu item text }
    Windows.CopyRect(r, ARect);
    r.Left := 25;
    InflateRect(r, -2, -2);

    Brush.Color := clMenu;
    SetBkMode(Handle, TRANSPARENT);
    if odSelected in State then
      SetBkColor(Handle, RGB(198,211,239))
    else
      SetBkColor(Handle, GetSysColor(COLOR_WINDOW));
    if mi.Enabled then
      Font.Color := clMenuText
    else
      Font.Color := clGrayText;
    if odNoAccel in State then
      DrawText(Handle, PChar(StripHotkey(mi.Caption)), -1, r,
        DT_SINGLELINE or DT_VCENTER)
    else
      DrawText(Handle, PChar(mi.Caption), -1, r, DT_SINGLELINE or DT_VCENTER);

    if mi.ShortCut <> 0 then
    begin
      r.Left := ARect.Right-TextWidth(ShortcutToText(mi.ShortCut))-5;
      DrawText(Handle, PChar(ShortcutToText(mi.ShortCut)), -1, r,
        DT_SINGLELINE or DT_VCENTER);
    end;

  end;
end;
end
EDIT2:


gruss
Miniaturansicht angehängter Grafiken
org_201.jpg  
  Mit Zitat antworten Zitat