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 » Developing U++ » UppHub » MultiList
Re: MultiList [message #17099 is a reply to message #16000] Mon, 28 July 2008 23:59 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
Hi James!

I have been using your control for over a month now and I must say that it has served me well.

I recommend that we make sure it is compatible with ColumnList (like Uno said) and we iron out some small issues, I recommend we merge this into CtrlLib and replace ColumnList.

And speaking about issues, there is a small thing that I find quite annoying. When using a control in row mode with a lot of items, if you scroll a lot down and click on an item, when that item is focused, the scroll position is slightly altered. Only the first time. If it did this every time maybe I wouldn't find it annoying Smile. You can see this in the example you provided.

Here is a possible solution:
void MultiList::PointDown(Point p) {
	int i = GetItem(p);
	bool b = false;
	if (p.y < cy || p.y > GetSize().cy - cy)
		b = true;
	if(i >= 0 && i < GetCount())
		SetCursor0(i, false, b);
	else
	if(clickkill)
		KillCursor();
}

void MultiList::SetCursor0(int c, bool sel, bool scroll)
{
	int c0 = cursor;
	c = minmax(c, 0, GetCount() - 1);
	if(c < 0 || cursor < 0)
		Refresh();
	else
		RefreshCursor();
	cursor = c;
	int q = sb;
	if (scroll)
		ScrollInto(cursor);
	if(q != sb)
		Refresh();
	else
		RefreshCursor();
	if(sel && multi) {
		ClearSelection();
		if(cursor >= 0) {
			SelectOne(cursor, true);
			anchor = cursor;
		}
	}
	if(c0 != cursor) {
		if(cursor >= 0)
			WhenEnterItem();
		else
			WhenKillCursor();
		WhenSel();
	}
	SyncInfo();
	Action();
}

void MultiList::SetCursor(int c)
{
	SetCursor0(c, true, false);
}

void    SetCursor0(int c, bool sel, bool scroll = true);
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Scatter malfunction du to ImageDraw bug ??
Next Topic: WithAutoChoice
Goto Forum:
  


Current Time: Mon Jul 07 13:30:13 CEST 2025

Total time taken to generate the page: 0.02728 seconds