Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo clearSelection
Combo clearSelection [message #458535] |
Thu, 14 July 2005 17:00 |
Eclipse User |
|
|
|
Originally posted by: ted_slusser.yahoo.com
Hi, I'm calling select(0) on my combos to have the first element appear in
the list. When I do this it selects all the text in the Combo line. Is
it possible to select the first element without selecting all the text?
When I call clearSelection it doesn't clear the selected text.
Thanks,
Ted
|
|
| | | |
Re: Combo clearSelection [message #458755 is a reply to message #458736] |
Wed, 20 July 2005 16:49 |
Ted Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi Alex,
Thanks for your suggestion. I have tried that and it doesn't work. However
if I add a focus listener and call this on the focus gained event then it
works. The funny thing is if I have several of these combo boxes on the
screen and have this event listener registered for each, it only works on a
single combo. Besides this seems like a real hacky way to do it. I'm
curious to know why clearSelection doesn't work? If I change to read-only
combo the problem goes away, but we'd like to use a Type Ahead feature for
combo and it must be read-write for this to work.
Thanks,
Ted
"Alex Shneyderman" <alex@law.columbia.edu> wrote in message
news:dblfr7$duj$3@news.eclipse.org...
>I think you can use
>
> setSelection (new Point(0,0));
>
> to deselect the text
>
> "Ted" <ted_slusser@yahoo.com> wrote in message
> news:dbjkd4$i7k$1@news.eclipse.org...
>> Hi Steve,
>>
>> Thanks for your reply. The combo box is read-write. I'm not trying to
>> actually delete the text just clear the selection. The problem occurs if
>> I have multiple combo boxes on the screen (all read-write) and I call
>> select(0) on each of them. It appears that all the combo boxes have
>> focus. What I mean is that the text is selected on all of the combo boxes
>> at the same time. I'm not sure if this makes sense, but the
>> clearSelection method does not actually 'deselect' the text.
>>
>> Thanks,
>>
>> Ted
>> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
>> news:dbh6uo$or3$1@news.eclipse.org...
>>> Combo.clearSelection() should just clear the selection, not delete the
>>> text.
>>> If your combo is read only, then the text will always match the
>>> selection.
>>>
>>> "T Slusser" <ted_slusser@yahoo.com> wrote in message
>>> news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>>>> Hi, I'm calling select(0) on my combos to have the first element appear
>>>> in
>>>> the list. When I do this it selects all the text in the Combo line.
>>>> Is
>>>> it possible to select the first element without selecting all the text?
>>>> When I call clearSelection it doesn't clear the selected text.
>>>>
>>>> Thanks,
>>>>
>>>> Ted
>>>>
>>>
>>>
>>
>>
>
>
|
|
| |
Re: Combo clearSelection [message #458785 is a reply to message #458757] |
Thu, 21 July 2005 11:47 |
Ted Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Yes, that's the behavior I'm seeing. Sorry for not finding the bugzilla.
The only work around I have currently is to make the combo-boxes read-only.
If this is a Windows bug that's fine. I just needed to exhaust all
possibilities.
Thanks,
Ted
"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:dbm55d$bgq$1@news.eclipse.org...
> Are you seeing this?
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=93938
>
> "Ted" <ted_slusser@yahoo.com> wrote in message
> news:dbjkd4$i7k$1@news.eclipse.org...
>> Hi Steve,
>>
>> Thanks for your reply. The combo box is read-write. I'm not trying to
>> actually delete the text just clear the selection. The problem occurs if
> I
>> have multiple combo boxes on the screen (all read-write) and I call
>> select(0) on each of them. It appears that all the combo boxes have
> focus.
>> What I mean is that the text is selected on all of the combo boxes at the
>> same time. I'm not sure if this makes sense, but the clearSelection
> method
>> does not actually 'deselect' the text.
>>
>> Thanks,
>>
>> Ted
>> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
>> news:dbh6uo$or3$1@news.eclipse.org...
>> > Combo.clearSelection() should just clear the selection, not delete the
>> > text.
>> > If your combo is read only, then the text will always match the
> selection.
>> >
>> > "T Slusser" <ted_slusser@yahoo.com> wrote in message
>> > news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
>> >> Hi, I'm calling select(0) on my combos to have the first element
>> >> appear
>> >> in
>> >> the list. When I do this it selects all the text in the Combo line.
> Is
>> >> it possible to select the first element without selecting all the
>> >> text?
>> >> When I call clearSelection it doesn't clear the selected text.
>> >>
>> >> Thanks,
>> >>
>> >> Ted
>> >>
>> >
>> >
>>
>>
>
>
|
|
|
Re: Combo clearSelection [message #458876 is a reply to message #458785] |
Mon, 25 July 2005 14:21 |
Steve Northover Messages: 1636 Registered: July 2009 |
Senior Member |
|
|
It's a Windows bug that I have been unable to work around. It's a tough
one.
"Ted" <ted_slusser@yahoo.com> wrote in message
news:dbo210$9ah$1@news.eclipse.org...
> Yes, that's the behavior I'm seeing. Sorry for not finding the bugzilla.
> The only work around I have currently is to make the combo-boxes
read-only.
> If this is a Windows bug that's fine. I just needed to exhaust all
> possibilities.
>
> Thanks,
>
> Ted
> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> news:dbm55d$bgq$1@news.eclipse.org...
> > Are you seeing this?
> >
> > https://bugs.eclipse.org/bugs/show_bug.cgi?id=93938
> >
> > "Ted" <ted_slusser@yahoo.com> wrote in message
> > news:dbjkd4$i7k$1@news.eclipse.org...
> >> Hi Steve,
> >>
> >> Thanks for your reply. The combo box is read-write. I'm not trying to
> >> actually delete the text just clear the selection. The problem occurs
if
> > I
> >> have multiple combo boxes on the screen (all read-write) and I call
> >> select(0) on each of them. It appears that all the combo boxes have
> > focus.
> >> What I mean is that the text is selected on all of the combo boxes at
the
> >> same time. I'm not sure if this makes sense, but the clearSelection
> > method
> >> does not actually 'deselect' the text.
> >>
> >> Thanks,
> >>
> >> Ted
> >> "Steve Northover" <steve_northover@ca.ibm.com> wrote in message
> >> news:dbh6uo$or3$1@news.eclipse.org...
> >> > Combo.clearSelection() should just clear the selection, not delete
the
> >> > text.
> >> > If your combo is read only, then the text will always match the
> > selection.
> >> >
> >> > "T Slusser" <ted_slusser@yahoo.com> wrote in message
> >> > news:6add884471eb10d89abc563ba0866769$1@www.eclipse.org...
> >> >> Hi, I'm calling select(0) on my combos to have the first element
> >> >> appear
> >> >> in
> >> >> the list. When I do this it selects all the text in the Combo line.
> > Is
> >> >> it possible to select the first element without selecting all the
> >> >> text?
> >> >> When I call clearSelection it doesn't clear the selected text.
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Ted
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Wed Sep 18 21:22:59 GMT 2024
Powered by FUDForum. Page generated in 0.04996 seconds
|