logo       

Re: validation with JCombobox: msg#00013

Subject: Re: validation with JCombobox
extern.Lars.Oeschey@xxxxxxx wrote:

I have a problem recreating a standard Windows behaviour for drop-down
lists: User can type in an entry, as long as those letters match the
beginning of a list entry, the list entry is highlighted. When a letter is
entered that doesn't match anymore, nothing in the list is selected, i.e. it
is a "free entry".

Ok, I've been working on a new release, and decided to thoroughly scrub the entire module, fixing whatever problems I can find and addressing any problems that have been sent to the mailing list/c.l.p.tk over the past year or so. I think I have a solution to your problem. I've never been completely happy with the -validate option. It seemed like I was mixing two different pieces of functionality together (finding existing entries in the Listbox, and validating what can be set in the Entry widget (or Label in RO mode). So in the new version, I've separated these two. There is still a validate mode called match/csmatch in addition to the other modes that can be set for an Entry widget. These modes are for validation purposes only and do not cause the Listbox to be displayed. What's more, the validate option has no effect at all when the JComboBox is in readonly mode.

There is a new option called -autofind that takes a reference to a hash
containing one or more options that define the autofind behavior. The
autofind options include:

-enabled  => boolean (defaults to true/1)
     whether or not autofind feature is activated or not

-casesensitive => boolean  (defaults to false/0)
     whether or not the case of the entry matters in finding a match

-completion => boolean (defaults to false/0)
     whether or not to use autocompletion within the Entry similar to
     what web browsers do within their location bar.

-showpopup => boolean (defaults to true/1)
     whether or not to display the listbox while using autofind
     functionality.

The effect the options have will depend on what mode the JComboBox is in. In readonly mode, the only options that will have a noticeable affect will be: -enabled and -showpopup, -casesensitive and the default behavior will be like what is found on windows machines. The initial letter will be able to be used to jump through the selections beginning with that letter. I believe this default behavior is what you are looking for.

In editable mode, all of the above options will be able to be used, and the default behavior will be similar to the older version of JComboBox when the -validate option was set to match. The main difference is that now the Combo Box will not prevent entries from being entered that are not contained within the Listbox so long as -validate is not set to
match or cs-match.

This, along with a few other tweaks should bring JComboBox in line with
the majority of the features offered by any of the other Combo Box widgets. The new version is about 2/3 complete, but I won't be releasing it until it has test cases, revised documentation, including a POD version of it. Except for bug-fixes, this may be the last release of JComboBox as a stand-alone module. Future releases will likely have dependancies on other Tk modules I'm working on, so it will just be easier to bundle them together. Easier for me to manage, and easier for
folks to download so that they do not have to track down invidual
dependancies.

Rob


-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe