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 » runtime tray icon? Draw a number?
Re: runtime tray icon? Draw a number? [message #8230 is a reply to message #8224] Thu, 22 February 2007 07:01 Go to previous messageGo to previous message
DrGary is currently offline  DrGary
Messages: 7
Registered: February 2007
Promising Member
Hey, that was pretty easy. It looks like a mask is necessary. Without the line that includes 'img.Alpha().DrawText()', only a black square appears. Is this correct?

--Gary

The code below is a modification of the TrayIcon sample.


#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : TrayIcon {
	Image icon1;
	
	void drawImage(String str) {
		ImageDraw img(16, 16);
        	img.Alpha().DrawText(0, 0, str, Arial(14), GrayColor(255)); 
		img.DrawText(0, 0, str, Arial(14), Blue()); 
		Icon(img);
	}
	
	void Info() {
		drawImage("11");
		PromptOK("TrayIcon launched this prompt!");
		drawImage("ab");
	}
	
	virtual 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);
		Tip("This is U++ tray icon");
		drawImage("56");
	}
};

GUI_APP_MAIN
{
	App().Run();
}
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Borderless TopWindow
Next Topic: How to add Topwindow icon?
Goto Forum:
  


Current Time: Sun Jun 15 23:54:52 CEST 2025

Total time taken to generate the page: 0.04119 seconds