Firemonkey FM2 Combobox - Setting ItemIndex

I'm trying to essentially "blank out" a combox.  I can set it's ItemIndex to -1 (even though that is the default value).  It will let me set the ItemIndex to another value.  How else can I blank out the combobox?
0
Joey
9/24/2012 7:58:05 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

6 Replies
2110 Views

Similar Articles

[PageSpeed] 23

> {quote:title=Joey Hickey wrote:}{quote}
> I'm trying to essentially "blank out" a combox.  I can set it's ItemIndex to -1 (even though that is the default value).  It will let me set the ItemIndex to another value.  How else can I blank out the combobox?

What do you mean by 'blank out'? From an end user point of view or from a programming point of view? Is it adequate just clear (i.e. empty) the Items?

-- 
MonkeyStyler FireMonkey style designer http://bit.ly/PzxKyI
Embarcadero MVP
0
Mike
9/24/2012 8:08:29 PM
> {quote:title=Mike Sutton wrote:}{quote}
> > {quote:title=Joey Hickey wrote:}{quote}
> > I'm trying to essentially "blank out" a combox.  I can set it's ItemIndex to -1 (even though that is the default value).  It will let me set the ItemIndex to another value.  How else can I blank out the combobox?
> 
> What do you mean by 'blank out'? From an end user point of view or from a programming point of view? Is it adequate just clear (i.e. empty) the Items?
> 
> -- 
> MonkeyStyler FireMonkey style designer http://bit.ly/PzxKyI
> Embarcadero MVP

OK.  I have to comboxes.  The first combobox determines what I display in the second box.  So, say I choose "SPORTS" in the first box.  I'll then see a list of sports (baseball, soccer, etc.).  When I change the my selection for the first box to "ACADEMICS", I want the second combox to change to math, science, etc.  This part works, but when I re-select the first combobox, the second one is autofilling with the first item int the list.  I'd like the selection to be blank until selected explicitly by the u
ser.  I don't want to remove all of the items from the list.

I thought setting the ItemIndex to -1 would work, but I get an access violation.

Edited by: Joey Hickey on Sep 24, 2012 1:32 PM
0
Joey
9/24/2012 8:33:24 PM
> {quote:title=Joey Hickey wrote:}{quote}

> OK.  I have to comboxes.  The first combobox determines what I display in the second box.  So, say I choose "SPORTS" in the first box.  I'll then see a list of sports (baseball, soccer, etc.).  When I change the my selection for the first box to "ACADEMICS", I want the second combox to change to math, science, etc.  This part works, but when I re-select the first combobox, the second one is autofilling with the first item int the list.  I'd like the selection to be blank until selected explicitly by the
 user.  I don't want to remove all of the items from the list.

In the VCL there's TComboBox has an option to show nothing. That option isn't there in FireMonkey. If there are items in the list then one of them will always be displayed.

I would suggest using the option used on many webforms. Make the first item something like 'Select a department' or just 'Select...' and clear the second combo if that item is selected.

--
MonkeyStyler FireMonkey style designer http://bit.ly/PzxKyI
Embarcadero MVP
0
Mike
9/24/2012 11:23:27 PM
> {quote:title=Mike Sutton wrote:}{quote}
> > {quote:title=Joey Hickey wrote:}{quote}
> 
> > OK.  I have to comboxes.  The first combobox determines what I display in the second box.  So, say I choose "SPORTS" in the first box.  I'll then see a list of sports (baseball, soccer, etc.).  When I change the my selection for the first box to "ACADEMICS", I want the second combox to change to math, science, etc.  This part works, but when I re-select the first combobox, the second one is autofilling with the first item int the list.  I'd like the selection to be blank until selected explicitly by t
he user.  I don't want to remove all of the items from the list.
> 
> In the VCL there's TComboBox has an option to show nothing. That option isn't there in FireMonkey. If there are items in the list then one of them will always be displayed.
> 
> I would suggest using the option used on many webforms. Make the first item something like 'Select a department' or just 'Select...' and clear the second combo if that item is selected.
> 
> --
> MonkeyStyler FireMonkey style designer http://bit.ly/PzxKyI
> Embarcadero MVP

