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 » U++ Library support » LineEdit, EditFields, DocEdit » double-click in EditField
Re: double-click in EditField [message #56282 is a reply to message #56279] Tue, 16 February 2021 18:44 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Not sure if this is what you are looking for, but
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct Edx: EditField{
	// typedef Edx CLASSNAME; (Not needed in new code)
	
	Edx(){};
	
	// encouraged to use c++11 new language feature
	// in new code to clearly manifest that you are
	// override a parent virtual function
	//
	void LeftDouble(Point p, dword keyflags)override
	{
		WhenLeftDouble(p,keyflags);
		
		// following line should be dispensible in this
		// particular case as I expect it does nothing
		//
		this->EditField::LeftDouble(p,keyflags);
	}
	
	// the following line introduce a new Event
	// and note how it comes to effect by calling it in the
	// overrided virtual.
	//
	Event<Point, dword> WhenLeftDouble;
};

GUI_APP_MAIN
{
	TopWindow  app;
	app.SetRect(0, 0, Zx(500), Zy(500));
	Edx text;
	
	text.WhenLeftDouble<<[=](Point , dword){ PromptOK("ok"); };
    
    app.Add(text.LeftPos(12,234).TopPos(63,21));
	text.SetText( "double click here");
	app.Run();
}
 
Read Message
Read Message
Read Message
Read Message icon3.gif
Read Message
Previous Topic: NotNull not working with custom SetConvert [CLOSED]
Next Topic: fill date bars automatically
Goto Forum:
  


Current Time: Sun May 05 01:44:09 CEST 2024

Total time taken to generate the page: 0.01737 seconds