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 » 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 Go to next message
forlano is currently offline  forlano
Messages: 1185
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 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
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

Re: About the movement of a row in a ArrayCtrl [FEATURE REQUEST] [message #4050 is a reply to message #4046] Tue, 18 July 2006 13:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
This is really strange - WhenArrayAction is client callback - you are supposed to use for your action when Array changes....

From what I see, it looks like you are using it and your code somehow makes cursor go away.

Mirek
Re: About the movement of a row in a ArrayCtrl [message #4052 is a reply to message #4050] Tue, 18 July 2006 14:05 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Tue, 18 July 2006 13:32

This is really strange - WhenArrayAction is client callback - you are supposed to use for your action when Array changes....

From what I see, it looks like you are using it and your code somehow makes cursor go away.

Mirek

It seems I am the guilty. After your reply I've investigated better my code and the cursor go away because after the movement I've a call to

tab1.arr.WhenArrayAction = THISBACK(arrCtrlsAction);

(I need it tu update something when I add/delete a row).
If I comment it the problem disappear.
Sorry.

Luigi
Previous Topic: Is it possible to set the Font type for the arrayctrl?
Next Topic: Multi-line entries
Goto Forum:
  


Current Time: Tue May 14 08:38:46 CEST 2024

Total time taken to generate the page: 0.01881 seconds