@Override public void setFont (Font font) { super.setFont (font); this.font = font; if (popupCalendar != null) popupCalendar.setFont (font); redraw (); }
@Override public void setFont (Font font) { super.setFont (font); this.font = font; if (popupCalendar != null) popupCalendar.setFont (font); redraw (); }
@Override public void setFont (Font font) { super.setFont (font); this.font = font; if (popupCalendar != null) popupCalendar.setFont (font); redraw (); }
data= new GridData(SWT.FILL, SWT.FILL, true, false); argumentsDate.setLayoutData(data); argumentsDate.setFont(multiArgumentComposite.getFont()); argumentsDate.addSelectionListener(new SelectionAdapter() { @Override
void createPopupShell (int year, int month, int day) { popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP); popupCalendar = new DateTime (popupShell, SWT.CALENDAR); if (font != null) popupCalendar.setFont (font); if (fg != null) popupCalendar.setForeground (fg); if (bg != null) popupCalendar.setBackground (bg); mouseEventListener = new Listener () { @Override public void handleEvent (Event event) { if (event.widget instanceof Control) { Control c = (Control)event.widget; if (c != down && c.getShell () != popupShell) dropDownCalendar (false); } } }; int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint}; for (int i=0; i < listeners.length; i++) { popupShell.addListener (listeners [i], popupListener); } listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose}; for (int i=0; i < listeners.length; i++) { popupCalendar.addListener (listeners [i], popupListener); } addListener (SWT.Dispose, popupListener); if (year != -1) popupCalendar.setDate (year, month, day); }
void createPopupShell (int year, int month, int day) { popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP); popupCalendar = new DateTime (popupShell, SWT.CALENDAR); if (font != null) popupCalendar.setFont (font); if (fg != null) popupCalendar.setForeground (fg); if (bg != null) popupCalendar.setBackground (bg); mouseEventListener = new Listener () { @Override public void handleEvent (Event event) { if (event.widget instanceof Control) { Control c = (Control)event.widget; if (c != down && c.getShell () != popupShell) dropDownCalendar (false); } } }; int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint}; for (int i=0; i < listeners.length; i++) { popupShell.addListener (listeners [i], popupListener); } listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose}; for (int i=0; i < listeners.length; i++) { popupCalendar.addListener (listeners [i], popupListener); } addListener (SWT.Dispose, popupListener); if (year != -1) popupCalendar.setDate (year, month, day); }
void createPopupShell (int year, int month, int day) { popupShell = new Shell (getShell (), SWT.NO_TRIM | SWT.ON_TOP); popupCalendar = new DateTime (popupShell, SWT.CALENDAR); if (font != null) popupCalendar.setFont (font); if (fg != null) popupCalendar.setForeground (fg); if (bg != null) popupCalendar.setBackground (bg); mouseEventListener = new Listener () { @Override public void handleEvent (Event event) { if (event.widget instanceof Control) { Control c = (Control)event.widget; if (c != down && c.getShell () != popupShell) dropDownCalendar (false); } } }; int [] listeners = {SWT.Close, SWT.MouseUp, SWT.Paint}; for (int i=0; i < listeners.length; i++) { popupShell.addListener (listeners [i], popupListener); } listeners = new int [] {SWT.MouseDown, SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose}; for (int i=0; i < listeners.length; i++) { popupCalendar.addListener (listeners [i], popupListener); } addListener (SWT.Dispose, popupListener); if (year != -1) popupCalendar.setDate (year, month, day); }
popupShell.window.setHasShadow(true); popupCalendar = new DateTime (popupShell, SWT.CALENDAR); if (font != null) popupCalendar.setFont (font);