Sign in to follow this  
Followers 0
AntiVirusGuy

$tab = GUICtrlCreateTab(5, 5, 398, 462,-1, $WS_EX_ACCEPTFILES)

8 posts in this topic

I feel like an idiot why wont this work

$primaryGui = GUICreate("IR-Tools", 405, 490)

GUISetFont(9, 300)

;endregion

;region my computer

;/////////////////////// MY COMPUTER /////////////////////////

;-------------------------------------------------------------

$tab = GUICtrlCreateTab(5, 5, 398, 462,-1, $WS_EX_ACCEPTFILES)

$Runbox = GUICtrlCreateInput ( "", 150, 430, 225, 20)

GUICtrlSetState(-1,$GUI_ACCEPTFILES)

Share this post


Link to post
Share on other sites



Looks like if the input is on a tab then the drag and drop isn't working properly

comment out the tab it works.

#include <GUIConstants.au3>

$primaryGui = GUICreate("IR-Tools", 405, 490, -1, -1, -1, $WS_EX_ACCEPTFILES)

GUISetFont(9, 300)

;endregion
;region my computer
;/////////////////////// MY COMPUTER /////////////////////////
;-------------------------------------------------------------

;~ $tab = GUICtrlCreateTab(5, 5, 398, 462,-1, $WS_EX_ACCEPTFILES)
$tab = GUICtrlCreateTab(5, 5, 398, 462)
$Runbox = GUICtrlCreateInput("", 150, 430, 225, 20)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
GUICtrlCreateTabItem("")  ; end tabitem definition


GUISetState()
While 1
 $msg = GUIGetMsg()
 Select
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
 EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

you miss to create the tabitem

$tab = GUICtrlCreateTab(5, 5, 398, 462)
GuiCtrlCreateTabitem ("tab 0")
$Runbox = GUICtrlCreateInput("", 150, 430, 225, 20)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
GUICtrlCreateTabItem("") ; end tabitem definition

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

A direct working solution.

HTH, Reinhard

;;-----------------------------------------------------------------------------------
;; Based on examples from and with thanks to:
;; Holger, Garfrost, Valuater, the Helpfile and 
;; whoever posted a GUI-Script here or answered some of my sometimes stupid questions.
;;------------------------------------------------------------------------------------

#include <GUIConstants.au3>

;;;;;;;;;;;;;;;; Define GUI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$main_GUI = GUICreate("IR-Tools",560,450,20,20,BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPSIBLINGS))
    $Info = "Selected File = No File "
    $Lab_Info = GUICtrlCreateLabel($Info,10,422,480,15,BitOR($SS_SUNKEN, $SS_Center))

$Files_GUI = GUICreate("",520,360,20,40, $WS_CHILD,$WS_EX_ACCEPTFILES,$main_GUI)
    $Runbox = GUICtrlCreateInput("", 10, 250, 500, 20)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    GUISetState()

GUISwitch($main_GUI)
    $main_tab   = GUICtrlCreateTab(10,10,540,400)
    $Files_tab = GUICtrlCreateTabItem("Files")
    GUICtrlCreateTabItem("")

GUISetState();;==> End of Gui definition

;;;;;;;;;;;;;;;;; GUI - Loop;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While 1
$msg = GUIGetMsg()
$RunboxFileNM = GUICtrlRead($Runbox)
if stringInStr($RunboxFileNM,":\") > 0  and stringInStr($RunboxFileNM,"  ") = 0 then 
    GUICtrlSetData($Lab_Info,"Selected File = " & $RunboxFileNM)
    GUICtrlSetData($Runbox,$RunboxFileNM&"  ");&"  " to avoid flickering of $Lab_Info
    endif
Select
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
EndSelect
WEnd;;==> End of Gui Loop
Edited by ReFran

Share this post


Link to post
Share on other sites

Thank you so much that is perfect

A direct working solution.

HTH, Reinhard

;;-----------------------------------------------------------------------------------
;; Based on examples from and with thanks to:
;; Holger, Garfrost, Valuater, the Helpfile and 
;; whoever posted a GUI-Script here or answered some of my sometimes stupid questions.
;;------------------------------------------------------------------------------------

#include <GUIConstants.au3>

;;;;;;;;;;;;;;;; Define GUI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$main_GUI = GUICreate("IR-Tools",560,450,20,20,BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPSIBLINGS))
    $Info = "Selected File = No File "
    $Lab_Info = GUICtrlCreateLabel($Info,10,422,480,15,BitOR($SS_SUNKEN, $SS_Center))

