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 |
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 |
|
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 #10133 is a reply to message #10130] |
Thu, 21 June 2007 22:26 |
|
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.
|
|
|
Goto Forum:
Current Time: Wed May 15 01:49:27 CEST 2024
Total time taken to generate the page: 0.01349 seconds
|