Belini Posted January 7, 2019 Share Posted January 7, 2019 (edited) I'm using the UDF Marquee.au3 made by @Melba 23 and I want to move or hide a control without deleting and recreate this control, does anyone know how to do this? My attempts: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include "Marquee.au3" Global $aMarquee_Coords[4] = [0, 0, @DesktopWidth, 60] Global $fMarquee_Pos = "top", $hGUI = 0 ; Create an array to hold the marquee indices Global $aMarquee[8] ; Create GUI to display various marquee styles GUICreate("Marquee Example 1", 320, 400) ; Initialise and create the marquees $aMarquee[0] = _GUICtrlMarquee_Init() _GUICtrlMarquee_Create($aMarquee[0], "Default Marquee Parameters", 10, 10, 300, 20) $aMarquee[1] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[1], Default, "alternate", "right", 7) _GUICtrlMarquee_SetDisplay($aMarquee[1], 1, 0xFF0000, 0xFFFF00, 12, "times new roman") _GUICtrlMarquee_Create($aMarquee[1], "Back And Forth", 10, 45, 300, 20) $aMarquee[2] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[2], 0, Default, "up", 1) _GUICtrlMarquee_SetDisplay($aMarquee[2], 2, "green", Default, 18, "comic sans ms") _GUICtrlMarquee_Create($aMarquee[2], "Up and Up...", 10, 80, 150, 30, "Vertical Scroll Up") $aMarquee[3] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[3], 0, Default, "down", 1) _GUICtrlMarquee_SetDisplay($aMarquee[3], 2, "fuchsia", Default, 18, "comic sans ms") _GUICtrlMarquee_Create($aMarquee[3], "Down We Go", 160, 80, 150, 30, "Vertical Scroll Down") $aMarquee[4] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[4], 0, Default, "right", Default, 120) _GUICtrlMarquee_SetDisplay($aMarquee[4], 3, "red", "silver", 12, "arial") _GUICtrlMarquee_Create($aMarquee[4], "And slowly to the right", 10, 120, 300, 26) $aMarquee[5] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[5], 1, "slide", Default, 2) _GUICtrlMarquee_SetDisplay($aMarquee[5], 1, "blue", "cyan", 9, "courier new") _GUICtrlMarquee_Create($aMarquee[5], " Just the once", 10, 160, 300, 17) $aMarquee[6] = _GUICtrlMarquee_Init() _GUICtrlMarquee_SetScroll($aMarquee[6]) _GUICtrlMarquee_SetDisplay($aMarquee[6]) _GUICtrlMarquee_Create($aMarquee[6], "Default Marquee Parameters", 10, 190, 300, 20, "Everything at default") ; Create buttons to demonstrate UDF functions $cButton_1 = GUICtrlCreateButton("Change top text", 10, 220, 90, 90, $BS_MULTILINE) $cButton_2 = GUICtrlCreateButton("Delete" & @CRLF & "'Just the once'", 110, 220, 100, 90, $BS_MULTILINE) $cButton_3 = GUICtrlCreateButton("Change Back & Forth", 220, 220, 90, 90, $BS_MULTILINE) $cButton_4 = GUICtrlCreateButton("Move Default Marquee Parameters", 10, 320, 300, 30, $BS_MULTILINE) $cButton_5 = GUICtrlCreateButton("Hide Marquee Parameters", 10, 360, 300, 30, $BS_MULTILINE) GUISetState() ; Look for the TaskBar Find_Taskbar($aMarquee_Coords) ; Create the banner marquee If @error Then MsgBox(0, "Error", "Could not find taskbar") EndIf ; Create the tray menu Opt("TrayOnEventMode", 1) ; Use event trapping for tray menu Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. ; Only add ticker position options if ticker exists If WinExists($hGUI) Then Global $hTray_Top_Item = TrayCreateItem("Top") TrayItemSetOnEvent(-1, "On_Place") Global $hTray_Bot_Item = TrayCreateItem("Bottom") TrayItemSetOnEvent(-1, "On_Place") TrayCreateItem("") EndIf TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "On_Exit") TraySetState() ; main loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_1 _GUICtrlMarquee_Reset($aMarquee[0], "New text set at " & @HOUR & ":" & @MIN & ":" & @SEC) Case $cButton_2 GUICtrlSetState($cButton_2, $GUI_DISABLE) _GUICtrlMarquee_Delete($aMarquee[5]) Case $cButton_3 GUICtrlSetState($cButton_3, $GUI_DISABLE) ; Change type of scroll _GUICtrlMarquee_SetScroll($aMarquee[1], -1, "scroll", "right", -1) ; Change colours and font _GUICtrlMarquee_SetDisplay($aMarquee[1], 2, 0x0000FF, 0xCCFFCC, 14, "Courier New") ; And redisplay _GUICtrlMarquee_Reset($aMarquee[1], "All different now!") Case $cButton_4 GUICtrlSetPos($aMarquee[0], 30, 10, 50, 15) ControlMove("Marquee Example 1", "", $aMarquee[0], 30, 10, 50, 15) Case $cButton_5 GUICtrlSetState($aMarquee[0], $GUI_HIDE) EndSwitch WEnd Func On_Exit() Exit EndFunc ;==>On_Exit Func On_Place() ; Switch ticker position flag If $fMarquee_Pos = "top" Then $fMarquee_Pos = "bottom" Else $fMarquee_Pos = "top" EndIf ; Find taskbar position and move ticker Find_Taskbar($aMarquee_Coords) WinMove($hGUI, "", $aMarquee_Coords[0], $aMarquee_Coords[1], $aMarquee_Coords[2], $aMarquee_Coords[3]) EndFunc ;==>On_Place Func Find_Taskbar(ByRef $aMarquee_Coords) ; Find taskbar and get size Local $iPrevMode = AutoItSetOption("WinTitleMatchMode", 4) Local $aTaskBar_Pos = WinGetPos("[CLASS:Shell_TrayWnd]") AutoItSetOption("WinTitleMatchMode", $iPrevMode) ; If error in finding taskbar If Not IsArray($aTaskBar_Pos) Then Return SetError(1, 0) ; Determine position of taskbar If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - $aTaskBar_Pos[3] - 60 EndIf ElseIf $aTaskBar_Pos[0] > 0 Then ; Taskbar at RIGHT so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf ElseIf $aTaskBar_Pos[2] = @DesktopWidth Then ; Taskbar at TOP so coords of the marquee are $aMarquee_Coords[0] = 0 $aMarquee_Coords[2] = @DesktopWidth If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = $aTaskBar_Pos[3] Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf ElseIf $aTaskBar_Pos[3] = @DesktopHeight Then ; Taskbar at LEFT so coords of the marquee are $aMarquee_Coords[0] = $aTaskBar_Pos[2] $aMarquee_Coords[2] = @DesktopWidth - $aTaskBar_Pos[2] If $fMarquee_Pos = "top" Then $aMarquee_Coords[1] = 0 Else $aMarquee_Coords[1] = @DesktopHeight - 60 EndIf EndIf EndFunc ;==>Find_Taskbar Edited January 7, 2019 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
qwert Posted January 7, 2019 Share Posted January 7, 2019 How about Control Hide and Control Show? These work for me. And I see you're already using Control Move. Link to comment Share on other sites More sharing options...
Belini Posted January 7, 2019 Author Share Posted January 7, 2019 Here ControlHide did not work for me, how did you use ControlHide? ControlHide("Marquee Example 1", "", $aMarquee[0]); did not work for me My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
qwert Posted January 7, 2019 Share Posted January 7, 2019 Well, it's true that my uses are simpler: ControlHide($GUI, "", $gotoDate) Have you tried passing only a variable, not an array element? (... using something like: $control = $aMarquee[0]) Link to comment Share on other sites More sharing options...
Belini Posted January 7, 2019 Author Share Posted January 7, 2019 (edited) ControlHide($gui, "", $aMarquee[0]) It also does not work. 11 hours ago, qwert said: How about Control Hide and Control Show? These work for me. How did you do it when it worked? Edited January 7, 2019 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
qwert Posted January 7, 2019 Share Posted January 7, 2019 My use was simple: ControlHide($GUI, "", $gotoDate) What I meant by $control = $aMarquee[0] was to eliminate the array reference from the statement. Just pass a variable. It's just something I've found that works in certain instances of other calls. Link to comment Share on other sites More sharing options...
Belini Posted January 7, 2019 Author Share Posted January 7, 2019 $GUI = GUICreate("Marquee Example 1", 320, 400), but what is the content of $gotoDate? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2019 Moderators Share Posted January 7, 2019 (edited) Hi, Try this Beta UDF to which I have added Hide/Show functions: And here is a quick example script to show it working: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "Marquee_Mod.au3" $hGUI = GUICreate("Marquee Hide/Show", 320, 320) $iMarqueeIndex = _GUICtrlMarquee_Init() _GUICtrlMarquee_Create($iMarqueeIndex, "I can be hidden and reshown", 10, 10, 300, 20) $cButton_1 = GUICtrlCreateButton("Hide", 10, 220, 90, 90) $cButton_2 = GUICtrlCreateButton("Show", 110, 220, 100, 90) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton_1 _GUICtrlMarquee_Hide($iMarqueeIndex) Case $cButton_2 _GUICtrlMarquee_Show($iMarqueeIndex) EndSwitch WEnd M23 Edited May 10, 2020 by Melba23 Beta code removed Belini 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
qwert Posted January 7, 2019 Share Posted January 7, 2019 Quote what is the content of $gotoDate? Sorry that I wasn't clear about that: $gotoDate = GUICtrlCreateButton("Go to Date", 340, 570, 120, 24) Belini 1 Link to comment Share on other sites More sharing options...
Belini Posted January 7, 2019 Author Share Posted January 7, 2019 Perfect @ Melba 32, thank you very much and thank @qwert too. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now