$Files_GUI = GUICreate("",520,360,20,40, $WS_CHILD,$WS_EX_ACCEPTFILES,$main_GUI)
    $Runbox = GUICtrlCreateInput("", 10, 250, 500, 20)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    GUISetState()

GUISwitch($main_GUI)
    $main_tab   = GUICtrlCreateTab(10,10,540,400)
    $Files_tab = GUICtrlCreateTabItem("Files")
    GUICtrlCreateTabItem("")

GUISetState();;==> End of Gui definition

;;;;;;;;;;;;;;;;; GUI - Loop;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While 1
$msg = GUIGetMsg()
$RunboxFileNM = GUICtrlRead($Runbox)
if stringInStr($RunboxFileNM,":\") > 0  and stringInStr($RunboxFileNM,"  ") = 0 then 
    GUICtrlSetData($Lab_Info,"Selected File = " & $RunboxFileNM)
    GUICtrlSetData($Runbox,$RunboxFileNM&"  ");&"  " to avoid flickering of $Lab_Info
    endif
Select
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
EndSelect
WEnd;;==> End of Gui Loop

Share this post


Link to post
Share on other sites

your example works but I can not seem to get multiple tabs working

Share this post


Link to post
Share on other sites

you miss to create the tabitem

$tab = GUICtrlCreateTab(5, 5, 398, 462)
GuiCtrlCreateTabitem ("tab 0")
$Runbox = GUICtrlCreateInput("", 150, 430, 225, 20)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
GUICtrlCreateTabItem(""); end tabitem definition

A big Duh on my part


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

your example works but I can not seem to get multiple tabs working

Oh, excuse the delay. The Day of Thorn is my Day of Sport. Attached the Script. Let me know if you need a 3-third one. B)

But now it is real complete: Create the Gui, define the Tab (hnd), Show/hide what you don't want.

HTH, Reinhard

;;-----------------------------------------------------------------------------------
;; Based on examples from and with thanks to:
;; Holger, Garfrost, Valuater, the Helpfile and 
;; whoever posted a GUI-Script here or answered some of my sometimes stipid questions.
;;------------------------------------------------------------------------------------

#include <GUIConstants.au3>

;;;;;;;;;;;;;;;; Define GUI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$main_GUI = GUICreate("IR-Tools",560,450,20,20,BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPSIBLINGS))
    $Info = "Selected File = No File "
    $Lab_Info = GUICtrlCreateLabel($Info,10,422,480,15,BitOR($SS_SUNKEN, $SS_Center))

$Files_GUI = GUICreate("",520,360,20,40, $WS_CHILD,$WS_EX_ACCEPTFILES,$main_GUI)
        GUISetBkColor(0xC0D0B0)
    $Runbox = GUICtrlCreateInput("", 10, 250, 500, 20)
    GUICtrlSetState(-1, $GUI_ACCEPTFILES)
    GUISetState()
$Cmd_GUI   = GUICreate("",520,360,20,40,$WS_CHILD,-1,$main_GUI)
         GUISetBkColor(0xA0D0B0)         
    GUICtrlCreateLabel ("Input File:",  10, 10)
    $Cmd_FileNM = GUICtrlCreateInput ("<nothing selected>", 90, 10, 420, 20)
    GUICtrlSetState(-1,$GUI_ACCEPTFILES)


GUISwitch($main_GUI)
    $main_tab   = GUICtrlCreateTab(10,10,540,400)
    $Files_tab = GUICtrlCreateTabItem("Files")
    $CMD_tab = GUICtrlCreateTabItem("Batch")
    GUICtrlCreateTabItem("")

GUISetState();;==> End of Gui definition

;;;;;;;;;;;;;;;;; GUI - Loop;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While 1
$msg = GUIGetMsg()
$RunboxFileNM = GUICtrlRead($Runbox)
if stringInStr($RunboxFileNM,":\") > 0  and stringInStr($RunboxFileNM,"  ") = 0 then 
    GUICtrlSetData($Lab_Info,"Selected File = " & $RunboxFileNM)
    GUICtrlSetData($Runbox,$RunboxFileNM&"  ") ;&"  " to avoid flickering of $Lab_Info
    endif
Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $main_tab
         $tab_item = GUICtrlRead($main_tab)
    Select   
        Case $tab_item = 0
            GUISetState(@SW_SHOW,$Files_GUI)
            GUISetState(@SW_HIDE,$Cmd_GUI)
        Case $tab_item  = 1
            GUISetState(@SW_HIDE,$Files_GUI)
            GUISetState(@SW_SHOW,$Cmd_GUI)
        EndSelect   
    EndSelect
WEnd;;==> End of Gui Loop

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