Jump to content

_GUICtrlComboBox_GetCueBanner simply doesn't work.


Recommended Posts

Hi huys !

 how are you ? family ? dog, cat ? well..

 

I've got a problem: _GUICtrlComboBox_GetCueBanner

i can't get it to work.

Simple: even the example from help does'nt work...

 

I insist, it's excactly the example from the help, no modifications

#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $g_idMemo
Example()

Func Example()
    Local $idCombo

    ; Create GUI
    GUICreate("ComboBox Get Count", 400, 296)
    $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
    _GUICtrlComboBox_SetCueBanner($idCombo, "Select an Item")
    $g_idMemo = GUICtrlCreateEdit("", 10, 50, 376, 234, $WS_VSCROLL)
    GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
    GUISetState(@SW_SHOW)

    ; Add files
    _GUICtrlComboBox_BeginUpdate($idCombo)
    _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($idCombo)

    MemoWrite("Cue Banner: " & _GUICtrlComboBox_GetCueBanner($idCombo))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

; Write a line to the memo control
Func MemoWrite($sMessage)
    GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

I also added the display of the cuebanner in the loop.

It never display what actually appears in the combo

If you can show me any king of working example.

Thanks Guys !

Nicolas.

Actually autoit v3.3.14.2

Link to comment
Share on other sites

  • Moderators

satanico64,

Combo cuebanners are funny things and will only display when the combo is not focussed. Focus on the edit by clicking it and the cuebanner appears in the combo. I will look at the UDF code and see if I can change this behaviour.

M23

Edit: Hi, Subz!

Edit 2: I see the problem - the _GUICtrlComboBox_SetCueBanner function does not have an optional parameter to display/hide the cue banner when focussed and just defaults to hide. If I add a parameter similar to the $bOnFocus parameter in _GUICtrlEdit_SetCueBanner you will be able to choose whether to see the cuebanner in all circumstances. I will amend the UDF accordingly.

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

okay thanks !

i've solved my problems:

initialy i wanted to use cuebanners  because i had a problem working with  _GUICtrlComboBox_AutoComplete while typing text, and mouse selection.

On each modification i display the value in other field, it was ok for text input, but when i was selecting with mouse, with Case $CBN_SELCHANGE  i could'nt get the selected text, _GUICtrlComboBox_GetEditText took the last text but not the text my eyes see.

I solved using:

$index = _GUICtrlComboBox_GetCurSel($Id_Combo)

_GUICtrlComboBox_GetLBText($Id_Combo,$index,$letexte )

wich give me selected text

well it's ok for me on this point.

Thanks for having a look on _GUICtrlComboBox_SetCueBanner

have a nice day !

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

×
×
  • Create New...