Greatis

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Skin for Windows 11 #70177
    Greatis
    Participant

    Let me know if you need my help.
    I have the latest Windows 11 (22000) on a virtual machine.

    in reply to: Exceptions in sThirdParty.GetCommonData #69351
    Greatis
    Participant

    Hi,

    Seems like the problems were fixed after 2 weeks of monitoring after releasing the new version.
    The problem was in this code:
    SkinManager->Active=RestoreCurSkin();
    I supposed if the property was set it will not executes something.
    I found that it is just true.
    The function SetActive checks for current setting.
    procedure TsSkinManager.SetActive(const Value: boolean);
    begin
    if FActive <> Value then begin
    FActive := Value;

    But at the end of function it executes always:
    SkinListController.SendSkinChanged;

    Usually, it may not a problem, but my program executes this code in Timer a lot of times.

    Hope it will help someone.

    Thanks for help.
    Resolved.

    in reply to: Exceptions in sThirdParty.GetCommonData #69141
    Greatis
    Participant

    Thank you for your answer!
    I thought that it was my component.
    But recently I saw the exception and the buttons (sButBtn) were not displayed.

    I suppose you are right, the problem is in drawing buttons.

    I added try/catch to avoid exception:
    DrawData.SkinIndex := SkinData.SkinIndex;
    try
    if (DrawData.CurrentState = 0) and
    (SkinData.FOwnerControl.Parent <> nil) and
    (SkinData.SkinManager <> nil) and SkinData.SkinManager.IsValidSkinIndex(SkinData.SkinIndex) and
    (SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].Transparency = 100) then
    DrawData.SkinIndex := GetFontIndex(Button, SkinData.SkinIndex, SkinData.SkinManager);
    except
    end;

    It works, but there are a lot of codes with direct access to gd.
    SkinData.CommonSkinData.gd[…].

    I guess that IsValidSkinIndex works well, but gd is not properly filled at the moment when we access it.
    Getting this causes the exception:
    Props[0].Transparency

    Is there a workaround?
    How to be sure that the structures are filled well before opening a window with buttons?

    in reply to: Exceptions in sThirdParty.GetCommonData #69129
    Greatis
    Participant

    I have my own grid component.
    I use SkinManager in the main form.
    My grid is declared in Thridparty list as “Grid”.

    The grid component stored in a separate form.
    SkinProvider exists in each form.

    I see the exception immediately after showing the child form.
    The form is created manually.

    in reply to: Exceptions in sThirdParty.GetCommonData #69113
    Greatis
    Participant

    Hi,

    I understand, but I can’t do it, because is hard in reproducing.
    I see it several times on my PC and I see it every day in the user’s bug reports.
    I checked the latest version 15.12.
    The code was not changed: sThirdParty.pas
    Now the line is 460.
    if (DrawData.CurrentState = 0) and
    (SkinData.FOwnerControl.Parent <> nil) and
    (SkinData.SkinManager <> nil) and SkinData.SkinManager.IsValidSkinIndex(SkinData.SkinIndex) and
    (SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].Transparency = 100) then

    The exception is on the:
    SkinData.CommonSkinData.gd[SkinData.SkinIndex].Props[0].Transparency

    I suppose that this code is not safe.
    SkinData received as parameter:
    procedure GetCommonData(SkinData: TsCtrlSkinData);

    SkinIndex maybe wrong or gd is not properly initialized.

    I want to fix the bug and asked your opinion.
    What is SkinData.SkinIndex?
    How to check that it is valid?
    How to check that it is not bigger than the size of “gd”?

    I can add “try/catch” on, but I don’t know how safe is assigning this on exception:
    DrawData.SkinIndex := SkinData.SkinIndex;

    Thank you!
    Dmitry

    in reply to: Как поменять в теме цвет TsLabel? #59530
    Greatis
    Participant

    Спасибо за помощь!

    Теперь понял.

    Проблема решена.

    'TCount' wrote:

    У родителя TsLabel. То есть, у контрола, на который TsLabel помещена. Например, на панель TsPanel.

    Под цветом парента имелся ввиду параметр “Text Color” в секции скина для данного парента.

    Например, для панели по умолчанию это секция “PANEL” в редакторе скинов (скрин).

    Вот параметр “Text Color” парента применяется в случае, если у TsLabel не определен параметр SkinSection и включен параметр “UseSkinColor”.

    in reply to: Как поменять в теме цвет TsLabel? #59524
    Greatis
    Participant

    Спасибо за ответ!

    Я ставлю UseSkinColor=true и управлять цветами в теме, а не в коде приложения.

    'Support' wrote:

    TsLabel, а также прозрачные элементы управления (такие как TsCheckBox, TsGroupBox) берут цвет текста у парента, чтобы текст всегда был совместим с цветом бакграунда и хорошо читался.

    У какого парента берется цвет?

    Я попробовал бросить на форму панель и TsLabel на форму и панель.

    Меняю и цвет формы и панели и цвет шрифтов у них, но цвет Label не меняется.

    В аттаче тестовая форма.

    Как быть?

Viewing 7 posts - 1 through 7 (of 7 total)