Edifice Posted February 19, 2009 Share Posted February 19, 2009 Hey We are all familiar with google's "new" feature: It suggests keywords as you type in the box - very neat! Anyway, I work at a computer-repair shop, and as it is we really keep track of all our repairs with a piece of paper. I decided to change that. I have managed to create a database-file in SQLite, with various data reagarding the repairs and ofcourse a matching GUI to input data. I am now working on the bit to get the data back on-screen again, and have to sort all the forms somehow. I have to have a search-feature, coz there is just too many entries to look through by hand. My $id looks like this: Dim $form_num = GUIctrlRead($input_phonenumber, 1) & @MDAY&@MON&@YEAR&@HOUR&@MIN&@SEC Which with the Danish phonenumbers generate a number that looks somewhat like this: 7833664119022009105053 (Unique coz of the timestamp ) Anyway, let me get to the point: I have to be able to search these inputs by phonenumber (It's also in the DB - standalone input, if that helps me out) What I would like to do is to be able to type for example "7" in a combobox, then search all the $id's for input with "7" in it, and display them in the combo to select. Then type some more: "7833" and display all the $id's with that specific number to select .... I think you see where this is going I have no idea where to start here and would just appreciate it very much to be pointed in the right direction - and maybe even with a bit of help along the way Link to comment Share on other sites More sharing options...
CBuckley Posted February 19, 2009 Share Posted February 19, 2009 Hey We are all familiar with google's "new" feature: It suggests keywords as you type in the box - very neat! Anyway, I work at a computer-repair shop, and as it is we really keep track of all our repairs with a piece of paper. I decided to change that. I have managed to create a database-file in SQLite, with various data reagarding the repairs and ofcourse a matching GUI to input data. I am now working on the bit to get the data back on-screen again, and have to sort all the forms somehow. I have to have a search-feature, coz there is just too many entries to look through by hand. My $id looks like this: Dim $form_num = GUIctrlRead($input_phonenumber, 1) & @MDAY&@MON&@YEAR&@HOUR&@MIN&@SEC Which with the Danish phonenumbers generate a number that looks somewhat like this: 7833664119022009105053 (Unique coz of the timestamp ) Anyway, let me get to the point: I have to be able to search these inputs by phonenumber (It's also in the DB - standalone input, if that helps me out) What I would like to do is to be able to type for example "7" in a combobox, then search all the $id's for input with "7" in it, and display them in the combo to select. Then type some more: "7833" and display all the $id's with that specific number to select .... I think you see where this is going I have no idea where to start here and would just appreciate it very much to be pointed in the right direction - and maybe even with a bit of help along the way This would be quite a cool concept. You are lucky but Google hasn't released suggest in our country yet DataHostDirect Linux VPS Specialists Link to comment Share on other sites More sharing options...
BrettF Posted February 19, 2009 Share Posted February 19, 2009 Maybe check out what I did here:http://www.autoitscript.com/forum/index.php?showtopic=62303Cheers,Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Edifice Posted February 19, 2009 Author Share Posted February 19, 2009 It's sounds like something like it yeah, however the result of running that script was at first a couple of error on undeclared stuff. After I put in some includes I was able to get a GUI with an Input. I have the feeling it was supposed to do something more? Link to comment Share on other sites More sharing options...
BrettF Posted February 19, 2009 Share Posted February 19, 2009 Meant to be an example of how to go about using a combo with auto complete. I didn't say it would solve your problem 100%. Can you post a replicator script? Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Edifice Posted February 19, 2009 Author Share Posted February 19, 2009 Meant to be an example of how to go about using a combo with auto complete. I didn't say it would solve your problem 100%. Can you post a replicator script? Cheers, Brett Ofcourse not - I just don't think the version I'm running is Working As intended Here is what i've got: expandcollapse popup#include <GUIComboBox.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GUIConstants.au3> Opt('MustDeclareVars', 1) $Debug_CB = False; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work Global $hCombo Example_Internal() Func Example_Internal() Local $hGUI ; Create GUI $hGUI = GUICreate("(Internal) ComboBox Auto Complete", 400, 296) $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 20, BitOR ($CBS_NOINTEGRALHEIGHT, $CBS_SIMPLE)) GUISetState() ; Add files _GUICtrlComboBox_BeginUpdate ($hCombo) _GUICtrlComboBox_AddDir ($hCombo, @WindowsDir & "\*.exe") _GUICtrlComboBox_EndUpdate ($hCombo) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") ; Loop until user exits Do Sleep (10) Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_Internal Func _Edit_Changed() _GUICtrlComboBox_AutoComplete ($hCombo) EndFunc ;==>_Edit_Changed Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $hWndCombo If Not IsHWnd($hCombo) Then $hWndCombo = GUICtrlGetHandle($hCombo) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF); Low Word $iCode = BitShift($iwParam, 16); Hi Word Switch $hWndFrom Case $hCombo, $hWndCombo Switch $iCode Case $CBN_EDITCHANGE; Sent after the user has taken an action that may have altered the text in the edit control portion of a combo box _Edit_Changed() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Link to comment Share on other sites More sharing options...
Edifice Posted February 19, 2009 Author Share Posted February 19, 2009 (edited) Arh got it working now! - Dunno what I messed up in the first copy+paste action This is actually really, really great! I took the styling off and discovered that the combo didn't have more than one option. I was kinda hoping to get all the results with "7833" in there to be able to choose from. I do have returning customers, and I have to be able to handle the same phonenumber twice. Thus the timestamp in the $id. Anyone with a bright idea? - I have to admit this code is a bit advanced for me Edited February 19, 2009 by Edifice Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now