Is it possible to have a window or dialog close itself?
#1
Is it possible to have a window or dialog close its self after a delayed amount of time?

Is there function that acts like "onClick" that is self initiating?

Here is the code from the page i would like to have self close.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

<window type="dialog" id="9000">
<allowoverlay>no</allowoverlay>
<previouswindow>9000</previouswindow>

<animation effect="fade" start="100" end="0" time="2000">WindowOpen</animation>
<visible>Window.IsVisible(9000)</visible>

<controls>

<control type="group" id="9001">
<include>transistiontestsetup</include>
</control>

</control>
</controls>

</window>

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

any help would be appreciated.Eek

**Thanks
Reply
#2
Try this:

Code:
<window type="dialog" id="300">
    <defaultcontrol always="true">72</defaultcontrol>
    <allowoverlay>no</allowoverlay>
    <animation effect="fade" start="100" end="0" time="2000">WindowClose</animation>

    <controls>

        <control type="button" id="72">
            <onfocus>Dialog.Close(300)</onfocus>
            <posx>-1000</posx>
            <animation effect="fade" start="100" end="0" delay="5000" time="0">WindowClose</animation>
        </control>

        <control type="group" id="9001">
            <include>transistiontestsetup</include>
        </control>



    </controls>

</window>

I did the following:

1. Corrected the window ID. 9000 is typically used for the main group in a window. A list of the various system ID's for XBMC is here: http://wiki.xbmc.org/?title=Window_IDs

2. Added the button, ID 72. This is the key to the whole thing. If you look at the second line, <defaultcontrol> tells it what to give focus to as soon as the window opens. The <onfocus> tag tells it to close the window right away. Adding the animation with delay="5000" will make it wait 5 seconds, then fade the button out in 0ms then close the window.

3. Set the button's X position to -1000 so that it's off screen.

4. Removed a dupe <control> tag that was after group 9001.


Hopefully this works for you.
Reply
#3
Thank you very much for the help. the only problem is that the window opens and closes in less than a second. (it's probably something i did wrong).

Ultimately what i am trying to do, is, open a new window once the dialog closes.

example:
Lets say your on the home page.

you click the pictures link.

i would like a picture (in a dialog or new window) to display (for 3 seconds or so...).

then i would like that window to call the pictures page.


SO:

Window 0 (Calls)Activate.Window(300)
Window 300 (Calls)Activate.Window(2) (After displaying a picture for 3 sec.)


Is that possible?

**Thanks AgainHuh
Reply
#4
See if this works for you:

Code:
<window type="dialog" id="300">
    <defaultcontrol always="true">72</defaultcontrol>
    <allowoverlay>no</allowoverlay>
    <animation effect="fade" start="100" end="0" time="2000">WindowClose</animation>

    <controls>

        <control type="button" id="72">
            <onfocus>ReplaceWindow(2)</onfocus>
            <texturenofocus>-</texturenofocus>
            <texturefocus>-</texturefocus>
            <animation effect="fade" delay="3000" end="100">Focus</animation>
        </control>

        <control type="group" id="9001">
            <include>transistiontestsetup</include>
                        <animation type="WindowOpen">
                <effect type="fade" start="0" end="100" reversible="false"  time="200" />
            </animation>
            <animation type="WindowClose">
                <effect type="fade" start="100" end="0" reversible="false" delay="3000" time="100" />
            </animation>
        </control>



    </controls>

</window>
Reply
#5
i got it working perfectly. you are awesome.

thank you very much for the coding help.
Reply
#6
TheWhiteRabbit Wrote:i got it working perfectly. you are awesome.

thank you very much for the coding help.

Anytime. Should be interesting to see what you're cooking up. Wink
Reply
#7
This was incredible helpful, thanks!
Reply
#8
Hello digitalhigh!

I use this skript and it works good - i use it to show buttons for player controls, but when one of this buttons is used or focused - the dialog will never closed alone ..... why?

can u help me?

here my used script:



<window type="dialog" id="3331">
<defaultcontrol always="true">72</defaultcontrol>
<allowoverlay>no</allowoverlay>
<animation effect="fade" start="100" end="0" time="2000">WindowClose</animation>

<controls>

<control type="button" id="72">
<onfocus>Dialog.Close(3331)</onfocus>
<texturenofocus>-</texturenofocus>
<texturefocus>-</texturefocus>
<animation effect="fade" delay="3000" end="100">Focus</animation>
</control>

<control type="group" id="9001">
<include>CommonNowPlaying_Controls_Complete</include> <-- this are the player buttons!
<animation type="WindowOpen">
<effect type="fade" start="0" end="100" reversible="false" time="200" />
</animation>
<animation type="WindowClose">
<effect type="fade" start="100" end="0" reversible="false" delay="3000" time="100" />
</animation>
</control>



</controls>

</window>
-- please forgive me for my bad english -- :blush:
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to have a window or dialog close itself?0