Jump to content

Childs GUI


banged
 Share

Recommended Posts

Hello, i have issues with my code

If not WinSetTrans (line 44.45 - Both, red and yellow), Then not Show Childs                               (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !!
if WinSetTrans (line 44.45 - Both, red and yellow) , Then  Show Childs, why NEED WinSetTrans??             (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !!
if WinSetTrans Child1(RED) ONLY, then Show Child1(RED)                                                     (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Child not show !!
if WinSetTrans (line 44 Child2(Yellow) ONLY), then Show Child1(RED) & Child2(Yellow), Why show Both ????     (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !!

 With $WS_POPUP (and $WS_EX_MDICHILD ) i have not above problems, but i need use $WS_CHILD
 Problems with $WS_POPUP : if change windows resolution (and restore next time), then childs change position on main form
                       : i Need WinSetTrans on all GUIS when fade,with popup i need winsettrans all guis one by one
                        : on minimize,restore Main GUI ,childs not following windows minimize/restore effect

 First i Create  Child1, Second Child2, Why Child1 is above child2 ? (i need child2 above child1, and i don't want create firts the child2 or this is only way???)

#include <GuiConstants.au3>

Global $idButton2,$pp1,$pp2,$bShow = True

$Main_GUI = GUICreate("Main", 1000,500,Default,Default)
;_BK() ;<--------- FAIL

$Child1_GUI = GUICreate("Child1", 700,200, 220, 200, $WS_CHILD+$WS_THICKFRAME,Default, $Main_GUI)
$idButton = GUICtrlCreateButton("RED",25,25,50,30)
GUISetBkColor (0xFF334C, $Child1_GUI ) ; RED

$Child2_GUI = GUICreate("Child2", 700,200, 30, 200,$WS_CHILD, Default, $Main_GUI)
$test = GUICtrlCreateButton("Yellow",10,10,250,20)
GUISetBkColor (0xFFff4C, $Child2_GUI ) ; Yellow

_BK() ;<--------- SUCCES

Func _BK()
    GUISwitch($Main_GUI)
    $pp1 = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg",0,0,1000,500)
    GUICtrlSetState($pp1,$GUI_DISABLE)
    $pp2 = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg",200,100,600,350)
    GUICtrlSetState($pp2,$GUI_DISABLE)
    $idButton2 = GUICtrlCreateButton("Main",0,300,280,30)
    $idButton3 = GUICtrlCreateButton("Main2",0,315,280,30)
EndFunc

GUISetState(@SW_SHOW, $Main_GUI)
GUISetState(@SW_SHOW, $Child1_GUI)
GUISetState(@SW_SHOW, $Child2_GUI)













WinSetTrans($Child1_GUI,"",200) ;RED
WinSetTrans($Child2_GUI,"",100) ; Yellow


while 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case -3
            _Fade($Main_GUI,"out",254)
            Exit

        Case $idButton,$test
            For $i = 254 To 0 Step - 4
                Sleep(10)
                WinSetTrans($Main_GUI,"",$i)
            Next
            For $i = 0 To 254 Step 4
                Sleep(10)
                WinSetTrans($Main_GUI,"",$i)
            Next
        Case $idButton2
            If $bShow = True Then
                GUISetState(@SW_HIDE, $Child2_GUI)
                GUISetState(@SW_HIDE, $Child1_GUI)
                $bShow = False
            Else
                GUISetState(@SW_SHOW, $Child2_GUI)
                GUISetState(@SW_SHOW, $Child1_GUI)
                $bShow = True
            EndIf
    EndSwitch
wend

Func _Fade($hHdl,$InOut,$iMax = 255,$iSpeed = 4)
    If $InOut = "out" Then
        For $i = $iMax To 0 Step - $iSpeed
            Sleep(10)
            WinSetTrans($hHdl,"",$i)
        Next
    Else
        For $i =  0 To $iMax Step $iSpeed
            Sleep(10)
            WinSetTrans($hHdl,"",$i)
        Next
    EndIf
EndFunc

 

Edited by banged
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

×
×
  • Create New...