Search the Community
Showing results for tags 'tabs'.
-
Hello, I would like to know how to go about making the following item clear and transparent. They're currently being highlight by a blue/black bar over the texts. I've read through pages and pages of "transparent group, radios, and checkboxes" but none looks like a simple implemenation nor does it apply to my case. Groups Text Radio Text Also, I'm unable to see my tabs perhaps it's being hidden by the background picture? (see figure 2 for what it's supposed to look like). Using the code from AdmiralClaws, it made the radio graphic or style a little plain and I would like to restore it. I don't need the tab section transparent, just the dark grey area around it. Example: $chk = GUICtrlCreateCheckbox("This is checkbox - Lorem ipsum dolor sit amet.", 20, 20) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) $lbl = GUICtrlCreateLabel("This is label - Lorem ipsum dolor sit amet", 20, 100) $rdo = GUICtrlCreateRadio("This is radio - Lorem ipsum dolor sit amet", 20, 180) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) Test Program #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 400, 300) ; GUICtrlCreatePic (".\background.bmp", 0, 0, 400, 300) GUICtrlCreateTab (20, 20, 360, 260) GUICtrlCreateTabItem ("Option 1") GUICtrlCreateGroup ("Radio", 40, 60, 320, 200) $radio1 = GUICtrlCreateRadio ("Radio 1", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio1), "wstr", 0, "wstr", 0) $radio2 = GUICtrlCreateRadio ("Radio 2", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($radio2), "wstr", 0, "wstr", 0) GUICtrlCreateTab (30, 30, 360, 260) GUICtrlCreateTabItem ("Option 2") GUICtrlCreateGroup ("Radio", 40, 60, 320, 200) $radio3 = GUICtrlCreateRadio ("Radio 3", 60, 80) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) $radio4 = GUICtrlCreateRadio ("Radio 4", 60, 110) ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI) EndFunc ;==>Example (Figure 1) (Figure 2)
-
Hi everyone, I have created a ListView that is in a tab, and I want to display an image in that tab, with the ListView on top. However, the image still appears on top of my ListView. If I remove the tabs everything works. I looked at the autoit documentation and the <GuiListView.au3> documentation , I can't figure out how to display a background image, and put on top a ListView, inside a tab. 😥 Here is the code: Opt("GUIOnEventMode", 1) $Form1 = GUICreate($Titre, 700, 627, $Form1Width, $Form1Height); main window $tabulation = GUICtrlCreateTab(148,0,700,580); creating tabs $tab1=GUICtrlCreateTabItem("Tab 1"); first tab GUICtrlSetState(-1, $GUI_SHOW); this tab is selected by default $Pic1 = GUICtrlCreatePic("image.jpg", 0, 30, 700, 627) GUICtrlSetState(-1, $GUI_DISABLE). $idListview = GUICtrlCreateListView("list 1|list 2|list 3", 200, 50, 390, 200) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Thank you in advance.
-
Hello. I'm using SciTE v3.3.14.5 I think, and I find this very annoying (GIF): https://i.gyazo.com/e60b5d94b8c16d217be4010e208d7042.mp4 I've searched around but found nothing that helped including this: https://www.autoitscript.com/forum/topic/100517-stop-scite-removing-tab-indentations/ So the problem obviously is that when I go to a new line after "EndIf", it removes the tab which I don't want to happen. Is there any fix? I've tried to change some configs such as Line 183: # Indentation Line 185: indent.size=0 Line 187: #indent.auto=0 Line 188: indent.automatic=0 Line 189: indent.opening=0 Line 190: indent.closing=0 Line 191: #tab.indents=0 Line 192: #backspace.unindents=0 strip.trailing.spaces=0 But nothing seems to get rid of this. Thanks
- 5 replies
-
- scite removing tabs
- scite
-
(and 3 more)
Tagged with:
-
Hi dears I've got a question in creating tabs in autoit Usually in other programs you can move between tabs by pressing ctrl + tab or ctrl + shift + tab I tried to create a window which have a multy tab but when i press one of the shortcuts it does not move between the tabs Is there an option to enable or disable this Greetings this is the example i tryed #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <TabConstants.au3> #include <ComboConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> effectsSettings() func effectsSettings() local $echoCombo[6], $reverbCombo[5], $CHORUSCombo[8], $flangerCombo[8], $paramEQCombo[4], $distortionCombo[6], $gargleCombo[3] $EffWindow = GUICreate("efects settings", 400, 400, -1, -1, $WS_TABSTOP) local $BtOK = GUICtrlCreateButton("ok", 5, 360, 50, 30, 0x01) GUIStartGroup("") local $BTCancel = GUICtrlCreateButton("cancel", 340, 360, 50, 30) GUIStartGroup("") local $effectTabs = GUICtrlCreateTab(10, 10, 380, 70) GUICtrlSetState(-1, $GUI_focus) GUICtrlCreateTabItem("echo") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $echoCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 180, 100, 100, 60) $echoCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fLeftDelay", 290, 100, 100, 60) $echoCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fRightDelay", 50, 180, 100, 60) $echoCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lPanDelay", 180, 180, 100, 60) $echoCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateTabItem("reverb") GUICtrlCreateLabel("fInGain", 50, 100, 100, 60) $ReverbCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fReverbMix", 180, 100, 100, 60) $ReverbCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fReverbTime", 290, 100, 100, 60) $ReverbCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fHighFreqRTRatio", 50, 180, 100, 60) $ReverbCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateTabItem("chorus") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $ChorusCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $ChorusCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $ChorusCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $ChorusCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $ChorusCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $ChorusCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $ChorusCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40) GUICtrlCreateTabItem("flanger") GUICtrlCreateLabel("fWetDryMix", 50, 100, 100, 60) $FlangerCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fDepth", 180, 100, 100, 60) $FlangerCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fFeedback", 290, 100, 100, 60) $FlangerCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $FlangerCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("lWaveform", 180, 180, 100, 60) $FlangerCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateLabel("fDelay", 290, 180, 100, 60) $FlangerCombo[6] = GUICtrlCreateCombo("", 300, 190, 80, 40) GUICtrlCreateLabel("lPhase", 50, 260, 100, 60) $FlangerCombo[7] = GUICtrlCreateCombo("", 60, 270, 80, 40) GUICtrlCreateTabItem("paramatric eq") GUICtrlCreateLabel("fCenter", 50, 100, 100, 60) $parameqCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fBandwidth", 180, 100, 100, 60) $ParamEqCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fGain", 290, 100, 100, 60) $parameqCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateTabItem("distortion") GUICtrlCreateLabel("fGain", 50, 100, 100, 60) $distortionCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("fEdge", 180, 100, 100, 60) $distortionCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUICtrlCreateLabel("fPostEQCenterFrequency", 290, 100, 100, 60) $distortionCombo[3] = GUICtrlCreateCombo("", 300, 110, 80, 40) GUICtrlCreateLabel("fFrequency", 50, 180, 100, 60) $distortionCombo[4] = GUICtrlCreateCombo("", 60, 190, 80, 40) GUICtrlCreateLabel("fPostEQBandwidth", 180, 180, 100, 60) $distortionCombo[5] = GUICtrlCreateCombo("", 190, 190, 80, 40) GUICtrlCreateTabItem("gargle") GUICtrlCreateLabel("dwRateHz", 50, 100, 100, 60) $gargleCombo[1] = GUICtrlCreateCombo("", 60, 110, 80, 40) GUICtrlCreateLabel("dwWaveShape", 180, 100, 100, 60) $gargleCombo[2] = GUICtrlCreateCombo("", 190, 110, 80, 40) GUISetState(@sw_show, $EffWindow) While 1 Switch GUIGetMSG() case $GUI_Event_close, $BTCancel exit EndSwitch Wend return "" endFunc
-
Hi all, Anyone have any idea how to close all open tabs except a specific one I manually open. Assuming I don't know what is open in all the tabs except just the one I want to keep open. I didn't want to use sendkeys and I was trying to use the following code to list the title (or url) of the 3 open tabs and after I got that part working I would just close the other 2. This sample only displays the title of the first open tab #include <IE.au3> Const $ie_new_in_tab = 0x0800 $oIE = _IECreate("https://www.autoitscript.com") __IENavigate($oIE, "https://www.autoitscript.com/forum/", 1, $ie_new_in_tab) ;(obj,url,wait,param) __IENavigate($oIE, "https://www.google.com/", 1, $ie_new_in_tab) ;(obj,url,wait,param) Local $aIE[1] $aIE[0] = 0 Local $i = 1, $oIE While 1 $oIE = _IEAttach("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ConsoleWrite(_IEPropertyGet($oIE, "title") & @CRLF) ReDim $aIE[$i + 1] $aIE[$i] = $oIE ;each item holds object $aIE[0] = $i ;first item holds count $i += 1 WEnd MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) ; This doesn't return the list of tabs in the console just the first tab Thanks for any and all help
-
Hello I got these tabs Global $TabMain = GUICtrlCreateTabItem("Main") Global $Action = GUICtrlCreateTabItem("Actions") Global $TabThings = GUICtrlCreateTabItem("Things") As we know to change tab we have to click with mouse on tab name like here it looks like below. Is there possibility to change tab without click on the tab but change by click on button for example?
-
Hi Guys, I've been reading this post ... When I came accross the examples, non of them had what I was looking for. I basically want to "snapshot" my GUI's multiple tabs and send them into the pdf. A little nudge from you guys would be great. Im really stuck with this one, therefore I have no code. Lets discuss or point me in a right direction... thanks alot
-
I am trying to script the opening of multiple tabs in IE with each tab having a separate login/password. I have been able to make a successful script that will open 3 separate IE sessions with the correct webpage and login or a script that will open 3 tabs in one session (which I want) but will not login. I have tried _IECreate, IEAttach etc. This is the script I am currently using . #include <IE.au3> Const $navOpenInNewTab = 0x0800 Dim $oIE = _IECreate('http://asag.xxxxxxx.com/AAAA/index.htm') ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) ;$o_IE.Navigate2('http://asag.xxxxxxx.com/apps/yyyyyyy/LogInSAG/login.asp', $navOpenInNewTab) Call ("YYYYYYYSignIn") Func YYYYYYYSignIn () Local $username = _IEGetObjByName ($oIE,"uname") Local $password = _IEGetObjByName ($oIE,"pword") $oIE.Navigate2('http://asag.xxxxxxx.com/apps/xxxxxxx/LogInSAG/login.asp',2048) _IEFormElementSetValue ($username, "xxxxxxx") _IEFormElementSetValue ($password, "xxxxxxx") Send('{Enter}') EndFunc Call ("xxxxxxxSignIn") Func xxxxxxxSignIn () __IENavigate($oIE, "https://soa1gui.xxxxxxx.biz/gateway/NFServlet;jsessionid=1E3B8F6520DE0A1EC914A8ABB7E86341?NFH_MessageId=&NFH_Page=%2fpages%2fsearch%2fsearch.jsp", 1, 0x800) Local $domain = _IEGetObjByName ($oIE,"NF_CustomerID") Local $User_Name = _IEGetObjByName ($oIE,"NF_UserName") Local $Password = _IEGetObjByName ($oIE,"NF_Password") _IEFormElementSetValue ($domain, xxxxxxx") _IEFormElementSetValue ($User_Name, "xxxxxxx") _IEFormElementSetValue ($Password, "xxxxxxx") ;Send('{Enter}') EndFunc
-
OK, still learning SOLVED! $WS_EX_COMPOSITED hides buttons? I've read, run examples but cannot show action buttons in tabs in a GUI. I've run the GUICtrlCreateTabItem function example and, of course, it works. Mine doesn't: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <MenuConstants.au3> #include <TabConstants.au3> #include <ColorConstants.au3> $hGUI = GUICreate("My GUI Tab", @DesktopWidth * 1, @DesktopHeight * 1, 0, 0,-1, $WS_EX_COMPOSITED) $hTab = GUICtrlCreateTab(10, 10, 640, 480,$TCS_HOTTRACK) ; Create tabitems ;For $i = 0 To 2 GUICtrlCreateTabItem(" Scan Sample ") ; $idButton1 = GUICtrlCreateButton("Button " & 0, 20 + (0 * 100), 40 + (0 * 50), 80, 30) ; $idButton1 = GUICtrlCreateButton("00", 20, 50, 80, 30) GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK0", 20, 50, 50, 20) GUICtrlCreateInput("default", 80, 50, 70, 20) GUICtrlCreateTabItem(" Database ") GUICtrlCreateButton("Button " & 1, 20 + (1 * 100), 40 + (1 * 50), 80, 30) GUICtrlCreateTabItem(" Software ") GUICtrlCreateButton("Button " & 2, 20 + (2 * 100), 40 + (2 * 50), 80, 30) ;Next ; Close Tab definiton GUICtrlCreateTabItem("") ; Set the color of the label control. ; GUICtrlSetColor($idButton1, 0x002E7A) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd It just shows: whatever I try. So I've missed, again?, that I do not have the focus?
-
Hello I got problem with my form cause i got some buttons, labels, inputs and now i want organize this in tabs. There is a problem, when i put new tab this tab is on bottom and this is above my buttons or button is show on whole form , not only in one tab. How to deal with it
-
Hello, First off, I want to say that I very much appreciate the hard work that people put in to replying on these forums and helping newbs. I've gotten 99% of my answers through google, forum searches, and documentation. Okay, so. I'm actually sure this has been asked before, but I wasn't able to find anything and I'm having some difficulty. I want to delete tabs in a control with a middle click (or specifically, detect when a tab has been middle-clicked). Initially I was going to try to use GUIGetCursorInfo along with checking for a middle-click, the problem is, when the cursor is over a tab, it simply returns the ID of the whole control (I'm using the native tab functionality). If I can avoid it, I REALLY don't want to manually check coordinates of tabs when the middle mouse is clicked, as tabs are going to be generated dynamically (anywhere from one to infinity tabs if the user lets things get out of hand), and the window I'm using will be resizable (thus having to run checks if a tab is out of view, etc), but I can if I have no other choice. So basically, Is there either 1: a simple native/UDF way to detect middle-click on tabs, 2: a way to get GUIGetCursorInfo give the control ID of the tab itself instead of the control, or 3: something I haven't thought of all together? Thanks in advance!
- 7 replies
-
- tabs
- guigetcursorinof
-
(and 3 more)
Tagged with:
-
Hello, i have read the wiki for tabs, and search in some sites for code ideas, and get what i have now 1st i have the broblem that wen i choice one iten the image appears in all tabs i resolved that with the -----GUISwitch($GUI, $TabID)---- Now i have a problema that wen i choice the iten the image doesn t appear only if i change tab i go back to the tab Any idea? #include <GuiConstantsEx.au3> #include <GuiTab.au3> Global $dir =("FULL\") $GUI = GUICreate("Test Script", 500, 500) $hTab = GUICtrlCreateTab(5, 10, 500, 450) $Tab1 = GUICtrlCreateTabItem("Tab1") $Tab2 = GUICtrlCreateTabItem("Tab2") $Pic1 = GUICtrlCreatePic("", 15, 202, 25, 25); pic coordenades and size $Pic2 = GUICtrlCreatePic("", 15, 234, 25, 25) $Pic3 = GUICtrlCreatePic("", 15, 264, 25, 25) $Combo3 = GUICtrlCreateCombo("Corpo", 47, 268, 65, 25); combobox place GUICtrlSetFont(-1, 8, 400, 0, "Arial") jcorpo($combo3) ; getdata funcion $Combo2 = GUICtrlCreateCombo("Corpo", 47, 238, 65, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") jcorpo($combo2) $Combo1 = GUICtrlCreateCombo("Corpo", 47, 206, 65, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") jcorpo($combo1) $Tab3 = GUICtrlCreateTabItem("Tab3") ;GUICtrlSetState($Tab2, $GUI_SHOW); tessting code GUICtrlCreateTabItem("") $Switch_Button = GUICtrlCreateButton("Switch Next", 20, 470, 80, 20) GUISetState(@SW_SHOW, $GUI) While 1 Switch GUIGetMsg() Case $combo1 GUISwitch($GUI, $Tab2) img1($combo1, $Pic1, 15, 202) GUISwitch($GUI) case $combo2 img1($combo2, $pic2, 15, 234) Case $combo3 img1($combo3, $Pic3, 15, 264) Case $GUI_EVENT_CLOSE Exit Case $Switch_Button $iCurrent_TabIndex = _GUICtrlTab_GetCurSel($hTab) $iNext_TabIndex = $iCurrent_TabIndex Switch $iCurrent_TabIndex Case 0, 1 $iNext_TabIndex += 1 Case 2 $iNext_TabIndex = 0 EndSwitch _GUICtrlTab_SetCurSel($hTab, $iNext_TabIndex) EndSwitch WEnd Func img1($var, $imp, $x1, $y1) ; $Read = GUICtrlRead($var) If $Read = "A" Then $imp = GUICtrlCreatePic($dir & "A.bmp", $x1, $y1, 25, 25) EndIf If $Read = "B" Then $imp = GUICtrlCreatePic($dir & "B.bmp", $x1, $y1, 25, 25) EndIf If $Read = "C" Then $imp = GUICtrlCreatePic($dir & "C.bmp", $x1, $y1, 25, 25) EndIf If $Read = "" Then $imp = GUICtrlCreatePic($dir & "", $x1, $y1, 25, 25) ;Else ; $imp = GUICtrlCreatePic($dir & "null.bmp", $x1, $y1, 25, 25) EndIf EndFunc Func jcorpo($varcomb) GUICtrlSetData($varcomb, "A|B|C") EndFunc func _exit() Exit EndFunc
-
#include <GuiTab.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> AutoItSetOption("GUIOnEventMode", 1) global $tabspace, $tabspace_opt, $old_tab, $tabs[3] = [2], $opt_tabs[6] = [5] global $width = 400, $height = 300, $x = -1, $y = -1 $ExampleGUI = GUICreate("example", $width, $height, $x, $y, BitOr($WS_CAPTION, $WS_SYSMENU, $WS_MINIMIZEBOX, $WS_SIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "DoExit", $ExampleGUI) $opt_gui = GUICreate("opt_child", $width, $height-50, 3, 5, BitOR($WS_CHILD, $WS_TABSTOP), -1, $ExampleGUI) $tabspace_opt = GUICtrlCreateTab(3, 2, $width-20, $height-20, BitOr($TCS_BUTTONS, $TCS_FLATBUTTONS, $TCS_TOOLTIPS, $TCS_HOTTRACK, $WS_CHILD, $WS_TABSTOP)) $opt_tabs[1] = GUICtrlCreateTabItem(" Option 1 ") $opt_tabs[2] = GUICtrlCreateTabItem(" Option 2 ") $opt_tabs[3] = GUICtrlCreateTabItem(" Option 3 ") $opt_tabs[4] = GUICtrlCreateTabItem(" Option 4 ") $opt_tabs[5] = GUICtrlCreateTabItem(" Option 5 ") GUICtrlCreateTabItem("") GUISwitch($ExampleGUI) $tabspace = GUICtrlCreateTab(3, 2, $width, $height-5, BitOr($TCS_BOTTOM, $TCS_BUTTONS, $TCS_TOOLTIPS, $TCS_HOTTRACK, $WS_TABSTOP)) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) $tabs[1] = GUICtrlCreateTabItem(" Main Tab.. ") $tabs[2] = GUICtrlCreateTabItem(" Options.. ") GUICtrlCreateTabItem("") GUICtrlSetTip($tabs[1], " Tip for the main tab.. ") GUICtrlSetTip($tabs[2], " Tip for the options tab.. ") GUICtrlSetTip($opt_tabs[1], " Tip for options tab 1.. ") GUICtrlSetTip($opt_tabs[2], " Tip for options tab 2.. ") GUICtrlSetTip($opt_tabs[3], " Tip for options tab 3.. ") GUICtrlSetTip($opt_tabs[4], " Tip for options tab 4.. ") GUICtrlSetTip($opt_tabs[5], " Tip for options tab 5.. ") GUISetState(@SW_SHOW, $ExampleGUI) while true local $new_tab = GUICtrlSendMsg($tabspace, $TCM_GETCURSEL, 0, 0) if $new_tab <> $old_tab then if $new_tab = 1 then GUISetState(@SW_SHOW, $opt_gui) else GUISetState(@SW_HIDE, $opt_gui) GUISetState(@SW_SHOW, $ExampleGUI) endif $old_tab = $new_tab endif Sleep(100) wend func DoExit() exit endfunc As you can see, the tooltip for the options tabs 1 & 2 appear when hovering your pointer over the main two tabs. Am I doing something wrong? Or is this a bug? ;o) Cor
-
I'm writing a script to automate retrieving PDFs from a third-party website. The website opens the PDF in a new tab when I click on the link. I know how to click on the link, but the focus remains in the original tab. I need to transfer control to the newly-opened tab, where I can execute a SaveAs on the PDF. How do I detect the new tab and move to it?
- 9 replies
-
- internet explorer
- ie
-
(and 1 more)
Tagged with:
-
How to remove grey area after the tabs? Code: ; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ; #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiButton.au3> #include <GuiTab.au3> $GUI = GUICreate("GUI",350,350,-1,-1,-1,-1) GUISetBkColor(0xFFFFFF,$GUI) $tab = GUICtrlCreatetab(10,10,335,329,-1,-1) GuiCtrlSetState(-1,2048) GUICtrlCreateTabItem("Page 1") GUICtrlCreateTabItem("Page 2") GUICtrlCreateTabItem("Page 3") GUICtrlCreateTabItem("Page 4") GUICtrlCreateTabItem("Page 5") GUICtrlCreateTabItem("") _GUICtrlTab_SetCurFocus($tab,-1) _GUICtrlTab_SetCurFocus($tab,0)
-
Hello, Several places in my Tabbed GUI input is overwritten again and again. the problem is that I can't get the old text to go away. So it overlaps until it is a mixed up line of unreadable black. In the sample below if you go to TAB4, Enter some text in the input box, click OK. Thinks look normal. Go to the input box agaion and change or add more text and click on OK. Not so Good. Thanks! #include <Array.au3> ;#include <AVIConstants.au3> #include <Constants.au3> ;#include <Date.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> ;#include <IE.au3> #include <Process.au3> #include <StaticConstants.au3> #include <String.au3> ;#include <TreeViewConstants.au3> #include <ListViewConstants.au3> #include <ColorConstants.au3> #include <WinAPI.au3> ;#include <Inet.au3> #include <Services.au3> ;#include <NetInfo.au3> #include <WindowsConstants.au3> ;#include <GuiImageList.au3> Global $g_idListView = 99999 , $DirectSubmitButton, $StatusButton DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) ; This disables 32bit applications from being redirected to syswow64 instead of system32 by default ; ConsoleWrite("Loaded #include Files" & @CRLF) Global $SSID, $BSSID, $Signal, $Authentication, $Encryption GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping ConsoleWrite("Created Variables" & @CRLF) DirCreate (@TempDir & "\\SCCTemp") $SCCTempDir=(@TempDir & "\\SCCTemp\") ConsoleWrite("Created $SCCTempDir directory at " & $SCCTempDir & @CRLF) Call("_WifiNetsPrep") Call("_WifiNets") $Gooey = GUICreate("Sortable Wifi Tab", 770, 540) $Tab = GUICtrlCreateTab(10, 0, 755, 530) ; -15 x -10 $Tab1 = GUICtrlCreateTabItem("Tab 1") ;- ========================================================================== Status ;~ GUISwitch($Gooey, $Tab1) $font = ("Lucida Console") GUISetFont(9, 400, 1, $font) GUICtrlCreateLabel("Data on Tab 1", 30, 60) ; Label, Dist to right, Down ;~ GUICtrlCreateTabItem("") ;~ GUISwitch($Gooey) $Tab2 = GUICtrlCreateTabItem("Tab 2") ;- ========================================================================== ARP/UPnP ;~ GUISwitch($Gooey, $Tab2) $font = ("Lucida Console") GUISetFont(9, 400, 1, $font) GUICtrlCreateLabel("Data on Tab 2", 30, 60) ; Label, Dist to right, Down ;~ GUICtrlCreateTabItem("") ;~ GUISwitch($Gooey) $Tab3 = GUICtrlCreateTabItem("Tab 3") ; =================================================================================== PINGS ;~ GUISwitch($Gooey, $Tab3) $font = ("MS Sans Serif") GUISetFont(9, 400, 1, $font) GUICtrlCreateLabel("Data on Tab 3", 30, 60) ; Label, Dist to right, Down ;~ GUICtrlCreateTabItem("") ;~ GUISwitch($Gooey) $Tab4 = GUICtrlCreateTabItem("Tab 4") ;- ========================================================================== s GUISwitch($Gooey, $Tab4) GUICtrlCreateLabel("Ping: ", 30, 450) ; Label, Dist to right, Down Global $Tab4OK = GUICtrlCreateInput("", 80, 60, 150, 20) ;MsgBox(0, "$BrowserDefault", $BrowserDefault) $IPButton = GUICtrlCreateButton("OK", 340, 60, 60) ;GUICtrlSetState($IPButton, $GUI_DISABLE) $DirectSubmitButton = GUICtrlCreateButton("Direct Submit", 340, 90, 85) GUICtrlSetState($DirectSubmitButton, $GUI_DISABLE) $StatusButton = GUICtrlCreateButton("Status", 340, 120, 60) GUICtrlSetState($StatusButton, $GUI_DISABLE) $Tab5 = GUICtrlCreateTabItem("Wifi") ;- ========================================================================== Wifi Networks GUICtrlCreateTabItem("") _BuildLV() GUISetState() While 1 Switch GUIGetMsg() Case $Tab Switch GUICtrlRead($Tab) Case $Tab Case 0 ;ConsoleWrite ("1st Tab " & @CRLF ) ; Status Case 1 ;ConsoleWrite ("2nd Tab " & @CRLF ) ; ARP/UPnP Case 2 ;ConsoleWrite ("3rd Tab "& @CRLF ) ; Pings Case 3 ;ConsoleWrite ("4th Tab " & @CRLF ) ; s Case 4 ;~ EndSwitch Case $IPButton GUISwitch($Gooey, $Tab4) ;MsgBox(0, "this", "This is in SonosIP Button") Call ("_Tab4") ; Call to TAB with Overwriet issue GUICtrlCreateTabItem("") GUISwitch($Gooey) Case $GUI_EVENT_CLOSE ConsoleWrite("Case $GUI_EVENT_CLOSE in main loop" & @CRLF) DirRemove($SCCTempDir) Exit Case $g_idListView _SortBy() EndSwitch WEnd Func _Tab4() ; ======================================== TAB with Overwrite issue ============================================================================= GUISwitch($Gooey, $Tab4) GUICtrlSetState($DirectSubmitButton, $GUI_ENABLE) GUICtrlSetState($StatusButton, $GUI_ENABLE) $DestinationIP = "192.168.1.34" $DestinationIP = GUICtrlRead($Tab4OK) ;$font = ("Verdana") ;GUISetFont(9, 400,1 , $font) Global $DS = GUICtrlCreateLabel("http://" & $DestinationIP & "/support/", 30, 90) $DirectSubmit = ("http://" & $DestinationIP & "/support/") Global $Stat = GUICtrlCreateLabel("http://" & $DestinationIP & "/status", 30, 120) $Status = ("http://" & $DestinationIP & "/status") GUICtrlCreateTabItem("") GUISwitch($Gooey) EndFunc Func _WifiNetsPrep() Local $rc = _RunDos("netsh wlan show all > " & $SCCTempDir & "WifiData.txt") Global $WifiData2 = $SCCTempDir & "WifiData.txt" ConsoleWrite("WIfiTab $$WifiData2 " & $WifiData2) Local $WifiNets = FileRead($WifiData2) FileOpen($WifiData2, 2) Local $Trim1 = StringInStr($WifiNets, "SSID 1") $WifiNets = StringTrimLeft($WifiNets, $Trim1 - 6) FileWrite($WifiData2, $WifiNets) FileClose($WifiData2) $WifiNets = FileOpen($WifiData2, 1) FileWriteLine($WifiNets, "END") FileClose($WifiNets) EndFunc ;==>_WifiNetsPrep Func _WifiNets() ConsoleWrite("Called _WifiNets()" & @CRLF) $WifiNets = FileOpen($WifiData2, 0) Local $WifiNetsParsed = FileOpen($SCCTempDir & "WifiNetsParsed.txt", 2) Do Local $WifiNetLine = FileReadLine($WifiNets) Local $SSIDCheck = StringInStr($WifiNetLine, "SSID") If $SSIDCheck <> 0 Then FileWriteLine($WifiNetsParsed, $WifiNetLine) Local $AuthenticationCheck = StringInStr($WifiNetLine, "Authentication") If $AuthenticationCheck <> 0 Then FileWriteLine($WifiNetsParsed, $WifiNetLine) Local $EncryptionCheck = StringInStr($WifiNetLine, "Encryption") If $EncryptionCheck <> 0 Then FileWriteLine($WifiNetsParsed, $WifiNetLine) Local $SignalCheck = StringInStr($WifiNetLine, "Signal") If $SignalCheck <> 0 Then FileWriteLine($WifiNetsParsed, $WifiNetLine) Local $ChannelCheck = StringInStr($WifiNetLine, "Channel") If $ChannelCheck <> 0 Then FileWriteLine($WifiNetsParsed, $WifiNetLine) If $ChannelCheck <> 0 Then FileWriteLine($WifiNetsParsed, " ") Until $WifiNetLine = "END" FileClose("$WifiData2") FileWriteLine($WifiNetsParsed, "END") FileClose($WifiNetsParsed) $font = ("MS Sans Serif") GUISetFont(9, 400, 1, $font) Local $iListView = GUICtrlCreateListView("Detected Wifi Networks ", 30, 90, 725, 430) _GUICtrlListView_SetColumnWidth($iListView, 0, $LVSCW_AUTOSIZE_USEHEADER) $WifiNetsParsed = FileOpen($SCCTempDir & "WifiNetsParsed.txt", 0) Do $WifiNets = FileReadLine($WifiNetsParsed) GUICtrlCreateListViewItem($WifiNets, $iListView) Until $WifiNets = "END" EndFunc ;==>_WifiNets Func _BuildLV() ; Wifi data sort ConsoleWrite(@ScriptLineNumber & " Called _BuildLV" & @CRLF) ;~ Global $g_idListView Local $hImage, $aIcons[3] = [0, 3, 6] Local $iExWindowStyle = BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE) Local $iExListViewStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER) GUISwitch($Gooey, $Tab5) $g_idListView = GUICtrlCreateListView("SSID|BSSID|Channel|Signal|Authentication|Encryption", 20, 25, 730, 500, -1, $iExWindowStyle) ;28, 25, 725, 500 _GUICtrlListView_SetExtendedListViewStyle($g_idListView, $iExListViewStyle) $WifiNets = FileOpen($WifiData2, 0) Do Global $WifiNetLine = FileReadLine($WifiNets) Global $SSIDCheck = StringInStr($WifiNetLine, "SSID") Global $AuthenticationCheck = StringInStr($WifiNetLine, "Authentication") Global $EncryptionCheck = StringInStr($WifiNetLine, "Encryption") Global $BSSIDCheck = StringInStr($WifiNetLine, "BSSID") Global $SignalCheck = StringInStr($WifiNetLine, "Signal") Global $ChannelCheck = StringInStr($WifiNetLine, "Channel") If $SSIDCheck <> 0 And $BSSIDCheck = 0 Then Call("_SSIDTrimmer") If $SSIDCheck <> 0 And $BSSIDCheck <> 0 Then Call("_BSSIDTrimmer") If $AuthenticationCheck <> 0 Then Call("_AuthenticationTrimmer") If $EncryptionCheck <> 0 Then Call("_EncryptionTrimmer") If $SignalCheck <> 0 Then Call("_SignalTrimmer") If $ChannelCheck <> 0 Then Call("_ChannelTrimmer") Until $WifiNetLine = "END" GUISetState(@SW_SHOW) _GUICtrlListView_RegisterSortCallBack($g_idListView) Local $count = 0 EndFunc ;==>_BuildLV Func _SortBy() ConsoleWrite( @ScriptLineNumber & " _SortBy" & @CRLF) $Column = GUICtrlGetState($g_idListView) _GUICtrlListView_SortItems($g_idListView, $Column) EndFunc ;==>_SortBy Func _SSIDTrimmer() ;ConsoleWrite( @ScriptLineNumber & " Called _SSIDTrimmer()" & @CRLF) ;msgbox (0, "Func _SSIDTrimmer()", "We're Here Now") Local $Colon = StringInStr($WifiNetLine, ":") $SSID = StringTrimLeft($WifiNetLine, $Colon) ;Local $BSSID_WAP = 0 ;msgbox (0, "$SSID ", $SSID) EndFunc ;==>_SSIDTrimmer Func _BSSIDTrimmer() ;ConsoleWrite( @ScriptLineNumber & " Called _BSSIDTrimmer()" & @CRLF) ;msgbox (0, "Func _BSSIDTrimmer()", "We're Here Now") Local $Colon = StringInStr($WifiNetLine, ":") $BSSID = StringTrimLeft($WifiNetLine, $Colon) ;Local $BSSID_WAP = 1 ;msgbox (0, "$BSSID ", $BSSID) EndFunc ;==>_BSSIDTrimmer Func _AuthenticationTrimmer() ;msgbox (0, "_SignalTrimmer()", "We're Here Now") Local $Colon = StringInStr($WifiNetLine, ":") $Authentication = StringTrimLeft($WifiNetLine, $Colon) ;msgbox (0, "$Authentication ", $Authentication) EndFunc ;==>_AuthenticationTrimmer Func _EncryptionTrimmer() ;msgbox (0, "_SignalTrimmer()", "We're Here Now") Local $Colon = StringInStr($WifiNetLine, ":") $Encryption = StringTrimLeft($WifiNetLine, $Colon) ;msgbox (0, "$Encryption ", $Encryption) EndFunc ;==>_EncryptionTrimmer Func _SignalTrimmer() ;msgbox (0, "_SignalTrimmer()", "We're Here Now") Local $Colon = StringInStr($WifiNetLine, ":") $Signal = StringTrimLeft($WifiNetLine, $Colon) ;msgbox (0, "$Signal ", $Signal) EndFunc ;==>_SignalTrimmer Func _ChannelTrimmer() ConsoleWrite(@ScriptLineNumber & " Called _ChannelTrimmer" & @CRLF) Local $Colon = StringInStr($WifiNetLine, ":") $Channel = StringTrimLeft($WifiNetLine, $Colon) $bChannel = Number($Channel) ;msgbox (0, "$bChannel ", $bChannel) _AddRow($g_idListView, $SSID & "|" & $BSSID & "|" & $bChannel & "|" & $Signal & "|" & $Authentication & "|" & $Encryption) ; Passing Data to AddRow ;$SSID = "" $BSSID = "" $Authentication = "" $Encryption = "" $Channel = "" $Signal = "" EndFunc ;==>_ChannelTrimmer Func _AddRow($hWnd, $sItem, $iPlus = 0) ConsoleWrite(@ScriptLineNumber & " Called _AddRow" & @CRLF) Local $aItem = StringSplit($sItem, "|") Local $iIndex = _GUICtrlListView_AddItem($hWnd, $aItem[1], +$iPlus, _GUICtrlListView_GetItemCount($hWnd) + 9999) _GUICtrlListView_SetColumnWidth($hWnd, 0, $LVSCW_AUTOSIZE_USEHEADER) For $x = 2 To $aItem[0] _GUICtrlListView_AddSubItem($hWnd, $iIndex, $aItem[$x], $x - 1, $iPlus) _GUICtrlListView_SetColumnWidth($hWnd, $x - 1, $LVSCW_AUTOSIZE) Next ConsoleWrite(@ScriptLineNumber & " Return from _AddRow" & @CRLF) EndFunc ;==>_AddRow Func _CleanUp() FileClose($SCCTempDir & "WifiNetsParsed.txt") FileClose($SCCTempDir & "WifiChannel.txt") Sleep(500) FileDelete($SCCTempDir & "WifiNetsParsed.txt") FileDelete($SCCTempDir & "WifiChannel.txt") EndFunc ;==>_CleanUp test overwrite on tabs.au3
- 2 replies
-
- Tabs Overwrite
- GUICtrlCreateLabel
-
(and 1 more)
Tagged with:
-
A few quick searched yielded no results, so... This sets the width of the tabs for a tab control according to the gui width. Additionally, it can control min/max gui size. One benefit of this is, if you have a custom background color for your gui, you no longer have to do something 'sneaky' like adding a colored label to cover that unsightly gray area of the tab control. This was updated to address the bug that @funkey found #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 3 -w 4 -w 5 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> Global $Form1 = GUICreate("Form1", 214, 121, 645, 124, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP)) Global $Tab1 = GUICtrlCreateTab(0, 0, 213, 120, $TCS_FIXEDWIDTH) ; $TCS_FIXEDWIDTH required! GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUICtrlCreateTabItem("TabSheet1") GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") Global $aTabCtrlPos, $aWinPos = WinGetPos($Form1) ; set initial tab width _Tab_SetWidth(1) ; the parameter = the number of additional pixels to subtract from the tab width to avoid having the previous/next tab control show GUISetState(@SW_SHOW) GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") ;GUIRegisterMsg($WM_SIZE, "WM_SIZE") ; without the minimum gui size constraints (comment out above line) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE _Tab_SetWidth(2) EndSwitch WEnd Func _Tab_SetWidth($i) ; sets the tab width Local $aRet = ControlGetPos($Form1, "", $Tab1) ; used to set tab width ; size tabs - need to subtract a small number of pixels, else sometimes the previous/next tab control will show - the more tabs, the more we need to subtract ; the "2" in "/ 2" = the number of tabs in the tab control If Not @error Then GUICtrlSendMsg($Tab1, $TCM_SETITEMSIZE, 0, Int($aRet[2] / 2) - $i) EndFunc Func WM_GETMINMAXINFO($hWnd, $MsgID, $wParam, $lParam) #forceref $MsgID, $wParam If Not IsHWnd($hWnd) Then Return $GUI_RUNDEFMSG Local $minmaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($minmaxinfo, 7, $aWinPos[2]) ; enforce a minimum width for the gui (min width will be the initial width of the gui) DllStructSetData($minmaxinfo, 8, $aWinPos[3]) ; enforce a minimum height for the gui (min height will be the initial height of the gui) _Tab_SetWidth(2) Return $GUI_RUNDEFMSG EndFunc ; without the minimum gui size constraints (comment out WM_GETMINMAXINFO function)... #cs Func WM_SIZE($hWnd, $MsgID, $wParam, $lParam) #forceref $MsgID, $wParam, $lParam If Not IsHWnd($hWnd) Then Return $GUI_RUNDEFMSG _Tab_SetWidth(2) Return $GUI_RUNDEFMSG EndFunc #ce
-
Greetings, I know this subject has been beaten to death and many people have gotten close, but I have not been able to find an actual resolution so far. I have a GUI that uses tabs and on the first tab, I have a _GUICtrlListView_Create, and at first, no matter what tab you changed it to, that control would show right through anything else. I was able to fix it by hiding the control much like the Dev team advised when handling tabs. My only concern is the control has a delay when hiding, and when coming back when I switch tabs. Has anyone been able to find a way around this? I am including the code here and attaching the AU3 for convenience.. On a side note, chunks of this code not related to the problem will be removed because I am borrowing from some of my other scripts. #region INCLUDES #include <ButtonConstants.au3 > #include <ComboConstants.au3 > #include <GUIConstantsEx.au3 > #include <GuiStatusBar.au3 > #include <Misc.au3 > #include <GUIListViewEx.au3 > #include <StaticConstants.au3 > #include <TabConstants.au3 > #include <WindowsConstants.au3> #endregion INCLUDES #region GLOBALS Global $reportsfile = "SWAT_Report" Global $Settingsinifile = "SWAT_Settings.ini" Global $commandsfile = "SWAT_Commands.ini" Global $Jobsfile = "SWAT_Jobs.ini" Global $RegLoc = "HKEY_LOCAL_MACHINE\SOFTWARE\SWAT\" Global $bgcolor = 0xEEEEEE Global $dll = DllOpen("user32.dll") Global $ToolMacro1 = "Empty Macro" #endregion GLOBALS #region Defaults GUICtrlSetDefBkColor($GUI_BKCOLOR_TRANSPARENT) #endregion Defaults #region GUI $MainGui = GUICreate("Form2", 1108, 722, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $DS_SETFOREGROUND)) $Menu_File = GUICtrlCreateMenu("File") $Menu_File_Exit = GUICtrlCreateMenuItem("Exit", $Menu_File) $Menu_Action = GUICtrlCreateMenu("Action") $Menu_Action_Start = GUICtrlCreateMenuItem("Start", $Menu_Action) $Menu_Help = GUICtrlCreateMenu("Help") $Menu_Help_About = GUICtrlCreateMenuItem("About", $Menu_Help) $Menu_Help_ChangeLog = GUICtrlCreateMenuItem("Change Log", $Menu_Help) $Tabs = GUICtrlCreateTab(0, 0, 793, 425, 0272) #region "Run Job" $T_RunJob = GUICtrlCreateTabItem("Run Job") ;$RunJob_Jobs = GUICtrlCreateListView("col1 |col2|col3 ", 8, 49, 777, 161) Global $RunJob_Jobs = _GUICtrlListView_Create($MainGui, " Job Name | Commands | Computers | OnDemand ", 8, 49, 777, 161, BitOR($LVS_DEFAULT, $WS_BORDER, $LVS_EDITLABELS)) _GUICtrlListView_SetExtendedListViewStyle($RunJob_Jobs, BitOR($LVS_EX_DOUBLEBUFFER, $LVS_EX_BORDERSELECT, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) _GUICtrlListView_SetColumnWidth($RunJob_Jobs, 0, 140) _GUICtrlListView_SetColumnWidth($RunJob_Jobs, 1, 300) _GUICtrlListView_SetColumnWidth($RunJob_Jobs, 2, 180) _GUICtrlListView_SetColumnWidth($RunJob_Jobs, 3, 75) Global $init2 = _GUIListViewEx_Init($RunJob_Jobs, "", 0, 0x00FF00) $RunJob_B_StartJob = GUICtrlCreateButton("Start Selected Job", 8, 217, 123, 25) $RunJob_B_AddComps = GUICtrlCreateButton("Add Selected Computers", 640, 217, 147, 25) $RunJob_B_RefreshCompList = GUICtrlCreateButton("Refresh Computer List", 640, 249, 147, 25) GUICtrlCreateLabel("JOBS STATUS", 8, 257, 278, 49) GUICtrlSetFont(-1, 30, 400, 0, "Arial") GUICtrlCreateLabel("Jobs", 8, 33, 26, 17) $RunJob_Status = GUICtrlCreateLabel("Running", 288, 257, 147, 49) GUICtrlSetFont(-1, 30, 400, 0, "Arial") $RunJob_Currently = GUICtrlCreateLabel("Currently", 8, 305, 161, 49) GUICtrlSetFont(-1, 30, 400, 0, "Arial") $RunJob_PercentComplete = GUICtrlCreateLabel("100%", 176, 305, 106, 49) GUICtrlSetFont(-1, 30, 400, 0, "Arial") $RunJob_Complete = GUICtrlCreateLabel("complete", 288, 305, 165, 49) GUICtrlSetFont(-1, 30, 400, 0, "Arial") #region "Job Builder" $T_JobBuilder = GUICtrlCreateTabItem("Job Builder") $JobBuilder_Commands = GUICtrlCreateListView("Command Name | Command String ", 8, 73, 393, 345) GUICtrlSetData(-1, "") $JobBuilder_JobList = GUICtrlCreateTreeView(552, 73, 233, 345) GUICtrlCreateLabel("Commands", 8, 57, 56, 17) GUICtrlCreateLabel("Job List", 552, 57, 40, 17) $JobBuilder_B_RefreshCommands = GUICtrlCreateButton("Refresh", 296, 41, 75, 25) $JobBuilder_B_RefreshJobList = GUICtrlCreateButton("Refresh", 704, 41, 75, 25) $JobBuilder_B_AddCommand = GUICtrlCreateButton("Add Command >>", 416, 361, 123, 25) $JobBuilder_B_RemoveCommand = GUICtrlCreateButton("<< Remove Command", 416, 393, 123, 25) $JobBuilder_B_CreateJob = GUICtrlCreateButton("Create new Job", 416, 113, 123, 25) $JobBuilder_B_RemoveJob = GUICtrlCreateButton("Remove Job", 416, 145, 123, 25) #region "Command List" $T_CommandList = GUICtrlCreateTabItem("Command List") $CommandList_CommandString = GUICtrlCreateInput("", 144, 393, 633, 22) $CommandList_CommFriendlyName = GUICtrlCreateInput("", 8, 393, 121, 22) $CommandList_CommandList = GUICtrlCreateListView("Command Name | Command String ", 8, 33, 769, 281) GUICtrlCreateLabel("Command Friendly Name", 8, 377, 121, 17) GUICtrlCreateLabel("Command String", 144, 377, 81, 17) $CommandList_B_Add = GUICtrlCreateButton("Add", 8, 321, 75, 25) $CommandList_B_Edit = GUICtrlCreateButton("Edit", 96, 321, 75, 25) $CommandList_B_Delete = GUICtrlCreateButton("Delete", 184, 321, 75, 25) #region "Results" $T_Results = GUICtrlCreateTabItem("Results") $Results_Results = GUICtrlCreateEdit("Edit4", 8, 33, 777, 337) $Results_B_TBD1 = GUICtrlCreateButton("TBD", 8, 377, 75, 25) $Results_B_TBD2 = GUICtrlCreateButton("Button23", 88, 377, 75, 25) $Results_B_TBD3 = GUICtrlCreateButton("Button24", 168, 377, 75, 25) #region "Compare Reports" $T_CompareReports = GUICtrlCreateTabItem("Compare Reports") GUICtrlCreateGroup("", 16, 241, 761, 177) $CompResults_CompareResults = GUICtrlCreateEdit("CompResults_B3", 20, 256, 670, 153) $CompResults_B_CompareResults_Save = GUICtrlCreateButton("Save as", 696, 385, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $CompResults_LeftEdit = GUICtrlCreateEdit("CompResults_B1", 16, 41, 300, 201) $CompResults_RightEdit = GUICtrlCreateEdit("CompResults_B2", 472, 41, 305, 201) $CompResults_B_LoadLeft = GUICtrlCreateButton("<< Load Results", 328, 41, 131, 25) $CompResults_B_LoadRight = GUICtrlCreateButton("Load Results >>", 328, 73, 131, 25) $CompResults_B_GenerateCompare = GUICtrlCreateButton("Generate Comparison", 328, 209, 131, 25) #region "Preferences" $T_Preferences = GUICtrlCreateTabItem("Preferences") GUICtrlCreateGroup("Domain Account with Admin Rights", 16, 33, 281, 153) GUICtrlSetBkColor(-1, $bgcolor) $Preferences_DomainUsername = GUICtrlCreateInput("", 24, 65, 150, 22) $Preferences_DomainPass = GUICtrlCreateInput("", 24, 145, 150, 22) GUICtrlCreateLabel("Username", 24, 49, 52, 17) GUICtrlCreateLabel("Domain", 24, 89, 40, 17) $Preferences_DomainDomain = GUICtrlCreateInput("", 24, 105, 150, 22) GUICtrlCreateLabel("Password", 24, 129, 50, 17) $Preferences_B_DomainValidate = GUICtrlCreateButton("Validate", 208, 153, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Local Account with Admin Rights", 16, 193, 281, 105) GUICtrlSetBkColor(-1, $bgcolor) $Preferences_LocalPass = GUICtrlCreateInput("", 24, 265, 150, 22) GUICtrlCreateLabel("Password", 24, 249, 40, 17) $Preferences_LocalUsername = GUICtrlCreateInput("", 24, 225, 150, 22) GUICtrlCreateLabel("Username", 24, 209, 52, 17) $Preferences_B_LocalValidate = GUICtrlCreateButton("Validate", 208, 265, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("File Locations", 304, 33, 473, 177) GUICtrlSetBkColor(-1, $bgcolor) GUICtrlCreateLabel("Commands and Job file storage", 312, 145, 151, 17) $Preferences_ComJobFileLocal = GUICtrlCreateInput("", 312, 161, 449, 22) $Preferences_ReportsFileLocal = GUICtrlCreateInput("", 312, 81, 449, 22) GUICtrlCreateLabel("Reports", 312, 65, 41, 17) $Preferences_SettingsINIFileLoc = GUICtrlCreateInput("", 312, 121, 449, 22) GUICtrlCreateLabel("Settings INI File", 312, 105, 78, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("IMPORT SETTINGS", 16, 305, 281, 113) GUICtrlSetBkColor(-1, $bgcolor) $Preferences_ImportFromComp = GUICtrlCreateInput("", 184, 337, 100, 22) GUICtrlCreateLabel("Import from computer", 184, 321, 103, 17) $Preferences_B_Import = GUICtrlCreateButton("IMPORT", 208, 377, 75, 25) $Preferences_ImportADMPass = GUICtrlCreateInput("", 24, 377, 150, 22) GUICtrlCreateLabel("ADM Password", 24, 361, 77, 17) $Preferences_ImportADMUsername = GUICtrlCreateInput("", 24, 337, 150, 22) GUICtrlCreateLabel("ADM Username", 24, 321, 79, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("Group5", 304, 217, 473, 161) GUICtrlSetBkColor(-1, $bgcolor) $Preferences_TBD2 = GUICtrlCreateCheckbox("Future Use 1", 320, 249, 97, 17) $Preferences_TBD1 = GUICtrlCreateCheckbox("Future Use 2", 320, 265, 97, 17) $Preferences_TBD3 = GUICtrlCreateCheckbox("Future Use 3", 320, 281, 97, 17) $Preferences_TBD4 = GUICtrlCreateCheckbox("Future Use 4", 320, 297, 97, 17) $Preferences_TBD5 = GUICtrlCreateCheckbox("Future Use 5", 320, 313, 97, 17) $Preferences_TBD6 = GUICtrlCreateCheckbox("Future Use 6", 320, 329, 97, 17) $Preferences_B_SaveAll = GUICtrlCreateButton("Save All", 704, 393, 75, 25) $Preferences_B_Reset = GUICtrlCreateButton("Reset", 624, 393, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) #region "Diagnostics" $T_Diags = GUICtrlCreateTabItem("Diagnostics") $T_Diags_B_StartDiags = GUICtrlCreateButton("Start Diags", 640, 265, 115, 25) $Diags_Step1 = GUICtrlCreateLabel("Has Valid IP", 32, 105, 62, 17) $Diags_Step2 = GUICtrlCreateLabel("Can reach domain", 32, 129, 90, 17) $Diags_Step3 = GUICtrlCreateLabel("Can see computers ready for testing", 32, 153, 173, 17) $Diags_Step4 = GUICtrlCreateLabel("Reports Path exists and is writeable", 32, 177, 171, 17) $Diags_Step5 = GUICtrlCreateLabel("Settings Path exists and is writeable", 32, 201, 172, 17) $Diags_Step6 = GUICtrlCreateLabel("Commands and Job file storage exists and is writeable", 32, 225, 256, 17) $Diags_Step7 = GUICtrlCreateLabel("Local User Account with Admin Rights account is in good standing", 32, 249, 318, 17) $Diags_Step8 = GUICtrlCreateLabel("Domain User Account with Admin Rights account is in good standing", 32, 273, 328, 17) ;$Label26 = GUICtrlCreateLabel("", 32, 257, 4, 4) $Edit5 = GUICtrlCreateEdit("Edit5", 33, 297, 727, 113) #region ### Bottom Area ### GUICtrlCreateTabItem("") GUICtrlCreateGroup("", 0, 432, 793, 137) $CustCommand = GUICtrlCreateInput("", 8, 536, 657, 21) $Execute = GUICtrlCreateButton("Execute", 672, 536, 99, 25) GUICtrlCreateLabel("Custom Command", 8, 520, 89, 17) $Macro1 = GUICtrlCreateButton("Macro1", 8, 448, 75, 25) $Macro2 = GUICtrlCreateButton("Macro2", 88, 448, 75, 25) $Macro3 = GUICtrlCreateButton("Macro3", 168, 448, 75, 25) $Macro4 = GUICtrlCreateButton("Macro4", 248, 448, 75, 25) $Macro5 = GUICtrlCreateButton("Macro5", 328, 448, 75, 25) $Macro6 = GUICtrlCreateButton("Macro6", 8, 480, 75, 25) $Macro7 = GUICtrlCreateButton("Macro7", 88, 480, 75, 25) $Macro8 = GUICtrlCreateButton("Macro8", 168, 480, 75, 25) $Macro9 = GUICtrlCreateButton("Macro9", 248, 480, 75, 25) $Macro10 = GUICtrlCreateButton("Macro10", 328, 480, 75, 25) GUICtrlSetTip($Macro1 , $ToolMacro1, "Macro 1", 1, 1) GUICtrlSetTip($Macro2 , $ToolMacro1, "Macro 2", 1, 1) GUICtrlSetTip($Macro3 , $ToolMacro1, "Macro 3", 1, 1) GUICtrlSetTip($Macro4 , $ToolMacro1, "Macro 4", 1, 1) GUICtrlSetTip($Macro5 , $ToolMacro1, "Macro 5", 1, 1) GUICtrlSetTip($Macro6 , $ToolMacro1, "Macro 6", 1, 1) GUICtrlSetTip($Macro7 , $ToolMacro1, "Macro 7", 1, 1) GUICtrlSetTip($Macro8 , $ToolMacro1, "Macro 8", 1, 1) GUICtrlSetTip($Macro9 , $ToolMacro1, "Macro 9", 1, 1) GUICtrlSetTip($Macro10, $ToolMacro1, "Macro 010", 1, 1) LoadToolTips() GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("Custom Command", 420, 448, 357, 81) $MachList = GUICtrlCreateEdit("", 800, 24, 305, 545) GUICtrlSetData(-1, "") $Console = GUICtrlCreateEdit("", 0, 600, 1105, 97) GUICtrlSetData(-1, "console") $_B_SaveConsole = GUICtrlCreateButton("Save", 0, 576, 75, 17) $_B_ClearConsole = GUICtrlCreateButton("Clear", 80, 576, 75, 17) ;$ButtonForLaterUse = GUICtrlCreateButton("Save", 160, 576, 75, 17) GUICtrlSetState($T_RunJob, $GUI_SHOW) GUISetState(@SW_SHOW) #endregion GUI Global $Currenttab = GUICtrlRead($Tabs) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Macro1 If _IsPressed("11", $dll) Then SetMacro(1) Else Macro(1) EndIf Case $Macro2 If _IsPressed("11", $dll) Then SetMacro(2) Else Macro(2) EndIf Case $Macro3 If _IsPressed("11", $dll) Then SetMacro(3) Else Macro(3) EndIf Case $Macro4 If _IsPressed("11", $dll) Then SetMacro(4) Else Macro(4) EndIf Case $Macro5 If _IsPressed("11", $dll) Then SetMacro(5) Else Macro(5) EndIf Case $Macro6 If _IsPressed("11", $dll) Then SetMacro(6) Else Macro(6) EndIf Case $Macro7 If _IsPressed("11", $dll) Then SetMacro(7) Else Macro(7) EndIf Case $Macro8 If _IsPressed("11", $dll) Then SetMacro(8) Else Macro(8) EndIf Case $Macro9 If _IsPressed("11", $dll) Then SetMacro(9) Else Macro(9) EndIf Case $Macro10 If _IsPressed("11", $dll) Then SetMacro(10) Else Macro(10) EndIf ; TAB Switch Stuff Case $Currenttab <> GUICtrlRead($Tabs) $Currenttab = GUICtrlRead($Tabs) If GUICtrlRead($Tabs) <> 0 Then ; If tab is not Run Job then ; WinSetState($RunJob_Jobs, "", @SW_HIDE) Else ; WinSetState($RunJob_Jobs, "", @SW_SHOW) EndIf If GUICtrlRead($Tabs) <> 1 Then ; If tab is not Job Builder then ; Else ; EndIf If GUICtrlRead($Tabs) <> 2 Then ; If tab is not Command List then ; Else ; EndIf If GUICtrlRead($Tabs) <> 3 Then ; If tab is not Results then ; Else ; EndIf If GUICtrlRead($Tabs) <> 4 Then ; If tab is not Compare Reports then ; Else ; EndIf If GUICtrlRead($Tabs) <> 5 Then ; If tab is not Preferences then ; Else ; EndIf If GUICtrlRead($Tabs) <> 6 Then ; If tab is not Diagnostics then ; Else ; EndIf EndSwitch WEnd Func SetMacro($whichone) #cs $minigui = GUICreate("Edit Macro " & $whichone, 434, 229, 192, 114) GUISetBkColor(0xF0F0F0) $macnameset = GUICtrlCreateInput("", 16, 30, 153, 21) GUICtrlSetLimit($macnameset, 12, 0) GUICtrlCreateLabel("Macro Name", 16, 12, 65, 17) $canc = GUICtrlCreateButton("Close", 252, 192, 75, 25) $apply = GUICtrlCreateButton("Apply", 340, 192, 75, 25) $clearm = GUICtrlCreateButton("Clear Macro", 8, 192, 75, 25) $MacLocBu = GUICtrlCreateCombo("", 59, 77, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "4|7|11|15|17|19|52") $MacLocFl = GUICtrlCreateCombo("", 201, 77, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "1|2|3") $MacLocSi = GUICtrlCreateCombo("", 335, 77, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "Left|Right") $MacLocAr = GUICtrlCreateCombo("", 59, 119, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10") $MacLocUn = GUICtrlCreateCombo("", 201, 119, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "0|1|2|3|4|5|6|7|8|9|10") $MacLocSh = GUICtrlCreateCombo("", 335, 119, 85, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|10") GUICtrlCreateLabel("Building:", 13, 77, 45, 20, $SS_RIGHT) GUICtrlCreateLabel("Floor:", 159, 77, 37, 20, $SS_RIGHT) GUICtrlCreateLabel("Side:", 293, 77, 37, 20, $SS_RIGHT) GUICtrlCreateLabel("Area:", 21, 119, 37, 20, $SS_RIGHT) GUICtrlCreateLabel("Unit:", 159, 119, 37, 20, $SS_RIGHT) GUICtrlCreateLabel("Shelf:", 301, 119, 29, 20, $SS_RIGHT) $Label1 = GUICtrlCreateLabel("EDIT MACRO " & $whichone, 224, 10, 170, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) #ce #region ### START Koda GUI section ### Form= $minigui = GUICreate("Edit Macro", 549, 210, 245, 200) GUISetBkColor(0xF0F0F0) $macnameset = GUICtrlCreateInput("", 16, 62, 153, 21) GUICtrlCreateLabel("Command Name", 16, 44, 145, 17) $canc = GUICtrlCreateButton("Close", 372, 160, 75, 25) $apply = GUICtrlCreateButton("Apply", 460, 160, 75, 25) $clearm = GUICtrlCreateButton("Clear Macro", 200, 160, 75, 25) $MacLocAr = GUICtrlCreateCombo("", 19, 167, 149, 120, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) $Label1 = GUICtrlCreateLabel("EDIT MACRO", 328, 10, 170, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Input1 = GUICtrlCreateInput("", 184, 62, 353, 21) GUICtrlCreateLabel("Command String", 184, 44, 145, 17) GUICtrlCreateLabel("Pre-defined Command", 16, 148, 145, 17) $Label2 = GUICtrlCreateLabel("OR", 48, 98, 58, 36) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### $isitthere = RegRead($RegLoc & "Mac" & $whichone, "name") If $isitthere <> "" Then If RegRead($RegLoc & "Mac" & $whichone, "Name") Then GUICtrlSetData($macnameset, RegRead($RegLoc & "Mac" & $whichone, "Name")) If RegRead($RegLoc & "Mac" & $whichone, "Building") Then GUICtrlSetData($MacLocBu, RegRead($RegLoc & "Mac" & $whichone, "Building")) If RegRead($RegLoc & "Mac" & $whichone, "Floor") Then GUICtrlSetData($MacLocFl, RegRead($RegLoc & "Mac" & $whichone, "Floor")) If RegRead($RegLoc & "Mac" & $whichone, "Side") Then GUICtrlSetData($MacLocSi, RegRead($RegLoc & "Mac" & $whichone, "Side")) If RegRead($RegLoc & "Mac" & $whichone, "Area") Then GUICtrlSetData($MacLocAr, RegRead($RegLoc & "Mac" & $whichone, "Area")) If RegRead($RegLoc & "Mac" & $whichone, "Unit") Then GUICtrlSetData($MacLocUn, RegRead($RegLoc & "Mac" & $whichone, "Unit")) If RegRead($RegLoc & "Mac" & $whichone, "Shelf") Then GUICtrlSetData($MacLocSh, RegRead($RegLoc & "Mac" & $whichone, "Shelf")) EndIf GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($minigui) ExitLoop Return Case $canc GUIDelete($minigui) ExitLoop Return Case $apply If GUICtrlRead($macnameset) = "" Then MsgBox(0, "Forget Something?", "You have to give your macro a name. This is the name that will appear on the button of the macro.", 5) Else RegWrite($RegLoc & "Mac" & $whichone, "Name", "REG_SZ", GUICtrlRead($macnameset)) If GUICtrlRead($MacLocBu) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Building", "REG_SZ", GUICtrlRead($MacLocBu)) If GUICtrlRead($MacLocFl) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Floor", "REG_SZ", GUICtrlRead($MacLocFl)) If GUICtrlRead($MacLocSi) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Side", "REG_SZ", GUICtrlRead($MacLocSi)) If GUICtrlRead($MacLocAr) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Area", "REG_SZ", GUICtrlRead($MacLocAr)) If GUICtrlRead($MacLocUn) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Unit", "REG_SZ", GUICtrlRead($MacLocUn)) If GUICtrlRead($MacLocSh) <> "" Then RegWrite($RegLoc & "Mac" & $whichone, "Shelf", "REG_SZ", GUICtrlRead($MacLocSh)) UpdateMacros() GUIDelete($minigui) ExitLoop EndIf Case $clearm Dim $iMsgBoxAnswerMac $iMsgBoxAnswerMac = MsgBox(262419, "Are you SURE?", "Are you SURE you wish to clear this macro?", 15) Select Case $iMsgBoxAnswerMac = 6 ;Yes RegDelete($RegLoc & "Mac" & $whichone) UpdateMacros() MsgBox(0, "", "Macro Cleared") UpdateMacros() Case $iMsgBoxAnswerMac = 7 ;No MsgBox(0, "", "OK, nothing has been deleted", 5) UpdateMacros() Case $iMsgBoxAnswerMac = 2 ;Cancel ;UpdateMacros() Case $iMsgBoxAnswerMac = -1 ;Timeout MsgBox(0, "", "OK, nothing has been deleted", 5) UpdateMacros() EndSelect EndSwitch WEnd EndFunc ;==>SetMacro Func Macro($num) EndFunc ;==>Macro Func UpdateMacros() If RegRead($RegLoc & "Mac1", "Name") Then GUICtrlSetData($Macro1, RegRead($RegLoc & "Mac1", "Name")) GUICtrlSetStyle($Macro1, $GUI_SS_DEFAULT_BUTTON) Else GUICtrlSetData($Macro1, "Macro 1") GUICtrlSetStyle($Macro1, $BS_FLAT) EndIf LoadToolTips() EndFunc ;==>UpdateMacros Func LoadToolTips() $isitthere1 = RegRead($RegLoc & "Mac1", "name") If $isitthere1 <> "" Then $isitthere1data = "" If RegRead($RegLoc & "Mac1", "Building") Then $isitthere1data &= "Building: " & RegRead($RegLoc & "Mac1", "Building") & @CRLF If RegRead($RegLoc & "Mac1", "Floor") Then $isitthere1data &= "Floor: " & RegRead($RegLoc & "Mac1", "Floor") & @CRLF GUICtrlSetTip($Macro1, $isitthere1data, "Macro 1", 1, 1) Else GUICtrlSetTip($Macro1, "This macro is not defined yet." & @CRLF & "Hold CTRL and click on it" & @CRLF & "to bind a command to it.", "Macro 1", 1, 1) EndIf EndFunc ;==>LoadToolTips Func Hide($Rachel) If GUICtrlGetState($Rachel) = 80 Then GUICtrlSetState($Rachel, 96) EndFunc ;==>Hide Func Show($Rachel) If GUICtrlGetState($Rachel) = 96 Then GUICtrlSetState($Rachel, 80) EndFunc ;==>Show Thanks in advance! SWAT Server 1.au3
-
; ******************************************************* ; Example 5 - Create an array of object references to all current browser instances ; The first array element will contain the number of instances found ; ******************************************************* ; #include <IE.au3> Dim $aIE[1] $aIE[0] = 0 $i = 1 While 1 $oIE = _IEAttach ("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] $aIE[$i] = $oIE $aIE[0] = $i $i += 1 WEnd MsgBox(0, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) How can i modify this to show the popup for each tab and display the title of that tab?
-
Hello everyone, I am trying to create some labels over some tabs, to kind of highlights tabs. I get the position of the tabs, and move the labels over them. When I use the up-down control to move the tabs, I need to compute the position again. The problem is that in the execution order, the labels are refreshed before the position of the tabs and I don't know how to change that (that creates a sort of delay and the labels don't stick to the tabs because the tabs move after the labels have been refreshed). I found that the WM_NOTIFY -722 is sent when you click on the up-down. Check out the example below, and try to enable the "sleep" at line 101 to see the refresh order. #include <StructureConstants.au3> #include <TabConstants.au3> #include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Math.au3> Global $hTab, $GUI _Main() Func _Main() $GUI = GUICreate("Test", 500, 500) $hTab = GUICtrlCreateTab(50, 50, 396, 296) GUISetState() _GUICtrlTab_SetMinTabWidth(GUICtrlGetHandle($hTab), 100) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _Tab_Add(0, "Tab 1", 0xFFFF00) ;Tab 1 will be yellow _Tab_Add(1, "Tab 2") _Tab_Add(2, "Tab 3") _Tab_Add(3, "Tab 4", 0x00FF00) ;tab 4 is green _Tab_Add(4, "Tab 5", 0x0000FF) ;tab 5 is blue _Tab_Hightlight(0) _Tab_Hightlight(3) _Tab_Hightlight(4) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func _Tab_Add($iItem, $sText, $iColor = 0xFF0000) Local $iTab = _GUICtrlTab_InsertItem($hTab, $iItem, $sText) $aRect = _GUICtrlTab_GetItemRect($hTab, $iTab) If Not IsArray($aRect) Then Return SetError(1, 0, 0) $iCtrl = GUICtrlCreateLabel("", $aRect[0], $aRect[1], 100, 2) GUICtrlSetBkColor($iCtrl, $iColor) GUICtrlSetState($iCtrl, $GUI_HIDE + $GUI_DISABLE) _GUICtrlTab_SetItemParam($hTab, $iTab, $iCtrl) EndFunc ;==>_Tab_Add Func _Tab_Hightlight($iTabItem, $bHighlight = True) Local $iCtrl, $aRect If $bHighlight Then ;highlight: $iCtrl = _GUICtrlTab_GetItemParam($hTab, $iTabItem) Local $aPos = ControlGetPos($GUI, '', $hTab) $aRect = _GUICtrlTab_GetItemRect($hTab, $iTabItem) If Not IsArray($aRect) Then Return SetError(1, 0, 0) GUICtrlSetPos($iCtrl, $aPos[0] + $aRect[0], $aPos[1] + $aRect[1]) GUICtrlSetState($iCtrl, $GUI_ONTOP + $GUI_SHOW + $GUI_ENABLE) Return SetError(0, 0, $iCtrl) Else ;un-highlight: $iCtrl = _GUICtrlTab_GetItemParam($hTab, $iTabItem) GUICtrlSetState($iCtrl, $GUI_HIDE + $GUI_DISABLE) Return SetError(0, 0, 1) EndIf EndFunc ;==>_Tab_Hightlight Func _tab_RedrawNotif() Local $aPos = ControlGetPos($GUI, '', $hTab) If @error Then Return SetError(1, 0, 0) Local $iCount = _GUICtrlTab_GetItemCount($hTab) For $i = 0 To $iCount Local $iCtrl = _GUICtrlTab_GetItemParam($hTab, $i) $aRect = _GUICtrlTab_GetItemRect($hTab, $i) If Not IsArray($aRect) Then ContinueLoop Local $x = _Max($aPos[0], $aPos[0] + $aRect[0]) Local $y = $aPos[1] + $aRect[1] Local $w = 100 If $x <= $aPos[0] Then $w = 0 EndIf If $x + $w > $aPos[1] + $aPos[2] Then $w = ($aPos[1] + $aPos[2]) - ($x) EndIf GUICtrlSetPos($iCtrl, $x, $y, $w) ;~ Sleep ( 50 ) ;!! TRY TO ENABLE THIS SLEEP AND SEE THAT THE LABELS ARE UPDATED BEFORE THE TAB Next Return True EndFunc ;==>_tab_RedrawNotif Func WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) Local $tagNMHDR = DllStructCreate("int;int;int;int;int;int;int;ptr;int;int;int;int;int;int;int;int;int;int;int", $lParam) If @error Then Return Local $hWndFrom = DllStructGetData($tagNMHDR, 1) Local $IdFrom = DllStructGetData($tagNMHDR, 2) Local $Event = DllStructGetData($tagNMHDR, 3) ;Appearently this event (-722) is triggered when the user clicks the up-down on the tabs If $Event = -722 Then ConsoleWrite("From : " & $hWndFrom & " idfrom : " & $IdFrom & " event : " & $Event & @CR) _tab_RedrawNotif() Return 1 EndIf Switch $hWndFrom Case GUICtrlGetHandle($hTab) ;From the tab control: Switch $Event Case $NM_RCLICK ;Right click to highlight Local $tPoint = _WinAPI_GetMousePos(True, GUICtrlGetHandle($hTab)) Local $tHitTest = _GUICtrlTab_HitTest(GUICtrlGetHandle($hTab), DllStructGetData($tPoint, 1), DllStructGetData($tPoint, 2)) If Not $tHitTest = -1 Then If $tHitTest[0] <> -1 Then _Tab_Hightlight($tHitTest[0], True) EndIf EndIf Case $TCN_SELCHANGE ;left click or change tab to un-highlight: Local $iItem = _GUICtrlTab_GetCurFocus(GUICtrlGetHandle($hTab)) If $iItem <> -1 Then _Tab_Hightlight($iItem, False) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Thanks for your time. PS: I don't want to use the built in function to highlight the tabs because it doesn't work with Uskin dll [EDIT] Solved in post #4 by LarsJ.
-
I am having trouble with Tabs in my code. I create tabs, and each tab has a series of check boxes or labels read from a file. However, the first tab doesn't show anything until you click into the other tab and then click back into it. Any ideas on how to fix this issue? Code is a bit hard to post because I'm basically writing a GUI for a different tool and it needs specific set of files to run and then read from. Any help would be appreciated. Kind Regards
-
Hello! Is it possible to make the background of a tab transparent to f.ex show the backgroundimage of a underlying GUI? According to the help-file the GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) don't work w/ GUICtrlCreateTab It won't do to just set the image to show inside of the tabs instead of this. Any suggestions or solution if this is possible? I saw that this had been asked on the forums a few years back, but that problem didn't get solved. Best regards, zvvyt
- 10 replies
-
- guictrlcreatetab
- transparent
-
(and 2 more)
Tagged with: