Jump to content

buttons icons on toolbar


roby
 Share

Recommended Posts

Hi,

why the buttons icons of toolbar desappear when the tooltip, number only, of the textbox is closed??? And I view them if I put the mouse pointer on them....

Smbody knows the soluction to avoid this problem?

Thank you

Roby

Link to comment
Share on other sites

This is the code:

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.10.0
    Author:      R.B.
    
    Script Function:
    Gestione Anagrafica
    
#ce ----------------------------------------------------------------------------
;AutoIt3 v3.2.10.0 or higher
;Opt('MustDeclareVars', 1)
#Include <Array.au3>
$ufficiRSC = ObjCreate("ADODB.Recordset")
$ufficiRSC.CursorType = 0
$ufficiRSC.LockType = 3
$ufficiRSC.Open("SELECT COUNT(*) AS nUffici FROM Uffici", $sqlConACC)
Global $aUffici[$ufficiRSC.Fields("nUffici"  ).Value]

Func _Anagrafica()
    $hGUI_Anagrafica = GUICreate("Dati Dipendente", 401, 181, 353, 357)
    GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")
;WinActivate($hGUI_Anagrafiche)
    $hReBar_Anagrafica = _GUICtrlReBar_Create($hGUI_Anagrafica, BitOR($CCS_TOP, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS, $RBBS_FIXEDBMP ))
    $hToolbar_Anagrafica = _GUICtrlToolbar_Create($hGUI_Anagrafica, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN, $BTNS_AUTOSIZE, $BTNS_BUTTON, $BTNS_SHOWTEXT)) ; BitOR($BTNS_AUTOSIZE, $BTNS_BUTTON, $BTNS_SHOWTEXT)
    $aSize = _GUICtrlToolbar_GetMaxSize($hToolbar_Anagrafica)
; Create ToolTip
    $hTooltip_Anagrafica = _GUIToolTip_Create($hToolbar_Anagrafica, $TTS_ALWAYSTIP)
    _GUICtrlToolbar_SetToolTips($hToolbar_Anagrafica, $hTooltip_Anagrafica)
; Add Icons
    $hToolbar_ImageListNorm = _GUIImageList_Create(24, 24)
    _GUIImageList_AddBitmap($hToolbar_ImageListNorm, @ScriptDir & "\Icone\Salva.bmp")
    _GUIImageList_AddBitmap($hToolbar_ImageListNorm, @ScriptDir & "\Icone\Uscita.bmp")
; add AutoIt icon from exe internal resources or icon added at compile time by compiler directives
    _GUICtrlToolbar_SetImageList($hToolbar_Anagrafica, $hToolbar_ImageListNorm)
; Add buttons
    _GUICtrlToolbar_AddButton($hToolbar_Anagrafica, $id1, 0); Index 0
    _GUICtrlToolbar_AddButton($hToolbar_Anagrafica, $id2, 1); Index 1
    _GUICtrlReBar_AddToolBarBand($hReBar_Anagrafica, $hToolbar_Anagrafica)
    #Region ### START Koda GUI section ### Form=C:\Documents and Settings\TIMBRA-20.12.2007\koda_file\frmAnagrafica.kxf
    $lblBadge = GUICtrlCreateLabel("Badge", 40, 53, 35, 17)
    $txtBadge = GUICtrlCreateInput("", 93, 49, 80, 21, BitOR($ES_AUTOHSCROLL, $ES_NUMBER))
    GUICtrlSetLimit(-1, 10)
    $lblCognome = GUICtrlCreateLabel("Cognome", 40, 80, 49, 17)
    $txtCognome = GUICtrlCreateInput("", 93, 77, 274, 21, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL))
    GUICtrlSetLimit(-1, 40)
    $lblNome = GUICtrlCreateLabel("Nome", 40, 104, 32, 17)
    $txtNome = GUICtrlCreateInput("", 93, 101, 274, 21, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL))
    GUICtrlSetLimit(-1, 40)
    $lblUfficio = GUICtrlCreateLabel("Ufficio", 43, 138, 34, 17)
    $hCmbUfficio = _GUICtrlComboBox_Create($hGUI_Anagrafica, "", 94, 136, 153, 25)
