Sign in to follow this  
Followers 0
zvvyt

Parent GUI w/ backgroundimage and transparent child GUI ontop?

16 posts in this topic

Hello there!

The idea I'm having is the following:

To have a GUI with the left half scrollable and to have a background image which is "fixed" and won't be moved with the scrolling.

To do this I've so far come up with:

Placing the backgrond image onto a parent GUI

Creating a child GUI to the parent, ontop of the left half of the parent

Using "GUIScrollbars_Ex.au3" to easy insert my scrollbars into the child gui

The problem I'm having is that the background image places itself ontop of the child GUI, making the child not visible.

I have tried placing the same background image into the child GUI to recieve the same result I want, but by doing so the image will move with my scrolling. (The right half of the parent is covered by another image, so that's why I'm able of placing the same background image into the child GUI)

If I'm somehow able of placing the background image "behind" the child GUI I could use either a transparent .GIF or .PNG to make the child window show the image aswell as my controls.

Any direct thoughts about this, or do you need me to post some of the code?

Best regards,

Share this post


Link to post
Share on other sites



zvvyt,

do you need me to post some of the code?

Yes please - then we will see exactly what you have done so far. ;)

M23

P.S. When you post your code please use Code tags - put [autoit] before and [/autoit] after it. :)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Alrighty then! ^__^

I took only the parts about GUIs and their controls now, which I recon are what matters.

#include <ButtonConstants.au3>
#include "GUIScrollbars_Ex.au3"





$MainWindow = GUICreate("Main Window", 800,500,-1,-1,-1)
;$ItemBackground = GUICtrlCreatePic(".\..\LoL Recommended Builder\ItemsBackground.jpg",0,0,900,600,$bs_flat) ;--------Here's the background image stated in my last post
GUICtrlSetState($ItemBackground,$gui_disable)
$Border = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Border.jpg",802-260*(500/390)-38,0,38,500,$bs_flat)
$ChampionSplash = GUICtrlCreatePic("",802-260*(500/390),"",260*(500/390),390*(500/390),$BS_FLAT)
$ButtonCC = GUICtrlCreateButton("Change Champion",700,0,95,25,$GUI_NOFOCUS)
$RecItem1 = GUICtrlCreateIcon("icons.dll","NOITEM",470,440,50,50)
$RecItem2 = GUICtrlCreateIcon("icons.dll","NOITEM",525,440,50,50)
$RecItem3 = GUICtrlCreateIcon("icons.dll","NOITEM",580,440,50,50)
$RecItem4 = GUICtrlCreateIcon("icons.dll","NOITEM",635,440,50,50)
$RecItem5 = GUICtrlCreateIcon("icons.dll","NOITEM",690,440,50,50)
$RecItem6 = GUICtrlCreateIcon("icons.dll","NOITEM",745,440,50,50)
$HighlightRecItem = GUICtrlCreateGroup("","","","","")
GUICtrlSetState(-1, $gui_hide)
$HighlightSelectedItem = GUICtrlCreateGroup("","","","","")
GUICtrlSetState(-1, $gui_hide)
$Read = FileReadLine("List.ini",2)
$ItemDropdown = GUICtrlCreateCombo("",50,50,200,45)
GUICtrlSetState(-1,$gui_hide) ;--------------------------------------------------------------------------------------------Temp. Hidden
GUICtrlSetData(-1,$Read)
$SelectedItem = GUICtrlCreateIcon("","",300,100,64,64)
$BackButton = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Back.jpg",165,370,100,30) ;Back-button
GUICtrlSetState(-1,$gui_hide)
GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\ItemTextBackgroundDark.jpg",0,400,430,100) ;Background for itemtext
$ItemText = GUICtrlCreateLabel("",10,410,420,80)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@sw_hide,$MainWindow)


;-----------------------------------------------------------------------------Child Windows----------------------
$CatWindow = GUICreate("Main Category Window",430,400,0,0,$ws_child,"",$MainWindow) ;First child-window with the main categories
;$ItemBackground = GUICtrlCreatePic(".\..\LoL Recommended Builder\ItemsBackground.jpg",0,0,900,600,$bs_flat);----And here is where I tried placing the background again.
$CatDefense = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Defense.jpg",115,45,200,40)
$CatAttack = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Attack.jpg",115,110,200,40)
$CatMagic = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Magic.jpg",115,175,200,40)
$CatMovement = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Movement.jpg",115,240,200,40)
$CatConsumables = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Cat.Consumables.jpg",115,305,200,40)
GUISetState(@sw_hide,$CatWindow)

