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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Slider and "Dynamic rectangle" example
Slider and "Dynamic rectangle" example [message #910] Wed, 08 February 2006 05:27 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
#define MY_TITLE "Dynamic Rectangle"
#include <CtrlLib/CtrlLib.h>
//Based on SliderProgressIndicator example
//dynamically changes StaticRect coords

struct App : TopWindow {
	StaticRect dynrc;
	SliderCtrl        slider;
	Label             text;

	void Slider() {
//here is the main "dynamism"...
		dynrc.SetRectX(50,~slider);
		text = "\1[C6*/@b " + AsString(~slider);
	}

	typedef App CLASSNAME;

	App() {
		Add(slider.BottomPosZ(5, 30).HSizePos(300, 300));
		
		dynrc.Color(SRed);
		Add(dynrc.VSizePos(10, 40).HCenterPos(40));
		
		Add(text.LeftPos(5, 200).TopPos(5, 40));
		slider <<= THISBACK(Slider);
		slider.Range(700);
		slider <<= 50;
		Slider();
		Sizeable().Zoomable();
	}
};

GUI_APP_MAIN
{
	App().Title(MY_TITLE).Run();
}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ExpressPane
Next Topic: Mouse over button example -"catch me if you can..."
Goto Forum:
  


Current Time: Thu Apr 25 09:17:20 CEST 2024

Total time taken to generate the page: 0.07183 seconds