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 » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Ctrl::OverrideCursor
Re: Ctrl::OverrideCursor [message #14359 is a reply to message #14355] Sat, 23 February 2008 17:21 Go to previous messageGo to previous message
Tom1
Messages: 1216
Registered: March 2007
Senior Contributor
OK, here's the testcase. Today I'm on Linux and therefore I have no idea what happens when this is taken on Windows.

Anyway, on Linux none of the context menu callbacks work. The WaitCursor works neither on the context menu callback nor directly in MiddleUp. OverrideCursor works on LeftUp, but fails on context menu callback.


#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class Testcase : public TopWindow{
	
public:
	typedef Testcase CLASSNAME;
	
	Testcase(){

	}

	virtual void ContextMenu(Bar &bar){
		bar.Add(t_("Lengthy process with OverrideCursor..."),THISBACK(LengthyProcess1));
		bar.Add(t_("Lengthy process with WaitCursor..."),THISBACK(LengthyProcess2));
	}

	virtual void LengthyProcess1(){
		// Not working on Linux:
		Image cursor=OverrideCursor(Image::Wait());
		Sleep(1000);
		OverrideCursor(cursor);
	}

	virtual void LengthyProcess2(){
		// Not working on Linux:
		WaitCursor waitcursor;
		Sleep(1000);
	}

	virtual void RightUp(Point p, dword keyflags){
		MenuBar::Execute(THISBACK(ContextMenu));
	}

	virtual void LeftUp(Point p, dword keyflags){
		// Working OK on Linux:
		Image cursor=OverrideCursor(Image::Wait());
		Sleep(1000);
		OverrideCursor(cursor);
	}

	virtual void MiddleUp(Point p, dword keyflags){
		// Not working on Linux:
		WaitCursor waitcursor;
		Sleep(1000);
	}

};

GUI_APP_MAIN
{
	Testcase().Run();
}


I think mouseCtrl might be null even though it should have a value. At least I can see the cursor on top of the Testcase window but still have no control over it using the above methods.

Just out of curiosity, which of the four cases work for you in XP? (When I get back to work on monday, I can test it on Vista.)

// Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SDL updated from 1.2.12 to 1.2.13
Next Topic: to_string, to_wstring
Goto Forum:
  


Current Time: Mon May 13 22:16:00 CEST 2024

Total time taken to generate the page: 0.23100 seconds