Use wxAnimationCtrl in wxDataViewCtrl Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Schn1c0
In need of some credit
In need of some credit
Posts: 6
Joined: Thu Apr 09, 2020 4:34 am

Use wxAnimationCtrl in wxDataViewCtrl

Post by Schn1c0 » Wed May 05, 2021 10:11 am

Hi there,

can anybody tell me if there is any chance for using a wxAnimationCtrl in a wxDataViewCtrl? There doesn't seem to be a renderer for this control and I wonder if there is any possibility to render it in a custom renderer. I am aiming for a loading icon besides a tree entry.

Thanks a lot for you help.

Cheers
Nico

User avatar
doublemax
Moderator
Moderator
Posts: 16146
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Use wxAnimationCtrl in wxDataViewCtrl

Post by doublemax » Wed May 05, 2021 11:44 am

I don't think wxAnimationCtrl is going to work, as the cells of a wxDVC are not individual windows, so placing the wxAnimationCtrl might be difficult.

I think you need a custom renderer for this.
- use wxAnimation to load the animation, this also gives you access to each frame as wxImage

However, i can't think of an elegant solution to automatically refresh all cells that use this renderer. The best i came up with is to use a timer and update the value these cells, which will force a redraw.
Use the source, Luke!

Schn1c0
In need of some credit
In need of some credit
Posts: 6
Joined: Thu Apr 09, 2020 4:34 am

Re: Use wxAnimationCtrl in wxDataViewCtrl

Post by Schn1c0 » Wed May 05, 2021 12:19 pm

Thanks a lot for you reply. That's more or less what I had in mind as a workaround, but I wanted to make sure I am not overseeing something simple.

Post Reply