 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Bartimus
Joined: 10 Nov 2005 Posts: 164 Location: Texas
|
Posted: Wed Jun 24, 2009 6:26 pm Post subject: autofilling a combobox |
|
|
Is there a way to have a combobox automattically fill in what you're typing based on a pre-existing list of choices? Example: Lets say I want to search for Watermelon. I start typing in the combobox and get to wate, the box will autoexpand and show Water & Watermelon. I'm kinda looking for the same effect as some of the major search engines have when you try to do a query with them.
So, is it possible? |
|
| Back to top |
|
 |
RTFM. Guest
|
Posted: Wed Jun 24, 2009 6:57 pm Post subject: |
|
|
Check out: "incremental search".
I guess Intellisense/ISense's functionality is what you're looking for. |
|
| Back to top |
|
 |
Bartimus
Joined: 10 Nov 2005 Posts: 164 Location: Texas
|
Posted: Wed Jun 24, 2009 8:05 pm Post subject: |
|
|
Thanks RTFM... this is the idea I'm looking for, but ListView won't work for my application.
I'm using a Combo to generate the list and if an entry doesn't exist to allow the person using add a new entry. I'll provide the script. This is a phone call logging script. It records date, time, person logging the call, the caller, and reason. The caller and reason are what the comboboxes are for. I am using this script in my I.T. dept. My tech's have a shortcut to it and use it as they receive calls that don't need service tickets. I need the log for accountability purposes.
| Code: | ;
; Language: English
; Platform: WinAll
; Author: Bartimus
;
; Script Function:
; Phone Log Script
; Generates a CSV file to log incoming calls based on date, time, and user.
;
#SingleInstance, Force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
Loop, read, \\Server\share$\Phone-Log-lists.csv
{
LineNumber = %A_Index%
Loop, parse, A_LoopReadLine, CSV
{
If (A_Index = 1)
If (A_LoopField <> "")
LstWho .= A_LoopField "|"
If (A_Index = 2)
If (A_LoopField <> "")
LstWhat .= A_LoopField "|"
}
}
WinPosx := (A_ScreenWidth)-(360)
WinPosy := (A_ScreenHeight)-(166)
Gui -system
Gui, Color, EEAA99
Gui, Font, s16, Verdana
Gui, Add, Text, Center x0 w325, Log a Phone Call
Gui, Font, s11, Tahoma
Gui, Add, Text, w115 y45 x5 Right,Person Calling:
Gui, Add, ComboBox, yp-5 x120 w155 vWho, %LstWho%
Gui, Add, Text, w115 x5 Right, Reason for Call:
Gui, Add, ComboBox, yp-5 x120 w155 vWhat,%lstWhat%
Gui, Add, Button, x275 y40 w60 h60 default gSubmit, &Submit`nCall
Gui, Show, w345 h105 x%WinPosx% y%WinPosy%, I.T. Phone Log
Gui +LastFound
return
Submit:
Gui, Submit, NoHide
Gui, Destroy
FileAppend, %A_YYYY%-%A_MMM%-%A_DD%`,%A_Hour%:%A_Min%:%A_Sec%`,%A_username%`,%who%`,%what%`n, \\Server\share$\Phone-Log.csv
IfNotInString, LstWho, %Who%
{
FileAppend, %who%, \\Server\share$\Phone-Log-lists.csv
}
IfNotInString, LstWhat, %What%
{
FileAppend, `,%what%, \\Server\share$\Phone-Log-lists.csv
}
FileAppend, `n, \\Server\share$\Phone-Log-lists.csv
TrayTip, I.T. Phone Log, %A_username%`,`nAn entry was made on`n%A_YYYY%-%A_MMM%-%A_DD% at %A_Hour%:%A_Min%:%A_Sec%, 10, 1
Soundbeep, 1500,500
sleep 10000
GuiEscape:
GuiClose:
ExitApp |
|
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 509 Location: Unknown
|
Posted: Wed Jun 24, 2009 10:07 pm Post subject: |
|
|
If you can use a DropDownList in your program add the option "sort".
| Code: | | Gui, 2:Add, DropDownList, Sort , List|List1|WaterMelon |
|
|
| Back to top |
|
 |
Bartimus
Joined: 10 Nov 2005 Posts: 164 Location: Texas
|
Posted: Wed Jun 24, 2009 10:22 pm Post subject: |
|
|
I'm working with this notion (from the help file):
| Quote: | ComboBox
Description: Same as DropDownList but also permits free-form text to be entered as an alternative to picking an item from the list. |
I really need that free-form entry because the list grows as more people call in. I was hoping that I can get the list to pop up as my techs type, so if there's an existing person or reason, they can just use it. |
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 509 Location: Unknown
|
|
| Back to top |
|
 |
Bartimus
Joined: 10 Nov 2005 Posts: 164 Location: Texas
|
Posted: Thu Jun 25, 2009 1:54 pm Post subject: |
|
|
I'm having a hard time seeing how Intellisense is going to apply to my situation.
Intellisense is a great tool, don't get me wrong, but it only pulls from one list (which I have 2) and then on top of that, even if I recode it to work on my app, it will give me the one list it has and apply it to both inputs that I need in my app. I don't need 'reasons' to show up in the 'names' input and I don't need 'names' to show up in the 'reasons' input. I want to keep the two separate. I was also hoping to have a dropdown show up instead of a tooltip as well.
I don't ask for too much do I?  |
|
| Back to top |
|
 |
sysmon Guest
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|