NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 14 15 16 17 18 … 93 Next »
Focus

 
  • 0 Vote(s) - 0 Average
Focus
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2011-07-15, 03:36 PM
The System plugin contains a screen with both a UiButtonList and a UiList. The buttons are to the left-hand side of the list (see image).

Either by design (or more likely luck), when the focus is on the buttons and user presses "Right", the focus moves to the list.

But when the list is empty of elements, I hide it from display, and restore the plugin's default view which is a custom rendering of drive-space remaining. The trouble is the hidden list still holds focus, so I'd like to return it to the buttons automatically - can this be done?

You can still get focus back by pressing "Left" but that's not particularly user-friendly.

Thanks

Iain
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#2
2011-07-15, 04:01 PM
Check if the list is empty and then fake a 'left' press by calling the key handler directly with the 'left' key code? Sorry been a while since I did plugin development and can't remember exactly but I faked key presses like this in the past.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#3
2011-07-15, 06:38 PM
Hmm, nice idea thanks, but I can't make it work consistently. I think the keyevent is (sometimes) getting lost deep within the event/render/threaded/blackmagic call stack that happens at runtime.

I'll keep fighting with it, but it's not looking hopeful. Wasn't really anything that important, but it would be nice to crack the bugger.

Iain
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,723
Threads: 767
Joined: Nov 2003
#4
2011-07-15, 07:16 PM
Is this derived from SimpleButtonListPlugin? If so, you can probably do the following to select the buttons:

focus = Focus.FOCUS_ON_BUTTONS;
uiList.Selected = false;
uiButtonList.Selected = true;
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#5
2011-07-15, 09:36 PM
Cheers sub. I can't make that work reliably either, so it must be something else silly I'm doing. I'll have a good think about it overnight and take a fresh attack at it in the morning.

Iain
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,952
Threads: 956
Joined: May 2006
#6
2011-07-15, 09:50 PM
I don't know if it helps but to make the button strip lose focus I think I need to use

uiButtonStrip.VisibleUntil = DateTime.MinValue;

Martin
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#7
2011-07-16, 09:37 AM
Ok, I think I finally have something that is working.

The problem seems to be that although focus was being returned to the buttons, the screen wasn't updating itself to actually draw the focus. I was doing the check inside NeedsRendering, and asking for a redraw if necessary, but it looks like once just wasn't enough. So I changed the flag for the check from a bool to an int (set to 5) that gets decremented each time, causing a series of screen refreshes that seem to solve the problem.

Iain
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Regaining focus McBainUK 2 1,692 2009-12-31, 04:31 PM
Last Post: McBainUK
  Set focus to list McBainUK 4 2,057 2009-12-09, 07:54 PM
Last Post: whurlston
  Finding focus of a control? bgowland 1 1,249 2008-02-02, 06:02 AM
Last Post: bgowland
  Set focus to another process? bgowland 2 1,486 2008-01-12, 03:18 AM
Last Post: bgowland
  PostMessage() / IR32 No-Focus compatibility HydroChronic 1 1,570 2007-07-25, 06:36 PM
Last Post: sub
  Keeping GB-PVR in focus liteswap 6 2,334 2007-04-26, 04:07 PM
Last Post: pastro
  stopping the screensaver taking focus idkpmiller 2 1,554 2007-01-21, 12:43 AM
Last Post: idkpmiller
  I need to check if a specific process has focus idkpmiller 4 1,902 2007-01-15, 11:17 PM
Last Post: whurlston
  AxWMPLib.AxWindowsMediaPlayer in a form alwys has focus reven 8 4,098 2006-10-13, 11:44 AM
Last Post: reven

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

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

Linear Mode
Threaded Mode