Navigate to control using Code (1 Viewer)

hardcorehire

Portal Pro
April 1, 2008
108
45
OHIO
Home Country
United States of America United States of America
Is there a way I could navigate to a certain control or the next control using code instead of in the navigation of the xml file. I need this because the button I want to navigate to isn't always visible so I check to see if it is visible and if it isn't and I hit the right arrow I want to navigate to the next control. In order to do this I need to know how to move to a controlid using code.

Any help would be greatly appreciated as always tried forever to get this. I can move the mouse using cursor.point but it isn't the same as navigating in MP because the actual cursor moves and when you hit down in MP no cursor moves.

Thanks

FYI. Just about ready to release MyRolodex probably next week all functionality is complete just cleaning up some navigation.
 

hardcorehire

Portal Pro
April 1, 2008
108
45
OHIO
Home Country
United States of America United States of America
I found somewhat of a way, but it only works in full screen I use the following code:

public override void OnAction(MediaPortal.GUI.Library.Action action)
{
if (btnFirstContactA_M.Visible == false && PreviousFocusedId >= 2 && PreviousFocusedId <= 14)
{
if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT)
{

int nextcontrolid = PreviousFocusedId + 1;

switch (nextcontrolid)
{
case 3:
Cursor.Position = new Point(btnB._positionX, btnB._positionY);
break;
case 4:
Cursor.Position = new Point(btnC._positionX, btnC._positionY);
break;
case 5:
Cursor.Position = new Point(btnD._positionX, btnD._positionY);
break;
etc........


cursor.hide();
return;
}


The problem is when you aren't in full screen the _positionX and _positionY of the buttons aren't correct. Any ideas to help out think I am ready to release MyRolodex if anyone is interested will be posting sometime over the next couple days maybe sooner. Check it out.


Thanks
 

Users who are viewing this thread

Top Bottom