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 » GridCtrl MultiSelect bug
GridCtrl MultiSelect bug [message #55789] Mon, 14 December 2020 10:27 Go to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi,

There is a bug when multiselect is used in the GridCtrl.

You can test it on GridCtrlTest in the reference. On main tab hold CTRL an left mouse button click on line 7, line 3, line 9, line 4, line 10. When you click on line 10 you get:
ASSERT FAILED: Assertion failed in uppsrc/Core/Vcont.h, line 182
i >= 0 && i < items


BR, Radek

Tested:
Linux ul001998 5.4.0-56-generic #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu clang version 10.0.1-++20200708122807+ef32c611aa2-1~exp1~20200707223407.61
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

[Updated on: Mon, 14 December 2020 10:28]

Report message to a moderator

Re: GridCtrl MultiSelect bug [message #55848 is a reply to message #55789] Tue, 22 December 2020 12:42 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Thank you for reporting, should be now fixed.

If you had time to test it thouroughly, it would be great!

Mirek
Re: GridCtrl MultiSelect bug [message #55856 is a reply to message #55848] Wed, 23 December 2020 08:14 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi,

Your patch worked and the GridCtrlTest in the reference assembly is OK.

But I still have a problem with GridCtrl (see attached archive). When I select one row (e.g. 9), holding the CTRL and select another row (e.g. 15) I got the same error as from the first post. What am I doing wrong?
ASSERT FAILED: Assertion failed in uppsrc/Core/Vcont.h, line 182
i >= 0 && i < items


BR, Radek
Re: GridCtrl MultiSelect bug [message #55857 is a reply to message #55856] Wed, 23 December 2020 12:48 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Thank you! What about now?

Mirek
Re: GridCtrl MultiSelect bug [message #55859 is a reply to message #55857] Wed, 23 December 2020 14:05 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Corrected, thank you
Re: GridCtrl MultiSelect bug [message #55901 is a reply to message #55789] Mon, 28 December 2020 19:31 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi,

I found another problemm with GridCtrl selection. When you select e.g. line 9 and then execute menu: Data->Data 2. You will get selected rows although none should be selected.

BR, Radek
Re: GridCtrl MultiSelect bug [message #55928 is a reply to message #55901] Mon, 04 January 2021 10:19 Go to previous messageGo to next message
mirek is currently online  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
coolman wrote on Mon, 28 December 2020 19:31
Hi,

I found another problemm with GridCtrl selection. When you select e.g. line 9 and then execute menu: Data->Data 2. You will get selected rows although none should be selected.

BR, Radek


Hopefully fixed, please test...

Mirek
Re: GridCtrl MultiSelect bug [message #55929 is a reply to message #55928] Mon, 04 January 2021 12:02 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Fixed, thank you
Re: GridCtrl MultiSelect bug [message #56274 is a reply to message #55789] Mon, 15 February 2021 21:35 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,
I download v15764, windows 10, 64bits

and doesn't work as expected ie


        gridCta.Searching();
	gridCta.SetToolBar(BarCtrl::BAR_BOTTOM);
	gridCta.MultiSelect(false);



after starting with the line above,
in the grid I click with the right button and it displays
menu to select all. Having chosen not to do multiple selection,
what is the reason for selecting all?

if I go to the source and inhibit the menu call,
works as intended.

Or have solution without changing the source?

GridCtrl.cpp

	if(multi_select || !select_row)
	{
		SelectMenu(bar); // if inhibiting this line its works as expected
		isitem = true;
	}



Thanks





Re: GridCtrl MultiSelect bug [message #56280 is a reply to message #56274] Tue, 16 February 2021 17:20 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
Hi,

in source code this work fine to me:

	if(multi_select || !select_row)
	{
		//when MultiSelect is set to false, it will not display a selection menu.
                //    otherwise it will display the menu and the selection of multiple records. In this situation, 
                //         the issue of copies of records must still be properly configured.
		if(multi_select)
		  SelectMenu(bar);
		
		isitem = true;
	}


Thanks!


Re: GridCtrl MultiSelect bug [message #56281 is a reply to message #56280] Tue, 16 February 2021 17:46 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
in time: as a suggestion the two lines below, to display if configured the clipboard is configured to display or not.

void GridCtrl::ClipboardMenu(Bar &bar)
{
	bool c = IsCursor();
	bool s = c || IsSelection();
	bar.Add(t_("Copy"), THISBACK(DoCopy)).Image(CtrlImg::copy()).Key(K_CTRL_C).Enable(s && copy_allowed);
	//**added line below 
	if(cut_allowed)
	  bar.Add(t_("Cut"), THISBACK(Nothing)).Image(CtrlImg::cut()).Key(K_CTRL_X).Enable(s && cut_allowed);
	//**added line below
	if(paste_allowed)
	  bar.Add(t_("Paste"), THISBACK(DoPaste)).Image(CtrlImg::paste()).Key(K_CTRL_V).Enable(c && paste_allowed && 
            IsClipboardAvailable());
	if(extra_paste)
		bar.Add(t_("Paste as"), THISBACK(PasteAsMenu));

}



Thanks


Re: GridCtrl MultiSelect bug [message #56318 is a reply to message #56281] Sat, 20 February 2021 17:48 Go to previous message
mirek is currently online  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Thanks, fixed.
Previous Topic: GridCtrl - grid problem when i set focus
Next Topic: GridCtrl - after filter, copy all, show incorrect clipboard records
Goto Forum:
  


Current Time: Sun Jun 16 19:42:34 CEST 2024

Total time taken to generate the page: 0.03124 seconds