Home » Developing U++ » UppHub » MultiList
Re: MultiList [message #17099 is a reply to message #16000] |
Mon, 28 July 2008 23:59   |
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 . 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);
|
|
|
 |
|
MultiList
By: mrjt on Wed, 21 May 2008 12:54
|
 |
|
Re: MultiList
By: unodgs on Wed, 21 May 2008 18:08
|
 |
|
Re: MultiList
By: mrjt on Wed, 21 May 2008 18:28
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: mirek on Tue, 29 July 2008 00:10
|
 |
|
Re: MultiList
By: mrjt on Tue, 29 July 2008 17:25
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: mrjt on Wed, 30 July 2008 12:59
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: mrjt on Tue, 17 March 2009 17:09
|
 |
|
Re: MultiList
By: mirek on Tue, 28 April 2009 13:45
|
 |
|
Re: MultiList
By: mirek on Tue, 28 April 2009 14:25
|
 |
|
Re: MultiList
By: mirek on Tue, 28 April 2009 14:47
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: koldo on Wed, 11 January 2012 10:38
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: koldo on Wed, 11 January 2012 12:59
|
 |
|
Re: MultiList
By: koldo on Wed, 11 January 2012 21:48
|
 |
|
Re: MultiList
|
 |
|
Re: MultiList
By: koldo on Thu, 12 January 2012 10:45
|
 |
|
Re: MultiList
By: cocob on Tue, 17 March 2009 14:14
|
Goto Forum:
Current Time: Mon Jul 07 13:30:13 CEST 2025
Total time taken to generate the page: 0.02728 seconds
|