Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Borders like org.eclipse.swt.widgets.Text and org.eclipse.swt.widgets.DateTime (ie. with focus in effect)

Hi Damien

> How can I get such a border on a custom control ?

Sorry, you can't. There's currently no API to get this in SWT.

This "focus" border around the active Text/Combo/Date is something the OS 
provides for these special widgets. (Windows turns the border blue; Mac 
add's a blue "focus ring" around.)

You can't see the implementation in the DateTime class because it's really 
not there. :-) DateTime is only a Composite because it used to be emulated 
on platforms that didn't offer such a widget.

You can file an enhancement request for SWT, but I'm not sure if this can 
be implemented for non-native widgets. See e.g. StyledText and CCombo, 
which also don't show a focus ring.

Markus



From:   Arun K Thondapu <arunkumar.thondapu@xxxxxxxxxx>
To:     "Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>
Date:   2014-09-04 20:12
Subject:        Re: [platform-swt-dev] Borders like 
org.eclipse.swt.widgets.Text and org.eclipse.swt.widgets.DateTime (ie. 
with focus in effect)
Sent by:        platform-swt-dev-bounces@xxxxxxxxxxx



Hi Damien,

I'm not sure I understand your question completely.
What exactly do you mean by a border that changes on focus in? Did you 
mean
that this change is happening now on Windows 7 & Mac OS X but not on 
Linux?

I would suggest posting this query with more details (including screen
shots if possible) on the SWT community forum (
https://www.eclipse.org/forums/index.php/f/100/) which is more appropriate
for queries of this kind.

Thanks,
Arun



From:            Damien Dudouit <ddudouit@xxxxxxx>
To:              "Eclipse Platform SWT component developers list."
            <platform-swt-dev@xxxxxxxxxxx>
Date:            03-09-14 15:02
Subject:                 [platform-swt-dev] Borders like 
org.eclipse.swt.widgets.Text
            and org.eclipse.swt.widgets.DateTime (ie. with focus in 
effect)
Sent by:                 platform-swt-dev-bounces@xxxxxxxxxxx



Hello,

I would like a control similar to org.eclipse.swt.widgets.DateTime, that
appears as a Text field but has several sub areas.
The problème for me is the border. On Windows 7 and MacOS X for instance,
widgets such as Text and DateTime have a border that change when the focus
is gained.

How can I get such a border on a custom control ?

The only way I know of to get a native border is :

public class MyWidget extends Composite {

  public MyWidget(Composite parent, int style) {
  super (parent, SWT.BODER);

but that border does nothing on focus in.


I have tried looking at the code of the DateTime widget but I don't manage
to see where the border is dealt with :

public class DateTime extends Composite {

  public DateTime (Composite parent, int style) {
  super (parent, checkStyle (style));


Thanks a lot in advance,

Regards,

Damien_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe 
from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top