v8.12 Small problem with popmenu items

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #35514
    Oconnel
    Participant

    Screen below is showing a problem that I have with all versions of AC beyond 8.0. In older versions of AC all items captions where in the middle of the item. Now, they are pushed to the top of each item. Is there a way to center them again?

    34970pk.png

    #49633
    CheshireCat
    Participant

    Hello Oconnel,

    you can use the following workaround until a solution was found by Serge.

    Code:
    procedure TForm1.mi_CopyFileAdvancedDrawItem(Sender: TObject;
    ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState);
    var
    bmp: TBitmap;
    begin
    ACanvas.FillRect(ARect) ;

    //zeichne text/draw text
    ACanvas.TextRect(ARect, 40 + ARect.Left, 10 + ARect.Top, mi_CopyFile.Caption) ;

    //zeichne Bitmap aus ImageList/draw bitmap from imagelist
    bmp := TBitmap.Create;
    try
    menuImages.GetBitmap(mi_CopyFile.ImageIndex, bmp) ;
    ACanvas.Draw(ARect.Top, ARect.Left, bmp) ;
    finally
    bmp.Free;
    end;
    end;

    The example is based on a 32×32 pixel imagelist.

    #49637
    Oconnel
    Participant

    It cannot work. Because you are deleting AC skinning with FillRect. Result = proper item caption position, but broken skinning:

    nwy7wk.png

    #49638
    CheshireCat
    Participant

    Hello Oconnel,

    sorry, I have not tested the code before. You can try to set the canvas brush color to global skin color, but it works not for all skins and there is no clean solution.

    #49639
    Oconnel
    Participant

    Yeah, but I need clean solution. Some of the skins have textures/gradient in popupmenu so getting single color is not what I want…

    #49644
    Support
    Keymaster

    I'll check it and I'll fix it soon.

    #49648
    Support
    Keymaster

    Try attached file, please.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.