Mercurial > projects > dwt-win
diff dwt/widgets/Spinner.d @ 54:0f25be5cbe6f
Added aliases and overrides from generated file, remaining widgets. Thanks torhu for doing this job.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 04 Feb 2008 10:05:20 +0100 |
parents | 92c102dd64a3 |
children | 66203354c9d3 |
line wrap: on
line diff
--- a/dwt/widgets/Spinner.d Sun Feb 03 15:48:14 2008 -0800 +++ b/dwt/widgets/Spinner.d Mon Feb 04 10:05:20 2008 +0100 @@ -55,6 +55,13 @@ * @since 3.1 */ public class Spinner extends Composite { + + alias Composite.computeSize computeSize; + alias Composite.sendKeyEvent sendKeyEvent; + alias Composite.setBackgroundImage setBackgroundImage; + alias Composite.setToolTipText setToolTipText; + alias Composite.windowProc windowProc; + int hwndText, hwndUpDown; bool ignoreModify; int pageIncrement, digits; @@ -103,7 +110,7 @@ super (parent, checkStyle (style)); } -int callWindowProc (int hwnd, int msg, int wParam, int lParam) { +override int callWindowProc (int hwnd, int msg, int wParam, int lParam) { if (handle is 0) return 0; if (hwnd is hwndText) { return OS.CallWindowProc (EditProc, hwnd, msg, wParam, lParam); @@ -125,15 +132,15 @@ return style & ~(DWT.H_SCROLL | DWT.V_SCROLL); } -bool checkHandle (int hwnd) { +override bool checkHandle (int hwnd) { return hwnd is handle || hwnd is hwndText || hwnd is hwndUpDown; } -protected void checkSubclass () { +override protected void checkSubclass () { if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); } -void createHandle () { +override void createHandle () { super.createHandle (); state &= ~(CANVAS | THEME_BACKGROUND); int hInstance = OS.GetModuleHandle (null); @@ -276,11 +283,11 @@ addListener (DWT.Verify, typedListener); } -int borderHandle () { +override int borderHandle () { return hwndText; } -public Point computeSize (int wHint, int hHint, bool changed) { +override public Point computeSize (int wHint, int hHint, bool changed) { checkWidget (); int width = 0, height = 0; if (wHint is DWT.DEFAULT || hHint is DWT.DEFAULT) { @@ -328,7 +335,7 @@ return new Point (trim.width, trim.height); } -public Rectangle computeTrim (int x, int y, int width, int height) { +override public Rectangle computeTrim (int x, int y, int width, int height) { checkWidget (); /* Get the trim of the text control */ @@ -393,23 +400,23 @@ OS.SendMessage (hwndText, OS.WM_CUT, 0, 0); } -int defaultBackground () { +override int defaultBackground () { return OS.GetSysColor (OS.COLOR_WINDOW); } -void enableWidget (bool enabled) { +override void enableWidget (bool enabled) { super.enableWidget (enabled); OS.EnableWindow (hwndText, enabled); OS.EnableWindow (hwndUpDown, enabled); } -void deregister () { +override void deregister () { super.deregister (); display.removeControl (hwndText); display.removeControl (hwndUpDown); } -bool hasFocus () { +override bool hasFocus () { int hwndFocus = OS.GetFocus (); if (hwndFocus is handle) return true; if (hwndFocus is hwndText) return true; @@ -593,13 +600,13 @@ OS.SendMessage (hwndText, OS.WM_PASTE, 0, 0); } -void register () { +override void register () { super.register (); display.addControl (hwndText, this); display.addControl (hwndUpDown, this); } -void releaseHandle () { +override void releaseHandle () { super.releaseHandle (); hwndText = hwndUpDown = 0; } @@ -677,7 +684,7 @@ eventTable.unhook (DWT.Verify, listener); } -bool sendKeyEvent (int type, int msg, int wParam, int lParam, Event event) { +override bool sendKeyEvent (int type, int msg, int wParam, int lParam, Event event) { if (!super.sendKeyEvent (type, msg, wParam, lParam, event)) { return false; } @@ -760,12 +767,12 @@ return false; } -void setBackgroundImage (int hBitmap) { +override void setBackgroundImage (int hBitmap) { super.setBackgroundImage (hBitmap); OS.InvalidateRect (hwndText, null, true); } -void setBackgroundPixel (int pixel) { +override void setBackgroundPixel (int pixel) { super.setBackgroundPixel (pixel); OS.InvalidateRect (hwndText, null, true); } @@ -804,7 +811,7 @@ setSelection (pos, false, true, false); } -void setForegroundPixel (int pixel) { +override void setForegroundPixel (int pixel) { super.setForegroundPixel (pixel); OS.InvalidateRect (hwndText, null, true); } @@ -971,7 +978,7 @@ if (notify) postEvent (DWT.Selection); } -void setToolTipText (Shell shell, String string) { +override void setToolTipText (Shell shell, String string) { shell.setToolTipText (hwndText, string); shell.setToolTipText (hwndUpDown, string); } @@ -1014,14 +1021,14 @@ setSelection (selection, true, true, false); } -void subclass () { +override void subclass () { super.subclass (); int newProc = display.windowProc; OS.SetWindowLong (hwndText, OS.GWL_WNDPROC, newProc); OS.SetWindowLong (hwndUpDown, OS.GWL_WNDPROC, newProc); } -void unsubclass () { +override void unsubclass () { super.unsubclass (); OS.SetWindowLong (hwndText, OS.GWL_WNDPROC, EditProc); OS.SetWindowLong (hwndUpDown, OS.GWL_WNDPROC, UpDownProc); @@ -1060,11 +1067,11 @@ return event.text; } -int widgetExtStyle () { +override int widgetExtStyle () { return super.widgetExtStyle () & ~OS.WS_EX_CLIENTEDGE; } -int windowProc (int hwnd, int msg, int wParam, int lParam) { +override int windowProc (int hwnd, int msg, int wParam, int lParam) { if (hwnd is hwndText || hwnd is hwndUpDown) { LRESULT result = null; switch (msg) { @@ -1124,29 +1131,29 @@ return super.windowProc (hwnd, msg, wParam, lParam); } -LRESULT WM_ERASEBKGND (int wParam, int lParam) { +override LRESULT WM_ERASEBKGND (int wParam, int lParam) { super.WM_ERASEBKGND (wParam, lParam); drawBackground (wParam); return LRESULT.ONE; } -LRESULT WM_KILLFOCUS (int wParam, int lParam) { +override LRESULT WM_KILLFOCUS (int wParam, int lParam) { return null; } -LRESULT WM_SETFOCUS (int wParam, int lParam) { +override LRESULT WM_SETFOCUS (int wParam, int lParam) { OS.SetFocus (hwndText); return null; } -LRESULT WM_SETFONT (int wParam, int lParam) { +override LRESULT WM_SETFONT (int wParam, int lParam) { LRESULT result = super.WM_SETFONT (wParam, lParam); if (result !is null) return result; OS.SendMessage (hwndText, OS.WM_SETFONT, wParam, lParam); return result; } -LRESULT WM_SIZE (int wParam, int lParam) { +override LRESULT WM_SIZE (int wParam, int lParam) { LRESULT result = super.WM_SIZE (wParam, lParam); if (isDisposed ()) return result; int width = lParam & 0xFFFF, height = lParam >> 16; @@ -1159,7 +1166,7 @@ return result; } -LRESULT wmChar (int hwnd, int wParam, int lParam) { +override LRESULT wmChar (int hwnd, int wParam, int lParam) { LRESULT result = super.wmChar (hwnd, wParam, lParam); if (result !is null) return result; /* @@ -1245,7 +1252,7 @@ return null; } -LRESULT wmCommandChild (int wParam, int lParam) { +override LRESULT wmCommandChild (int wParam, int lParam) { int code = wParam >> 16; switch (code) { case OS.EN_CHANGE: @@ -1267,7 +1274,7 @@ return super.wmCommandChild (wParam, lParam); } -LRESULT wmKeyDown (int hwnd, int wParam, int lParam) { +override LRESULT wmKeyDown (int hwnd, int wParam, int lParam) { LRESULT result = super.wmKeyDown (hwnd, wParam, lParam); if (result !is null) return result; @@ -1310,7 +1317,7 @@ return result; } -LRESULT wmKillFocus (int hwnd, int wParam, int lParam) { +override LRESULT wmKillFocus (int hwnd, int wParam, int lParam) { int value = getSelectionText (); if (value is -1) { if (OS.IsWinCE) { @@ -1323,7 +1330,7 @@ return super.wmKillFocus (hwnd, wParam, lParam); } -LRESULT wmNotifyChild (NMHDR hdr, int wParam, int lParam) { +override LRESULT wmNotifyChild (NMHDR hdr, int wParam, int lParam) { switch (hdr.code) { case OS.UDN_DELTAPOS: NMUPDOWN lpnmud = new NMUPDOWN (); @@ -1352,7 +1359,7 @@ return super.wmNotifyChild (hdr, wParam, lParam); } -LRESULT wmScrollChild (int wParam, int lParam) { +override LRESULT wmScrollChild (int wParam, int lParam) { int code = wParam & 0xFFFF; switch (code) { case OS.SB_THUMBPOSITION: