|
|
Home » U++ Library support » TopWindow&PopUp, TrayIcon » ColorPopUp Problem
|
|
|
Re: ColorPopUp Problem [message #3679 is a reply to message #3664] |
Mon, 12 June 2006 17:08 |
andrei-catalin
Messages: 62 Registered: May 2006 Location: Romania
|
Member |
|
|
Hello,
Below is a little adaptation of ch11 tutorial showing ColorPusher, ColorCtrl and ColorButton in action.
#include <CtrlLib/CtrlLib.h>
#define IMAGECLASS TutorialImg
#define IMAGEFILE <gui_tutorial/ch11/images.iml>
#include <Draw/iml.h>
struct MyAppWindow : TopWindow {
MenuBar menu;
ToolBar tool;
//================================
ColorPusher colorSelector1;
ColorCtrl colorSelector2;
ColorButton colorSelector3;
//=================================
void MenuFn() {
PromptOK("Fn activated!");
}
void BarFn() {
PromptOK("Fn2 activated!");
}
void Exit() {
if(PromptOKCancel("Exit MyApp?"))
Break();
}
void SubBar(Bar& bar) {
bar.AddMenu("Function", TutorialImg::Fn(), THISBACK(MenuFn));
bar.Add(TutorialImg::Fn2(), THISBACK(BarFn));
bar.Add("Exit", TutorialImg::Exit(), THISBACK(Exit));
//==============================
bar.Separator();
bar.Add(colorSelector1,120,20);
colorSelector1.WithText();
bar.Add(colorSelector2,50,20);
bar.Add(colorSelector3);
colorSelector3.ColorImage(CtrlImg::BoxButton0());
colorSelector3.NullImage(CtrlImg::set_transparent());
//===============================
}
void MainMenu(Bar& bar) {
bar.Add("Menu", THISBACK(SubBar));
}
typedef MyAppWindow CLASSNAME;
MyAppWindow() {
Title("My application with bars").Sizeable();
AddFrame(menu);
AddFrame(tool);
menu.Set(THISBACK(MainMenu));
tool.Set(THISBACK(SubBar));
}
};
GUI_APP_MAIN
{
MyAppWindow app;
app.Run();
}
Andrei
|
|
|
|
Re: ColorPopUp Problem [message #3692 is a reply to message #3691] |
Tue, 13 June 2006 11:22 |
|
Quote: | It's a cool example, how easy it is to embed and handle complex control-elements within a toolbar (for example).
Unbelievable to do it as easy in MFC-Framework or Win32 API directly.
|
Exactly! But more interesting is frame concept which is very flexible and useful - you can for example easily put any toolbar (or another frame) inside any upp control. The only thing I miss is an ability to set cliping of child controls to arbitrary rectangle (default is to a frame) what complicated my grid ctrl code and frankly forced me to develop it twice from scratch
Quote: | For me, U++ is overall the best Framework to develop OS-independent!
|
Holy truth!
|
|
|
|
Re: ColorPopUp Problem [message #3695 is a reply to message #3693] |
Tue, 13 June 2006 14:14 |
|
Quote: | More sad is the fact that so many promising members praising U++ disappear very quickly...
|
How can you know that? Not everyone like to be active on forums..
|
|
|
Re: ColorPopUp Problem [message #3696 is a reply to message #3695] |
Tue, 13 June 2006 14:23 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
unodgs wrote on Tue, 13 June 2006 13:14 |
Quote: | More sad is the fact that so many promising members praising U++ disappear very quickly...
|
How can you know that? Not everyone like to be active on forums..
|
then look at the downloads statistics... and compare with other toolkits statistical trends...
[Updated on: Tue, 13 June 2006 14:23] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Sun Dec 08 22:53:05 CET 2024
Total time taken to generate the page: 0.02429 seconds
|
|
|