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 » Draw, Display, Images, Bitmaps, Icons » Color menu choice
Color menu choice [message #22939] Mon, 31 August 2009 16:50 Go to next message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
I need to create a button that let me choose a default color for a grid column in the setup of the application, like the BG choice in the UWord example application. Is possible to make this? I don't find example.. Thanks
Sam
Re: Color menu choice [message #22943 is a reply to message #22939] Tue, 01 September 2009 04:19 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

darthspawn wrote on Mon, 31 August 2009 16:50

I need to create a button that let me choose a default color for a grid column in the setup of the application, like the BG choice in the UWord example application. Is possible to make this? I don't find example.. Thanks
Sam


Hi Sam,

There are several widgets to handle colors in U++. They are described in this manual page. Best choice for you would be probably ColorPusher, which can be easily used like this:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

class win : public TopWindow{
public:
	typedef win CLASSNAME;
	ColorPusher cp;
	Label l;
	void DoSomething(){
		l.SetInk(cp.GetData());
	}
	win(){
		cp.SetRect(10,30,40,20);
		cp.SetData(Black());
		cp<<=THISBACK(DoSomething);
		Add(cp);
		l.SetText("Color test").SetRect(10,10,150,20);
		Add(l);
	}
};

GUI_APP_MAIN{
	win().Run();
}
Of course you would have to change DoSomething to actually do what you need with the selected color. Wink

Regards,
Honza
Re: Color menu choice [message #22954 is a reply to message #22939] Wed, 02 September 2009 15:58 Go to previous message
darthspawn is currently offline  darthspawn
Messages: 58
Registered: February 2009
Member
Thank you so much! Smile nice and useful information!

Sam
Previous Topic: Tutorial Draw01 error
Next Topic: How to efficiently update a large Image?
Goto Forum:
  


Current Time: Fri Apr 19 17:35:51 CEST 2024

Total time taken to generate the page: 0.06026 seconds