$CatWindowDefense = GUICreate("Defense",430,400,0,0,$ws_child,"",$MainWindow) ;A child-window showing the defense subcats
$DefenseSubcatHealth = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\SubCat.Health.jpg",115,45,200,40)
$DefenseSubcatMagicResist = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.MagicResist.jpg",115,110,200,40)
$DefenseSubcatHealthRegen = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.HealthRegen.jpg",115,175,200,40)
$DefenseSubcatArmor = GUICtrlCreatePic(".\..\LoL Recommended Builder\Images\Layout\Subcat.Armor.jpg",115,240,200,40)
GUISetState(@SW_HIDE)

Best regards

Share this post


Link to post
Share on other sites

zvvyt,

That script looks very much as if it is game-related (League of Legends) - you have read the Forum Rules I take it? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

That script looks very much as if it is game-related (League of Legends) - you have read the Forum Rules I take it? :)

It is correct, that game is made "for" League of Legends!

I dunno if you're a player yourself or not, but the meaning of this program is to make a visual solution for a function created by Riot games themselves.

I'll describe this in short:

Ingame each champion has got a "Recommended build", an item build that if you follow it you'll do "good" in game with that character.

There's a way of making your own "Recommended build" for whichever champion you'd like, but to do so you have to type all the specific item numbers and such into a .ini file, all this implemended by Riot Games.

It works outside of "LoL", so it's nothing really to do with the game itself, therefor I take it this is allowed to take up for discussion? ;)

More about this function can be read here: http://na.leagueoflegends.com/board/showthread.php?t=1177803 where their "tech support" explains how to do this yourself w/ the .ini and so ^__^

Best regards,

Share this post


Link to post
Share on other sites

zvvyt,

I am not a gamer so I have no idea what you are talking about. I am locking this thread until I can find out more. Please accept my apologies in advance if this is an unnecessary precaution. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

As long as this remains a purely GUI question I'm going to allow this. There's no manipulation of the game here. There's no manipulation of the INI file, either. As long as this discussion remains strictly on the GUI it's fine.

Share this post


Link to post
Share on other sites

You can create the ScrollBar this is the basic code

#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hParent=GUICreate('',400,500)
GUICtrlCreatePic('Tc3.jpg',0,0 ,400,500)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW,$hParent)
$h_Child=GUICreate('',100,300,10,10,$WS_POPUP,$WS_EX_MDICHILD,$hParent)
GUISwitch($h_Child)
GUICtrlCreateEdit('',10,10,90,290)
GUISetState(@SW_SHOW,$h_Child)
Local $nMsg[1]
While $nMsg[0]<>-3
$nMsg=GUIGetMsg(1)
WEnd

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

First of all: Thank's for unlocking the thread! =)

You can create the ScrollBar this is the basic code

#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hParent=GUICreate('',400,500)
GUICtrlCreatePic('Tc3.jpg',0,0 ,400,500)
GUICtrlSetState(-1,$GUI_DISABLE)
GUISetState(@SW_SHOW,$hParent)
$h_Child=GUICreate('',100,300,10,10,$WS_POPUP,$WS_EX_MDICHILD,$hParent)
GUISwitch($h_Child)
GUICtrlCreateEdit('',10,10,90,290)
GUISetState(@SW_SHOW,$h_Child)
Local $nMsg[1]
While $nMsg[0]<>-3
$nMsg=GUIGetMsg(1)
WEnd

By adding the $WS_POPUP,$WS_EX_MDICHILD to the child made it be ontop and in position, but it "flickers" a bit when it "popups". Is that avoidable? Or do I "have to live with it?"

And then to the child gui being transparent: Ain't that possible to achieve w/ GuiCtrlCreatePic and a transparent .GIF? Or do I need to use GDI+ and a transparent .png?

Share this post


Link to post
Share on other sites

Ain't that possible to achieve w/ GuiCtrlCreatePic and a transparent .GIF?

If u r dealing with GIF's then Tracexx UDF will sound helpful

herez the link :

but it "flickers" a bit when it "popups". Is that avoidable? Or do I "have to live with it?"

I dont see any flicker with my code

Regards

Phoenix XL


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

If u r dealing with GIF's then Tracexx UDF will sound helpful

herez the link :

Link seem to be broken, but found it by Google.

Can I recieve same transparent result with .GIF as with .PNG? First time dealing with this matter so I have no clue >__<

I dont see any flicker with my code

Could be becuase I'm having another GUI up before the parent and child one.

EDIT: Fixed by reorganizing the GuiSetState-commands

