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 - Child Ctrl, selected row, focus issue
GridCtrl - Child Ctrl, selected row, focus issue [message #10113] Thu, 21 June 2007 05:28 Go to next message
kcabobert is currently offline  kcabobert
Messages: 51
Registered: January 2007
Location: USA
Member
There appears to be an issue with GridCtrl related to child ctrls the selected row and focus in general.

How to replicate:
class myapp : public TopWindow {
  GridCtrl gridctrl;

public:
  myapp() {
    Add( gridctrl.SizePos() );
    gridctrl.AddIndex("thing_id");
    gridctrl.AddColumn("check","Check").Ctrls<Option>().Default(0);
    gridctrl.AddColumn("name","name");

    gridctrl.Add(0,0,"me");
    gridctrl.Add(1,0,"you");
    gridctrl.Add(2,0,"them");
    gridctrl.Add(3,0,"him");
  }

}


Compile the app.

a) Enter the GridCtrl, press the <space>, then <tab> twice, then <space>.

b) using the arrow keys, move up and down across all of the rows.

The result:
a) The cell two above's checkbox will uncheck.

b) as the cursor moves the box which are selected will change.


I an guessing something is not properly refreshing when WhenCtrls Action is called.

Thoughts?
Re: GridCtrl - Child Ctrl, selected row, focus issue [message #10117 is a reply to message #10113] Thu, 21 June 2007 08:55 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

There appears to be an issue with GridCtrl related to child ctrls the selected row and focus in general.

Thanks for the test case!. Bug is hopefuly fixed (I hope it wont break something else - grid is quite complicated). Before I put here the new GridCtrl (I'm almost done with NoEditable) comment IsNewCol() in Go0(...) in two places.
case GO_LEFT:
{
	if(!SetCursor0(curpos.x < 0 ? firstVisCol : curpos.x - 1,
		   curpos.y < 0 ? firstVisRow : curpos.y,
		   0, 0, -1, 0, ctrlmode)/*.IsNewCol()*/)
	return false;
	break;
}
case GO_RIGHT:
{
	if(!SetCursor0(curpos.x < 0 ? firstVisCol : curpos.x + 1,
		   curpos.y < 0 ? firstVisRow : curpos.y,
		   0, 0, 1, 0, ctrlmode)/*.IsNewCol()*/)
	return false;
	break;
}




Re: GridCtrl - Child Ctrl, selected row, focus issue [message #10130 is a reply to message #10117] Thu, 21 June 2007 20:15 Go to previous messageGo to next message
kcabobert is currently offline  kcabobert
Messages: 51
Registered: January 2007
Location: USA
Member
Wonderful. That appears to have fixed it.

Now, an additional small question:

Should not EnterLikeTab() make <enter> actually behave like <tab>? In my particular case, I need for <enter> to actually just move to the next row, then on the last row pass focus onto the next ctrl.

Perhaps the best solution is to derive another class from GridCtrl so that I can just override 'Key' and make it behave as needed?
Re: GridCtrl - Child Ctrl, selected row, focus issue [message #10133 is a reply to message #10130] Thu, 21 June 2007 22:26 Go to previous message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

kcabobert wrote on Thu, 21 June 2007 14:15

Should not EnterLikeTab() make <enter> actually behave like <tab>? In my particular case, I need for <enter> to actually just move to the next row, then on the last row pass focus onto the next ctrl.

Perhaps the best solution is to derive another class from GridCtrl so that I can just override 'Key' and make it behave as needed?

Yes, EnterLikeTab makes enter to behave exactely the same way like tab except one thing. If under cursor is not shown control enter makes it visible and then pass focus to the next visible control.
Your case is very specific. Deriving new class is one solution, another one is to add callback which if is definied it is call instead of Key() body.
Previous Topic: Ctrls<>() Callback / Disable some rows
Next Topic: GridCtrl 'Key' modifications / questions
Goto Forum:
  


Current Time: Wed May 15 01:49:27 CEST 2024

Total time taken to generate the page: 0.01349 seconds