AutoHotkey Community

It is currently May 26th, 2012, 8:58 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: autofilling a combobox
PostPosted: June 24th, 2009, 7:26 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2009, 7:57 pm 
Check out: "incremental search".
I guess Intellisense/ISense's functionality is what you're looking for.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2009, 9:05 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2009, 11:07 pm 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
If you can use a DropDownList in your program add the option "sort".
Code:
Gui, 2:Add, DropDownList, Sort , List|List1|WaterMelon


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2009, 11:22 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2009, 11:44 pm 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
http://www.autohotkey.com/forum/viewtop ... tellisense


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 25th, 2009, 2:54 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
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? :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 25th, 2009, 5:17 pm 
http://www.autohotkey.com/forum/topic19766.html


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bekihito, Bing [Bot], BrandonHotkey, coinman, Exabot [Bot], Google Feedfetcher, oldbrother and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group