Mercurial > projects > dwt-win
diff dwt/widgets/Table.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 | 3f4e6a4ecc09 |
line wrap: on
line diff
--- a/dwt/widgets/Table.d Sun Feb 03 15:48:14 2008 -0800 +++ b/dwt/widgets/Table.d Mon Feb 04 10:05:20 2008 +0100 @@ -101,6 +101,13 @@ */ public class Table extends Composite { + + alias Composite.computeSize computeSize; + alias Composite.setBackgroundImage setBackgroundImage; + alias Composite.setBounds setBounds; + alias Composite.sort sort; + alias Composite.update update; + TableItem [] items; TableColumn [] columns; int columnCount, customCount; @@ -165,7 +172,7 @@ super (parent, checkStyle (style)); } -void _addListener (int eventType, Listener listener) { +override void _addListener (int eventType, Listener listener) { super._addListener (eventType, listener); switch (eventType) { case DWT.MeasureItem: @@ -221,7 +228,7 @@ addListener (DWT.DefaultSelection,typedListener); } -int callWindowProc (int hwnd, int msg, int wParam, int lParam) { +override int callWindowProc (int hwnd, int msg, int wParam, int lParam) { return callWindowProc (hwnd, msg, wParam, lParam, false); } @@ -825,7 +832,7 @@ return new LRESULT (code); } -void checkBuffered () { +override void checkBuffered () { super.checkBuffered (); if (OS.COMCTL32_MAJOR >= 6) style |= DWT.DOUBLE_BUFFERED; if ((style & DWT.VIRTUAL) !is 0) style |= DWT.DOUBLE_BUFFERED; @@ -857,12 +864,12 @@ return true; } -bool checkHandle (int hwnd) { +override bool checkHandle (int hwnd) { if (hwnd is handle) return true; return hwnd is OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); } -protected void checkSubclass () { +override protected void checkSubclass () { if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); } @@ -1125,7 +1132,7 @@ } } -public Point computeSize (int wHint, int hHint, bool changed) { +override public Point computeSize (int wHint, int hHint, bool changed) { checkWidget (); if (fixScrollWidth) setScrollWidth (null, true); //This code is intentionally commented @@ -1186,7 +1193,7 @@ return new Point (width, height); } -void createHandle () { +override void createHandle () { super.createHandle (); state &= ~(CANVAS | THEME_BACKGROUND); @@ -1515,18 +1522,18 @@ if (count is 0) setScrollWidth (item, false); } -void createWidget () { +override void createWidget () { super.createWidget (); itemHeight = hotIndex = -1; items = new TableItem [4]; columns = new TableColumn [4]; } -int defaultBackground () { +override int defaultBackground () { return OS.GetSysColor (OS.COLOR_WINDOW); } -void deregister () { +override void deregister () { super.deregister (); int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); if (hwndHeader !is 0) display.removeControl (hwndHeader); @@ -2629,13 +2636,13 @@ return (result !is 0) && ((lvItem.state & OS.LVIS_SELECTED) !is 0); } -void register () { +override void register () { super.register (); int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); if (hwndHeader !is 0) display.addControl (hwndHeader, this); } -void releaseChildren (bool destroy) { +override void releaseChildren (bool destroy) { if (items !is null) { int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0); /* @@ -2681,7 +2688,7 @@ super.releaseChildren (destroy); } -void releaseWidget () { +override void releaseWidget () { super.releaseWidget (); customDraw = false; currentItem = null; @@ -3483,12 +3490,12 @@ OS.RestoreDC (hDC, nSavedDC); } -void setBackgroundImage (int hBitmap) { +override void setBackgroundImage (int hBitmap) { super.setBackgroundImage (hBitmap); if (!customDraw) setBackgroundTransparent (hBitmap !is 0); } -void setBackgroundPixel (int newPixel) { +override void setBackgroundPixel (int newPixel) { if (!customDraw) { if (findImageControl () !is null) return; if (newPixel is -1) newPixel = defaultBackground (); @@ -3588,7 +3595,7 @@ } } -void setBounds (int x, int y, int width, int height, int flags, bool defer) { +override void setBounds (int x, int y, int width, int height, int flags, bool defer) { /* * Bug in Windows. If the table column widths are adjusted * in WM_SIZE or WM_POSITIONCHANGED using LVM_SETCOLUMNWIDTH @@ -3857,7 +3864,7 @@ OS.SendMessage (handle, OS.LVM_SETSELECTIONMARK, 0, index); } -public void setFont (Font font) { +override public void setFont (Font font) { checkWidget (); /* * Bug in Windows. Making any change to an item that @@ -3897,7 +3904,7 @@ OS.InvalidateRect (hwndHeader, null, true); } -void setForegroundPixel (int pixel) { +override void setForegroundPixel (int pixel) { /* * The Windows table control uses CLR_DEFAULT to indicate * that it is using the default foreground color. This @@ -4126,7 +4133,7 @@ } } -public void setRedraw (bool redraw) { +override public void setRedraw (bool redraw) { checkWidget (); /* * Feature in Windows. When WM_SETREDRAW is used to turn @@ -4852,7 +4859,7 @@ // redraw (); } -void subclass () { +override void subclass () { super.subclass (); if (HeaderProc !is 0) { int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); @@ -4860,7 +4867,7 @@ } } -String toolTipText (NMTTDISPINFO hdr) { +override String toolTipText (NMTTDISPINFO hdr) { int hwndToolTip = OS.SendMessage (handle, OS.LVM_GETTOOLTIPS, 0, 0); if (hwndToolTip is hdr.hwndFrom && toolTipText !is null) return ""; //$NON-NLS-1$ if (headerToolTipHandle is hdr.hwndFrom) { @@ -4872,7 +4879,7 @@ return super.toolTipText (hdr); } -void unsubclass () { +override void unsubclass () { super.unsubclass (); if (HeaderProc !is 0) { int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); @@ -4880,7 +4887,7 @@ } } -void update (bool all) { +override void update (bool all) { // checkWidget (); /* * When there are many columns in a table, scrolling performance @@ -4929,7 +4936,7 @@ } } -void updateImages () { +override void updateImages () { if (sortColumn !is null && !sortColumn.isDisposed ()) { if (OS.COMCTL32_MAJOR < 6) { switch (sortDirection) { @@ -4952,7 +4959,7 @@ OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, OS.LVS_EX_HEADERDRAGDROP, newBits); } -int widgetStyle () { +override int widgetStyle () { int bits = super.widgetStyle () | OS.LVS_SHAREIMAGELISTS; if ((style & DWT.HIDE_SELECTION) is 0) bits |= OS.LVS_SHOWSELALWAYS; if ((style & DWT.SINGLE) !is 0) bits |= OS.LVS_SINGLESEL; @@ -4967,15 +4974,15 @@ return bits; } -TCHAR windowClass () { +override TCHAR windowClass () { return TableClass; } -int windowProc () { +override int windowProc () { return TableProc; } -int windowProc (int hwnd, int msg, int wParam, int lParam) { +override int windowProc (int hwnd, int msg, int wParam, int lParam) { if (handle is 0) return 0; if (hwnd !is handle) { switch (msg) { @@ -5061,7 +5068,7 @@ return super.windowProc (hwnd, msg, wParam, lParam); } -LRESULT WM_CHAR (int wParam, int lParam) { +override LRESULT WM_CHAR (int wParam, int lParam) { LRESULT result = super.WM_CHAR (wParam, lParam); if (result !is null) return result; switch (wParam) { @@ -5103,7 +5110,7 @@ return result; } -LRESULT WM_CONTEXTMENU (int wParam, int lParam) { +override LRESULT WM_CONTEXTMENU (int wParam, int lParam) { /* * Feature in Windows. For some reason, when the right * mouse button is pressed over an item, Windows sends @@ -5120,7 +5127,7 @@ return super.WM_CONTEXTMENU (wParam, lParam); } -LRESULT WM_ERASEBKGND (int wParam, int lParam) { +override LRESULT WM_ERASEBKGND (int wParam, int lParam) { LRESULT result = super.WM_ERASEBKGND (wParam, lParam); if (findImageControl () !is null) return LRESULT.ONE; if (OS.COMCTL32_MAJOR < 6) { @@ -5132,7 +5139,7 @@ return result; } -LRESULT WM_GETOBJECT (int wParam, int lParam) { +override LRESULT WM_GETOBJECT (int wParam, int lParam) { /* * Ensure that there is an accessible object created for this * control because support for checked item accessibility is @@ -5144,7 +5151,7 @@ return super.WM_GETOBJECT (wParam, lParam); } -LRESULT WM_KEYDOWN (int wParam, int lParam) { +override LRESULT WM_KEYDOWN (int wParam, int lParam) { LRESULT result = super.WM_KEYDOWN (wParam, lParam); if (result !is null) return result; switch (wParam) { @@ -5212,7 +5219,7 @@ return result; } -LRESULT WM_KILLFOCUS (int wParam, int lParam) { +override LRESULT WM_KILLFOCUS (int wParam, int lParam) { LRESULT result = super.WM_KILLFOCUS (wParam, lParam); /* * Bug in Windows. When focus is lost, Windows does not @@ -5226,7 +5233,7 @@ return result; } -LRESULT WM_LBUTTONDBLCLK (int wParam, int lParam) { +override LRESULT WM_LBUTTONDBLCLK (int wParam, int lParam) { /* * Feature in Windows. When the user selects outside of @@ -5274,7 +5281,7 @@ return LRESULT.ZERO; } -LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { +override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { /* * Feature in Windows. For some reason, capturing * the mouse after processing the mouse event for the @@ -5310,7 +5317,7 @@ return result; } -LRESULT WM_MOUSEHOVER (int wParam, int lParam) { +override LRESULT WM_MOUSEHOVER (int wParam, int lParam) { /* * Feature in Windows. Despite the fact that hot * tracking is not enabled, the hot tracking code @@ -5325,7 +5332,7 @@ return LRESULT.ZERO; } -LRESULT WM_PAINT (int wParam, int lParam) { +override LRESULT WM_PAINT (int wParam, int lParam) { if (!ignoreShrink) { /* Resize the item array to match the item count */ int count = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0); @@ -5399,7 +5406,7 @@ return super.WM_PAINT (wParam, lParam); } -LRESULT WM_RBUTTONDBLCLK (int wParam, int lParam) { +override LRESULT WM_RBUTTONDBLCLK (int wParam, int lParam) { /* * Feature in Windows. When the user selects outside of * a table item, Windows deselects all the items, even @@ -5423,7 +5430,7 @@ return LRESULT.ZERO; } -LRESULT WM_RBUTTONDOWN (int wParam, int lParam) { +override LRESULT WM_RBUTTONDOWN (int wParam, int lParam) { /* * Feature in Windows. For some reason, capturing * the mouse after processing the mouse event for the @@ -5434,7 +5441,7 @@ return sendMouseDownEvent (DWT.MouseDown, 3, OS.WM_RBUTTONDOWN, wParam, lParam); } -LRESULT WM_SETFOCUS (int wParam, int lParam) { +override LRESULT WM_SETFOCUS (int wParam, int lParam) { LRESULT result = super.WM_SETFOCUS (wParam, lParam); /* * Bug in Windows. When focus is gained after the @@ -5469,7 +5476,7 @@ return result; } -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; @@ -5493,7 +5500,7 @@ return result; } -LRESULT WM_SIZE (int wParam, int lParam) { +override LRESULT WM_SIZE (int wParam, int lParam) { if (ignoreResize) return null; if (hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) { OS.InvalidateRect (handle, null, true); @@ -5505,7 +5512,7 @@ return super.WM_SIZE (wParam, lParam); } -LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) { +override LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) { LRESULT result = super.WM_SYSCOLORCHANGE (wParam, lParam); if (result !is null) return result; if (findBackgroundControl () is null) { @@ -5518,7 +5525,7 @@ return result; } -LRESULT WM_HSCROLL (int wParam, int lParam) { +override LRESULT WM_HSCROLL (int wParam, int lParam) { /* * Bug in Windows. When a table that is drawing grid lines * is slowly scrolled horizontally to the left, the table does @@ -5583,7 +5590,7 @@ return result; } -LRESULT WM_VSCROLL (int wParam, int lParam) { +override LRESULT WM_VSCROLL (int wParam, int lParam) { /* * When there are many columns in a table, scrolling performance * can be improved by temporarily unsubclassing the window proc @@ -5651,7 +5658,7 @@ return result; } -LRESULT wmMeasureChild (int wParam, int lParam) { +override LRESULT wmMeasureChild (int wParam, int lParam) { MEASUREITEMSTRUCT struct = new MEASUREITEMSTRUCT (); OS.MoveMemory (struct, lParam, MEASUREITEMSTRUCT.sizeof); if (itemHeight is -1) { @@ -5665,7 +5672,7 @@ return null; } -LRESULT wmNotify (NMHDR hdr, int wParam, int lParam) { +override LRESULT wmNotify (NMHDR hdr, int wParam, int lParam) { int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0); if (hdr.hwndFrom is hwndHeader) { /* @@ -5855,7 +5862,7 @@ return result; } -LRESULT wmNotifyChild (NMHDR hdr, int wParam, int lParam) { +override LRESULT wmNotifyChild (NMHDR hdr, int wParam, int lParam) { switch (hdr.code) { case OS.LVN_ODFINDITEMA: case OS.LVN_ODFINDITEMW: {