Jump to content
Sign in to follow this  
stingjoel

Sliding Menu

Recommended Posts

stingjoel

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

Share this post


Link to post
Share on other sites
Chris_1013

I ran it, but I don't see anything... I'm know I'm surely missing something, can you give me a pointer?

Share this post


Link to post
Share on other sites
sandyd

Move you mouse over to the extreme left of your screen, a blank form similar to the windows taskbar will pop-out.


----[ SandyD ]---

Share this post


Link to post
Share on other sites
SlimShady

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

Share this post


Link to post
Share on other sites
Chris_1013

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

<{POST_SNAPBACK}>

Is it possible to do that with an AutoIt GUI? If so how, because I've got a script where I'd be keen to do this...

Share this post


Link to post
Share on other sites
SlimShady

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

Share this post


Link to post
Share on other sites
Chris_1013

Ahhhh, so you create your GUI as a child of another GUI which is never shown? Is that how I've read the code right?

Share this post


Link to post
Share on other sites
Nova

No title in the taskbar $WS_EX_TOOLWINDOW

GUICreate("New GUI", $GUIWidth, $GUIHeight, -1, -1, -1, -1, $WS_EX_TOOLWINDOW)

Share this post


Link to post
Share on other sites
Chris_1013

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)

Share this post


Link to post
Share on other sites
Holger

@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

Share this post


Link to post
Share on other sites
Chris_1013

Ah I was through cos I just saw four numbers in the example, and assumed these were size/positioning, so thought the next was just a style.

Doh!

Share this post


Link to post
Share on other sites
Norsestar

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]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.