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 » ArrayCtrl, HeaderCtrl & GridCtrl » Problem w/ HeaderCtrl.SetPaper() in my app.
Problem w/ HeaderCtrl.SetPaper() in my app. [message #14458] Tue, 26 February 2008 22:16 Go to next message
jlfranks is currently offline  jlfranks
Messages: 57
Registered: May 2007
Location: Houston, TX, USA
Member
I'm can't seem to make SetPaper() work for
ArrayCtrl::HeaderCtrl work. I've included this example
app that demonstrates the problem.

Can anyone see what I'm doing wrong in making this work?



---------- environment and Upp version ------
Linux
Upp-2007.1.i386
---------- example code ---------------------
#include <CtrlLib/CtrlLib.h>
using namespace Upp;


class ArrayCtrlTest : public TopWindow
{
public:
ArrayCtrlTest()
{
Zoomable().Sizeable();

ArrayCtrl::Column & c1 = _SensorInfo.AddColumn("Value", 60);
ArrayCtrl::Column & c2 = _SensorInfo.AddColumn("Info", 100);

c1.HeaderTab().SetAlign(ALIGN_CENTER);
c2.HeaderTab().SetAlign(ALIGN_CENTER);

c1.HeaderTab().SetFont(StdFont().Bold());
c2.HeaderTab().SetFont(StdFont().Bold());

c1.HeaderTab().SetInk(Cyan());
c2.HeaderTab().SetInk(Cyan());

c1.HeaderTab().SetPaper(Yellow()); // this does not work
c2.HeaderTab().SetPaper(Yellow()); // this does not work

_SensorInfo.NoTrack();
_SensorInfo.Add(1, "46.0 psig");
_SensorInfo.Add(2, "2000.0 sccm");
_SensorInfo.SetReadOnly();

Add(_SensorInfo.SizePos());
}

~ArrayCtrlTest() {}

private:
ArrayCtrl _SensorInfo;
};


GUI_APP_MAIN
{
ArrayCtrlTest().Run();
}
Re: Problem w/ HeaderCtrl.SetPaper() in my app. [message #14460 is a reply to message #14458] Tue, 26 February 2008 23:32 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
It's a bug, propbably introduced with Chameleon.

Fix - line 74 in CtrlLib/HeaderCtrl.cpp change to:
	ChPaint(w, x, y, cx, cy, IsNull(paper) ? style->look[q] : paper);

Commit?
Re: Problem w/ HeaderCtrl.SetPaper() in my app. [message #14462 is a reply to message #14460] Wed, 27 February 2008 00:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, applied.

Mirek
Re: Problem w/ HeaderCtrl.SetPaper() in my app. [message #14469 is a reply to message #14462] Wed, 27 February 2008 01:18 Go to previous messageGo to next message
jlfranks is currently offline  jlfranks
Messages: 57
Registered: May 2007
Location: Houston, TX, USA
Member
This failed to compile for me.

HeaderCtrl.cpp
/home/jfranks/upp/uppsrc/CtrlLib/HeaderCtrl.cpp: In member function ‘void Upp::HeaderCtrl::Column::Paint(bool&, Upp::Draw&, int, int, int, int, bool, bool, bool)’:
/home/jfranks/upp/uppsrc/CtrlLib/HeaderCtrl.cpp:74: error: operands to ?: have different types
Re: Problem w/ HeaderCtrl.SetPaper() in my app. [message #14476 is a reply to message #14469] Wed, 27 February 2008 09:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes:

	ChPaint(w, x, y, cx, cy, IsNull(paper) ? style->look[q] : paper.operator Value());


(BTW, not sure why simple (Value)paper does not work with GCC here, but I gave up...)

Mirek
Re: Problem w/ HeaderCtrl.SetPaper() in my app. [message #14482 is a reply to message #14476] Wed, 27 February 2008 10:30 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Oops. In future I'll double check with MingW before submitting fixes. MSVC says it's fine.
Previous Topic: Problems with ArrayCtrl, GridCtrl in my app
Next Topic: Bugfix: ArrayCtrl Black info popups
Goto Forum:
  


Current Time: Mon Apr 29 13:39:29 CEST 2024

Total time taken to generate the page: 0.03251 seconds