Thanks, I'll go with your suggestion.
0
Joey
9/25/2012 12:29:55 PM
> {quote:title=Mike Sutton wrote:}{quote}
> > {quote:title=Joey Hickey wrote:}{quote}
> In the VCL there's TComboBox has an option to show nothing. That option isn't there in FireMonkey. If there are items in the list then one of them will always be displayed.
I am not seeing that. I am using XE3 and I created a TComboBox and two buttons. I populated the combobox with 5 items. The first button sets the index to 0 (first item), the second button sets the itemindex to -1 (no item selected). When I run the application, I can select an item from the list. I can press the first button and see the first item or I can press the second button to the combo box goes blank (nothing selected).

Also note that FMX has two types of Combo boxes. TComboBox and TComboEdit the later has a Text property and allows users to type into the box in addition to selecting from a drop down. VCL has a property (Kind it think) that allowed you to select from the two different modes.

 Mike
0
Mike
9/25/2012 5:55:59 PM
> {quote:title=Mike Myhre wrote:}{quote}
> I am not seeing that. I am using XE3 and I created a TComboBox and two buttons. I populated the combobox with 5 items. The first button sets the index to 0 (first item), the second button sets the itemindex to -1 (no item selected). When I run the application, I can select an item from the list. I can press the first button and see the first item or I can press the second button to the combo box goes blank (nothing selected).

Maybe a difference in XE3? I'll take a look when I get time.

--
MonkeyStyler FireMonkey style designer http://bit.ly/PzxKyI
Embarcadero MVP
0
Mike
9/25/2012 9:20:31 PM
Reply:

Similar Artilces:

Ann: FastReport FMX for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Ann: X-platform report generator for Delphi XE3 (FireMonkey 2) and XE2 (FireMonkey) released
Dear friends, Visual report designer is available now on both MS Windows and MAC OS X! Full sources. We can write here full list of possibilities, but it will so long. Let see FastReport VCL and FastReport FMX comparison table: http://www.fast-report.com/en/products/comparison-fast-report-firemonkey-vcl.html And all of this - just now in your hands for business-applications for Mac. Report generator FastReport FMX is the first multiplatform solution for including Business Intelligence into software based on Embarcadero FireMonkey IDE (Delphi for MS Windows and Apple Mac OS X)...

Firemonkey
I am so dammed frustrated with firemonkey and livebindings. The VCL + DB Controls were fast, consistent, and stable. This fmx framework is crap. It's slow on my i5 Macbook. I'd be embarrassed to put out an app like this. The help is lousy and apparently very few people are using it based on my failed Google searches. I can see why. Livebindings is cute when you have a few fields, but it a rats nest when you have a moderately complex form and have to wire up dozens of controls. There is no official support for nullable fields in livebindings which blows my mind....

Installing components for FireMonkey HD and FireMonkey iOS
Hi, How do I install components for both FireMonkey HD and FireMonkey iOS? I have one package 'FMXMyFireMonkeyControl' and 'FMIFireMonkeyControl' which both point to the same file with the same registration 'TFireMonkeyControl'. If I compile one package (FMXMyFireMonkeyControl) it installs correctly, then change the include file (FMCompile.INC) to compile for IOS (FMIFireMonkeyControl) which is included in the FMX.FireMonkeyControl.pas file: {$I FMCOMPILE.INC} uses {$IFDEF COMPILEIOS} FMX_Types, FMX_Objects, FMX_Forms, FMX_Dialogs, FMX_Effe...

Delphi XE2, OSX and FireMonkey?
1. Does anyone know if developing with FireMonkey will be the only way to develop for OSX with XE2? 2. Does anyone know if you will need to compile on a Mac for OSX, or will XE2 cross compile? I know this will all come out during the world tour, but I'm just trying to get some idea so I can start planning. 1. Yes, I think for now it will be the only way. But you can probably build a native UI for OSX by directly using the API, like you can also develop Win32 applications without using the VCL. 2. XE2 will only be available for Windows, but it will compile for other platforms. &l...

