/** * Returns the font that the receiver will use to paint textual information. * * @return the receiver's font * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public Font getFont () { checkWidget(); if (font == null) { int /*long*/ hFont = defaultFont (); return Font.win32_new (display, hFont); } return font; }
@Override LRESULT WM_SETFONT (int /*long*/ wParam, int /*long*/ lParam) { layout.setFont (Font.win32_new (display, wParam)); if (lParam != 0) OS.InvalidateRect (handle, null, true); return super.WM_SETFONT (font = wParam, lParam); }
/** * Returns a reasonable font for applications to use. * On some platforms, this will match the "default font" * or "system font" if such can be found. This font * should not be freed because it was allocated by the * system, not the application. * <p> * Typically, applications which want the default look * should simply not set the font on the widgets they * create. Widgets are always created with the correct * default font for the class of user-interface component * they represent. * </p> * * @return a font * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Font getSystemFont () { checkDevice (); int /*long*/ hFont = OS.GetStockObject (OS.SYSTEM_FONT); return Font.win32_new (this, hFont); }
/** * Returns the font that the receiver will use to paint textual information. * * @return the receiver's font * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public Font getFont () { checkWidget (); if (font != null) return font; int /*long*/ hFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0); if (hFont == 0) hFont = defaultFont (); return Font.win32_new (display, hFont); }
data.font = Font.win32_new(this, OS.GetCurrentObject(handle, OS.OBJ_FONT)); isGCCreated = true;
return systemFont = Font.win32_new (this, hFont);
data.state &= ~FONT; } else { data.font = Font.win32_new(device, OS.GetCurrentObject(hDC, OS.OBJ_FONT));
int background = control.getBackgroundPixel (); if (background != OS.GetBkColor (hDC)) data.background = background; data.font = font != null ? font : Font.win32_new (display, OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0)); data.uiState = (int)/*64*/OS.SendMessage (hwnd, OS.WM_QUERYUISTATE, 0, 0);
if (control == null) control = this; data.background = control.getBackgroundPixel (); data.font = Font.win32_new(display, OS.SendMessage (handle, OS.WM_GETFONT, 0, 0)); data.uiState = (int)/*64*/OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0); GC gc = GC.win32_new (wParam, data);
data.foreground = OS.GetTextColor (nmcd.hdc); data.background = OS.GetBkColor (nmcd.hdc); data.font = Font.win32_new (display, hFont); GC gc = GC.win32_new (nmcd.hdc, data); int x = cellRect.left;
data.foreground = OS.GetTextColor (nmcd.hdc); data.background = OS.GetBkColor (nmcd.hdc); data.font = Font.win32_new (display, hFont); GC gc = GC.win32_new (nmcd.hdc, data); int x = cellRect [0].left + INSET;
if (control == null) control = this; data.background = control.getBackgroundPixel (); data.font = Font.win32_new(display, OS.SendMessage (handle, OS.WM_GETFONT, 0, 0)); data.uiState = (int)/*64*/OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0); if ((style & SWT.NO_BACKGROUND) != 0) {