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 » TopWindow&PopUp, TrayIcon » ColorPopUp Problem
Re: ColorPopUp Problem [message #3679 is a reply to message #3664] Mon, 12 June 2006 17:08 Go to previous messageGo to previous message
andrei-catalin is currently offline  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
 
Read Message icon9.gif
Read Message
Read Message icon14.gif
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Splash Screen
Next Topic: Resizing a TopWindow but keeping the width/height ratio fixed?
Goto Forum:
  


Current Time: Thu May 01 01:06:03 CEST 2025

Total time taken to generate the page: 0.03912 seconds