Jump to content

AVIs on Tabs on GUI


Schlumpf
 Share

Recommended Posts

Hi,

I've a problem with AVIs on a GUI. I'd like to display an AVI an a tab on a GUI. OK, that works. But know I want change the AVI (display another avi). I don't works with "GuiCtrlSetData", so I tried to delete the old AVI and create a new one. But now the AVI isn't on the tab, but on the GUI over the tabs:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 420, 207, 188, 173)
$Tab1 = GUICtrlCreateTab(4, 4, 405, 193)
$TabSheet1 = GUICtrlCreateTabItem("Tab 1")
$Avi1 = GUICtrlCreateAvi("shell32.dll", 161, 16, 36, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
$Label1 = GUICtrlCreateLabel("1. The AVI is only on this tab.", 16, 104, 142, 17)
$Label2 = GUICtrlCreateLabel("2. change AVI (using: GuiCtrlDelete, GuiCtrlCreateAvi)", 16, 120, 257, 17)
$Button1 = GUICtrlCreateButton("Change AVI", 28, 136, 75, 25, 0)
$Label3 = GUICtrlCreateLabel("3. You can see the AVI on all Tabs...", 16, 164, 178, 17)
$TabSheet2 = GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlDelete($Avi1)
            $Avi1 = GUICtrlCreateAvi("shell32.dll", 170, 16, 36, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
    EndSwitch
WEnd

I hope you understand my problem, but how can I solve it?

[CENTER]Sorry for my bad English... ;)[/CENTER]

Link to comment
Share on other sites

You could do this, but it means you have to know what avi's you want when you write the script.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 420, 207, 188, 273)

$Tab1 = GUICtrlCreateTab(4, 4, 405, 193)
$TabSheet1 = GUICtrlCreateTabItem("Tab 1")
$Avi1 = GUICtrlCreateAvi("shell32.dll", 161, 16, 36, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
$Avi3 = GUICtrlCreateAvi("shell32.dll", 170, 16, 36, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
GUICtrlSetState($Avi3,$GUI_HIDE)

$Label1 = GUICtrlCreateLabel("1. The AVI is only on this tab.", 16, 104, 142, 17)
$Label2 = GUICtrlCreateLabel("2. change AVI (using: GuiCtrlDelete, GuiCtrlCreateAvi)", 16, 120, 257, 17)
$Button1 = GUICtrlCreateButton("Change AVI", 28, 136, 75, 25, 0)
$Label3 = GUICtrlCreateLabel("3. You can still only see the AVI on Tab 1.", 16, 164, 178, 17)
$TabSheet2 = GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetState($Avi1,$GUI_HIDE)
            GUICtrlSetState($Avi3,$GUI_SHOW)
            GUICtrlSetState($Avi3,$GUI_AVISTART)
            
    EndSwitch
WEnd

There must be a way to change the file an avi is playing but I don't know how.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

That's the problem. I don't know what AVI should the script has to display. The User can decide it. I postet this Question in 3 Forums but nobody could help me.

Here is another sample:

#include <GUIConstants.au3>
 
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 457, 157, 186, 194)
$Tab1 = GUICtrlCreateTab(4, 4, 313, 145)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$Avi1 = GUICtrlCreateAvi("shell32.dll", 160, 20, 40, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
$Button1 = GUICtrlCreateButton("Load AVI", 20, 108, 271, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$Input1 = GUICtrlCreateInput(""&@systemdir&"\shell32.dll, 160", 12, 48, 297, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
$Label2 = GUICtrlCreateLabel("Loaded AVI:", 12, 32, 73, 17)
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("If you click to [Load AVI], you can display another AVI.", 324, 4, 126, 145)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $neu = FileOpenDialog("AVI laden...", @DesktopDir, "Avi-Videos (*.avi)")
            If @error <> 1 Then
                GUICtrlDelete($Avi1)
                $Avi1 = GUICtrlCreateAvi($neu, -1, 16, 36, 272, 60, BitOR($ACS_TRANSPARENT,$ACS_AUTOPLAY))
                GUICtrlSetData($Input1, $neu)
            EndIf
    EndSwitch
WEnd
Edited by Schlumpf

[CENTER]Sorry for my bad English... ;)[/CENTER]

Link to comment
Share on other sites

Your code looks ok to me.

The result you experience is definately suspect.

Use your first code as the example and post it as a possible bug query in the BUG forum

Admin will soon advise if a bug or not

HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...