U++ framework
Do not panic. Ask here before giving up.

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: 14291
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: Mon May 11 12:10:20 GMT+2 2026

Total time taken to generate the page: 0.00552 seconds