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 » ProgressIndicator in StatusBar
ProgressIndicator in StatusBar [message #10054] Mon, 18 June 2007 15:03 Go to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
How can i place a ProgressIndicator within a StatusBar?

Michael
Re: ProgressIndicator in StatusBar [message #10055 is a reply to message #10054] Mon, 18 June 2007 15:43 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1360
Registered: November 2005
Location: Poland
Ultimate Contributor

StatusBar sb;
ProgressIndicator pi;
sb.Add(pi.LeftPos(5, 200).HSizePos());

In U++ you can add any control to any conrol using Ctrl interface.
Re: ProgressIndicator in StatusBar [message #10056 is a reply to message #10054] Mon, 18 June 2007 15:58 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
Thanks so far, but when i use this code:

main.h
StatusBar status;
ProgressIndicator progress;

main.cpp
AddFrame(status);
status.Add(progress.LeftPos(5, 200).HSizePos());

Nothing besides Ready is displayed in the statusBar.

Michael
Re: ProgressIndicator in StatusBar [message #10057 is a reply to message #10056] Mon, 18 June 2007 16:19 Go to previous messageGo to next message
Zardos is currently offline  Zardos
Messages: 62
Registered: April 2007
Member
Depending on the place where you call:
AddFrame(status);
status.Add(progress.LeftPos(5, 200).HSizePos());


you may consider creating the vars:
StatusBar status;
ProgressIndicator progress;

... as member vars in your class and not as local vars.

I'm not sure if this is the problem. I would expect a crash and not only non functioning of your code. But you may check it, anyway.

- Ralf
Re: ProgressIndicator in StatusBar [message #10060 is a reply to message #10057] Mon, 18 June 2007 19:10 Go to previous messageGo to next message
mezise is currently offline  mezise
Messages: 49
Registered: April 2006
Member
unodgs wrote on Mon, 18 June 2007 15:43

StatusBar sb;
ProgressIndicator pi;
sb.Add(pi.LeftPos(5, 200).HSizePos());

In U++ you can add any control to any conrol using Ctrl interface.

This code does not work for me too. It would be great to be feasible this way.

Working solutions are:
1. InfoCtrl with its own Display
2. and simpler use of ProgressInfo:
progressInfo.Info(status);


Slightly modified reference/SliderProgressInd using ProgressInfo:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : TopWindow {
	ProgressIndicator progress;
	SliderCtrl        slider;
	Label             text;
	StatusBar         status; // --- added ---
	ProgressInfo      progressInfo; // --- added ---

	void Slider() {
		progress.Set(~slider, 100);
		progressInfo.Set(~slider, 100); // --- added ---
		text = "\1[C6*/@b " + AsString(~slider);
	}

	typedef App CLASSNAME;

	App() {
		Add(slider.BottomPosZ(5, 30).HSizePos(10, 10));
		Add(progress.VSizePos(10, 40).HCenterPos(40));
		
		AddFrame(status); // --- added ---
		//status.Add(progress); // --- added --- DOES NOT WORK!
		progressInfo.Info(status); // --- added --- WORKS!
		
		Add(text.LeftPos(5, 200).TopPos(5, 40));
		slider <<= THISBACK(Slider);
		slider.Range(100);
		slider <<= 50;
		Slider();
		Sizeable().Zoomable();
	}
};

GUI_APP_MAIN
{
	App().Run();
}



Michal

[Updated on: Mon, 18 June 2007 19:11]

Report message to a moderator

Re: ProgressIndicator in StatusBar [message #10062 is a reply to message #10054] Mon, 18 June 2007 19:52 Go to previous messageGo to next message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
Well, using ProgressInfo works...

But what is the difference between ProgressIndicator and ProgressInfo? I can't find any Examples or Manual-Entries using ProgressInfo.

Michael
Re: ProgressIndicator in StatusBar [message #10066 is a reply to message #10062] Mon, 18 June 2007 20:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12941
Registered: November 2005
Ultimate Member
http://www.ultimatepp.org/src$CtrlLib$StatusBar$en-us.html
Re: ProgressIndicator in StatusBar [message #10071 is a reply to message #10056] Mon, 18 June 2007 22:07 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1360
Registered: November 2005
Location: Poland
Ultimate Contributor

Of course Zardos is right and I made a small mistake. Instead of HSizePos() use VSizePos() or TopPos(2, 15).
sb.Add(pi.LeftPos(5, 200).TopPos(2, 15))

It must work. I use it in one of my apps;
Re: ProgressIndicator in StatusBar [message #10072 is a reply to message #10054] Mon, 18 June 2007 22:32 Go to previous message
michael is currently offline  michael
Messages: 153
Registered: May 2007
Location: Germany
Experienced Member
Thanks, this works now.

Michael
Previous Topic: Use slider from layout designer?
Next Topic: Please, add SetColor function to ProgressIndicator
Goto Forum:
  


Current Time: Tue Nov 24 18:20:13 CET 2020

Total time taken to generate the page: 0.02640 seconds