Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Focusable CLabel
Focusable CLabel [message #445068] Mon, 25 October 2004 15:30 Go to next message
Sergey Vyunnikov is currently offline Sergey VyunnikovFriend
Messages: 10
Registered: July 2009
Junior Member
Hi, All!

How to do a focusable CLabel? I don`t want to copy/paste CLabel code with
commented line in "checkStyle" method (style |= SWT.NO_FOCUS).


--
With Best Regards
Vyunnikov Sergey
Re: Focusable CLabel [message #445079 is a reply to message #445068] Mon, 25 October 2004 18:10 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
CLabel does not take focus because it does not do anything interesting with
focus - you can not select the text or position the caret etc.

Why do you want it to take focus?

"Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
news:clj5rq$jir$1@eclipse.org...
> Hi, All!
>
> How to do a focusable CLabel? I don`t want to copy/paste CLabel code with
> commented line in "checkStyle" method (style |= SWT.NO_FOCUS).
>
>
> --
> With Best Regards
> Vyunnikov Sergey
>
>
Re: Focusable CLabel [message #445097 is a reply to message #445079] Tue, 26 October 2004 06:23 Go to previous messageGo to next message
Sergey Vyunnikov is currently offline Sergey VyunnikovFriend
Messages: 10
Registered: July 2009
Junior Member
I have a complex composite with CLabel and Button(SWT.ARROW). For example,
combo box with images. When I click on CLabel it has no focus. I want to
catch events FocusIn and FocusOut.

--
With Best Regards
Vyunnikov Sergey

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cljf7o$7nt$1@eclipse.org...
> CLabel does not take focus because it does not do anything interesting
with
> focus - you can not select the text or position the caret etc.
>
> Why do you want it to take focus?
>
> "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
> news:clj5rq$jir$1@eclipse.org...
> > Hi, All!
> >
> > How to do a focusable CLabel? I don`t want to copy/paste CLabel code
with
> > commented line in "checkStyle" method (style |= SWT.NO_FOCUS).
> >
> >
> > --
> > With Best Regards
> > Vyunnikov Sergey
> >
> >
>
>
Re: Focusable CLabel [message #445101 is a reply to message #445079] Tue, 26 October 2004 08:58 Go to previous messageGo to next message
Sergey Vyunnikov is currently offline Sergey VyunnikovFriend
Messages: 10
Registered: July 2009
Junior Member
Is this decision correct?

label = new CLabel(this, labelStyle) {
public boolean setFocus() {
checkWidget();
return forceFocus();
} //setFocus
};


--
With Best Regards
Vyunnikov Sergey

"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cljf7o$7nt$1@eclipse.org...
> CLabel does not take focus because it does not do anything interesting
with
> focus - you can not select the text or position the caret etc.
>
> Why do you want it to take focus?
>
> "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
> news:clj5rq$jir$1@eclipse.org...
> > Hi, All!
> >
> > How to do a focusable CLabel? I don`t want to copy/paste CLabel code
with
> > commented line in "checkStyle" method (style |= SWT.NO_FOCUS).
> >
> >
> > --
> > With Best Regards
> > Vyunnikov Sergey
> >
> >
>
>
Re: Focusable CLabel [message #445135 is a reply to message #445101] Tue, 26 October 2004 15:12 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Seems bad. If you want to forceFocus(), how about doing it in SWT.MouseDown?

"Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
news:cll37p$rcu$1@eclipse.org...
> Is this decision correct?
>
> label = new CLabel(this, labelStyle) {
> public boolean setFocus() {
> checkWidget();
> return forceFocus();
> } //setFocus
> };
>
>
> --
> With Best Regards
> Vyunnikov Sergey
>
> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
> news:cljf7o$7nt$1@eclipse.org...
> > CLabel does not take focus because it does not do anything interesting
> with
> > focus - you can not select the text or position the caret etc.
> >
> > Why do you want it to take focus?
> >
> > "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
> > news:clj5rq$jir$1@eclipse.org...
> > > Hi, All!
> > >
> > > How to do a focusable CLabel? I don`t want to copy/paste CLabel code
> with
> > > commented line in "checkStyle" method (style |= SWT.NO_FOCUS).
> > >
> > >
> > > --
> > > With Best Regards
> > > Vyunnikov Sergey
> > >
> > >
> >
> >
>
>
Re: Focusable CLabel [message #445142 is a reply to message #445135] Tue, 26 October 2004 19:39 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Note that the CLabel will not draw any differently when it has focus and the
user will not know where focus has gone.
Further, it will not participate in the keyboard tab traversal and as
mentioned before will not support selection.

You would be better off with a Label (that draws the image), a read-only
text widget and a Button(SWT.ARROW).

"Steve Northover" <steve_northover@ca.ibm.com> wrote in message
news:cllp6g$ek2$1@eclipse.org...
> Seems bad. If you want to forceFocus(), how about doing it in
> SWT.MouseDown?
>
> "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
> news:cll37p$rcu$1@eclipse.org...
>> Is this decision correct?
>>
>> label = new CLabel(this, labelStyle) {
>> public boolean setFocus() {
>> checkWidget();
>> return forceFocus();
>> } //setFocus
>> };
>>
>>
>> --
>> With Best Regards
>> Vyunnikov Sergey
>>
>> "Veronika Irvine" <veronika_irvine@oti.com> wrote in message
>> news:cljf7o$7nt$1@eclipse.org...
>> > CLabel does not take focus because it does not do anything interesting
>> with
>> > focus - you can not select the text or position the caret etc.
>> >
>> > Why do you want it to take focus?
>> >
>> > "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
>> > news:clj5rq$jir$1@eclipse.org...
>> > > Hi, All!
>> > >
>> > > How to do a focusable CLabel? I don`t want to copy/paste CLabel code
>> with
>> > > commented line in "checkStyle" method (style |= SWT.NO_FOCUS).
>> > >
>> > >
>> > > --
>> > > With Best Regards
>> > > Vyunnikov Sergey
>> > >
>> > >
>> >
>> >
>>
>>
>
>
Previous Topic:how to remove blinking cursor in StyledText widget
Next Topic:Double click on TableTreeViewer with CellEditors
Goto Forum:
  


Current Time: Wed Apr 24 19:43:00 GMT 2024

Powered by FUDForum. Page generated in 0.04248 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top