;$cmbUfficio = GUICtrlCreateCombo("", 94, 136, 153, 25)
    #EndRegion ### END Koda GUI section ###
; Populate list and make it wide enough to see
    $ufficiRS = ObjCreate("ADODB.Recordset")
    $ufficiRS.CursorType = 0
    $ufficiRS.LockType = 3
    $ufficiRS.Open("SELECT * FROM Uffici ORDER BY Ufficio", $sqlConACC)
    
;Local $aUffici[$ufficiRS.RecordCount]
    
    _GUICtrlComboBox_BeginUpdate($hCmbUfficio)
    $j = 0
    While Not $ufficiRS.Eof
        _GUICtrlComboBox_AddString($hCmbUfficio, $ufficiRS.Fields("Ufficio"  ).Value)
        $aUffici[$j] = $ufficiRS.Fields("idUff"  ).Value
        $j += 1
        $ufficiRS.Movenext
    WEnd
    _GUICtrlComboBox_EndUpdate($hCmbUfficio)
    If Not $nuovo Then
        GUICtrlSetData($txtBadge, _GUICtrlListView_GetItemText($hListView_Anagrafiche, _GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche)))
        GUICtrlSetData($txtCognome, _GUICtrlListView_GetItemText($hListView_Anagrafiche, _GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche), 1))
        GUICtrlSetData($txtNome, _GUICtrlListView_GetItemText($hListView_Anagrafiche, _GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche), 2))
        _GUICtrlComboBox_SetCurSel($hCmbUfficio, _ArraySearch($aUffici, _GUICtrlListView_GetItemText($hListView_Anagrafiche, _GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche), 4)))
    ;ConsoleWrite(_GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche) & '-' & _GUICtrlListView_GetItemText($hListView_Anagrafiche, _GUICtrlListView_GetSelectedIndices($hListView_Anagrafiche), 4) & @CRLF)
    EndIf
    GUISetState(@SW_SHOW)
    ControlFocus($hGUI_Anagrafica, '', $txtBadge)
    #EndRegion ### END Koda GUI section ###
EndFunc  ;==>_Anagrafica
Link to comment
Share on other sites

Also, in this example, the buttons on toolbar desappear when I close the tooltip of number only.... Why????

Help me, please....

Thank you

Roby

#include <GuiConstants.au3>
#include <GuiReBar.au3>
#include <GuiToolBar.au3>

;Opt("MustDeclareVars", 1)

$Debug_RB = False

_Main()

Func _Main()
    Local $hgui, $btnExit, $hToolbar, $hReBar, $hInput
    Local Enum $idNew = 1000, $idOpen, $idSave, $idHelp

    $hgui = GUICreate("Rebar", 400, 396, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_MAXIMIZEBOX))

; create the rebar control
    $hReBar = _GUICtrlReBar_Create($hgui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS))
    
; create a toolbar to put in the rebar
    $hToolbar = _GUICtrlToolBar_Create($hgui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN))
    
; Add standard system bitmaps
    Switch _GUICtrlToolbar_GetBitmapFlags($hToolbar)
        Case 0
            _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_SMALL_COLOR)
        Case 2
            _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR)
    EndSwitch

; Add buttons
    _GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
    _GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
    _GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
    _GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)

; create a input box to put in the rebar
    $hInput = GUICtrlCreateInput("Input control", 0, 0, 120, 20)

;add band containing the control
    _GUICtrlReBar_AddBand($hReBar, GUICtrlGetHandle($hInput), 120, 200, "Name:")

; add band containing the control to begining of rebar
    _GUICtrlReBar_AddToolBarBand($hReBar, $hToolbar, "", 0)
    
;---------------------------- example fields
    $lblBadge = GUICtrlCreateLabel("Badge", 40, 53, 35, 17)
    $txtBadge = GUICtrlCreateInput("", 93, 49, 80, 21, BitOR($ES_AUTOHSCROLL, $ES_NUMBER)) ;<--- numbers only
;--------------------------------------------------------------------------------------------
    
    
    $btnExit = GUICtrlCreateButton("Exit", 150, 360, 100, 25)
    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $btnExit
                Exit
        EndSwitch
    WEnd
EndFunc  ;==>_Main
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...