Jump to content

Search the Community

Showing results for tags 'Rubberband'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. _GUIBox Rubberband selection boxes using GUIs Create Rectangles using GUI boxes. Great for Rubber-band selection (as an alternative to DrawFocusRect), or just putting box outlines on the screen period!Example code included (including rubber-band style box-selection simulation). #include <_GUIBox.au3> ; =============================================================================================================================== ; <TestGUIBox.au3> ; ; Tests for _GUIBox UDF. ; ; Author: Ascend4nt ; =============================================================================================================================== ; =================================================================================================================== ; GLOBAL VARIABLES ; =================================================================================================================== Global $bEscPressed=False,$bHomeKeyPressed=False,$bEndKeyPressed=False,$aHomeLoc[2]=[-1,-1] ; =================================================================================================================== ; HOTKEY FUNCTIONS ; =================================================================================================================== Func _EscHotKeyPressed() $bEscPressed=True EndFunc Func _HomeKeyPressed() If Not $bHomeKeyPressed Then $bHomeKeyPressed=True $aHomeLoc=MouseGetPos() EndIf EndFunc Func _EndKeyPressed() If $bHomeKeyPressed Then $bEndKeyPressed=True EndFunc ; =================================================================================================================== ; MAIN START ; =================================================================================================================== Test1() Test2() ; Test 1 Func Test1() MsgBox(0,"Rubber-Band Box Example","After Clicking OK, the Rubber-Band GUI-Box Example will start."&@CRLF& _ "Press [Home] to set the initial Box start, and then [End] to set the end location of the box."&@CRLF& _ "You may stop the routine at any time by pressing [Escape].") HotKeySet("{ESC}","_EscHotKeyPressed") Dim $aCurMousePos,$aRubberBandGBox $aRubberBandGBox=_GBoxCreate("",3,0xFF0000) HotKeySet("{HOME}","_HomeKeyPressed") HotKeySet("{END}","_EndKeyPressed") While Not $bEscPressed And Not $bEndKeyPressed If $bHomeKeyPressed Then $aCurMousePos=MouseGetPos() _GBoxShowAt($aRubberBandGBox,$aHomeLoc[0],$aHomeLoc[1],$aCurMousePos[0],$aCurMousePos[1]) EndIf Sleep(5) WEnd If $bHomeKeyPressed And IsArray($aCurMousePos) Then MsgBox(0,"Rubber-band box example complete","Last coordinates of the Rubber-band box: "& _ "X1:"&$aHomeLoc[0]&" Y1:"&$aHomeLoc[1]&" X2:"&$aCurMousePos[0]&" Y2:"&$aCurMousePos[1]) EndIf _GBoxDestroy($aRubberBandGBox) EndFunc ; Test 2 Func Test2() Local $aBugaBox,$aBoxRed,$aBoxGreen,$aBoxBlue,$aBoxFADED $aBugaBox=_GBoxCreate() $aBoxRed=_GBoxCreate("",5,0XFF0000) $aBoxGreen=_GBoxCreate("",1,0xFF00) $aBoxBlue=_GBoxCreate("",1,0xFF) $aBoxFADED=_GBoxCreate("",1,0x0FADED) MsgBox(0,"Test 2 - Multiple GUI Boxes","Ready to show boxes - Click OK") _GBoxShowAt($aBugaBox,100,100,800,800) _GBoxShowAt($aBoxRed,300,400,700,700) _GBoxShowAt($aBoxGreen,400,800,402,802) _GBoxShowAt($aBoxBlue,801,200,900,900) _GBoxShowAt($aBoxFADED,410,410,790,790) MsgBox(0,"Now to Hide them","Click OK to Hide the boxes now") _GBoxHide($aBugaBox) _GBoxHide($aBoxRed) _GBoxHide($aBoxGreen) _GBoxHide($aBoxBlue) _GBoxHide($aBoxFADED) MsgBox(0,"Now to Redisplay Them","Click OK to Re-display the boxes, though one will have a new color, transparency, and thickness") _GBoxSetDisplayProps($aBugaBox,3,0x0899CC,255) ; Changing the thickness, color, and transparency (to non-transparent) ; Since the box was invisible, we need to force it to recognize a resize (last parameter=True) as we altered the thickness ; If we had instead put _GboxShow($aBugaBox) prior to _GBoxSetDisplayProps(), we would not need to force a resize _GBoxShow($aBugaBox,False,True) _GBoxShow($aBoxRed) _GBoxShow($aBoxGreen) _GBoxShow($aBoxBlue) _GBoxShow($aBoxFADED) MsgBox(0,"That's all folks!","Now click OK to delete") _GBoxDestroy($aBugaBox) _GBoxDestroy($aBoxRed) _GBoxDestroy($aBoxGreen) _GBoxDestroy($aBoxBlue) _GBoxDestroy($aBoxFADED) EndFunc Download the ZIP from my site Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.*edit: clarified with the word 'outlines' so as not to confuse people. (creating resizable solid boxes is a much simpler task not even needing a UDF - I just posted code to do exactly this -> )
×
×
  • Create New...