Mercurial > projects > dwt-win
comparison dwt/widgets/ExpandBar.d @ 331:27479f54069d
Removed trace outputs.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 27 Jan 2009 10:40:55 +0100 |
parents | fd9c62a2998e |
children |
comparison
equal
deleted
inserted
replaced
330:f980ea238e72 | 331:27479f54069d |
---|---|
33 import dwt.widgets.ExpandItem; | 33 import dwt.widgets.ExpandItem; |
34 import dwt.widgets.TypedListener; | 34 import dwt.widgets.TypedListener; |
35 import dwt.widgets.Event; | 35 import dwt.widgets.Event; |
36 | 36 |
37 import dwt.dwthelper.utils; | 37 import dwt.dwthelper.utils; |
38 import tango.util.log.Trace; | |
39 void trc( long line ){ | |
40 //Trace.formatln( "ExpandBar {}", line ); | |
41 } | |
42 | 38 |
43 /** | 39 /** |
44 * Instances of this class support the layout of selectable | 40 * Instances of this class support the layout of selectable |
45 * expand bar items. | 41 * expand bar items. |
46 * <p> | 42 * <p> |
637 override int windowProc () { | 633 override int windowProc () { |
638 return cast(int) display.windowProc; | 634 return cast(int) display.windowProc; |
639 } | 635 } |
640 | 636 |
641 override LRESULT WM_KEYDOWN (int wParam, int lParam) { | 637 override LRESULT WM_KEYDOWN (int wParam, int lParam) { |
642 trc(__LINE__); | |
643 LRESULT result = super.WM_KEYDOWN (wParam, lParam); | 638 LRESULT result = super.WM_KEYDOWN (wParam, lParam); |
644 if (result !is null) return result; | 639 if (result !is null) return result; |
645 if (focusItem is null) return result; | 640 if (focusItem is null) return result; |
646 switch (wParam) { | 641 switch (wParam) { |
647 case OS.VK_SPACE: | 642 case OS.VK_SPACE: |
720 } | 715 } |
721 return result; | 716 return result; |
722 } | 717 } |
723 | 718 |
724 override LRESULT WM_MOUSELEAVE (int wParam, int lParam) { | 719 override LRESULT WM_MOUSELEAVE (int wParam, int lParam) { |
725 trc(__LINE__); | |
726 LRESULT result = super.WM_MOUSELEAVE (wParam, lParam); | 720 LRESULT result = super.WM_MOUSELEAVE (wParam, lParam); |
727 if (result !is null) return result; | 721 if (result !is null) return result; |
728 for (int i = 0; i < itemCount; i++) { | 722 for (int i = 0; i < itemCount; i++) { |
729 ExpandItem item = items [i]; | 723 ExpandItem item = items [i]; |
730 if (item.hover) { | 724 if (item.hover) { |
751 } | 745 } |
752 return result; | 746 return result; |
753 } | 747 } |
754 | 748 |
755 override LRESULT WM_PAINT (int wParam, int lParam) { | 749 override LRESULT WM_PAINT (int wParam, int lParam) { |
756 trc(__LINE__); | |
757 PAINTSTRUCT ps; | 750 PAINTSTRUCT ps; |
758 GCData data = new GCData (); | 751 GCData data = new GCData (); |
759 data.ps = &ps; | 752 data.ps = &ps; |
760 data.hwnd = handle; | 753 data.hwnd = handle; |
761 GC gc = new_GC (data); | 754 GC gc = new_GC (data); |
781 } | 774 } |
782 return LRESULT.ZERO; | 775 return LRESULT.ZERO; |
783 } | 776 } |
784 | 777 |
785 override LRESULT WM_PRINTCLIENT (int wParam, int lParam) { | 778 override LRESULT WM_PRINTCLIENT (int wParam, int lParam) { |
786 trc(__LINE__); | |
787 LRESULT result = super.WM_PRINTCLIENT (wParam, lParam); | 779 LRESULT result = super.WM_PRINTCLIENT (wParam, lParam); |
788 RECT rect; | 780 RECT rect; |
789 OS.GetClientRect (handle, &rect); | 781 OS.GetClientRect (handle, &rect); |
790 GCData data = new GCData (); | 782 GCData data = new GCData (); |
791 data.device = display; | 783 data.device = display; |
795 gc.dispose (); | 787 gc.dispose (); |
796 return result; | 788 return result; |
797 } | 789 } |
798 | 790 |
799 override LRESULT WM_SETCURSOR (int wParam, int lParam) { | 791 override LRESULT WM_SETCURSOR (int wParam, int lParam) { |
800 trc(__LINE__); | |
801 LRESULT result = super.WM_SETCURSOR (wParam, lParam); | 792 LRESULT result = super.WM_SETCURSOR (wParam, lParam); |
802 if (result !is null) return result; | 793 if (result !is null) return result; |
803 int hitTest = cast(short) OS.LOWORD (lParam); | 794 int hitTest = cast(short) OS.LOWORD (lParam); |
804 if (hitTest is OS.HTCLIENT) { | 795 if (hitTest is OS.HTCLIENT) { |
805 for (int i = 0; i < itemCount; i++) { | 796 for (int i = 0; i < itemCount; i++) { |
813 } | 804 } |
814 return result; | 805 return result; |
815 } | 806 } |
816 | 807 |
817 override LRESULT WM_SETFOCUS (int wParam, int lParam) { | 808 override LRESULT WM_SETFOCUS (int wParam, int lParam) { |
818 trc(__LINE__); | |
819 LRESULT result = super.WM_SETFOCUS (wParam, lParam); | 809 LRESULT result = super.WM_SETFOCUS (wParam, lParam); |
820 if (focusItem !is null) focusItem.redraw (true); | 810 if (focusItem !is null) focusItem.redraw (true); |
821 return result; | 811 return result; |
822 } | 812 } |
823 | 813 |
824 override LRESULT WM_SIZE (int wParam, int lParam) { | 814 override LRESULT WM_SIZE (int wParam, int lParam) { |
825 trc(__LINE__); | |
826 LRESULT result = super.WM_SIZE (wParam, lParam); | 815 LRESULT result = super.WM_SIZE (wParam, lParam); |
827 RECT rect; | 816 RECT rect; |
828 OS.GetClientRect (handle, &rect); | 817 OS.GetClientRect (handle, &rect); |
829 int width = Math.max (0, (rect.right - rect.left) - spacing * 2); | 818 int width = Math.max (0, (rect.right - rect.left) - spacing * 2); |
830 for (int i = 0; i < itemCount; i++) { | 819 for (int i = 0; i < itemCount; i++) { |
835 OS.InvalidateRect (handle, null, true); | 824 OS.InvalidateRect (handle, null, true); |
836 return result; | 825 return result; |
837 } | 826 } |
838 | 827 |
839 override LRESULT wmScroll (ScrollBar bar, bool update, HWND hwnd, int msg, int wParam, int lParam) { | 828 override LRESULT wmScroll (ScrollBar bar, bool update, HWND hwnd, int msg, int wParam, int lParam) { |
840 trc(__LINE__); | |
841 LRESULT result = super.wmScroll (bar, true, hwnd, msg, wParam, lParam); | 829 LRESULT result = super.wmScroll (bar, true, hwnd, msg, wParam, lParam); |
842 SCROLLINFO info; | 830 SCROLLINFO info; |
843 info.cbSize = SCROLLINFO.sizeof; | 831 info.cbSize = SCROLLINFO.sizeof; |
844 info.fMask = OS.SIF_POS; | 832 info.fMask = OS.SIF_POS; |
845 OS.GetScrollInfo (handle, OS.SB_VERT, &info); | 833 OS.GetScrollInfo (handle, OS.SB_VERT, &info); |