NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 19 20 21 22 23 … 93 Next »
Popup box with buttons?

 
  • 0 Vote(s) - 0 Average
Popup box with buttons?
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#11
2008-06-29, 06:39 AM
I'm don't have a GetRenderList for the PopupBase since I figured it must be doing that internally, and calling stuff in the internal UI list.

Ok I'll override the getrenderlist.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#12
2008-06-29, 06:43 AM
Ok, got something displaying now, do you know how to mate the items button instead of normal list items??
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#13
2008-06-29, 06:10 PM
psycik Wrote:Ok, got something displaying now, do you know how to mate the items button instead of normal list items??
If I understand the question correctly, I just edited that item in my skin and specified a rows=1 to make it look like a button. I'm not sure if I attempted to use a UIButton instead or not.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#14
2008-06-29, 06:20 PM
psycik Wrote:Ok, got something displaying now, do you know how to mate the items button instead of normal list items??
What do you mean? I dont understand the question.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#15
2008-06-29, 07:58 PM
sub Wrote:What do you mean? I dont understand the question.

basically I got it to work by having a list in a popup. As in the items I have given to the list are UiSimpleList.Item. I couldn't figure out how to make a button ( UiButton )and add it either to a list or to a screen.

So the List is workable, and I'll just jimmy it around a bit so that the "items" look like buttons rather than a regular list object.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#16
2008-06-29, 10:55 PM
You dont need to do it exactly this way, but this was some bits I was able to cut and paste.

Code:
protected UiButton okButton;

Code:
PointF okOrigin = skinHelper2.getPlacementPos("OkButton");
            SizeF okSize = skinHelper2.getNamedImageRelativeSize("PopupCenterButtonNormal");
            okButton = new UiButton(skinHelper2, "OK", new RectangleF(okOrigin.X - (okSize.Width / 2), okOrigin.Y - (okSize.Height / 2), okSize.Width, okSize.Height), "PopupCenterButtonNormal", "PopupCenterButtonSelected");

Code:
protected override ArrayList getPostBackgroundRenderList()
        {
            // ok button
            ArrayList buttonRenderList = okButton.GetRenderList();
            renderList.AddRange(buttonRenderList);

            // probably other stuff like storing a list of button locations for testing with OnUiClick etc...

            return renderList;
        }


        public override void Dispose()
        {
            okButton.Dispose();
            base.Dispose();
        }

Hope that helps.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#17
2008-06-29, 11:00 PM
Ok, I might give this a go..... I suppose either way will work, it's just I'm running out of keys to do stuff. Big Grin
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#18
2010-01-08, 01:51 PM
sub Wrote:You dont need to do it exactly this way, but this was some bits I was able to cut and paste.

Code:
protected UiButton okButton;
Code:
PointF okOrigin = skinHelper2.getPlacementPos("OkButton");
            SizeF okSize = skinHelper2.getNamedImageRelativeSize("PopupCenterButtonNormal");
            okButton = new UiButton(skinHelper2, "OK", new RectangleF(okOrigin.X - (okSize.Width / 2), okOrigin.Y - (okSize.Height / 2), okSize.Width, okSize.Height), "PopupCenterButtonNormal", "PopupCenterButtonSelected");
Code:
protected override ArrayList getPostBackgroundRenderList()
        {
            // ok button
            ArrayList buttonRenderList = okButton.GetRenderList();
            renderList.AddRange(buttonRenderList);

            // probably other stuff like storing a list of button locations for testing with OnUiClick etc...

            return renderList;
        }


        public override void Dispose()
        {
            okButton.Dispose();
            base.Dispose();
        }
Hope that helps.
How does the button get keypress events? I was expecting a OnKeyDown method but UiButton doesn't have such a method.

How would the popup know that a button was pressed? In the main plugin it just overrides the handleCommand(string command) method.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#19
2010-01-08, 02:00 PM
Also in ShowDetailsPopup.xml there's this line:
<Placement name="FirstButton" loc="20.5,19" offset="5.5" />
Do you have a code sample for creating a vertical list of buttons?
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#20
2010-01-08, 03:39 PM
McBainUK Wrote:How does the button get keypress events? I was expecting a OnKeyDown method but UiButton doesn't have such a method.

How would the popup know that a button was pressed?
Typically in my plugin's OnKeyDown(), if the user presses OK, I check which button is selected, then call "handleCommand(selectedButton.GetName())"
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (3): « Previous 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Single row horizontal list in popup? cncb 4 2,255 2011-09-28, 09:48 PM
Last Post: cncb
  Disappearing popup message McBainUK 6 2,762 2010-11-04, 04:55 PM
Last Post: imilne
  Buttons on a popup tmrt 1 1,427 2010-09-28, 04:54 PM
Last Post: sub
  NPVR Popup sample mvallevand 3 1,673 2010-07-14, 07:54 PM
Last Post: mvallevand
  Too many buttons in plugin whurlston 7 2,504 2008-05-07, 07:04 PM
Last Post: whurlston
  Popup re-rendering whurlston 2 1,693 2008-05-03, 07:21 AM
Last Post: whurlston
  onKeyDown called on main plugin from Popup whurlston 1 1,403 2008-04-01, 07:59 AM
Last Post: whurlston
  Horizontal buttons in popups. whurlston 6 2,395 2008-03-30, 12:19 PM
Last Post: roy
  Skin Files - and Popup skin files psycik 1 1,314 2007-12-09, 03:16 PM
Last Post: sub
  Popup window idkpmiller 2 1,545 2007-04-30, 06:14 AM
Last Post: idkpmiller

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

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

Linear Mode
Threaded Mode