[mythtv] Plugin UI: Creating Buttons
    Paul Harrison 
    mythtv at dsl.pipex.com
       
    Tue Jan 23 11:27:12 UTC 2007
    
    
  
Jeremy Gillick wrote:
> I'm trying to create my first full plugin and am having trouble figuring 
> out how to create buttons.  I want to display a number of simple textual 
> buttons, but all the examples I see in other plugins reference images.  
> Can somebody explain how to create a simple button or point me to a good 
> reference?
>
> For more information, here's what I'm trying to do:  My wife likes the 
> way Tivo lets you find programs to record, so I'm trying to duplicate 
> that in myth.  It's a simple interface that finds and lists programs as 
> you select letters.  It looks something like this:
>
>  Batt           |
> ----------      |
> DEL CLR SPACE   | Batters Up
> A B C D E       | Battle of the Bulge
> F G H I J       | Battlestar Galactica
> K L M N O       |
> P Q R S T       |
> U V W Z Y       |
> Z               |
>
> As you select letters, they automatically get appended to the word above 
> and the list on the right is narrowed down.  When your program is 
> displayed on the right, you can use the right arrow button to go to that 
> side and select the program.  For example, if 'J' is selected, pressing 
> the right arrow would select 'Battlestar Galactica'.
>
> Any thoughts on how to build this interface and code would be very helpful.
>
> Thanks,
> Jeremy
>
>   
I take it your misses doesn't like the existing Program Finder :-) It 
almost does what you want already except you can only search on the 
first letter.
 
One possibility would be to use the UIKeyboardType defined in 
/libmyth/uitype.h its used by the virtual keyboard but there is no 
reason why you couldn't use it embedded on another MythThemedDialog. 
Take a look at libmyth/virtualkeyboard.h/cpp for how its used and 
themes/default/keyboard/* for the xml files that define the layout 
files; they are actually just normal UI files that define a themed 
dialog so you can add any UITypes you want.
Paul H.
    
    
More information about the mythtv-dev
mailing list