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 » Community » Newbie corner » Static Ctrl Picture and .iml
Re: Static Ctrl Picture and .iml [message #29742 is a reply to message #29739] Thu, 11 November 2010 13:11 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3372
Registered: August 2008
Senior Veteran
Hello Daniel

I think it should work. I enclose you a sample package.

And this is the .cpp file:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define  IMAGEFILE  <iml/image.iml>
#define  IMAGECLASS MyImg
#include <Draw/iml.h>

#define LAYOUTFILE <iml/img.lay>
#include <CtrlCore/lay.h>

struct App : WithMyLayout <TopWindow> {
	typedef App CLASSNAME;
	void OnLed() {
		static bool on;
		if (on) {
			on = false;
			led.SetImage(MyImg::Grey());
		} else {
			on = true;
			led.SetImage(MyImg::Red());
		}
	}
	App() {
		CtrlLayout(*this);
		but.WhenAction = THISBACK(OnLed);
		led.SetImage(MyImg::Red());
	}
};

GUI_APP_MAIN
{
	App().Run();
}

  • Attachment: iml.7z
    (Size: 1.03KB, Downloaded 214 times)


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Changing compiler "on the fly"
Next Topic: Using U++ without UppIDE
Goto Forum:
  


Current Time: Tue Jun 18 02:30:31 CEST 2024

Total time taken to generate the page: 0.03262 seconds