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 » TrayIcon::Icon problems
TrayIcon::Icon problems [message #933] Thu, 09 February 2006 15:04 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I am trying to use runtime generated images for tray icon. I modified the TrayIcon reference example to try it:
struct App : TrayIcon {
	void Info() {
		//Icon(Tray::Icon1());
		Image img(16, 16);
		img.Set(White);
                ImageDraw w(img);
                w.DrawRect(0, 0, 8, 8, Black);
		Icon(img);
		PromptOK("TrayIcon launched this prompt!");
		Icon(Tray::Icon());
	}

	void Menu(Bar& bar) {
		bar.Add("Info..", THISBACK(Info));
		bar.Separator();
		bar.Add("Exit", THISBACK(Break));
	}

	typedef App CLASSNAME;

	App() {
		WhenBar = THISBACK(Menu);
		WhenLeftDouble = THISBACK(Info);
		Icon(Tray::Icon());
		Tip("This is U++ tray icon");
	}
};
The tray icon set from the generated Image is just empty, transparent. What is the problem?
Re: TrayIcon::Icon problems [message #942 is a reply to message #933] Thu, 09 February 2006 21:04 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Missing mask and ImageDraw not finished

	void Info() {
		Image img(16, 16);
		img.Set(White);
		{
                ImageDraw w(img);
                w.DrawRect(0, 0, 8, 8, Black);
                ImageMaskDraw ww(img);
                ww.DrawRect(0, 0, 16, 16, Black);
		}
		Icon(img);


Note that there will be huge changes (including the interface) in relatively near future of all Image related stuff...

Mirek
Re: TrayIcon::Icon problems [message #961 is a reply to message #942] Fri, 10 February 2006 10:17 Go to previous messageGo to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
Thanks. So images are completely transparent by default. Wouldn't it be more logical if the "Image"-s would be opaque by default? Seems to me as a more typical need. And even if they were transparent, there could be an Image::MakeOpaque() method to make them opaque in a cleaner way. For example I wouldn't need to memorize which color (Black) marks opaque on the mask.
Re: TrayIcon::Icon problems [message #963 is a reply to message #961] Fri, 10 February 2006 10:36 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I agree. Expect many such improvements after Draw is completely refactored...


Mirek
Previous Topic: TopWindow childless Clock example [BUG][FIXED]
Next Topic: showing hidden & minimized windows
Goto Forum:
  


Current Time: Mon Apr 22 09:10:41 CEST 2024

Total time taken to generate the page: 0.01537 seconds