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 » U++ Widgets - General questions or Mixed problems » "ScrollArea"...
icon1.gif  "ScrollArea"... [message #911] Wed, 08 February 2006 07:15 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I haven't found ScrollArea control in U++, so I started playing...
#include <CtrlLib/CtrlLib.h>

struct App : TopWindow {
	StaticRect          view, work;
	Array<Button>   obj;
	SliderCtrl          slider;
	Label               text;
//change count to change work area width 
static	int const count = 100;
static	int const elw = 40;
static	int const vw=500;
static  int	const ww = count*elw+50;
static  int const wh = 290;
		
	void Slider() {
		work.SetRectX(~slider,ww);
		text = "\1[C6*/@b " + AsString(~slider);
	}

	typedef App CLASSNAME;

	App() {
		view.SetRect(30,30,vw,300);
		view.Color(SBlack);
		work.SetRect(0,0,ww,wh);
		work.Color(SRed);
		view.Add(work);
		Add(view);
		for(int i=0;i<=count;i++){
		  obj.Add(); obj[i].SetRect(5+i*elw,20,30,20);
		  obj[i].SetLabel(AsString(i));
		  work.Add(obj[i]);
		}
		
		Add(slider.BottomPosZ(5, 30).HSizePos(300, 300));
		Add(text.LeftPos(5, 200).TopPos(5, 40));
		slider <<= THISBACK(Slider);
		slider.MinMax(-ww+5, vw-5);
		slider <<= 50;
		Slider();
		Sizeable().Zoomable();
	}
};

GUI_APP_MAIN
{
	App().Title("ScrollArea -v0.1").Run();
}

 

[Updated on: Fri, 26 May 2006 09:49]

Report message to a moderator

 
Read Message icon1.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to use droplist and switch
Next Topic: What way is best to implement Callback for GotFocus/LostFocus?
Goto Forum:
  


Current Time: Sun Apr 28 17:09:49 CEST 2024

Total time taken to generate the page: 0.04535 seconds