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 » Problem with ColumnList (with example) [BUG/FIXED]
Re: Problem with ColumnList (with example) [message #5764 is a reply to message #5758] Fri, 13 October 2006 16:31 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
Thanks. Actually, the real problem was wrong colors for selected item in GetItemStyle. This bug escaped our attention because ColumnList so far is used just for filelists, where it has different Display.

As for not selecting the item without Shift or Ctrl, that is correct - cursor is not considered to be the selection.

ColumnList returns IsSelection when there are selected items. When there are not, IsCursor still can be true - in that case you have to use GetCursor to find which item has cursor.

My fixed GetItemStyle version:

void ColumnList::GetItemStyle(int i, Color& ink, Color& paper, dword& style)
{
	ink = SColorText;
	paper = SColorPaper;
	const Item& m = item[i];
	style = 0;
	if(i == cursor) {
		style = isselection ? Display::CURSOR : Display::CURSOR|Display::SELECT;
		paper = isselection ? Blend(SColorHighlight, SColorFace) : SColorFace;
		if(HasFocus()) {
			style |= Display::FOCUS;
			paper = isselection ? Blend(SColorHighlight, SColorPaper) : SColorHighlight;
			ink = SColorPaper;
		}
	}
	if(m.sel) {
		style |= Display::SELECT;
		paper = SColorShadow;
		if(HasFocus())
			style |= Display::FOCUS;
	}
}



Note: Instead that complicated game with LogPos at the benning of AWindow, SetRect(0, 0, 228, 356); would be a simpler variant.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to resize an ImageCtrl to fit the Image?
Next Topic: Fit control to text
Goto Forum:
  


Current Time: Fri Jul 18 17:49:15 CEST 2025

Total time taken to generate the page: 0.03825 seconds