Making Firemonkey more compatible with Delphi
I have programmed in Delphi since 1995 Delphi1 I am now evaluating Delphi XE4. It boggles my mind, why embarcadero has lost the most important aspects of Delphi. Simplicity and Fast User Interface creation. I can easily see how Firemonkey can be improved to bring it in line with traditional Delphi Techniques by doing the following. 1. All Firemonkey controls need a data aware counterpart. 2. Firemonkey Styles need to be converted to TControl descendants. 3. ie. TLayout goes to TPanel ( TFMXPanel ) 4. ie. TRectangle does to TFrame TFMXFrame ) 5. LiveBindings gets placed un...

ANN: Delphi XE2 FireMonkey BOOK
September 5, 2012 Coogara Consulting is pleased to announce that our new book is available: "FireMonkey Development for iOS and OS X with Delphi XE2" by Graeme Chandler. It is available printed (comb binding) or in PDF and MOBI (Kindle compatible) formats. Only from: http://shop.coogara.com Regards Graeme Chandler Coogara Consulting http://www.coogara.com.au http://shop.coogara.com http://www.strikingwood.com.au Graeme Chandler wrote: > Coogara Consulting is pleased to announce that our new book is > available: > > "FireMonkey Dev...

Delphi, Firemonkey, IOS, and TCP howto?
I was really excited about the new ability to compile IOS apps written in Delphi, but I'm starting to find some major limitations, unless I'm really overlooking something. I want to write an iphone/pad app that needs to retrieve data from a socket connection, or from a webpage (http, webservice, anything). It seems that all of the Firemonkey internet and indy components are not supported within xcode. Am I overlooking something here, or is this a feature that will not be implemented, or is it planned to be implemented? If this kind of communication is not supported, this is a hu...

Pop-up on Mobile apps (FireMonkey / Delphi )
Hi everyone, I'm currently working on a FireMonkey mobile app with Delphi (XE6) and since i'm really new to this i'm in need of a little bit of help. For my App i'd like to build in a subscription screen that would work like a pop-up, showing modal on the same form than the login. I've been looking around a bit on the internet but couldn't find any usefull advice. I found a video ("FireMonkey: Showing Modal form with animation and Shadow effect" from Yaroslav Brovin) thad proved me that it was possible, but was unable to find how. I'm sure it'...

How to make a Firemonkey lookup combobox? [Edit]
How can I create a lookup combobox with de lookup items from tabel 1 and de selected value has to go to tabel 2 . And if posible how do I make a lookup that shows images? The images are stored in a blob field in de database Edited by: Astrid Rijken on Feb 10, 2012 2:00 AM > {quote:title=Astrid Rijken wrote:}{quote} > How can I create a lookup combobox with de lookup items from tabel 1 and de selected value has to go to tabel 2 . > And if posible how do I make a lookup that shows images? > The images are stored in a blob field in de database > > Edited by: Astrid ...

Delphi XE5 Firemonkey iOS7 Style (where is it?)
It says here http://www.embarcadero.com/products/rad-studio/whats-new that XE5 has "iOS 7 SDK support and style" Where is the iOS7 style? - All I can see is iOS6 style components. I can compile on iOS7 and it will bring up the keyboard in iOS 7 but none of the drag and drop components from firemonkey are iOS7 style. Am I missing something obvious? > {quote:title=David Templar wrote:}{quote} > It says here http://www.embarcadero.com/products/rad-studio/whats-new that XE5 has "iOS 7 SDK support and style" > > Where is the iOS7 style? - All I can see is...

