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 ArrayCtrl
ProgressIndicator in ArrayCtrl [message #12359] Fri, 26 October 2007 12:13 Go to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Sorry for my English.
How to embeded ProgressIndicator in ArrayCtrl and how to set values of this ProgressIndicator.

Set(int actual, int total) ?
Percent(bool b = true) ?
Set(int actual) ?

Thanks!!!
Re: ProgressIndicator in ArrayCtrl [message #12393 is a reply to message #12359] Sat, 27 October 2007 15:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11843
Registered: November 2005
Ultimate Member
Use ArrayCtrl::SetCtrl.

Use ProgressIndicator::Set(pos, total);
Re: ProgressIndicator in ArrayCtrl [message #12462 is a reply to message #12393] Sat, 03 November 2007 16:00 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Sorry! But this does not work.
Please give me a small example.
Re: ProgressIndicator in ArrayCtrl [message #12467 is a reply to message #12462] Sun, 04 November 2007 11:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11843
Registered: November 2005
Ultimate Member
malya wrote on Sat, 03 November 2007 11:00

Sorry! But this does not work.



Post the code ("testcase").

Mirek
Re: ProgressIndicator in ArrayCtrl [message #12475 is a reply to message #12359] Mon, 05 November 2007 09:41 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

This is my code:

#ifndef _TestProgress_TestProgress_h
#define _TestProgress_TestProgress_h

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <TestProgress/TestProgress.lay>
#include <CtrlCore/lay.h>



class TestProgress : public WithTestProgressLayout<TopWindow> {
public:
	typedef TestProgress CLASSNAME;
	TestProgress();
	void StartProgress();
	ProgressIndicator pr;
};

#endif

//******
.cpp   * 
//******

#include "TestProgress.h"

TestProgress::TestProgress()
{
	CtrlLayoutOK(*this, "TestProgress");
	btStartProgress.WhenAction = THISBACK(StartProgress);
	list.AddColumn("Progress", 100);
	list.Insert(0);
	list.SetCtrl(0, 0, pr);
	pr.Set(0, 100000);
	pr.Percent();
}

void TestProgress::StartProgress()
{
	for (int i = 0; i < 100000; i++)
	{
		pr.Set(i);
		ProcessEvents();
	}
}




GUI_APP_MAIN
{
	TestProgress().Run();
}


Image:
index.php?t=getfile&id=812&private=0

Thats all. Progress does not show percent.
And Progress does not move after push Button Start.

Thanks!
Re: ProgressIndicator in ArrayCtrl [message #12484 is a reply to message #12475] Mon, 05 November 2007 14:54 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
That works fine for me using MSC8 on XP, if you posted your package so that we could be sure we are testing the same code it would help.

James
Re: ProgressIndicator in ArrayCtrl [message #12486 is a reply to message #12475] Mon, 05 November 2007 15:01 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

I see quick tabs do not fit too well to ide colors. I think I'll try to use chamelon to paint tabs..
Re: ProgressIndicator in ArrayCtrl [message #12487 is a reply to message #12486] Mon, 05 November 2007 17:43 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 794
Registered: November 2005
Location: Czech Republic - Praha
Contributor

unodgs wrote on Mon, 05 November 2007 15:01

I see quick tabs do not fit too well to ide colors. I think I'll try to use chamelon to paint tabs..


While you are on it, what about something like "ColorfulTabs" extension for Firefox?

http://photos1.blogger.com/x/blogger2/6388/344641085859382/1600/z/916132/gse_multipart26714.png
(I hope the picture will show here too)
Re: ProgressIndicator in ArrayCtrl [message #12494 is a reply to message #12487] Mon, 05 November 2007 22:29 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

I think it's unnecessary. One can turn on icon displaying to achieve better readability. The answer to question what is better colors or icons is of course very subjective. IMO too many colors will make theide to look unprofessional.
Re: ProgressIndicator in ArrayCtrl [message #12496 is a reply to message #12494] Mon, 05 November 2007 23:16 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Ok. It is work.
But what is the bug.
Progress value is 100%, but it is not full fill.
Many pixel not filled in the end of ProgressIndicator.

index.php?t=getfile&id=813&private=0

Windows XP. Classic Theme (in WinXP theme this is work normal)

Thanks!
Re: ProgressIndicator in ArrayCtrl [message #12501 is a reply to message #12496] Tue, 06 November 2007 11:39 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Good bug! Smile

When drawing percentages the progress bar falls back to none-chameleon drawing style and the function GetMsz() used for returning the inner control size (minus margins) returns an incorrect value because it still uses ChMargin.

My quick fix:
Size ProgressIndicator::GetMsz()
{
	Size sz = GetSize();
	if (GUI_GlobalStyle() >= GUISTYLE_XP && !percent) {
		Rect mg = ChMargins(style->hlook);
		sz.cx -= mg.left + mg.right;
		mg = ChMargins(style->vlook);
		sz.cy -= mg.top + mg.bottom;
	}
	else {
		sz.cx -= 4;
		sz.cy -= 4;	
	}
	return sz;
}


James

[Updated on: Tue, 06 November 2007 11:40]

Report message to a moderator

Re: ProgressIndicator in ArrayCtrl [message #12502 is a reply to message #12359] Tue, 06 November 2007 11:44 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

But what is that?
My previous post is at home and its working, but not at my work.
Help what is bug?

My package:
Re: ProgressIndicator in ArrayCtrl [message #12503 is a reply to message #12502] Tue, 06 November 2007 12:31 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
You need to open CtrlLib/ProgressIndicator.cpp and replace the function GetMsz with the code I posted above.

James

[Updated on: Tue, 06 November 2007 12:39]

Report message to a moderator

Re: ProgressIndicator in ArrayCtrl [message #12506 is a reply to message #12503] Tue, 06 November 2007 14:27 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

Sorry, but I aim at about previous problem.
At home: ProgressIndicator work very good.
At my work place: No.

Wherein problem?
Maybe its depended of Windows services, etc. Theme service.
Thanks!
Re: ProgressIndicator in ArrayCtrl [message #12528 is a reply to message #12359] Wed, 07 November 2007 15:14 Go to previous messageGo to next message
malya is currently offline  malya
Messages: 27
Registered: June 2007
Promising Member

New question.
How I may remove ProgressIndicator from cell and set into cell text.
progress = new ProgressIndicator();
progress->Percent(true);
progress->Set(0, 100);
list.SetCtrl(i, CPROG, progress);
delete progress;
list.Set(i, CPROG, "OK");


This code invoke error.
Re: ProgressIndicator in ArrayCtrl [message #12530 is a reply to message #12359] Wed, 07 November 2007 16:46 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 794
Registered: November 2005
Location: Czech Republic - Praha
Contributor

I'm not sure what did cause the error and what kind of error you are talking about, but doing "delete progress" as long as the list control has the pointer too may be big problem. Unless the destructor of ProgressIndicator will notify the parent control about it's deletion, in such case the code is ok, but IMHO *looks* bad anyway.

Try to do "list.Set(i, CPROG, "OK");" ahead of delete, that will be more logical and more easy to read for my mind.
(and check if the second "Set" will destroy the reference of list to progress, or you need some Unset .. sorry, I can't give you exact help as I didn't need yet the UPP GUI so I'm not sure how those classes work and about their API)

If the problem persist, try to post here what the error is or wait for someone else to give you another hint.
Re: ProgressIndicator in ArrayCtrl [message #12531 is a reply to message #12359] Wed, 07 November 2007 16:54 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 794
Registered: November 2005
Location: Czech Republic - Praha
Contributor

I did check the uppsrc .. found SetCtrl in "Item", "Node", "TabCtrl" and "ArrayCtrl". (As I have no idea what kind of class is "list", I had to consider all possibilities)

A quick check trough their source code revealed to me none of them sets anything in the control you are setting, so with "delete progress" you surely don't destroy the pointer in "list".

Check if the Set with text does that for you (in "Node" it would for example), than you can delete it.
Previous Topic: Please, add SetColor function to ProgressIndicator
Next Topic: Problem with ProgressIndicator in Kubuntu Linux
Goto Forum:
  


Current Time: Thu Apr 25 00:02:06 CEST 2019

Total time taken to generate the page: 0.01062 seconds