Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Changing cursor
Changing cursor [message #43119] Thu, 08 May 2014 19:03 Go to next message
xawery is currently offline  xawery
Messages: 4
Registered: April 2014
Junior Member
Hi!

How to change normal cursor to http://png-4.findicons.com/files/icons/2232/wireframe_mono/32/hand_2.png

It will be changed when cursor is over the LineEdit.

How to do it ?

[Updated on: Thu, 08 May 2014 19:04]

Report message to a moderator

Re: Changing cursor [message #43120 is a reply to message #43119] Thu, 08 May 2014 19:47 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1077
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello xawery,

You can override your cursor image readily. Here is sample code:
Image MyCoolCtrl::CursorImage(Point p, dword keyflags)
{
    return Image::Hand(); // <- Hand cursor image depending on operating system theme.
}


In your header file you will need also to override "CursorImage" virtual method:
class MyCoolCtrl : public Ctrl {
public:
    virtual Image CursorImage(Point p, dword keyflags);
};


Moreover, I enclosed stock cursor list that you can use in your applications (Based on CtrlCore/ImageX11.cpp source file):
Image Image::Arrow()
Image Image::Wait()
Image Image::IBeam()
Image Image::No()
Image Image::SizeAll()
Image Image::SizeHorz() 
Image Image::SizeVert()
Image Image::SizeTopLeft()
Image Image::SizeTop()
Image Image::SizeTopRight()
Image Image::SizeLeft() 
Image Image::SizeRight() 
Image Image::SizeBottomLeft() 
Image Image::SizeBottom() 
Image Image::SizeBottomRight()
Image Image::Cross()
Image Image::Hand()


BTW, I think that this list should be included in U++ documentation. It will help a lot.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Thu, 08 May 2014 19:48]

Report message to a moderator

Re: Changing cursor [message #43126 is a reply to message #43120] Mon, 12 May 2014 19:00 Go to previous messageGo to next message
xawery is currently offline  xawery
Messages: 4
Registered: April 2014
Junior Member
EDIT

[Updated on: Mon, 12 May 2014 19:02]

Report message to a moderator

Re: Changing cursor [message #43157 is a reply to message #43119] Tue, 20 May 2014 19:30 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
xawery :

I did that by changing the cursor image using M$ Paint in the first version of Win XP. It was 'cute' for less time than it took to change it.
Previous Topic: Heap leaks with fluidsynth on Ubuntu 12.04
Next Topic: OpenCV example on Linux/Ubuntu
Goto Forum:
  


Current Time: Sun Jun 16 21:57:30 CEST 2024

Total time taken to generate the page: 0.01592 seconds