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/DropGrid problem: Value related.
GridCtrl/DropGrid problem: Value related. [message #33604] Mon, 29 August 2011 21:01 Go to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I didn't update my UPP for a while. Then I did a update yesterday, only to find a previously working program now crashes.

I use an ArrayCtrl to display/edit data. There is an integer field whose Converter (Format/Scan) has been tested to work correctly. There is a DropGrid ctrl assoicated with the field for editing. The problem occurs when the edit started on a new row, or on any row where the field doesn't have a valid value.

The process is like following:
1. When I clicked the field to have it enter edit mode, I notice it works as intended;

2. When I use up/down arrow to select a value from the DropGrid's pick list, it works fine. After this, I can use keyboard or mouse to bring up the popup and make selection as before (the update);

3. If I skipped step 2 and the field is currently blank, press keyboard or double click in the field will crash the program, with a debug time message:
Assertion failed in c:\upp\uppsrc\core\Vcont.h, line 33
i>=0 && i<items

I figure it happened when DropGrid is trying to search a match entry in the picklist where none is existent.

I haven't done a simplified test example yet because most likely unodgs already got a fix to my problem.
Re: GridCtrl/DropGrid problem: Value related. [message #33605 is a reply to message #33604] Tue, 30 August 2011 01:48 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I have created a simple example to reproduce the error. See attached zip file.

The fruit in the first line have been entered use up/down arrow key. When I try to use dropdown or keyboard to choose one for the second line, error happened. See the following picture.
index.php?t=getfile&id=3422&private=0
Re: GridCtrl/DropGrid problem: Value related. [message #33608 is a reply to message #33605] Tue, 30 August 2011 08:14 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Please use this fix (it will be committed in the evening)
void DropGrid::SearchCursor()
{
	if(!list.IsCursor())
		return;
	
	if(trowid < -1)
		trowid = rowid;
	value = list.Get(value_col);
	rowid = list.GetRowId();
	Refresh();
}

Crash was caused by one of the latest changes (feature request) that WhenSearchString should be called when list is cleared.
Thank you for the test case! (It really speeds up finding bugs)

[Updated on: Tue, 30 August 2011 08:15]

Report message to a moderator

Re: GridCtrl/DropGrid problem: Value related. [message #33610 is a reply to message #33608] Tue, 30 August 2011 14:09 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
I am glad it's fixed. Thank you!

GridCtrl&DropGrid are very powerful widgets. Is there a thread to advise of the recently added features?

When using DropGrid as a program user, I noticed sometimes the DropGrid's behavior is less stable/correct than expected.

I use keyboard input to bring up the popup and searchhiderow(?) is set to true.

1. Sometimes the Popup's position/size is not correct. It's not open towards the side with more space. When it open upwards, sometime the column header or even first couple of entries are off the screen. Sometimes there is only one entry displayed even though there are more than one candidates.

2. Most of the time there will be a currently selected entry so that I can use navigation key to move to the intended entry and use enter key to select it. But occasionally (about 1/7) there will not be a highlighted row and navigation key will not work at all. I have to switch to mouse to click one to select.

If you need I will try to create a sample program to reproduce the defects I mentioned above. Please let me know. If you are too pressed with other more important issues, than forget it. It doesn't bother me as much anyways.

Re: GridCtrl/DropGrid problem: Value related. [message #33611 is a reply to message #33610] Tue, 30 August 2011 17:41 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Lance wrote on Tue, 30 August 2011 08:09


If you need I will try to create a sample program to reproduce the defects I mentioned above. Please let me know. If you are too pressed with other more important issues, than forget it. It doesn't bother me as much anyways.


Please prepare a program especially if the problem that occurs is not so easy to reproduce. That will save me a lot of time.
PS: I use DropGrid/GridCtrl controls a lot in my applications - that means it's also my business to have them working correctly Smile, so I'm very happy to fix every possible bug small or big one.
Re: GridCtrl/DropGrid problem: Value related. [message #33613 is a reply to message #33611] Tue, 30 August 2011 22:33 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
That's great. I have slightly change the test program, basically added more entries.

The following shows when the popup HAPPENED to show as a short rectangle when input string is "br":

index.php?t=getfile&id=3424&private=0

The exactly same input of "br", in most time will produce popup like this:

index.php?t=getfile&id=3425&private=0

The problem with the short one is that if the "br" was a mistake, I backspace one to change the search string to "b", a lot more entries now qualifies, but the size of the popup will never change before close and open again.

Here is a example of position/size problem:
index.php?t=getfile&id=3426&private=0

This happens more consistent. It invariably repeat itself as long as the current row is close to the center of the screen.

Other problems are harder to repeat. I'll do more experiment to see if I can find a rule.

  • Attachment: narrow.png
    (Size: 95.42KB, Downloaded 618 times)
  • Attachment: wide.png
    (Size: 79.27KB, Downloaded 607 times)
  • Attachment: wrongsize.png
    (Size: 97.33KB, Downloaded 621 times)
Re: GridCtrl/DropGrid problem: Value related. [message #33614 is a reply to message #33613] Tue, 30 August 2011 22:37 Go to previous message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Here is the new program.
Previous Topic: ArrayCtrl with vertical headers
Next Topic: GridCtrl: master - detail
Goto Forum:
  


Current Time: Fri Mar 29 06:14:14 CET 2024

Total time taken to generate the page: 0.01615 seconds