Need help to make a custom window visible
#1
Hello,

I'm trying to add a custom dialog window and make it visible each time an other window opens. In my example a variation of DialogVolumeBar.xml should show up each time the music library window is opened. Unfortuneatly the dialog window doesn't show up.

Here ist my custom window code, file custom7.xml (tried with confluence):
Code:
<window id="4568">
    <defaultcontrol>1</defaultcontrol>
    <visible>Window.IsActive(musiclibrary)</visible>
    <controls>
        <control type="group">
            <posx>820</posx>
            <posy>0</posy>
            <control type="image">
                <posx>0</posx>
                <posy>-10</posy>
                <width>300</width>
                <height>50</height>
                <texture flipy="true" border="20,20,20,2">InfoMessagePanel.png</texture>
            </control>
            <control type="group">
                <control type="image">
                    <description>Lite Volume Logo</description>
                    <posx>10</posx>
                    <posy>0</posy>
                    <width>40</width>
                    <height>35</height>
                    <aspectratio>keep</aspectratio>
                    <texture>VolumeIcon.png</texture>
                </control>
                <control type="progress" id="1">
                    <description>progress control</description>
                    <posx>50</posx>
                    <posy>8</posy>
                    <width>230</width>
                    <height>18</height>
                    <info>Player.Volume</info>
                </control>
            </control>
        </control>
    </controls>
</window>

What is wrong or missing to show this custom window when the musiclibrary window is open.

Thanks for some hints an tips in advance.

Greetings,

xbmcstarter
Reply
#2
I think you may need to specify that this is a dialog via <type>dialog</type> ?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Yes, the <type>dialog</type> is missing. I added it, but the result is the same. :-(

Could someone please try the code, maybe something else is wrong? Is there a debug possibity to check whether there is a syntax error or the visible condition doesn't become true as expected?
Reply
#4
I tried it out, and you can get it to work; but to show up on every page I think you are going about it the wrong way.
In order to see your window, you need something to activate the window as a control (ActivateWindow(4568)). You can do this when a window opens, or have a button that the user clicks. Once your window is activated though, you need to return control to another window on the screen or you aren't going to be able to navigate anything. That is the problem I had with yours, I could get it to work, but then the rest of the screen was useless.
What you probably want to do if you want this to show up on every screen is to make it an include that can be added to the existing window pages and just be rendered when they are loaded. If you need to highlight and have user input to these controls you'll need to modify the existing skin further to allow users to jump from one control to the next, and then back to the main window controls (SetFocus() calls).

Hope this helps a bit.
Reply
#5
No you don't. Custom dialogs can pop up at any point in time using visibility.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
Someone might want to change the wiki page on this then, because that is exactly what it says - http://wiki.xbmc.org/?title=Window_Struc...ra_Windows

It is also the only way I was able to get this window to show up. I'm wondering if you are adding this dialog to the Home.xml window for instance, how does it know to pull in the custom_7.xml file if you don't somehow use the ActivateWindow() function?
Reply
#7
It doesn't say that that's the only way to get the window up - it's just the usual way, as in general people want focusable controls on that window so that users can interact with it.

Any modeless dialog can be brought up solely on the base of a <visible> condition - that's how the volume and seekbar dialogs function for instance.

If it's not working for custom windows, then it's likely that there's a problem elsewhere. I'll take a look in a bit.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
Thanks for the info. I guess I'm just confused, since XBMC knows to load home.xml when you are on the home screen, but how does it know to load a custom .xml file when you don't have any calls pulling it in. I'll take a closer look at the volume and seekbar dialogs and see if it clears things up a bit for me.
Reply
#9
It loads them when the skin loads - it has to do this so it knows which windows are available to switch to when you do ActivateWindow(4368). How else would it know what the window with id 4368 is?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
jmarshall Wrote:It loads them when the skin loads - it has to do this so it knows which windows are available to switch to when you do ActivateWindow(4368). How else would it know what the window with id 4368 is?

Ok, I think I have it now. I found this page on the wiki:
http://wiki.xbmc.org/?title=HOW-TO_make_...a_skinning

I think my big problem in understand was that when in one window I could not understand how XBMC would know to reference another window without some sort of call or reference to that window. In my mind I guess it was similar to some kind of include - you can have all sorts of conditions in the include, but if your xml file doesn't use the <include> tag you will never pull in the control to see it.
If I'm understanding it right, XBMC will read in all the files and window ids when the skin loads, and when in a window (like Home.xml) if I have a dialog that meets its visible condition while I'm in that window (like volume) it will just 'show up' as it is supposed to, no additional includes or references required? Furthermore this holds true with custom dialogs and not just system defined ones like volume?
Sorry if this is seeming redundant to you, I normally don't have this big of a problem grasping a concept, but it seems there is just one key piece eluding me here. Thanks.
Reply
#11
XBMC loads all custom windows at skin load, yes. The only reason we do this is so that we can ascertain their id, name, xml name and type. All the built-in windows don't need to be loaded as we already know all about them (their id, name, xml name, type).

Now that we know all the window's, we know which ones are dialogs (and we no longer care whether they're custom or built-in) and every frame we check these dialogs to see if they should be automatically shown or not based on their <visible> tags.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Need help to make a custom window visible0