Jump to content

_ComboBoxAutoFill.au3 (UDF) - AutoFill a ComboBox edit control.


JScript
 Share

Recommended Posts

Function Reference


_ComboBoxAutoFill.au3

AutoFill a ComboBox edit control.

Sintax:

_GUICtrlComboBox_AutoFillCreate( hWnd[, lPartialSearch] )
_GUICtrlComboBox_AutoFillDelete( hWnd )
_GUICtrlComboBox_AutoFillSetContent( hWnd, vData )
_GUICtrlComboBox_AutoFillUpdateContent( hWnd )

Supports:

; Native and UDF combobox functions!

Downloads:

Version: 0.12

_ComboBoxAutoFill_(RedirectLink).html

Note: Usage example is included!

Sample:

Match from beginning:

Posted Image

Match from any string:

Posted Image

Fixes:

  • 0.12.1812.2600b
  • 18/12/2012 -> Added the parameter $lPartialSearch in:

    ;$lPartialSearch - [Optional] Search mode, True for partial. Default is False (Search from the beginning!).
    _GUICtrlComboBox_AutoFillCreate( hWnd[, lPartialSearch] )
    Thanks again to @matwachich for the tip!

    0.12.1712.2600b

  • 18/12/2012 -> The functions were changed by:

    _GUICtrlComboBox_AutoFillSetContent( hWnd, vData )
    _GUICtrlComboBox_AutoFillUpdateContent( hWnd )
  • 17/12/2012 -> We added two new functions:

    _GUICtrlComboBox_AutoFillAddString( hWnd, sText)
    _GUICtrlComboBox_AutoFillDelString( hWnd, iIndex)

    Thanks to @matwachich for the tip!

    0.12.1212.2600b

  • 12/12/2012 -> First release!


Regards,

João Carlos.

Edited by JScript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

  • Moderators

Neat, I did this with a mem sqlite db before, wish I could find the damn code!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Neat, I did this with a mem sqlite db before, wish I could find the damn code!

When you find share with us!

I added a star, I like it.

Thank you, I'm very glad you enjoyed it!

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

Very neat! I'm sure I saw a discussion about this on the best approach and I think you cracked it.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

When I enter e.g. a capital B and press the backspace then capital letter will be a small letter and when I press backspace again the combo list is not positioned below the combobox but over the GUI.

Posted Image

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@matwachich

Thanks for your reply, I tried to use the functions of addition of native UDF and a new item is not stored!

In this case I added two other functions:


Fixes:
  • 0.12.1712.2600b
  • 17/12/2012 -> We added two new functions:

    _GUICtrlComboBox_AutoFillAddString( hWnd, sText)
    _GUICtrlComboBox_AutoFillDelString( hWnd, iIndex)
    Thanks to @matwachich for the tip!

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

In addition to the functions you added, i suggest to add these two ones

; #FUNCTION# ====================================================================================================================
; Name ..........: _GUICtrlComboBox_AutoFillSetContent
; Description ...: Set the content of a ComboBox
; Syntax ........: _GUICtrlComboBox_AutoFillSetContent($hWnd, $vData)
; Parameters ....: $hWnd                - Control ID/Handle to the control.
;                 $vData               - Either an 1-Based array of items, or a pipe "|" delimited string of items.
; Return values .: Success - Items count
;                 Failure - -1
; Author ........: Matwachich
; ===============================================================================================================================
Func _GUICtrlComboBox_AutoFillSetContent($hWnd, $vData)
Local $iIndex, $iCount
$iIndex = __CBA_GetHWndIndex($hWnd)
If Not $iIndex Then Return -1
_GUICtrlComboBox_ResetContent($hWnd)
If Not IsArray($vData) Then $vData = StringSplit($vData, "|")
$iCount = $vData[0]
_GUICtrlComboBox_BeginUpdate($hWnd)
For $i = 1 To $vData[0]
  _GUICtrlComboBox_InsertString($hWnd, $vData[$i])
Next
_GUICtrlComboBox_EndUpdate($hWnd)
$avCBA_MSGIDS[$iIndex][2] = $iCount
$avCBA_MSGIDS[$iIndex][3] = $vData
Return $iCount
EndFunc
; #FUNCTION# ====================================================================================================================
; Name ..........: _GUICtrlComboBox_AutoFillUpdateContent
; Description ...: Update the auto-fill system with the data (items) contained in a comboBox
; Syntax ........: _GUICtrlComboBox_AutoFillUpdateContent($hWnd)
; Parameters ....: $hWnd                - Control ID/Handle to the control.
; Return values .: Success - Items count
;                 Failure - -1
; Author ........: Matwachich
; Remarks .......: Usefull when you change the data of the comboBox with the default AutoIt functions, and you want to update
;                 |the auto-fill data
; ===============================================================================================================================
Func _GUICtrlComboBox_AutoFillUpdateContent($hWnd)
Local $iIndex, $iCount
$iIndex = __CBA_GetHWndIndex($hWnd)
If Not $iIndex Then Return -1
$aList = _GUICtrlComboBox_GetListArray($hWnd)
$iCount = $aList[0]
;----> Update array with the new item!
$avCBA_MSGIDS[$iIndex][2] = $iCount
$avCBA_MSGIDS[$iIndex][3] = $aList
;<----
Return $iCount
EndFunc
Link to comment
Share on other sites

Much better!

I made changes according to what you posted, the version remains the same.


Fixes:
  • 0.12.1712.2600b
  • 18/12/2012 -> The functions were changed by:

    _GUICtrlComboBox_AutoFillSetContent( hWnd, vData )
    _GUICtrlComboBox_AutoFillUpdateContent( hWnd )

Thank you,

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

Fixes:

  • 0.12.1812.2600b
  • 18/12/2012 -> Added the parameter $lPartialSearch in:

    ;$lPartialSearch - [Optional] Search mode, True for partial. Default is False (Search from the beginning!).
    _GUICtrlComboBox_AutoFillCreate( hWnd[, lPartialSearch] )
    Thanks again to @matwachich for the tip!

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

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