Sign in to follow this  
Followers 0
Achilles

Small question about max GUI sizes

3 posts in this topic

#include <GUIConstants.au3>
#Include <File.au3>

$Foldername = "Click 'Browse' choose a folder..."
$on = False

;Global $iCntRow, $iCntCol, $iCurIndex, $1= 1, $a = 1, $filelist
;Opt("WinTitleMatchMode", 2)
;Opt("SendKeyDelay", 1)

$gui = GUICreate("", 480, 105, -1, -1, $WS_CAPTION, $WS_EX_TOOLWINDOW)
    GUISetBkColor (0xA29CFE)
GuiCtrlCreateLabel("This program enables you to view the files in a folder by simply moving the mouse to the bottom right corner of the screen. Please choose the directory you would like to be able to view.", 10, 5, 460, 30 )
$dir = GUICtrlCreateEdit($Foldername, 10,  45, 405, 15, BitOr($ES_READONLY, $ES_CENTER), $WS_EX_WINDOWEDGE)
$browse = GUICtrlCreateButton("Browse", 420,  40, 55, 25)
$exit = GuiCtrlCreateButton("Exit", 200, 70, 80, 30)
$ok = GuiCtrlCreateButton("OK", 320, 70, 80, 30)
GuiCtrlSetState(-1, $GUI_FOCUS)
GUISetState(@SW_Show)
;$directory = "E:\Documents and Settings\All Users\Documents\Daniel's Folder"

While 1 
    $msg = GuiGetMsg()
        Select
            Case $msg = $exit 
                Exit 
            Case $msg = $browse
                $directory = FileSelectFolder("Choose the folder where you files are located.", @HOMEDRIVE)
                GuiCtrlSetData($dir, $directory)
            Case $msg = $ok 
                GuiDelete($gui)

                While 1
                    $pos = MouseGetPos()
                    If $pos[0] + 5 > @DesktopWidth And $pos[1] + 5 > @DesktopHeight Then
                        Show()
                        Sleep(300)
                    EndIf
                WEnd
            
        EndSelect
Wend
    
Func Show()
    If $on = False Then
        $on = True
        $numFiles = _FileListToArray($directory)
        $y = 20
    
        $gui = GuiCreate("Files", 250, @DesktopHeight + 50, @DesktopWidth - 250, -22, $WS_CAPTION, $WS_EX_TOOLWINDOW)
        GUISetBkColor(0x111111)
        WinSetTrans("Files", "", 220)
        WinSetOnTop("Files", "", 1)
        For $a = 1 to $numFiles[0] 
            GuiCtrlCreateButton($numFiles[$a], 10, $y, 230, 30)
            $y+= 35
        Next
                
        GUISetState()
    Else
        $on = False
        GUIDelete($gui)
    EndIf
EndFunc

Alright, if you test this you'll see (hopefully) that the pop up GUI that comes from the side doesn't reach the bottom.... Are GUI's not allowed to be bigger then '@DesktopHeight'? 'Cause I've tried adding on more height but it still doesn't reach the bottom. Any help appreciated


My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Hey, that's really cool what you're doing there.

Try this:

$gui = GuiCreate("Files", 250, @DesktopHeight, @DesktopWidth - 250, 0, $WS_POPUP, $WS_EX_TOOLWINDOW)

edit - unclosed tag

Thanks... but that doesn't work (at least on my computer) either. It still lacks about 20 pixels at the bottom...

EDIT: Lol, what the heck... It works now, thanks a ton

Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

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  
Followers 0