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 » [Bug-Patch] ArrayCtrl: the cursor, does not skip hidden rows
[Bug-Patch] ArrayCtrl: the cursor, does not skip hidden rows [message #59475] Tue, 03 January 2023 13:51
omari is currently offline  omari
Messages: 264
Registered: March 2010
Experienced Member
Test case:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

GUI_APP_MAIN
{
    TopWindow win;
    ArrayCtrl arr;
    arr.AddColumn("");

    for(int i = 0; i < 10; i++){
        arr.Add(i);
        arr.ShowLine(i, i%2);
    }

    win.Add(arr.SizePos());
    win.Run();
}

then use keyboard arros in order to change the cursor.


patch:

replace

int ArrayCtrl::FindEnabled(int i, int dir)
{
	ASSERT(dir == -1 || dir == 1);
	while(i >= 0 && i < GetCount()) {
		if(IsLineEnabled(i))
			return i;
		i += dir;
	}
	return -1;
}


with:


int ArrayCtrl::FindEnabled(int i, int dir)
{
	ASSERT(dir == -1 || dir == 1);
	while(i >= 0 && i < GetCount()) {
		if(IsLineEnabled(i) && IsLineVisible(i))
			return i;
		i += dir;
	}
	return -1;
}


regards
omari.
Previous Topic: multi column droplist?
Next Topic: funny bug(or maybe not)
Goto Forum:
  


Current Time: Fri Mar 29 13:30:47 CET 2024

Total time taken to generate the page: 0.01147 seconds