Jump to content

Sliding Menu


stingjoel
 Share

Recommended Posts

Sliding Menu like windows taskbar...this script just basic script...

Change $SlidingWidth value if you want larger menu...

Change $MouseDelay value if you want shorter/longer delay to show the menu...

#Include <GUIConstants.au3>
AutoItSetOption("GuiOnEventMode", 1)
AutoItSetOption("TrayIconHide", 1)

Global $GUIWinSliding
$SlidingWidth = 50
$MouseDelay = 50
$SlidingPos = -($SlidingWidth + 2)
$MouseCounter = 0
$MouseLeftCounter = 0
$FlagSliding = 0

$GUIWinSliding = GUICreate("BSMUSliding", $SlidingWidth, @DesktopHeight, $SlidingPos, 0, $WS_POPUPWINDOW, $WS_EX_TOPMOST)

GUISetState(@SW_SHOW)

HotKeySet("{PAUSE}", "Quit")

While 1
      $MousePosition = MouseGetPos()
      If $MousePosition[0] = 0 Then
         $MouseLeftCounter = 0
         $MouseCounter = $MouseCounter + 1
      Else
         If $FlagSliding Then
            If $MousePosition[0] >= $SlidingWidth Then
               $Mousecounter = 0
               $MouseLeftCounter = $MouseLeftCounter + 1
            EndIf
         EndIf
      EndIf
      If $MouseCounter = $MouseDelay Then
         $MouseCounter = 0
         $MouseLeftCounter = 0
         If $FlagSliding = 0 Then
            For $X = $SlidingPos To 0 step 2
                WinMove("BSMUSliding", "", $X, 0)
            Next
            $FlagSliding = 1
         EndIf
      EndIf
     
      If $MouseLeftCounter = $MouseDelay Then
         $MouseLeftCounter = 0
         $MouseCounter = 0
         If $FlagSliding = 1 Then
            For $X = 0 To $SlidingPos Step -2
                WinMove("BSMUSliding", "", $X, 0)
            Next
            $FlagSliding = 0
         EndIf
      EndIf

      Sleep(10)
WEnd

Func Quit()
     Exit
EndFunc
Link to comment
Share on other sites

It's allright. You could add lot's of features:

- resizable and save on exit

- don't show the "menu" in the taskbar

- hotkey to show/hide the "menu"

- ability to configure the items + icons that show up and the action when you click on an item

Link to comment
Share on other sites

Wait a minute and I'll see if I can remember.

Edit:

Easy one.

(Removed useless lines)

#include <GUIConstants.au3>

;Initialize variables
Global $GUIWidth
Global $GUIHeight

$GUIWidth = 250
$GUIHeight = 250

$unused_win = GUICreate(@ScriptName)
GUICreate("New GUI", $GUIWidth, $GUIHeight, -1, -1, -1, -1, $unused_win)

GUISetState(@SW_SHOW)

While 1
   Sleep(25)
   $msg = GUIGetMsg()
   Select
   
      Case $msg = $GUI_EVENT_CLOSE
         GUIDelete()
         Exit

    ;Case $msg = ...

   EndSelect

WEnd
Edited by SlimShady
Link to comment
Share on other sites

Umm, just tested this - and $WS_EX_TOOLWINDOW still seems to show the taskbar. Here's the line I used;

GUICreate("Beachlands Connection Information",300,100,-10,-10,$WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)

Ideally I want this to not have a toolbar at the top either, al la

GUICreate("Beachlands Connection Information",300,100,-10,-10,$WS_POPUPWINDOW,$WS_EX_TOPMOST)
Link to comment
Share on other sites

@chris: ws_EX_toolwindow is an ExStyle NOT only Style you know.

So you have to use it like:

GUICreate("Beachlands Connection Information",300,100,-10,-10,$WS_POPUPWINDOW,BitOr($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))

Regards Holger :idiot:

Edited by Holger
Link to comment
Share on other sites

  • 2 years later...

hmm... well, i took the different bits of code posted here and added a button to it. only thing i cant figure out now, is how to make that button bring up a menu when you click on it. kinda like a start menu lolz. any thoughts?

Education: Francis Tuttle Technology Center adult full-time studentCourse of study: Network TechnologyCurrent Course: Microsoft Windows Server 2003, Enterprise EditionCompleted Courses: CompTIA A+ Hardware and Software, Windows XP Professional, Microsoft Office 2003, Desktop Support and Troubleshooting, and CompTIA Network+Remaining Courses: Linux Administration, Copper Cabling, Microsoft Windows Server 2003, Enterprise EditionAchievements: @17 years old, scored 98th percentile U.S. in Algebra 2 and Advanced Chemistry. [i.e. Ranked top 2% in the nation of High School students]

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