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

Home » U++ Library support » Menus&Toolbars » ToolButton: Label Patch!
ToolButton: Label Patch! [message #26932] Thu, 10 June 2010 15:56 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello all!

I propose to change a little Label method from ToolButton class:
from:
ToolButton& Label(const char *text, int kind = ToolButton::RIGHTLABEL);

to:
ToolButton& Label(const char *text, int kind);
	ToolButton& Label(const String &text) {Label(text, text.IsEmpty() ? ToolButton::NOLABEL : ((kind = ToolButton::NOLABEL)||(kind = ToolButton::FORCE)) ? ToolButton::RIGHTLABEL : kind);};


In this case, when i set label, kind option will change and did not call sepparate method "ToolButton& Kind(int _kind)"

and cpp file:
from:
ToolButton& ToolButton::Label(const char *text, int _kind)
{
	if(!(kind & FORCE)) {
		kind = _kind;
		Refresh();
	}
	Text(text);
	return *this;
}

to:
ToolButton& ToolButton::Label(const char *text, int _kind)
{
	if(_kind!=kind) {
		kind = _kind;
		Refresh();
	}
	Text(text);
	return *this;
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ToolBar's context menu
Next Topic: Tray Menu alignement bug
Goto Forum:
  


Current Time: Tue May 05 07:14:58 GMT+2 2026

Total time taken to generate the page: 0.00804 seconds