Jump to content
PatW

VWStaticTextCtrl SetColor

Recommended Posts

I was not able to change the color with this funciton(also SetStyle is not working) is there any trick or alternative function?

Share this post


Link to post

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

Share this post


Link to post
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

Share this post


Link to post

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.

Share this post


Link to post

@PatW , This may be related to a bug I filed in May (for regular VectorScript, not SDK) – (VB-160901) VS SetStaticTextColor() does not work in VW 2020. StaticText color assignment works is VW 2019, but not VW 2020. It still shows to be unresolved.

 

Raymond

  • Like 1

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...