Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
800
Trouble with a couple issues when adding custom UIElement to UltraExpandableGroupBox
posted

I've created a custom UIElement derived from the ImageAndTextButtonUIElement for creating right-aligned image buttons in the header of the UltraGroupBox, with different images for hot-tracking appearances.  The buttons are being added in the AfterCreateChildElements when the parent is the GroupBoxHeaderUIElement.  This is mostly working due to the very helpful example code posted in the knowledge base.  I'm down to just two problems I can't seem to figure out.

First, I don't want the default draw behavior of a disabled element, I want to use my own image for this.  I've tried overwriting a few of the image type methods, but didn't get anywhere with that.  For instances of when the button is disabled but the group box is not, I can workaround it by not actually using the Enabled property of the UIElement - I'd rather not do that, but it will work.  However, this won't work when the entire group box is disabled.  I also found out that when the group box is disabled, it won't set the Enabled property of my UIElement to false (which I would be able to handle with my workaround), it must go through some other mechanism that I don't know about yet.

Second, I need to be able to resize the text in the header that sits between my buttons and the expansion indicator.  I have some code now that changes the size of the Rect on the UIElement with the text, but I can't figure out how to resize the Height of it when it needs to wrap to two lines, in part because the parent also needs to be resized to fit the multiple rows.  I also tried putting my button add code in the BeforeCreateChildElements thinking that the resize code in the group box would take the buttons into account, but it looks like the area that is used to resize this ignores the elements I added.

Not quite sure what else to do on either of these issues, I've tried several things in both and didn't really go anywhere.  I'm pretty stuck now.

  • 800
    Verified Answer
    posted

    I've fixed the first problem here (partially by deriving from ButtonUIElementBase instead).  I'm still stuck on the first one.  I've created a new post with the second problem, hoping that a better title will help someone find it to help ....