Best regards,

Edited by zvvyt

Share this post


Link to post
Share on other sites

I haven't carefully read everything in this thread but I notice you keep referring to a transparent child. Transparent child windows are not so easy but you can do it in AutoIt if you have a child with the style $WS_EX_MDICHILD.

Here is a simple example

#include <windowsconstants.au3>
#include <winapi.au3>

$G1 = GUICreate("Parent")
GUICtrlCreateButton("quite a long button across the middle of the parent gui",20,200)
GUISetState()

$C1 = GUICreate("child",200,300,0,0,-1,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$G1)
GUISetBkColor(0xacbdef);set the child background to some colour which we can set as the transparent colour
$btn1 = GUICtrlCreateButton("a button",20,50)
GUISetState()
_WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

sleep(9000)
1 person likes this

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.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I haven't carefully read everything in this thread but I notice you keep referring to a transparent child. Transparent child windows are not so easy but you can do it in AutoIt if you have a child with the style $WS_EX_MDICHILD.

Here is a simple example

#include <windowsconstants.au3>
#include <winapi.au3>

$G1 = GUICreate("Parent")
GUICtrlCreateButton("quite a long button across the middle of the parent gui",20,200)
GUISetState()

$C1 = GUICreate("child",200,300,0,0,-1,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$G1)
GUISetBkColor(0xacbdef);set the child background to some colour which we can set as the transparent colour
$btn1 = GUICtrlCreateButton("a button",20,50)
GUISetState()
_WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

sleep(9000)

Your code worked like a charm on the transparancy! =D

Now it's just that when I click on a picture control in the child gui, an earlier hidden window comes back visible ... Just by adding the

bitor($WS_EX_MDICHILD, $WS_EX_LAYERED

and

GUISetBkColor(0xacbdef) _WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255)

Feels quite strange for me that this could happen. Will have a deeper look into it tomorrow.

EDIT: By removing the style $ws_child and replace it with $ws_popup I got away from the problem where another window would pop up. Dunno how, dunno why. Could be that something collided when I used both $ws_child and $ws_ex_mdichild.

Thanks for all your help in this matter! =D Much appreciated!

Edited by zvvyt

Share this post


Link to post
Share on other sites

Melba23

Melba23

Yes, me!

  • Posted Image
  • Moderators (Mod)
  • Posted Image
  • 11,757 posts
  • Gender:Not Telling
  • Location:Where never lark or even eagle flew

Posted Today, 03:50 AM

meows,

Regardless of whether you wrote the game or not, the Forum Rules prohibit the discussion of any script which interacts with or launches a game. Your script does exactly that and so is not permitted here - this thread is now locked. :naughty:

Please make sure your future posts are within the rules. :)

M23

This is not fair. I got locked for asking how to make a graphic buttom user clickable and I built the game. Some folks have friends in higher places than I do.

But thanks for the questions and answers. I learned a bit.

Share this post


Link to post
Share on other sites

meows,

This script did not interact with the game in any way as Valik makes quite clear:

There's no manipulation of the game here. There's no manipulation of the INI file, either

Your script by your own admission launches the game - which is prohibited under the Forum rules

Case $Icon1
        $Icon1= ShellExecuteWait("C:0aTestlvl3.exe", "","C:0aTest", "")
        ShellExecuteWait("C:0aTestChina2a.exe", "","C:0aTest", "")
EndSelect

That is the difference and that is why your thread was locked. :naughty:

And posting in another thread like this is not the way to make me change my mind. I will consider what to do with you during my drive home. :mad:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

meows,

I have now returned home, eaten and deliberated as to what I am going to do.

I have always made it clear that if I lock a thread I am quite prepared to listen to reasoned argument as to why I should not have done so. On several occasions - and this thread is a good case in point - the thread has indeed been reopened. But I will only reopen a thread if the OP can convince me that there is good reason to do so. In the thread to which you are referring you made it quite clear that the script was to launch a game - which is quite clearly prohibited under the Forum Rules. As I pointed out in the thread, it does not matter: if you wrote the game; if it is single player; if it is for your use only - the rules are quite clear:

"Do not discuss any of the following:

Automating games or game servers. This rule is zero tolerance. Any discussion of using AutoIt to launch or interact with a game or game server violates our rules"

As I stated in my earlier post, the script in this thread does not interact with the game while your script does - hence the difference in moderation. :mellow:

