satanico64

_GUICtrlComboBox_GetCueBanner simply doesn't work.

4 posts in this topic

#1 ·  Posted

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

Share this post


Link to post
Share on other sites



#2 ·  Posted

Focus on something else and the cue banner will appear, for example click the bottom Edit Box, Combo shows "Select an item", if you click in the Combo it disappears which is what it's suppose to do.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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
1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

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 !

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

  • Similar Content

    • kstriyhon
      By kstriyhon
      hello Comunity i am new to autoit and i bump into a pitfall regarding the creation of objects in a dinamyc way but more especific  creating combobox at runtime
      i need many comboboxes and sofar i createdthem manually 
      like this 
      $idCombo_1 = GUICtrlCreateCombo("", 500, 40, 130, 21)     $idCombo_2 = GUICtrlCreateCombo("", 500, 70, 130, 21)     $idCombo_3 = GUICtrlCreateCombo("", 500, 100, 130, 21)     $idCombo_4 = GUICtrlCreateCombo("", 500, 130, 130, 21)     $idCombo_5 = GUICtrlCreateCombo("", 500, 160, 130, 21)     $idCombo_6 = GUICtrlCreateCombo("", 500, 190, 130, 21)     $idCombo_7 = GUICtrlCreateCombo("", 500, 220, 130, 21)     $idCombo_8 = GUICtrlCreateCombo("", 500, 250, 130, 21)     $idCombo_9 = GUICtrlCreateCombo("", 500, 280, 130, 21)     GUICtrlSetData($idCombo_1, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_2, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_3, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_4, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_5, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_6, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_7, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_8, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_9, "Item1|Item2|Item3|Item4|Item5") now i need this example but create them at runtime as there are more than 9 combos what i need thanks in advance kind regards
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good evening guys
      I am working on a little project, in which I have to retrieve 8000+ rows of data from a table, from a SQLite database, to populate a combobox 
      This is what I tried 'til now, but it still takes about 12 seconds to populate the combobox.
      _SQLite_Exec($objDatabase, "BEGIN TRANSACTION;") If _SQLite_GetTable($objDatabase, "SELECT DISTINCT Comune FROM LISTA_COMUNI;", $arrRisultatoQuery, $intRighe, $intColonne) = $SQLITE_OK Then For $i = 2 To UBound($arrRisultatoQuery) - 1 If $i < UBound($arrRisultatoQuery) - 1 Then GUICtrlSetData($cbo_ComuneNascita, $arrRisultatoQuery[$i] & "|") Else GUICtrlSetData($cbo_ComuneNascita, $arrRisultatoQuery[$i]) EndIf Next _SQLite_Exec($objDatabase, "COMMIT;") Are there any other solution to retrieve 8000+ records from a SQLite database?
      Thank you very much  
    • Terenz
      By Terenz
      Hello,
      I have searched everywhere but on the forum there isn't an example of a combobox with checkbox. I think is a very useful control but require subclassing. Several example in C++, one of this:
      CheckComboBox Control
      If somone has some time to check it out. If need i can provide the source code. Thanks
    • SaeidN
      By SaeidN
      Let's say I have 10 combobox and 10 items in each.
      1- If one item in a combobox is selected, I don't want it to be selectable in another combobox. (Or if it is, remove the duplicate one)
      2- When I click on button, I want 10 msgboxes to show, and each item showing in each msgbox in order they are selected. (from combobox1 to combobox10)
      I'm confused whether to use select or switch or other loops.
    • FMS
      By FMS
      Hello,

      I've writing this code and I'm a little stuck in what i want to do.
      When I select the combobox I want to get the ini information inside the multiline input field.
      I know that what I'm doing now is wrong but maybe this helps to clearify things in what I want to do.
      Does somebody knows how to do this , or can help me?
       
       
      #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <File.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <Date.au3> check_file_exist() $Form1 = GUICreate("Form1", 320, 260, 192, 324);(b,h,,),30 $Tab1 = GUICtrlCreateTab(5, 5, 310, 250) ;(,,b,h) $TabSheet3 = GUICtrlCreateTabItem("Edit") $Label_tab_select = GUICtrlCreateLabel("select", 40, 50, 80, 25) $tab_select = GUICtrlCreateCombo(" tab 1", 40, 70, 80, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, " tab 2") $Label_BtnSelect = GUICtrlCreateLabel("nr", 125, 50, 80, 25) $BtnSelect = GUICtrlCreateCombo(" 1", 125, 70, 60, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, " 2 ") $Label_BtnName = GUICtrlCreateLabel("name", 190, 50, 80, 25) $BtName = GUICtrlCreateInput("", 190, 70, 80, 21) $multiline = GuiCtrlCreateEdit("this text needs to be changed at selection of combobox",15, 105, 290, 110) ;the next line is to clearify things :) ;$multiline = GuiCtrlCreateEdit(IniRead($ini_location_buttons, "btn00" & GUICtrlRead($BtnSelect), "text"),15, 105, 290, 110) $Btn301 = GUICtrlCreateButton("Cancel", 40, 220, 75, 25) $Btn302 = GUICtrlCreateButton("Save", 152, 220, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Btn301 Exit Case $Btn302 Exit EndSwitch WEnd Func check_file_exist() If FileExists(@SCRIPTDIR & "\ini.ini") Then Global $ini_location_buttons = @SCRIPTDIR & "\ini.ini" Else If Not _FileCreate(@SCRIPTDIR & "\buttons.ini") Then MsgBox($MB_SYSTEMMODAL, "Error", " Error Creating/Resetting ini. error:" & @error) Else Global $ini_location_buttons = @SCRIPTDIR & "\ini.ini" create_new_ini() EndIf EndIf EndFunc Func create_new_ini() $file = FileOpen($ini_location_buttons, 1) Local $i = 1 local $j = 0 Do if $i = 10 then $j = "" FileWrite($file, "[btn0" & $j & $i & "]"& @CRLF) FileWrite($file, "button_name=Button " & $i & @CRLF) FileWrite($file, "text=lorum ipsum" & $i & @CRLF) $i = $i + 1 Until $i = 3 FileClose($file) EndFunc