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 » Slider&ProgressIndicator » Slider and ProgressIndicator [EXAMPLE]
Slider and ProgressIndicator [EXAMPLE] [message #806] Fri, 03 February 2006 09:46
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
#include <CtrlLib/CtrlLib.h>
//based on Button example

struct ProgressApp : TopWindow {
	int    count;
	int		value;
	Label  label;
	ProgressIndicator progress;
	SliderCtrl slider;
	
	void RefreshLabel()
	{
		label = Format("Number of slider reads-%d, value of slider-%d", count, value);
	}
	void Slide()
	{
		++count;
		value=slider.GetData();
		progress.Set(value,100);
		RefreshLabel();
	}
	
	typedef ProgressApp CLASSNAME;
	
	ProgressApp()
	{
		count = 0;
		value = 75;
		slider <<= THISBACK(Slide);
		slider.SetData(value);
		Add(label.BottomPos(0, 20).HCenterPos(300));
		label.SetAlign(ALIGN_CENTER);
		
	    Add(slider.VSizePos(300,30).HSizePos(10,10));

	    Add(progress.VSizePos(10, 40).HCenterPos(100));
		progress.Set(value,100);
		
		Sizeable().Zoomable();
		RefreshLabel();
	}
};

GUI_APP_MAIN
{
	ProgressApp().Run();
}


I think you should play something with timer... Too many slider reads. Feel free to improve. Smile

[Updated on: Mon, 01 May 2006 14:25]

Report message to a moderator

Next Topic: Slider verticality bug or underdevelopment? [ADDED]
Goto Forum:
  


Current Time: Fri Mar 29 11:30:29 CET 2024

Total time taken to generate the page: 0.02817 seconds