Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Color menu choice
Color menu choice [message #22939] |
Mon, 31 August 2009 16:50  |
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   |
|
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. 
Regards,
Honza
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:06:32 CEST 2025
Total time taken to generate the page: 0.00578 seconds
|