Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Retrieving Screen Location of Selected Cell

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
erikest



Joined: 30 May 2007
Posts: 17

PostPosted: Wed Aug 22, 2007 7:01 pm    Post subject: Retrieving Screen Location of Selected Cell Reply with quote

Is there a method for retrieving the screen location (left, top) of the currently selected cell in the tree?
_________________
Erik Taylor
Developer
EnergySoft, LLC.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Aug 22, 2007 10:32 pm    Post subject: Reply with quote

Quote:
Is there a method for retrieving the screen location (left, top) of the currently selected cell in the tree?


Not directly - why do you need this? Are you using SelectionMode.Cell?
[/quote]
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
erikest



Joined: 30 May 2007
Posts: 17

PostPosted: Wed Aug 22, 2007 10:42 pm    Post subject: Reply with quote

I wish to display a context menu, similar to the one a user can display by right clicking on a tree element, when the user presses INS. It would be advantageous to set the location of the context menu to the currently selected tree element to provide consistent look when our users navigate and modify the tree using the keyboard instead of the mouse.
_________________
Erik Taylor
Developer
EnergySoft, LLC.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Aug 23, 2007 10:35 pm    Post subject: Reply with quote

Virtual Tree automatically displays the row context menu when the Windows Cmd Key (typically found between the right Alt and Ctrl keys) is pressed. If you want to display this menu on some other key press you could derive from Virtual Tree and call the ProcessAppsCmdKey method which does this.

If you want to display some other context menu you can use the same logic as the ProcessAppsCmdKey does to find the location of the row. Because the PinnedPanel is protected you would need to do this in a derived class.

Code:
           
Row row = FocusRow;
Point position = new Point(0, DisplayTop);
if (row != null)
{
    RowWidget widget = PinnedPanel.GetRowWidget(row);
    if (widget != null)
    {
         position = widget.Bounds.Location;
    }
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group