Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Focusable CLabel
Focusable CLabel [message #445068] Mon, 25 October 2004 11:30 Go to next message
Eclipse UserFriend
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 14:10 Go to previous messageGo to next message
Eclipse UserFriend
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 02:23 Go to previous messageGo to next message
Eclipse UserFriend
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 04:58 Go to previous messageGo to next message
Eclipse UserFriend
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 11:12 Go to previous messageGo to next message
Eclipse UserFriend
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 15:39 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 05:24:14 EDT 2025

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

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

Back to the top