Jump to content

HELP GUI!


MatheusGM
 Share

Recommended Posts

I need some help with this script, cuz i'm trying to create a DVD Menu For my Programs, And Each Buttom(Category) Have a "GUI" For The kind of program, and when i create the first, The Buttons Don't Work ( I can't Click, but i can nav. by keyboard) and don't close :S

Plz Help me!

#Region ### Includes ###
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#NoTrayIcon
#EndRegion ### Includes ###

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Programas V1 - BETA", 640, 464, 347, 207)
GUISetIcon(@scriptdir & "\Ico\icon.ico")
SoundPlay(@scriptdir & "\BGM\bgm1.mp3")
$Fundo = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo.jpg", 0, 0, 641, 465, 0)
$Button1 = GUICtrlCreateButton("Anti-Virus", 24, 320, 89, 33)
$Button2 = GUICtrlCreateButton("Atualizações W.", 120, 320, 89, 33)
$Button3 = GUICtrlCreateButton("Codecs", 216, 320, 89, 33)
$Button4 = GUICtrlCreateButton("Compartilhadores", 24, 360, 89, 33)
$Button5 = GUICtrlCreateButton("Editores de Img.", 120, 360, 89, 33)
$Button6 = GUICtrlCreateButton("Ferramentas p/ S;", 216, 360, 89, 33)
$Button7 = GUICtrlCreateButton("Gerenciadores D.", 344, 320, 89, 33)
$Button8 = GUICtrlCreateButton("Gravação", 440, 320, 89, 33)
$Button9 = GUICtrlCreateButton("Media Players", 536, 320, 89, 33)
$Button10 = GUICtrlCreateButton("Mensageiros", 344, 360, 89, 33)
$Button11 = GUICtrlCreateButton("Navegadores", 440, 360, 89, 33)
$Button12 = GUICtrlCreateButton("Programação", 536, 360, 89, 33)
$Button13 = GUICtrlCreateButton("Utilitários", 280, 400, 89, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $msg = GUIGetMsg()
        Select
        Case $msg = $Button1
;~          Run("Explorer.exe " & @ScriptDir & "\Anti-Virus\")
;~          Run(@ScriptDir & "\Anti-Virus\Avira Personal Free\Avira Anti Virus Personal Setup.exe")

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ###
$Form_gui1 = GUICreate("Programas V1 (BETA) - Anti-Virus", 400, 281, 192, 124)
GUISetIcon(@scriptdir & "\Ico\icon.ico")
$Fundo_gui1 = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo1.jpg", -16, -8, 417, 289)
$Avira = GUICtrlCreateButton("Avira", 152, 200, 89, 33)
$Exit1 = GUICtrlCreateButton("Sair", 176, 248, 33, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $Gmsg = GUIGetMsg()
    Select
        Case $Gmsg = $Avira
            Run(@scriptdir & "\Anti-Virus\Avira Personal Free\Avira Anti Virus Personal Setup.exe")

            Case $Gmsg = $Exit1
            WinClose("Programas V1 (BETA) - Anti-Virus")

    EndSelect
WEnd

GUIDelete()

Exit
EndSelect
WEnd
Link to comment
Share on other sites

  • Moderators

MatheusGM,

I have lost count of the number of times this has been asked - does no-one ever read the Help file? ;)

From the Help file for GUICtrlCreatePic:

"If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control ...: GuiCtrlSetState(-1,$GUI_DISABLE)"

So disable all of your $Fundo picture controls and you should find your buttons working again. :evil:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

MatheusGM,

Modify my script and post here, i didn't understand :S

Whatever happened to "Please" or "Por favor"? ;)

You need to disable the picture control immediately after creating it - just as the Help file says. That is why you can use the "-1", it is shorthand for "the last control created".

So you need to put the "disable" lines here:

$Form1 = GUICreate("Programas V1 - BETA", 640, 464, 347, 207)
GUISetIcon(@scriptdir & "\Ico\icon.ico")
SoundPlay(@scriptdir & "\BGM\bgm1.mp3")
$Fundo = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo.jpg", 0, 0, 641, 465, 0)
GuiCtrlSetState(-1,$GUI_DISABLE) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$Button1 = GUICtrlCreateButton("Anti-Virus", 24, 320, 89, 33)

$Form_gui1 = GUICreate("Programas V1 (BETA) - Anti-Virus", 400, 281, 192, 124)
GUISetIcon(@scriptdir & "\Ico\icon.ico")
$Fundo_gui1 = GUICtrlCreatePic(@ScriptDir & "\Fundo\fundo1.jpg", -16, -8, 417, 289)
GuiCtrlSetState(-1,$GUI_DISABLE) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$Avira = GUICtrlCreateButton("Avira", 152, 200, 89, 33)

That should sort the problem. :evil:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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...