New topic: How to get rid of selection in combo box?
<http://forums.realsoftware.com/viewtopic.php?t=46836> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message Ralf Funke Post subject: How to get rid of selection in combo box?Posted: Wed Feb 06, 2013 3:42 am Joined: Fri Feb 16, 2007 6:08 am Posts: 16 I populate a combo box and set a list index. When I start the app the text entry in the combo box is selected. Which looks ugly. I tried for hours but found no way to get rid of it. I tried to set the selection of a text field after population of the combo box but nothing seems to work. I also tried to explicitly set the selection of my combo boy to only the first character. But is always the entire entry that is selected. The combo box does not have the focus. The window it sits in (a palette) also does not have the focus. Also the combo box has a focus ring although I unchecked the option. (I hate focus rings). Hope someone has a solution. Otherwise I will have to use popup menus. Thanks, Ralf Top HMARROQUINC Post subject: Re: How to get rid of selection in combo box?Posted: Wed Feb 06, 2013 7:06 am Joined: Sun Jan 25, 2009 5:11 pm Posts: 413 Location: Guatemala, Central America Is your combobox the first control in the window? What I mean is it the first control that gets the taborder? Even if the combobox tab order is next to a label it will receive focus and select text the text which is the normal behaviour. In the gotfocus event of the combobox write combobox1.SelLength = 0 This will deselect the text in the combobox. _________________ Future RS guru. Ride the world! Top Ralf Funke Post subject: Re: How to get rid of selection in combo box?Posted: Wed Feb 06, 2013 8:02 am Joined: Fri Feb 16, 2007 6:08 am Posts: 16 No, it is not the first control. And no setting the sellength is one of the things I tried. For testing I put a push button upon the window with co_bplayer.sellength=0 Nothing happens. If I step into this code line, I just jump out of the editor in this line without anything happening. Lines after this code line are not processed. Ralf Top HMARROQUINC Post subject: Re: How to get rid of selection in combo box?Posted: Wed Feb 06, 2013 8:24 am Joined: Sun Jan 25, 2009 5:11 pm Posts: 413 Location: Guatemala, Central America Well I tested the code I posted and it worked here. The selection was not visible when the code was called from the got focus event, trying it from a pushbutton or even the window's open event didn't work. Oh, and if the combobox is not the first control in the taborder I never get the selection. Sorry I can't be of help. _________________ Future RS guru. Ride the world! Top Dale Post subject: Re: How to get rid of selection in combo box?Posted: Wed Feb 06, 2013 2:48 pm Joined: Thu Mar 01, 2007 2:02 pm Posts: 222 Location: Sunny (generally!) Southern California I did a little bit of investigating and found some interesting things. I started with a bevelbutton, added a combobox, a popupmenu, and a pushbutton. I filled in values for the combobox and popupmenu. None of the controls had anything coded into their actions. Here's what I found: When the program starts, the combobox entry at the listindex was highlighted. Clicking the bevelbutton had no effect, but clicking the pushbutton or dropping the popupmenu deselected the item in the combobox. Then I set the focus to the pushbutton in the window's open event. Running the program then had the button's focus set and the combobox was unhighlighted. So you might create a bogus pushbutton outside of the window and give it the focus when you need to have the combobox unhighlighted. Why it worked with the popupmenu and pushbutton but not the bevelbutton is beyond me. - Dale _________________ ----- Real Studio 2012r1 on Windows 7 (64 bit) ----- It has been said that politics is the second oldest profession. I have learned that it bears a striking resemblance to the first. - Ronald Reagan Top Ralf Funke Post subject: Re: How to get rid of selection in combo box?Posted: Thu Feb 07, 2013 4:02 am Joined: Fri Feb 16, 2007 6:08 am Posts: 16 Setting the focus to a push button did not work for me. But I now pushed the combobox outside the window and created a new combo. And now the behavior is satisfying. So maybe the first combobox control gets the selection. For whatever reason. Also, it seems to be a Cocoa issue. Same thing with Carbon does not happen. Thank you Dale and HMARROQUINC. Ralf Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
