Jump to content

Missing part in Statusbar...


PantZ4
 Share

Recommended Posts

I have a smaller problem. It seems that every time I set that I want a third part in my statusbar (The middle part) it either removes all the part, besides the first one, or remove the middle part. Maybe somebody can point out what I'm doing wrong?

#include <GUIConstants.au3>
#include <GUIEdit.au3>

$GUIWIDTH = 546
$GUIHEIGHT = 394

Local $GUIStatusBarPartLenght[3] = [150, 200, -1]
Local $GUIStatusBarPartText[3] = ["Command: ", "Press F1 for help", "Donate to AutoIt!"]

$GUI = GUICreate("TestGUI",$GUIWIDTH,$GUIHEIGHT,-1,-1,$WS_SIZEBOX+$WS_MINIMIZEBOX+$WS_MAXIMIZEBOX)

GUIRegisterMsg(0x24, "_GUISetResizing")

GUICtrlCreateEdit("",-1,99,$GUIWIDTH+1,$GUIHEIGHT-150,$ES_MULTILINE+$ES_READONLY+$WS_VSCROLL)
GUICtrlSetBkColor(-1,0xFFFFFF)
GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)

$GUIStatusBar = _GUICtrlStatusBarCreate ($GUI, $GUIStatusBarPartLenght, $GUIStatusBarPartText)
;_GUICtrlStatusBarSetIcon($GUIStatusBar, 2, "C:\Documents and Settings\****\Skrivebord\donate.ico",0)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_RESIZED
            $a_GUISize = WinGetPos($GUI)
            $GUIStatusBarPartLenght[0] = (($a_GUISize[2]/100)*50)
            $GUIStatusBarPartLenght[1] = (($a_GUISize[2]/100)*25)
            _GUICtrlStatusBarSetParts($GUI, $GUIStatusBar, 3, $GUIStatusBarPartLenght)
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_MAXIMIZE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_RESTORE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    Sleep(10)
WEnd

Func _GUISetResizing($hWnd, $Msg, $wParam, $lParam)
    $dllstruct = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam)
    DllStructSetData($dllstruct,7,552)
    DllStructSetData($dllstruct,8,400)
    Return 0
EndFunc
Link to comment
Share on other sites

I'm not sure I can see the problem. This all works for me?

#include <GUIConstants.au3>
#include <GUIEdit.au3>

$GUIWIDTH = 546
$GUIHEIGHT = 394

Local $GUIStatusBarPartLenght[3] = [150, 250, -1]; I changed it to be slightly larger (50px)
Local $GUIStatusBarPartText[3] = ["Command: ", "Press F1 for help", "Donate to AutoIt!"]

$GUI = GUICreate("TestGUI",$GUIWIDTH,$GUIHEIGHT,-1,-1,$WS_SIZEBOX+$WS_MINIMIZEBOX+$WS_MAXIMIZEBOX)

GUIRegisterMsg(0x24, "_GUISetResizing")

GUICtrlCreateEdit("",-1,99,$GUIWIDTH+1,$GUIHEIGHT-150,$ES_MULTILINE+$ES_READONLY+$WS_VSCROLL)
GUICtrlSetBkColor(-1,0xFFFFFF)
GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)

$GUIStatusBar = _GUICtrlStatusBarCreate ($GUI, $GUIStatusBarPartLenght, $GUIStatusBarPartText)
;_GUICtrlStatusBarSetIcon($GUIStatusBar, 2, "C:\Documents and Settings\****\Skrivebord\donate.ico",0)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_RESIZED
            $a_GUISize = WinGetPos($GUI)
            $GUIStatusBarPartLenght[0] = (($a_GUISize[2]/100)*50)
            $GUIStatusBarPartLenght[1] = (($a_GUISize[2]/100)*25)
            _GUICtrlStatusBarSetParts($GUI, $GUIStatusBar, 3, $GUIStatusBarPartLenght)
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_MAXIMIZE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_RESTORE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    Sleep(10)
WEnd

Func _GUISetResizing($hWnd, $Msg, $wParam, $lParam)
    $dllstruct = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam)
    DllStructSetData($dllstruct,7,552)
    DllStructSetData($dllstruct,8,400)
    Return 0
EndFunc
Link to comment
Share on other sites

I think you forgot to add the size for the third...

#include <GUIConstants.au3>
#include <GUIEdit.au3>

$GUIWIDTH = 546
$GUIHEIGHT = 394

Local $GUIStatusBarPartLenght[3] = [150, 250, -1]; I changed it to be slightly larger (50px)
Local $GUIStatusBarPartText[3] = ["Command: ", "Press F1 for help", "Donate to AutoIt!"]

$GUI = GUICreate("TestGUI",$GUIWIDTH,$GUIHEIGHT,-1,-1,$WS_SIZEBOX+$WS_MINIMIZEBOX+$WS_MAXIMIZEBOX)

GUIRegisterMsg(0x24, "_GUISetResizing")

GUICtrlCreateEdit("",-1,99,$GUIWIDTH+1,$GUIHEIGHT-150,$ES_MULTILINE+$ES_READONLY+$WS_VSCROLL)
GUICtrlSetBkColor(-1,0xFFFFFF)
GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM)

$GUIStatusBar = _GUICtrlStatusBarCreate ($GUI, $GUIStatusBarPartLenght, $GUIStatusBarPartText)
;_GUICtrlStatusBarSetIcon($GUIStatusBar, 2, "C:\Documents and Settings\****\Skrivebord\donate.ico",0)

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_RESIZED
            $a_GUISize = WinGetPos($GUI)
            $GUIStatusBarPartLenght[0] = 250
            $GUIStatusBarPartLenght[1] = 350
            $GUIStatusBarPartLenght[2] = 400
            _GUICtrlStatusBarSetParts($GUI, $GUIStatusBar, 3, $GUIStatusBarPartLenght)
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_MAXIMIZE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_RESTORE
            _GUICtrlStatusBarResize ($GUIStatusBar)
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    Sleep(10)
WEnd

Func _GUISetResizing($hWnd, $Msg, $wParam, $lParam)
    $dllstruct = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam)
    DllStructSetData($dllstruct,7,552)
    DllStructSetData($dllstruct,8,400)
    Return 0
EndFunc
Link to comment
Share on other sites

what you have to remember is the number is not the length of the part, but the right edge of the part

so if right edge or the 1st part is 150, then you need the right edge of the second part to be higher than 150, and the 3rd part to be higher than the 2nd part's right edge...

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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