NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 89 90 91 92 93 Next »
Mouse click changing 'selectedButton'

 
  • 0 Vote(s) - 0 Average
Mouse click changing 'selectedButton'
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#1
2004-04-10, 08:32 PM
I have a very alpha version of a enhanced weather plugin about ready to unleash. One problem I'm having is when you click on one of the buttons, it works OK, but the button does not get highlighted. I imagine something in OnClick has to modify selectedButton. Has anyone tackled this yet and if so, what was the fix?
-CodeMonkey
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,729
Threads: 767
Joined: Nov 2003
#2
2004-04-10, 08:43 PM
You could do something like this...

/// <summary>Is called by GBPVR when the user has click'd somewhere on the page</summary>
public void OnClick(System.Drawing.Point location)
{
if (clickableRegions != null)
{
int tempButtonIndex = 0;
// try to find what button the user clicked on
foreach (Rectangle rectangle in clickableRegions.Keys)
{
if (((location.X >= rectangle.X) && (location.X <= (rectangle.X + rectangle.Width))) &&
((location.Y >= rectangle.Y) && (location.Y <= (rectangle.Y + rectangle.Height))))
{
// found match
ScreenButton button = (ScreenButton)clickableRegions[rectangle];

// set new selected button
selectedButton = tempButtonIndex;

handleButtonCommand(button.command);
return;
}
tempButtonIndex++;
}
}
}
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,729
Threads: 767
Joined: Nov 2003
#3
2004-04-10, 08:44 PM
ah, html formatting.... You'll have to use your imagination for the correct tabbing.



CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#4
2004-04-10, 09:48 PM
That didn't seem to work quite right, I will look at it closer later. You will see what it does when you try the weather alpha.
-CodeMonkey
CodeMonkey
Offline

Senior Member

Posts: 389
Threads: 86
Joined: Apr 2004
#5
2004-04-11, 11:04 PM
Hashtable clickableRegions

is how it is defined.  Is the order being changed by the Hashtable class?  That would explain why the code above would not work.

Update: That must be the problem. I put some code in there, replacing that index logic, and all is well.
-CodeMonkey
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Changing the recording priority on recurring recordings cbgifford 4 3,816 2014-08-17, 03:13 PM
Last Post: Kiwi
  Timeline mouse navigation Jaggy 2 1,864 2011-09-18, 01:53 AM
Last Post: Jaggy
  Changing recording schedules on the fly. mvallevand 2 1,926 2011-09-06, 03:30 AM
Last Post: BrettB
  A list of changing images McBainUK 1 1,862 2011-06-21, 04:36 PM
Last Post: sub
  Changing skin font or colour mvallevand 30 6,991 2010-07-23, 02:20 PM
Last Post: whurlston
  Changing channel from a plugin Snarky 9 2,757 2006-09-20, 07:05 PM
Last Post: Snarky
  render only called for mouse and keyboard event rshaw 24 6,528 2006-09-20, 10:45 AM
Last Post: 23skidoo
  Changing colours of a bitmap/image? bgowland 7 2,778 2006-07-12, 02:54 PM
Last Post: bgowland
  changing the OSD size? reven 5 2,491 2006-03-23, 05:32 AM
Last Post: sub
  changing "ScheduleProgrammePopupBackground" in "Recordings" reven 12 3,778 2006-02-22, 10:47 PM
Last Post: Old Dog

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode