Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » About the movement of a row in a ArrayCtrl
About the movement of a row in a ArrayCtrl [message #4035] |
Mon, 17 July 2006 17:38 |
|
forlano
Messages: 1189 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
at the moment using CTRL+'up' or CTRL+'down' a row can be moved up or down. Unfortunately after the movement the cursor disappear, so if the user wants to continue to move the same row he needs to click and select it once more. This is unconfortable especially if one row should be moved a lot.
I would like that after the moving of a row the cursor remains on the same row.
Luigi
[Updated on: Tue, 18 July 2006 13:57] Report message to a moderator
|
|
|
Re: About the movement of a row in a ArrayCtrl [message #4046 is a reply to message #4035] |
Tue, 18 July 2006 11:01 |
|
forlano
Messages: 1189 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
forlano wrote on Mon, 17 July 2006 17:38 | Hello,
at the moment using CTRL+'up' or CTRL+'down' a row can be moved up or down. Unfortunately after the movement the cursor disappear, so if the user wants to continue to move the same row he needs to click and select it once more. This is unconfortable especially if one row should be moved a lot.
I would like that after the moving of a row the cursor remains on the same row.
Luigi
|
The previous feature can be obtained modifying the ArrayCtrl.cpp file in the method Move()
void ArrayCtrl::Move(int dir) {
int c = GetCursor();
int d = c + dir;
if(c < 0 || c >= GetCount() || d < 0 || d >= GetCount()) return;
Vector<Value> row(ReadRow(c), 0);
Set(c, ReadRow(d));
Set(d, row);
SetCursor(d);
// WhenArrayAction(); // <----- modification
}
If I comment the above line I get the wanted behaviour (the cursor do not run away). But, what may happen if I comment the WhenArrayAction() callback? It seems to work OK...
Luigi
[Updated on: Tue, 18 July 2006 13:58] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Thu Jun 13 07:43:27 CEST 2024
Total time taken to generate the page: 0.02066 seconds
|