Jump to content

rebar headache !


JackDinn
 Share

Recommended Posts

HI,

Iv been messing with ReBar and ToolBar and trying to put the two together but iv got stuck.

I cant figure out why i cant get the "Band Names" to show up when a ToolBar is added to a ReBar ?

If i shrink the GUI so that the ReBar moves a Band bellow the top one then the Handles and names of that Band show or if i take out the ToolBar from the REBar then again the "drag handles" & the Band Names show, but i need the band names to show but i only want one toolbar row.

Iv tried all sorts with the Styles of the _GUICtrlRebar_AddToolBarBand, _GUICtrlToolbar_Create, _GUICtrlRebar_Create & other things.

#include <GuiConstantsEx.au3>
#include <GuiReBar.au3>
#include <GuiToolBar.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <GuiEdit.au3>
#include <GuiImageList.au3>
#include <GuiToolTip.au3>
#Include <GuiButton.au3>

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
Global $hReBar, $aStrings[9], $hImage
Global Enum $idNew = 1000, $idOpen, $idSave, $idHelp
_main()
Func _main()
    Local $hgui, $btnExit, $hToolbar, $hInput
    $hgui = GUICreate("Rebar", 600, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX))
    $hReBar = _GUICtrlRebar_Create($hgui, $CCS_TOP+$RBS_BANDBORDERS)
    $hToolbar = _GUICtrlToolbar_Create($hgui)
    $hToolTip = _GUIToolTip_Create($hToolbar)
    _GUICtrlToolbar_SetToolTips($hToolbar, $hToolTip)
    $hImage = _GUIImageList_Create(24, 24, 5, 3)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 125)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
    _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)
    _GUICtrlToolbar_SetImageList($hToolbar, $hImage)
;~  $aStrings[0] = _GUICtrlToolbar_AddString($hToolbar, "Newf")
;~  $aStrings[1] = _GUICtrlToolbar_AddString($hToolbar, "Open")
;~  $aStrings[2] = _GUICtrlToolbar_AddString($hToolbar, "Save")
;~  $aStrings[3] = _GUICtrlToolbar_AddString($hToolbar, "Help")
    _GUICtrlToolbar_AddButton($hToolbar, $idNew, 0,0)
    _GUICtrlToolbar_AddButton($hToolbar, $idOpen, 1,1)
    _GUICtrlToolbar_AddButton($hToolbar, $idSave, 2)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, $idHelp, 3)
    _GUICtrlToolbar_AddButton($hToolbar, $idHelp, 4)
    _GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "test", 0)
    $hInput = _GUICtrlEdit_Create($hgui, "60", 0, 0, 120, 20)
    _GUICtrlRebar_AddBand($hReBar, $hInput, 100, 100, "Cycle Time (mins) :", 1 )
    
    $traybut=_GUICtrlButton_Create ($hgui,"",0,0,60,28)
    _GUICtrlRebar_AddBand($hReBar, $traybut, 50, 50, "Sent To Tray :-", 2 )
    
    $btnExit = GUICtrlCreateButton("Exit", 150, 360, 100, 25)
    
;~  $MenuItem1 = GUICtrlCreateMenu("Menu")
;~ $msglog = GUICtrlCreateMenuItem("Show Message Log", $MenuItem1)
;~ $Clearcsv = GUICtrlCreateMenuItem("Clear CSV File", $MenuItem1)
;~ $scrnsht = GUICtrlCreateMenuItem("Save a shot of graph to a JPG file", $MenuItem1)
;~ $bgpx = GUICtrlCreateMenu("Set Background Pic", $MenuItem1)
;~ $bgp = GUICtrlCreateMenuItem("Set Background Pic", $bgpx)
;~ $bgpc = GUICtrlCreateMenuItem("Clear Backgroud Pic", $bgpx)
;~ $update = GUICtrlCreateMenuItem("Check For Update", $MenuItem1)
;~ $Mexit = GUICtrlCreateMenuItem("Exit", $MenuItem1)
;~ $config = GUICtrlCreateMenuItem("Configuration", -1)
;~ $Graph_options = GUICtrlCreateMenu("Graph View Options")
;~ $hGraph_options_DL = GUICtrlCreateMenuItem("Show/Hide DownLoad", $Graph_options)
;~ GUICtrlSetState(-1, $GUI_CHECKED)
;~ $hGraph_options_UL = GUICtrlCreateMenuItem("Show/Hide UpLoad", $Graph_options)
;~ GUICtrlSetState(-1, $GUI_CHECKED)
;~ $hGraph_options_ping = GUICtrlCreateMenuItem("Show/Hide Ping", $Graph_options)
;~ GUICtrlSetState(-1, $GUI_CHECKED)
;~ $hGraph_options_pkt_loss = GUICtrlCreateMenuItem("Show/Hide Packet Loss", $Graph_options)
;~ GUICtrlSetState(-1, $GUI_CHECKED)
;~ $hGraph_options_Jitter = GUICtrlCreateMenuItem("Show/Hide Jitter", $Graph_options)
;~ GUICtrlSetState(-1, $GUI_CHECKED)
;~ $H_PrevDataSetx = GUICtrlCreateMenu("View Previous Data Sets")
;~ $H_PrevDataSet = GUICtrlCreateMenuItem("Load Previous Data Sets", $H_PrevDataSetx)
;~ $H_PrevDataSet_reset = GUICtrlCreateMenuItem("Return to current (working) Data Sets", $H_PrevDataSetx)
;~ $H_about = GUICtrlCreateMenu("Help/About")
;~ $help = GUICtrlCreateMenuItem("Help", $H_about)
;~ $request_help = GUICtrlCreateMenuItem("Request Help / Report a bug", $H_about)
;~ $vistweb = GUICtrlCreateMenuItem("Visit JDast WebSite", $H_about)
;~ $about = GUICtrlCreateMenuItem("About", $H_about)

    GUISetState(@SW_SHOW)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $btnExit
                Exit
        EndSwitch
    WEnd
EndFunc ;==>_Main
Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam)
    $wPos = WinGetPos($hWnd)
    ControlMove($hWnd, "", $hReBar, 0, 0, $wPos[2])
EndFunc ;==>WM_SIZE
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tInfo, $iID, $iCode
    $tInfo = DllStructCreate($tagNMTTDISPINFO, $ilParam)
    $iCode = DllStructGetData($tInfo, "Code")
    If $iCode = $TTN_GETDISPINFO Then
        $iID = DllStructGetData($tInfo, "IDFrom")
        Switch $iID
            Case $idNew
                DllStructSetData($tInfo, "aText", "New")
            Case $idOpen
                DllStructSetData($tInfo, "aText", "Open")
            Case $idSave
                DllStructSetData($tInfo, "aText", "Save")
            Case $idHelp
                DllStructSetData($tInfo, "aText", "Help")
        EndSwitch
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY

Many thx to anyone who can spot what im doing wrong.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

found it !

_GUICtrlToolbar_Create($hgui,$CCS_NORESIZE)

I dont know why it works but it does ;) now im just left wondering how to make the "Band Name" text black and not that disabled kinda look ?

post-38939-12831167155032_thumb.jpg

any suggestions ?

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

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