Delphi FireMonkey project / testComplete and MSAA
Hi I am actualy working on a new team project developped using FireMonkey. We want to create automated tests with TestComplete which is already used to run tests on some VCL projects. Unfortunatly, we discovered that TestComplete is not directly compatible with FireMonkey application, it only sees the windows but not the controls on it. Making some research we, found that TestComplete is able to identify controls thanks to MSAA. So we created a really short project (only one form with some controls) using the FireMonkey Accessibility Pack in order to look at TestComplete's behavio...

ANN: TMS Pack for FireMonkey v1.5 with new TMS Grid for FireMonkey released
We're very proud to announce the availability of TMS Pack for FireMonkey v1.5 at http://www.tmssoftware.com/site/tmsfmxpack.asp that includes our new TMS Grid for FireMonkey and also a new Outlook style navigation bar and advanced edit controls. Screenshot: http://www.tmssoftware.com/site/img/TMSFMXGridCollection_small.png TMS Grid for FireMonkey feature set: - Fully style-able, customizable and architected from the ground up for FireMonkey - Fully cross platform, support for Win32, Win64, Mac OSX, iOS - High performance: handles >500.000 rows, >10.000 columns witho...

Delphi firemonkey form and keyboard Previous/Next
If I have a web a webform (html) with many fields the Iphone and Ipad keyboard show Previous/Next field. Is there a way to get this functionality with Delphi and a FM form ? B ...

Firemonkey - XE 5 - Mac OS X Firemonkey HD App
My Firemonkey applications have no icon when they run in the dock. What is odd is that when I navigate in the finder to the app bundle to /Users/my_user_id/RADPAServer/scratch-dir I see the icon there, and if I open the app bundle, it contains the .icns file, which seems valid. But the Finder itself, in my iMac running OS X 10.8.5 seems to refuse to show the icon in the dock. Running the app bundle normally (not via RADPASERVER) also results in a broken icon. Note that if I make an icon myself, using the OS X app Icon Composer, and put it in there, it seems valid, but (a) the defau...

Web resources about - Firemonkey FM2 Combobox - Setting ItemIndex - embarcadero.delphi.firemonkey

Firemonkeys - GamesIndustry International
The world's leading games industry website. Get insight from todays industry leaders with news, interviews and analysis of global gaming trends. ...

Firemonkey’s Real Racing 3 To Launch At The End Of February
In September, Apple demoed Firemonkey’s Real Racing 3 at the iPhone 5 event . Three months later and the game has yet to show up in the App Store. ...

EA Games and Firemonkey Bringing Real Racing 3 to Android, Fasten your Seat Belts
Start up your engines race fans, EA Games is teaming up with Firemonkey to bring Real Racing 3 to mobile devices. If you’re a fan of more realistic ...

EA's Firemint and IronMonkey Studios Merge to Become FireMonkeys
... game development studios into one mega-studio in Australia. Firemint and IronMonkeys will be merged into a single studio now known as Firemonkeys ...

News: Firemonkeys announces Real Racing 3
Firemonkeys, a new gaming subsidiary of Electronic Arts born from the merger of FireMint and IronMonkey, has announced the coming release of ...

firemonkeys - iMore
EA has pushed out another impressive update to its equally impressive iOS racer, Real Racing 3, that for the first time brings cars from Ferrari ...

Firemonkeys on Real Racing 3 going free-to-play
... got a hands-on preview of Real Racing 3. We also spoke with Ptolemy Oberin, one of the game’s programmers and project lead at developer Firemonkeys, ...

Real Racing 3 coming in 2012 from Firemonkeys
The first game from recently merged developer Firemonkeys is Real Racing 3 , the developer revealed moments ago during EA's Summer Showcase event ...

Firemonkeys Previews Real Racing 3 for iPhone and iPad
Firemonkeys, the new combined studio from EA combining the IronMonkey and Firemint gaming studios, has announced the development of Real Racing ...

EA Mobile Moves: IronMonkey & Firemint Merge Into “Firemonkeys,” Now Have 50M Players Between
... that it is merging two top mobile game studios, IronMonkey and Firemint , which will fittingly combine to create a new company, called Firemonkeys. ...

Resources last updated: 11/25/2015 4:09:46 PM