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 » Promlem with ColumnList::SetDisplay()
Promlem with ColumnList::SetDisplay() [message #6020] Sat, 28 October 2006 19:19 Go to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
Hi all, i am trying to use a Display to change the look of ColumnList.

I have derived a class from ColumnList and Display like FileList does:
class NewList : public ColumnList, private Display {
   public:
      NewList();
      virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style);
      Size GetStdSize();
}


and the implementation looks like this:
NewList::NewList() {
   SetDisplay(*this);
};

void NewList::Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) {
   w.DrawRect(r,SGray());
};

Size NewList::GetStdSize() {
   Size sz;
   sz.cx=300;
   sz.cy=40;
   return sz;
}


But the Paint method of NewList ist never called - only StdDisplay::Paint is called.

what did i do wrong?

PS: sorry for any strage code, but copy and paste still doesn't work for me, at least not from TheIDE to Firefox, the other way works Confused
Re: Promlem with ColumnList::SetDisplay() [message #6033 is a reply to message #6020] Sun, 29 October 2006 04:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Hard to say what is wrong... A test package? Smile

Mirek
Re: Promlem with ColumnList::SetDisplay() [message #6043 is a reply to message #6033] Sun, 29 October 2006 08:09 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
sure again,

here it is

Bas
Re: Promlem with ColumnList::SetDisplay() [message #6064 is a reply to message #6043] Sun, 29 October 2006 20:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Well, C++ showed its ugly face here... missing const in Paint declaration... (-> overload by different signature -> introducing a new virtual method. C++ really needs "override" keyword).

Mirek
Re: Promlem with ColumnList::SetDisplay() [message #6073 is a reply to message #6064] Sun, 29 October 2006 22:23 Go to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
thanks a lot Mirek

Bas
Previous Topic: StdFont(11) in DocEdit and LineEdit
Next Topic: easiest way to convert a Topwindow into a control
Goto Forum:
  


Current Time: Mon Jun 10 01:19:29 CEST 2024

Total time taken to generate the page: 0.01151 seconds