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 » U++ Widgets - General questions or Mixed problems » WhenSelected callback to DropList
WhenSelected callback to DropList [message #26319] Sat, 24 April 2010 09:42 Go to next message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

Hello all!

I think, it will be good idea to add WhenSelected-callback to DropList.

My variant:
DropChoise.h
class DropList ...
...
Callback WhenSelected;
...


DropList.cpp
void DropList::Select() {
	int c = list.GetCursor();
	if(c >= 0)
		value = key[c];
	if(dropfocus)
		SetFocus();
	Sync();
	UpdateAction();
	WhenSelected.Execute();
}


Best regards,
Anton
Re: WhenSelected callback to DropList [message #26338 is a reply to message #26319] Mon, 26 April 2010 10:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sc0rch wrote on Sat, 24 April 2010 03:42

Hello all!

I think, it will be good idea to add WhenSelected-callback to DropList.

My variant:
DropChoise.h
class DropList ...
...
Callback WhenSelected;
...


DropList.cpp
void DropList::Select() {
	int c = list.GetCursor();
	if(c >= 0)
		value = key[c];
	if(dropfocus)
		SetFocus();
	Sync();
	UpdateAction();
	WhenSelected.Execute();
}


Best regards,
Anton


UpdateAction above calls generic WhenAction (like for almost any other widget when user changes the value of widget). (It also sets modify flag for widget).

Is WhenSelected supposed to be any different?

Mirek
Previous Topic: Images for disabled button in "Classic" style
Next Topic: QTF with QtfRichObject as Button label causes crash
Goto Forum:
  


Current Time: Fri Apr 19 12:07:50 CEST 2024

Total time taken to generate the page: 2.15244 seconds