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 » Wrong display in arrayctrl
Wrong display in arrayctrl [message #8199] Sun, 18 February 2007 10:51 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

several versions ago with the following Display:

class ColoredCell : public Display
{
public:
  static bool isBlack(String s);
  void PaintBackground(Draw& w, const Rect& r, const Value& q,
	                     Color ink, Color paper, dword style) const;
	
};

bool ColoredCell::isBlack(String s)
{
  if(s[1] == 'B') return true;  
  return false;
}

void ColoredCell::PaintBackground(Draw& w, const Rect& r, const Value& q,
	                               Color ink, Color paper, dword style) const
{
    if( isBlack(AsString(q)) )	paper = Color(255, 150, 150);	
	Display::PaintBackground(w, r, q, ink, paper, style);
}

I was able to set pink the background of a cell. Only I saw that the color is not uniform. It does not appear under all the content of cell:

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

It seems a problem of transparency.
Am I wrong?

Luigi
  • Attachment: pic1.jpg
    (Size: 13.54KB, Downloaded 559 times)
Re: Wrong display in arrayctrl [message #8297 is a reply to message #8199] Thu, 01 March 2007 08:49 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
forlano wrote on Sun, 18 February 2007 10:51

Hello,

several versions ago with the following Display:

class ColoredCell : public Display
{
public:
  static bool isBlack(String s);
  void PaintBackground(Draw& w, const Rect& r, const Value& q,
	                     Color ink, Color paper, dword style) const;
	
};

bool ColoredCell::isBlack(String s)
{
  if(s[1] == 'B') return true;  
  return false;
}

void ColoredCell::PaintBackground(Draw& w, const Rect& r, const Value& q,
	                               Color ink, Color paper, dword style) const
{
    if( isBlack(AsString(q)) )	paper = Color(255, 150, 150);	
	Display::PaintBackground(w, r, q, ink, paper, style);
}

I was able to set pink the background of a cell. Only now I saw that the color is not uniform. It does not appear under all the content of cell:

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

It seems a problem of transparency.
Am I wrong?

Luigi


This is a picture of the look with the previous release that show what I mean:

index.php?t=getfile&id=473&private=0
Luigi
  • Attachment: pic3.jpg
    (Size: 20.33KB, Downloaded 482 times)
Re: Wrong display in arrayctrl [message #8418 is a reply to message #8297] Thu, 08 March 2007 14:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
A problem in U++; now should be fixed, unfortunately, fix is quite complex.

Perhaps you can use AttrText here?

Mirek
Re: Wrong display in arrayctrl [message #8424 is a reply to message #8418] Thu, 08 March 2007 17:34 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Thu, 08 March 2007 14:16

A problem in U++; now should be fixed, unfortunately, fix is quite complex.

Perhaps you can use AttrText here?

Mirek


Yes, of course...
Only now I've used AttrText for first time and it seems easier to use than Display. The above problem disappeared but I've noticed something I'm not sure is correct. I mean the color cursor is not modified when it stays in a cell affected by AttrText (see picture). Perhaps this is normal. Only the color of the text inside the cell is modified by the interaction with the cursor. But when the entire row is processed by AttrText and the cursor stay there I guess it is hided by the paper color of the cells.
Luigi

index.php?t=getfile&id=480&private=0index.php?t=getfile&id=481&private=0
  • Attachment: pic5.jpg
    (Size: 14.45KB, Downloaded 420 times)
Re: Wrong display in arrayctrl [message #8444 is a reply to message #8424] Fri, 09 March 2007 18:25 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Thu, 08 March 2007 11:34

luzr wrote on Thu, 08 March 2007 14:16

A problem in U++; now should be fixed, unfortunately, fix is quite complex.

Perhaps you can use AttrText here?

Mirek


Yes, of course...
Only now I've used AttrText for first time and it seems easier to use than Display. The above problem disappeared but I've noticed something I'm not sure is correct. I mean the color cursor is not modified when it stays in a cell affected by AttrText (see picture). Perhaps this is normal. Only the color of the text inside the cell is modified by the interaction with the cursor. But when the entire row is processed by AttrText and the cursor stay there I guess it is hided by the paper color of the cells.
Luigi

index.php?t=getfile&id=480&private=0index.php?t=getfile&id=481&private=0


Well, that is the price of simplification...

Mirek
Previous Topic: just looking for a basic arrayctrl example please
Next Topic: GridCtrl and mingw compiler error
Goto Forum:
  


Current Time: Mon Apr 29 04:51:58 CEST 2024

Total time taken to generate the page: 0.02404 seconds