But you, instead of arguing reasonably, decide on an imflammatory post suggesting that there is favouritism and corruption with in the ranks of the Moderators. While I was quite prepared to let your initial thread pass by without imposing sanctions, I am not prepared to stand by while you attack the honour and integrity of those volunteers who give up their time to keep this forum the sort of place the majority of members wish it to be. If you cannot abide by the rules as set out by the forum owner and argue against those who enforce them - in as just a manner as they can - then you obviously forfeit your right to use the forum. :mad:

You will be unable to post for a month. When and if you return, either abide by the rules and show respect for those whose task it is to apply them or you will find yourself permanently removed. You have used up any shred of flexibility that I may have been prepared to show you - any attempt to PM me about this will result in an immediate block. :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • Jibberish
      By Jibberish
      Hi,
      I am automating the testing of a video player. I search a file for ".mp4" and want to create a GUI with radio buttons to select what video to play. The number of videos can change based on the user's library so this must be created automatically.  I have searched for how to accomplish this and there are several posts out there that help a little but I can't figure out the solution. I pulled the offending code from my main script and created the file below to make this easier to read. I am sure one of our experts here can help!
      #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <array.au3> #include <File.au3> #include <GUIConstantsEx.au3> Local $sMediaFile = "D:\MediaFiles\MediaFiles.txt" Local $iStrReturn = 0 Local $aText Local $aArrayFile Local $iMax = 6 ;Default number of Videos - 1 for the array counter Local $aVideoName[$iMax] = [0] Local $sCheckBox1 Local $iT = 0, $iVideoCount = 0, $iCount Local $ix = 0 Local $iy = 0 Local $idClose1 Const $iL = 10 ; Count from Left for GUI so all buttons line up ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Read a list of video file names and create a GUI with Radio Buttons to select a single video. ; Problem: We don't know how many video names will be in the text file, so we can't hard code Case Statements & their variables ; Put the Video File Names into an Array _FileReadToArray($sMediaFile, $aArrayFile) For $a = 1 To $aArrayFile[0] ; Step through the array looking for .mp4 If StringInStr($aArrayFile[$a], ".mp4") Then $iVideoCount = $iVideoCount + 1 $aText = StringSplit($aArrayFile[$a],"\\") ; This video player reads double backslashes For $a1 = 1 to $aText[0] ; Check that the array is big enough If StringInStr($aText[$a1], ".mp4") Then ;MsgBox(0,"","Video is " & $aText[$a1]) If UBound($aVideoName) = $iVideoCount Then ; Resize the array when $iCount is equal to the element count in the array to prevent subscript error ReDim $aVideoName[$aVideoName[0] + $iMax] EndIf $aVideoName[$iVideoCount] = $aText[$a1]; add data to new index element $aVideoName[0] = $a1 ; update the index count for future reference ; The idea is to create a GUI width to accommodate long video file names $it = StringLen($aVideoName[$iVideoCount]) If $iT > $ix Then $ix = $iT EndIf EndIf Next EndIf Next ; Move backwards through the array deleting blank rows For $iCount = UBound($aVideoName) - 1 To 0 Step -1 If $aVideoName[$iCount] = "" Then _ArrayDelete($aVideoName, $iCount) EndIf Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Create the GUI - Names and Radio Button counts will vary - How do I do this? ; ;_ArrayDisplay($aVideoName) ;Local $aVarName[$aVideoName[0]] Local $iRows = UBound($aVideoName, $UBOUND_ROWS) $iRows = $iRows -1 $aVideoName[0] = $iRows ; Prep the GUI to display the FileNames with Radio Buttons - Can only select one at a time. $a = 0 $ix = $ix + 200 $iy = ($aVideoName[0] * 30) + 60 $hGUI = GUICreate("Videos", $ix, $iy) ;$iT = $iT+30 ; Create the variable names for the Case statement - Video count may change so Video Names displayed and GUICtrlCreateRadio count may change. ;~ For $a = 1 to $aVarName[0] ;~ If UBound($aVarName) = $aVarName Then ;~ ; Resize the array when $iCount is equal to the element count in the array to prevent subscript error ;~ ReDim $aVarName[$aVarName[0] + $iMax] ;~ EndIf ;~ Assign("$bVideoName" & $a, $a) ;~ Local $aVarName[$a] = Eval($bVideoName[$a]) ;~ ; $aVarName[$a] = GUICtrlCreateRadio($aVarName[$a], $iL, $iT) ;~ Next $iCount = 1 ;MsgBox(0,"","VideoName[0] is "&$aVideoName[0]) ;_ArrayDisplay($aVideoName) Local $bVideoName1 If $iCount < $aVideoName[0] Then $bVideoName1 = GUICtrlCreateRadio($aVideoName[$iCount], $iL, $iT) GUICtrlSetState($bVideoName1, $GUI_CHECKED) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName2 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName3 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0]) Then Local $bVideoName4 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName5 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName6 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iCount = $iCount + 1 If $iCount <= ($aVideoName[0] -1) Then Local $bVideoName7 = GUICtrlCreateRadio($aVideoName[$iCount],$iL,$iT) $iT = $iT+30 EndIf $iT = $iT + 30 $idClose1 = GUICtrlCreateButton("Go!", $iL, $iT) GUISetState(@SW_SHOW) ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ; Switch Statement ; ;Local $nMsg = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $bVideoName1 Case $bVideoName2 Case $bVideoName3 Case $bVideoName4 Case $bVideoName5 ;Case $bVideoName6 <- Fails because there are only 5 videos - Need variable $bVideoNames ;Case $bVideoName7 <- Fails because there are only 5 videos Case $idClose1 $bVideoName1 = GUICtrlRead($bVideoName1) $bVideoName2 = GUICtrlRead($bVideoName2) $bVideoName3 = GUICtrlRead($bVideoName3) $bVideoName4 = GUICtrlRead($bVideoName4) $bVideoName5 = GUICtrlRead($bVideoName5) ;$bVideoName6 = GUICtrlRead($bVideoName6) ;$bVideoName7 = GUICtrlRead($bVideoName7) ExitLoop EndSwitch WEnd GUIDelete($nMsg) MsgBox(0,"","Case " & $nMsg & " was selected.") ; Always returns 8. ??? This is the "MediaFiles.txt" file I am reading:
      D:\\MediaFiles\\BigBuckBunny.mp4 D:\\MediaFiles\\BigBuckBunny60fps.mp4 D:\\MediaFiles\\Sintel.mp4 D:\\MediaFiles\\sintel-2048-surround.mp4 D:\\MediaFiles\\TearsOfSteel.mp4 D:\\MediaFiles\\tearsofsteel_4K.mp4 I'm sure I have several mistakes (or poor coding methods) in my AutoIt file.
    • Skeletor
      By Skeletor
      Hi All,
      I know many newbies search for this feature.
      I decided to share this piece of code with everyone.
      Basically its a "splash screen" that has a transparent image.
      In a nutshell - Gui with a transparent gif.
      Enjoy...
      Download attachment....
       
      Splash Screen GUI.zip
    • Skeletor
      By Skeletor
      Hi Developers,
       
      While trying to find a way to actually style/skin the GUICtrlCreateTabItem, I read the help file and stated:
      My question to you guys is will this be updated? or am I hoping for something that will never come to pass?
      I've seen scripts between 2007 to 2009 allowing the tabs to be modified
      Reason for my question is I'm trying to make my GUI Tabs look more modern.
      Thanks in advance for reading my post.
       
    • Jibberish
      By Jibberish
      I am trying to get the results of a radio button selection. I have tried implementing sample scripts but to no avail.
      Can someone tell / show me what I am doing wrong?
      #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Local $bSelect1 Local $bSelect2 Local $bSelect3 SelectButton() ;The results of SelectButton is not being returned MsgBox(0,"","Select1 is "& $bSelect1 & ". Select2 is "& $bSelect2 & ". Select3 is "& $bSelect3 & ".") Func SelectButton() Local $hGUI = GUICreate("SGX4CP Tests", 300, 300) GUISetState() Local $bSelect1 = GUICtrlCreateRadio("Select 1", 10, 160) Local $bSelect2 = GUICtrlCreateRadio("Select 2", 10, 190) Local $bSelect3 = GUICtrlCreateRadio("Select 3", 10, 220) ; Set TestSelectForever as the default radio button GUICtrlSetState($bSelect1, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Start", 120,250) Local $idMsg While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE Or $idMsg = $idClose ExitLoop Case $idMsg = $bSelect1 And BitAND(GUICtrlRead($bSelect1), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select1") Case $idMsg = $bSelect2 And BitAND(GUICtrlRead($bSelect2), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select2") Case $idMsg = $bSelect3 And BitAND(GUICtrlRead($bSelect3), $GUI_CHECKED) = $GUI_CHECKED MsgBox(0,"","Select3") ; GUICtrlRead($hGUI) EndSelect WEnd MsgBox(0,"","Select1 is "& $bSelect1 & ". Select2 is "& $bSelect2 & ". Select3 is "& $bSelect3 & ".") ; Why is this returning numbers? EndFunc