Jump to content

Command execution problem


Saitoh183
 Share

Recommended Posts

I just noticed that every time i start my script and then go into the option GUI, im forced to click twice on any of the checkboxes or the ok or cancel buttons before it execute the command. This only happens on the first time i enter the option GUI. Also, the option GUI has tabs(as you can see below) and on the first Tab everything works fine but on the 2 other tabs i have the problem. The Ok and cancel buttons are not part of any of the tabs.

Posted Image

Option GUI code

If WinExists($TRH_GUI) Then GUISetState(@SW_DISABLE, $TRH_GUI)
TraySetState(2)
;Global Options Menu================================================
$TRH_opt_GUI = XskinGUICreate("TRHelper Options", 615, 438, $skinfolder)
$XIcon_opt = XSkinIcon($TRH_opt_GUI, 2)
GUISetIcon($sFile)
WinMove($TRH_opt_GUI, "", IniRead(@ScriptDir & "\position.ini", "TRH_Options_Position", "X-Pos", 1044), IniRead(@ScriptDir & "\position.ini", "TRH_Options_Position", "Y-Pos", 160))
GUICtrlCreateTab(50, 50, 510, 330)
$Ok = __HoverButton("OK", 104, 392, 81, 25, "s1_")
$Cancel = __HoverButton("Cancel", 408, 392, 81, 25, "s1_")
;General TAB====================================================
GUICtrlCreateTabItem("General")
GUICtrlSetState(-1, $GUI_SHOW)
GUICtrlCreateGroup("TheRenamer", 55, 90, 497, 193)
$x86 = GUICtrlCreateCheckbox("Windows 32bit", 60, 110, 89, 17)
GUICtrlSetTip(-1, 'C:\Program Files\theRenamer\theRenamer.exe')
$x64 = GUICtrlCreateCheckbox("Windows 64bit", 60, 160, 89, 17)
GUICtrlSetTip(-1, 'C:\Program Files (x86)\theRenamer\theRenamer.exe')
$custom = GUICtrlCreateCheckbox("Custom path", 60, 210, 81, 17)
$custompath = GUICtrlCreateInput("", 60, 230, 393, 21)
GUICtrlSetState(-1, $gui_disable)
$Brow_cus = __HoverButton("Browse", 460, 230, 81, 25, "s1_")
__HoverButtonSetState($Brow_cus, $gui_disable)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$win = GUICtrlRead($x86) Or GUICtrlRead($x64)
$win64cus = GUICtrlRead($custom) Or GUICtrlRead($x64)
$win86cus = GUICtrlRead($custom) Or GUICtrlRead($x86)
GUICtrlCreateGroup("Progress Bar", 55, 295, 497, 81)
$bar = GUICtrlCreateCheckbox("Progress Bar on/off", 59, 320, 121, 17)
GUICtrlSetTip(-1, "Progress bar only instead of main GUI")
$invis = GUICtrlCreateCheckbox("Transparency", 59, 342, 113, 17)
GUICtrlSetState(-1, $gui_disable)
$Slider1 = GUICtrlCreateSlider(272, 320, 170, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE, $TBS_top))
GUICtrlSetState(-1, $gui_disable)
GUICtrlSetLimit(-1, 100, 1)
$Trans = GUICtrlCreateLabel("Transperency :", 183, 320, 100, 18)
$slid_text = GUICtrlCreateInput("<==invis                   semi-trans==>", 272, 344, 170, 22, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY), 0)
$i_perc = GUICtrlCreateInput("0", 480, 320, 49, 22, $ES_NUMBER)
GUICtrlSetState(-1, $gui_disable)
GUICtrlSetLimit($i_perc, 3, 1)
$Updown1 = GUICtrlCreateUpdown($i_perc)
GUICtrlSetState(-1, $gui_disable)
GUICtrlSetLimit($Updown1, 100, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
;Fetching Extra TAB==============================================================================
GUICtrlCreateTabItem("Fetching / Extras")
;GUICtrlSetTip(-1, "")
$Anime = GUICtrlCreateCheckbox("  Anime", 60, 90, 81, 17)
GUICtrlCreateLabel("Anime Fetch Folder :", 60, 110, 101, 17)
$ani_fetch = GUICtrlCreateInput("", 60, 125, 197, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_ani_fet = __HoverButton("...", 195, 108, 25, 17, "s1_")
__HoverButtonSetState($Brow_ani_fet, $gui_disable)
GUICtrlSetTip(-1, "Folder that will contain the non-process files")
GUICtrlCreateLabel("Anime Archive Folder :", 330, 110, 110, 17)
$Ani_arch = GUICtrlCreateInput("", 330, 125, 197, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_ani_arch = __HoverButton("...", 465, 108, 25, 17, "s1_")
__HoverButtonSetState($Brow_ani_arch, $gui_disable)
GUICtrlSetTip(-1, "Folder where you store your anime")
$extra = GUICtrlCreateCheckbox("  Extra", 60, 155, 81, 17)
GUICtrlCreateLabel("Extra Fetch Folder :", 60, 175, 96, 17)
$Brow_ext_fet = __HoverButton("...", 195, 173, 25, 17, "s1_")
GUICtrlSetTip(-1, "Folder that will contain the non-process files")
__HoverButtonSetState($Brow_ext_fet, $gui_disable)
$ext_fetch = GUICtrlCreateInput("", 60, 190, 197, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
GUICtrlCreateLabel("Extra  Archive Folder :", 330, 175, 108, 17)
$Brow_ext_arch = __HoverButton("...", 465, 173, 25, 17, "s1_")
__HoverButtonSetState($Brow_ext_arch, $gui_disable)
$ext_Arch = GUICtrlCreateInput("", 330, 190, 197, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$extcontentname = GUICtrlCreateInput("Name of your Extra folder", 60, 215, 129, 21)
GUICtrlSetTip(-1, 'For example: "HDMovies"' & @CRLF & 'It cannot be named "Extra"')
GUICtrlSetState(-1, $gui_disable)
$TV_fet = GUICtrlCreateCheckbox("TV Fetcher", 60, 270, 81, 17)
GUICtrlSetTip(-1, "If TV Settings are activated in TheRename, check this box")
$changeTVpath = __HoverButton("...", 164, 270, 25, 17, "s1_")
__HoverButtonSetState($changeTVpath, $gui_disable)
$tv_fet_input = GUICtrlCreateInput("", 195, 270, 241, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
$Mov_fet = GUICtrlCreateCheckbox("Movie Fetcher", 60, 300, 89, 17)
GUICtrlSetTip(-1, "If Movie Settings are activated in TheRename, check this box")
$changeMovpath = __HoverButton("...", 164, 300, 25, 17, "s1_")
__HoverButtonSetState($changeMovpath, $gui_disable)
$mov_fet_input = GUICtrlCreateInput("", 195, 300, 241, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlCreateLabel("If you have TVshow or Movies configured in The Renamer ," & _
   "these boxes must be checked", 60, 320, 431, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
;LOG TAB============================================================================================
GUICtrlCreateTabItem("Log Settings")
$TVlog_chk = GUICtrlCreateCheckbox("TV Log Path", 60, 101, 79, 17)
$TVlogpath = GUICtrlCreateInput("", 60, 121, 393, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_Tvlog = __HoverButton("...", 460, 121, 25, 17, "s1_")
__HoverButtonSetState($Brow_Tvlog, $gui_disable)
$Movlog_chk = GUICtrlCreateCheckbox("Movie Log Path", 60, 173, 95, 17)
$Movlogpath = GUICtrlCreateInput("", 60, 193, 393, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_movlog = __HoverButton("...", 460, 193, 25, 17, "s1_")
__HoverButtonSetState($Brow_movlog, $gui_disable)
$Anilog_chk = GUICtrlCreateCheckbox("Anime Log Path", 60, 245, 95, 17)
$Anilogpath = GUICtrlCreateInput("", 60, 265, 393, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_anilog = __HoverButton("...", 461, 265, 25, 17, "s1_")
__HoverButtonSetState($Brow_anilog, $gui_disable)
$extlog_chk = GUICtrlCreateCheckbox("Extra Log Path", 60, 308, 95, 17)
$extlogpath = GUICtrlCreateInput("", 60, 328, 393, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
GUICtrlSetState(-1, $gui_disable)
$Brow_extlog = __HoverButton("...", 461, 328, 25, 17, "s1_")
__HoverButtonSetState($Brow_extlog, $gui_disable)
GUICtrlCreateLabel("* If Log is enabled, Log path must be added." & _
   "Log path must have this form (c:\myfolder\mylog.(log or txt)", 60, 350, 550, 49)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("*", 155, 308, 8, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("*", 155, 245, 8, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("*", 155, 173, 8, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateLabel("*", 155, 101, 8, 17)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlSetColor(-1, 0xFF0000)
;If __HoverWaitButtonUp($TRH_opt_GUI) Then Return
;=============Load Settings that are configured=========================================
If FileExists(@ScriptDir & "\TRH_settings.ini") Then settings()
;=================End Load Settings======================
GUISetState(@SW_SHOW)
XSkinGradient($TRH_opt_GUI, $bkg_color, $btn_color)
;================GUI Event buttons=======================
GUICtrlSetOnEvent($custom, "_actions")
GUICtrlSetOnEvent($x86, "_actions")
GUICtrlSetOnEvent($x64, "_actions")
GUICtrlSetOnEvent($Anime, "_actions")
GUICtrlSetOnEvent($extra, "_actions")
GUICtrlSetOnEvent($TVlog_chk, "_actions")
GUICtrlSetOnEvent($Movlog_chk, "_actions")
GUICtrlSetOnEvent($Anilog_chk, "_actions")
GUICtrlSetOnEvent($extlog_chk, "_actions")
GUICtrlSetOnEvent($Ok[0], "_actions")
GUICtrlSetOnEvent($Cancel[0], "_actions")
GUICtrlSetOnEvent($TV_fet, "_actions")
GUICtrlSetOnEvent($Mov_fet, "_actions")
GUICtrlSetOnEvent($changeTVpath[0], "_actions")
GUICtrlSetOnEvent($changeMovpath[0], "_actions")
GUICtrlSetOnEvent($Brow_cus[0], "_actions")
GUICtrlSetOnEvent($Brow_ani_arch[0], "_actions")
GUICtrlSetOnEvent($Brow_ani_fet[0], "_actions")
GUICtrlSetOnEvent($Brow_ext_arch[0], "_actions")
GUICtrlSetOnEvent($Brow_ext_fet[0], "_actions")
GUICtrlSetOnEvent($Brow_Tvlog[0], "_actions")
GUICtrlSetOnEvent($Brow_movlog[0], "_actions")
GUICtrlSetOnEvent($Brow_anilog[0], "_actions")
GUICtrlSetOnEvent($Brow_extlog[0], "_actions")
GUICtrlSetOnEvent($bar, "_actions")
GUICtrlSetOnEvent($XIcon_opt[1], "_actions")
GUICtrlSetOnEvent($XIcon_opt[2], "_actions")
GUICtrlSetOnEvent($Slider1, "_actions")
GUICtrlSetOnEvent($i_perc, "_actions")
GUICtrlSetOnEvent($Updown1, "_actions")
GUICtrlSetOnEvent($invis, "_actions")
EndFunc   ;==>_opt

Since my script is over 1500 lines i attached it in case it can help.

TRHelper_skin.au3

Edited by Saitoh183
Link to comment
Share on other sites

If you can put all the needed UDFs together and upload it than we can test also your code properly.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Well, I cannot reproduce your problem. When I click on any checkboxes it get checked / unchecked with one click.

Try to run you script on a different machine.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

i tried on 2 machines...my server and my main machine. The problem isnt the checkbox themselves...those work its, its that when i check the box , the browse buttons should become active. The problem is that i have to check the box twice for it to enable the button. As i said, it happens only with Log tab or Fetching tab and only once from either. Once you do that, everything acts as intended even if you exit the options and go back in.

Link to comment
Share on other sites

The issues are the case statements in your _actions() function (read carefully the Switch...Case...EndSwitch description in the help file).

...
Case $i_perc, $Updown1
...
Case GUICtrlRead($Slider1) <> $last_perc
...

For Case $i_perc, $Updown1 you can use

Case $i_perc
            GUICtrlSetData($Slider1, GUICtrlRead($i_perc))
        Case $Updown1
            GUICtrlSetData($Slider1, GUICtrlRead($i_perc))

instead if this is your intention.

I don't know the meaning of Case GUICtrlRead($Slider1) <> $last_perc

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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