Jump to content

GUI Tabs


caineman
 Share

Recommended Posts

Hi

Iv'e just started to use autoit3 and ive created a some Gui to run different programs, i have created tabs across the top to separate the different apps.

I have worked out how to group check/uncheck the checkboxes on one tab but im not able to get it to work on the other tabs using the same button.

If any one can help me out i would be most greatful

cheers

Caineman

Link to comment
Share on other sites

Hi

Iv'e just started to use autoit3 and ive created a some Gui to run different programs, i have created tabs across the top to separate the different apps.

I have worked out how to group check/uncheck the checkboxes on one tab but im not able to get it to work on the other tabs using the same button.

If any one can help me out i would be most greatful

cheers

Caineman

Could you please post some script so that we can see what you have tried.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Hi

Iv'e just started to use autoit3 and ive created a some Gui to run different programs, i have created tabs across the top to separate the different apps.

I have worked out how to group check/uncheck the checkboxes on one tab but im not able to get it to work on the other tabs using the same button.

If any one can help me out i would be most greatful

cheers

Caineman

Here is my code

#include <GUIConstants.au3>

Global $History, $Cookies, $Tempfiles, $ClearUrls, $GoButton, $ExitButton

GuiCreate("MY GUI", 260, 300,(@DesktopWidth-260)/2, (@DesktopHeight-300)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$menu = GUICtrlCreateMenu ("&Menu")

$GoButton = GUICtrlCreateMenuitem ("Execute Selections", $menu)

$Select = GUICtrlCreateMenuitem ("Select all",$menu)

$Deselect = GUICtrlCreateMenuitem ("Deselect",$menu)

$ExitButton = GUICtrlCreateMenuitem ("Exit",$menu)

$tab=GUICtrlCreateTab (0,0, 260,300)

$tab0=GUICtrlCreateTabitem ("Tab1")

GUICtrlSetState(-1,$GUI_SHOW) ; will be display first

$History = GUICtrlCreateCheckbox("Clear internet history",20,70,190,20)

$Cookies = GUICtrlCreateCheckbox("Clear internet cookies",20,90,190,20)

$tab1=GUICtrlCreateTabitem ( "tab2")

$TempFiles = GUICtrlCreateCheckbox("Clear internet temp files",20,70,190,20)

$ClearUrls = GUICtrlCreateCheckbox("Clear typed urls from address bar",20,90,190,20)

GuiSetState()

While 1

$msg = GUIGetMsg()

If $msg = $ExitButton Then ExitLoop

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $GoButton

if(GuiCtrlRead($History) = 1) then

Run("history.exe" )

Sleep(8000)

SplashTextOn("Report", "History have been removed", -1, 25, -1, 225, 4, "", 12)

Sleep(3000)

SplashOff()

EndIf

if(GuiCtrlRead($Cookies) = 1) then

Run("cookies.exe" )

Sleep(8000)

SplashTextOn("Report", "Cookies have been removed", -1, 25, -1, 225, 4, "", 12)

Sleep(3000)

SplashOff()

EndIf

if(GuiCtrlRead($TempFiles) = 1) then

Run("files.exe" )

Sleep(8000)

SplashTextOn("Report", "Temporary files have been removed", -1, 25, -1, 225, 4, "", 12)

Sleep(3000)

SplashOff()

EndIf

if(GuiCtrlRead($ClearUrls) = 1) then

RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")

Sleep(1000)

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")

SplashTextOn("Report", "Typed Urls in address bar have been removed", -1, 25, -1, 225, 4, "", 12)

Sleep(3000)

SplashOff()

EndIf

Case $msg = $Select

GUICtrlSetState($History, $GUI_CHECKED)

GUICtrlSetState($Cookies, $GUI_CHECKED)

GUICtrlSetState($TempFiles, $GUI_CHECKED)

GUICtrlSetState($ClearUrls, $GUI_CHECKED)

Case $msg = $Deselect

GUICtrlSetState($History, $GUI_UNCHECKED)

GUICtrlSetState($Cookies, $GUI_UNCHECKED)

GUICtrlSetState($TempFiles, $GUI_UNCHECKED)

GUICtrlSetState($ClearUrls, $GUI_UNCHECKED)

EndSelect

WEnd

From the menu im trying to make it so the select all and deselect only works on the tab that is displayed

Link to comment
Share on other sites

You could use _GUICtrlTabGetCurSel to determine which tab is selected and change your select /deselect functions to suit.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

You could use _GUICtrlTabGetCurSel to determine which tab is selected and change your select /deselect functions to suit.

cheers

Do you have any information on how to use this as i have search the help files and can not find anything

caineman

Link to comment
Share on other sites

cheers

Do you have any information on how to use this as i have search the help files and can not find anything

caineman

You will need the Beta version, you can download it by following the link in my signature.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

No need for beta to accomplish this

#include <GUIConstants.au3>
Global $History, $Cookies, $Tempfiles, $ClearUrls, $GoButton, $ExitButton
GUICreate("MY GUI", 260, 300, (@DesktopWidth - 260) / 2, (@DesktopHeight - 300) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$menu = GUICtrlCreateMenu("&Menu")
$GoButton = GUICtrlCreateMenuItem("Execute Selections", $menu)
$Select = GUICtrlCreateMenuItem("Select all", $menu)
$Deselect = GUICtrlCreateMenuItem("Deselect", $menu)
$ExitButton = GUICtrlCreateMenuItem("Exit", $menu)

$tab = GUICtrlCreateTab(0, 0, 260, 300)
$tab0 = GUICtrlCreateTabItem("Tab1")
GUICtrlSetState(-1, $GUI_SHOW); will be display first
$History = GUICtrlCreateCheckbox("Clear internet history", 20, 70, 190, 20)
$Cookies = GUICtrlCreateCheckbox("Clear internet cookies", 20, 90, 190, 20)
$tab1 = GUICtrlCreateTabItem("tab2")
$Tempfiles = GUICtrlCreateCheckbox("Clear internet temp files", 20, 70, 190, 20)
$ClearUrls = GUICtrlCreateCheckbox("Clear typed urls from address bar", 20, 90, 190, 20)

GUISetState()
While 1
   $msg = GUIGetMsg()
   If $msg = $ExitButton Then ExitLoop
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $GoButton
         
         if (GUICtrlRead($History) = 1) Then
            
            Run("history.exe")
            Sleep(8000)
            SplashTextOn("Report", "History have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($Cookies) = 1) Then
            
            Run("cookies.exe")
            Sleep(8000)
            SplashTextOn("Report", "Cookies have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($Tempfiles) = 1) Then
            
            Run("files.exe")
            Sleep(8000)
            SplashTextOn("Report", "Temporary files have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($ClearUrls) = 1) Then
            
            RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")
            Sleep(1000)
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")
            SplashTextOn("Report", "Typed Urls in address bar have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
      Case $msg = $Select
            If GUICtrlRead($tab) = 0 Then
                GUICtrlSetState($History, $GUI_CHECKED)
                GUICtrlSetState($Cookies, $GUI_CHECKED)
            Else
                GUICtrlSetState($Tempfiles, $GUI_CHECKED)
                GUICtrlSetState($ClearUrls, $GUI_CHECKED)
            EndIf
      Case $msg = $Deselect
            If GUICtrlRead($tab) = 0 Then
                GUICtrlSetState($History, $GUI_UNCHECKED)
                GUICtrlSetState($Cookies, $GUI_UNCHECKED)
            Else
                GUICtrlSetState($Tempfiles, $GUI_UNCHECKED)
                GUICtrlSetState($ClearUrls, $GUI_UNCHECKED)
            EndIf
         
   EndSelect
WEnd
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to comment
Share on other sites

No need for beta to accomplish this

As ever I bow to your superior knowledge. You are the man. :lmao:


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

No need for beta to accomplish this

#include <GUIConstants.au3>
Global $History, $Cookies, $Tempfiles, $ClearUrls, $GoButton, $ExitButton
GUICreate("MY GUI", 260, 300, (@DesktopWidth - 260) / 2, (@DesktopHeight - 300) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$menu = GUICtrlCreateMenu("&Menu")
$GoButton = GUICtrlCreateMenuItem("Execute Selections", $menu)
$Select = GUICtrlCreateMenuItem("Select all", $menu)
$Deselect = GUICtrlCreateMenuItem("Deselect", $menu)
$ExitButton = GUICtrlCreateMenuItem("Exit", $menu)

$tab = GUICtrlCreateTab(0, 0, 260, 300)
$tab0 = GUICtrlCreateTabItem("Tab1")
GUICtrlSetState(-1, $GUI_SHOW); will be display first
$History = GUICtrlCreateCheckbox("Clear internet history", 20, 70, 190, 20)
$Cookies = GUICtrlCreateCheckbox("Clear internet cookies", 20, 90, 190, 20)
$tab1 = GUICtrlCreateTabItem("tab2")
$Tempfiles = GUICtrlCreateCheckbox("Clear internet temp files", 20, 70, 190, 20)
$ClearUrls = GUICtrlCreateCheckbox("Clear typed urls from address bar", 20, 90, 190, 20)

GUISetState()
While 1
   $msg = GUIGetMsg()
   If $msg = $ExitButton Then ExitLoop
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $GoButton
         
         if (GUICtrlRead($History) = 1) Then
            
            Run("history.exe")
            Sleep(8000)
            SplashTextOn("Report", "History have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($Cookies) = 1) Then
            
            Run("cookies.exe")
            Sleep(8000)
            SplashTextOn("Report", "Cookies have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($Tempfiles) = 1) Then
            
            Run("files.exe")
            Sleep(8000)
            SplashTextOn("Report", "Temporary files have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
         if (GUICtrlRead($ClearUrls) = 1) Then
            
            RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")
            Sleep(1000)
            RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs")
            SplashTextOn("Report", "Typed Urls in address bar have been removed", -1, 25, -1, 225, 4, "", 12)
            Sleep(3000)
            SplashOff()
         EndIf
         
      Case $msg = $Select
            If GUICtrlRead($tab) = 0 Then
                GUICtrlSetState($History, $GUI_CHECKED)
                GUICtrlSetState($Cookies, $GUI_CHECKED)
            Else
                GUICtrlSetState($Tempfiles, $GUI_CHECKED)
                GUICtrlSetState($ClearUrls, $GUI_CHECKED)
            EndIf
      Case $msg = $Deselect
            If GUICtrlRead($tab) = 0 Then
                GUICtrlSetState($History, $GUI_UNCHECKED)
                GUICtrlSetState($Cookies, $GUI_UNCHECKED)
            Else
                GUICtrlSetState($Tempfiles, $GUI_UNCHECKED)
                GUICtrlSetState($ClearUrls, $GUI_UNCHECKED)
            EndIf
         
   EndSelect
WEnd
cheers

I now worship the ground you walk on

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