Jump to content

VWStaticTextCtrl SetColor


PatW

Recommended Posts

  • Member

I never used this function, but maybe the dialog is not yet displayed when you call the function? Does it fail on Mac and Windows or just on one platform? Does the control with the given ID actually exist and is it a static text control? Which RGB values are you passing? How did you initialize the CRGBColor? Check if your color has a valid color ref and check the RGB values.

  • Like 1
Link to comment
18 minutes ago, Nicolas Goutte said:

2020 or 2019?

Ich have checked in our code base. In 2019 VWStaticTextCtrl does not work with styles. In 2020 it was corrected.

 

In 2019, you have to use ISDK::CreateStyleStaticText instead of ISDK:CreateStaticText (as VWStaticTextCtrl does) to been able to have style.

Edited by Nicolas Goutte
  • Like 1
Link to comment

We are using VW2020.
 

    auto statTX = GetStaticTextCtrlByID(kedtitDim_EffLengthBasket);
    Uint8 R = 255;
    Uint8 G = 0;
    Uint8 B = 0;
    CRGBColor color(R, G, B);    
    statTX->SetColor(color, false /*atDialogInitTime*/ );

I was calling this in DispatchEvent and OnUpdateUI without any effect.

What we want is to make the static text red dynamically when a value is invalid.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...