Standard colors cannot be used

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #36980
    HeDiBo
    Participant

    When an application must be able to run with skinning active or skinning disabled the standard colors (clScrollBar, clBackground, clActiveCaption, clInactiveCaption, clMenu, clWindow, clWindowFrame, clMenuText, clWindowText, clCaptionText, clActiveBorder, clInactiveBorder, clAppWorkSpace, clHighlight, clHighlightText, clBtnFace, clBtnShadow, clGrayText, clBtnText, clInactiveCaptionText, clBtnHighlight, cl3DDkShadow, cl3DLight, clInfoText, clInfoBk, clHotLight, clGradientActiveCaption, clGradientInactiveCaption, clMenuHighlight, clMenuBar) are totally unusable.

    I would like to propose a set of functions that will work both in skinned and non-skinned modes.

    For instance the function acclGrayText() would result in clGrayText if non-skinned and in the appropriate color value for the active skin if skinned.

    Maybe you have a better solution to solve this predicament? :huh:

    #55071
    Support
    Keymaster

    I can make a function for colors converting, like the ColorToRGB function.

    Something named like ColorToSkin(AColor: TColor)… Is this what you meant?

    #55073
    HeDiBo
    Participant
    'Support' wrote:

    I can make a function for colors converting, like the ColorToRGB function.

    Something named like ColorToSkin(AColor: TColor)… Is this what you meant?

    Wouldn't that be a much too complicated function? Do you really know how to convert clRed and clMoneyGreen to a color according to the skin?

    I would be glad to have a conversion for the standard colors of a themed Windows app. Like clBtnShadow and clInactiveCaptionText. If you mean you can provide a conversion for these kind of colors, that would be great.

    #55086
    Support
    Keymaster
    'HeDiBo' wrote:
    Do you really know how to convert clRed and clMoneyGreen to a color according to the skin?

    Such colors may be leaved unchanged.

    Quote:
    I would be glad to have a conversion for the standard colors of a themed Windows app. Like clBtnShadow and clInactiveCaptionText. If you mean you can provide a conversion for these kind of colors, that would be great.

    function ColorToSkin(AColor: TColor): TColor;

    I think, this function can do that for AlphaSkins, but I don't know how to do it for Windows theme.

    #55100
    HeDiBo
    Participant

    That would be very easy:

    Code:
    function ColorToSkin(AColor: TColor): TColor;
    begin
    if not skinned then Result := AColor
    else begin
    // Here you would do your stuff
    end{if};
    end;

    So I would call the function like this: ColorToSkin(clBtnShadow) and it would return clBtnShadow if not skinning or your equivalent, theme oriented color if skinning was active.

    #55165
    HeDiBo
    Participant

    In 10.30 the function SysColorToSkin is almost what you would expect.

    Only, if the skinmanager used is not active, the color is still translated. That's not the way it should work.

    You see, if you want to write a program that will work OK with or without skinning, the function SysColorToSkin(clBtnShadow) should return the value clBtnShadow if the skinmanager is not active.

    I think, the code for SysColorToSkin should be this:

    Code:
    if ASkinManager = nil then
    ASkinManager := DefaultManager;

    if ( ASkinManager nil ) and
    ( ASkinManager.Active ) then // Added by DB
    case AColor of
    clScrollBar, clBackground, clBtnFace, clAppWorkSpace, clMenu:
    .
    .

    #55171
    Support
    Keymaster

    You are right, such code will be added.

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