Need help animating a .ani cursor  [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.
papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA
Contact:

Need help animating a .ani cursor

Postby papayrus » Thu Aug 23, 2012 1:04 pm

When I load a .ani for a cursor it loads but does not animate at all. This is the code I made for it.

Code: Select all

wxImage image4(wxT("Ani\\Arrow.ani"), wxBITMAP_TYPE_ANI);
if (image4.Ok())
wxCursor cursor4(image4);
TextCtrl4->SetCursor(wxCursor(image4));

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

Re: Need help animating a .ani cursor

Postby doublemax » Thu Aug 23, 2012 1:08 pm

I think wxAnimation is the only class that supports animations, I'm almost sure that any other conversion will lose the animation information.
Use the source, Luke!

papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA
Contact:

Re: Need help animating a .ani cursor

Postby papayrus » Thu Aug 23, 2012 8:20 pm

I tried that but will that load .ani files and also will it auto play or do I need to ->Play it because I tried this and it did not work either but I will try again and see if I did something wrong.

EDIT it works just loading it like this but how can I set it to the cursor?

Code: Select all

m_animationCtrl = new wxAnimationCtrl(this, wxID_ANY);
    if (m_animationCtrl->LoadFile(wxT("Arrow.ani")))
        m_animationCtrl->Play();

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

Re: Need help animating a .ani cursor  [SOLVED]

Postby doublemax » Thu Aug 23, 2012 9:51 pm

I don't think wxWidgets supports animated cursors. Looking at the MSW source codes, it *might* work if you explicitly load a native Windows cursor, but i'm not sure and haven't tried it.
Use the source, Luke!

papayrus
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 204
Joined: Tue Jan 25, 2011 4:55 pm
Location: USA
Contact:

Re: Need help animating a .ani cursor

Postby papayrus » Fri Aug 24, 2012 3:58 am

Yes I already loaded a native windows cursor and it loads and animates but it will not animate any of my custom cursors. Oh well if it does not support it then I guess there is not anything I can do. Thanks alot for the info.
I just think it is kind of weird though that it supports .ani files but just does not animate them.


Return to “C++ Development”

Who is online

Users browsing this forum: Bing [Bot] and 12 guests