Changeset 34
- Timestamp:
- Nov 8, 2007, 10:11:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/Display.java
r14 r34 408 408 //} 409 409 410 //@@TODO (dmik): later 410 //@@TODO (dmik): later (lpino) using WinUpperChar 411 411 //int controlKey (int key) { 412 // int upper = OS. CharUpper ((short) key);412 // int upper = OS.WinUpperChar ((short) key); 413 413 // if (64 <= upper && upper <= 95) return upper & 0xBF; 414 414 // return key; … … 621 621 * </ul> 622 622 */ 623 //@@TODO (dmik) :623 //@@TODO (dmik) Implement it using WinQueryActiveWindow(OS.HWND_DESKTOP)(lpino): 624 624 //public Shell getActiveShell () { 625 625 // checkDevice (); 626 // Control control = findControl (OS. GetActiveWindow ());626 // Control control = findControl (OS.WinQueryActiveWindow(OS.HWND_DESKTOP)); 627 627 // if (control instanceof Shell) return (Shell) control; 628 628 // return null; … … 674 674 * </ul> 675 675 */ 676 //@@TODO (dmik) :676 //@@TODO (dmik) using WinQueryCursorInfo (lpino): 677 677 //public Control getCursorControl () { 678 678 // checkDevice (); … … 692 692 * </ul> 693 693 */ 694 //@@TODO (dmik): 694 //@@TODO (dmik):using WinQueryCursorInfo (lpino): 695 695 //public Point getCursorLocation () { 696 696 // checkDevice (); … … 794 794 * </ul> 795 795 */ 796 //@@TODO (dmik): 797 // WinQuerySysValue(HWND_DESKTOP, .SV_DBLCLKTIME) 798 //public int getDoubleClickTime () { 799 // checkDevice (); 800 // return OS.GetDoubleClickTime (); 801 //} 796 public int getDoubleClickTime () { 797 checkDevice (); 798 return OS.WinQuerySysValue(OS.HWND_DESKTOP, OS.SV_DBLCLKTIME); 799 } 802 800 803 801 /** … … 1046 1044 * @see SWT 1047 1045 */ 1048 //@@TODO (dmik):1049 //public Color getSystemColor (int id) {1050 //checkDevice ();1051 //int pixel = 0x02000000;1052 //switch (id) {1053 // case SWT.COLOR_WIDGET_DARK_SHADOW: pixel = OS. GetSysColor (OS.COLOR_3DDKSHADOW); break;1046 //@@TODO finish the rest of the colors(lpino): 1047 public Color getSystemColor (int id) { 1048 checkDevice (); 1049 int pixel = 0x02000000; 1050 switch (id) { 1051 // case SWT.COLOR_WIDGET_DARK_SHADOW: pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_SHADOW,0); break; 1054 1052 // case SWT.COLOR_WIDGET_NORMAL_SHADOW: pixel = OS.GetSysColor (OS.COLOR_3DSHADOW); break; 1055 1053 // case SWT.COLOR_WIDGET_LIGHT_SHADOW: pixel = OS.GetSysColor (OS.COLOR_3DLIGHT); break; 1056 1054 // case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: pixel = OS.GetSysColor (OS.COLOR_3DHIGHLIGHT); break; 1057 1055 // case SWT.COLOR_WIDGET_BACKGROUND: pixel = OS.GetSysColor (OS.COLOR_3DFACE); break; 1058 // case SWT.COLOR_WIDGET_BORDER: pixel = OS.GetSysColor (OS.COLOR_WINDOWFRAME);break;1056 case SWT.COLOR_WIDGET_BORDER: pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_WINDOWFRAME,0); break; 1059 1057 // case SWT.COLOR_WIDGET_FOREGROUND: 1060 // case SWT.COLOR_LIST_FOREGROUND: pixel = OS.GetSysColor (OS.COLOR_WINDOWTEXT); break;1061 // case SWT.COLOR_LIST_BACKGROUND: pixel = OS.GetSysColor (OS.COLOR_WINDOW); break;1062 // case SWT.COLOR_LIST_SELECTION: pixel = OS.GetSysColor (OS.COLOR_HIGHLIGHT);break;1063 // case SWT.COLOR_LIST_SELECTION_TEXT: pixel = OS.GetSysColor (OS.COLOR_HIGHLIGHTTEXT);break;1058 case SWT.COLOR_LIST_FOREGROUND: pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_WINDOWTEXT,0); break; 1059 case SWT.COLOR_LIST_BACKGROUND: pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_WINDOW,0); break; 1060 case SWT.COLOR_LIST_SELECTION: pixel = OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_MENUHILITEBGND,0); break; 1061 case SWT.COLOR_LIST_SELECTION_TEXT: pixel =OS.WinQuerySysColor (OS.HWND_DESKTOP, OS.SYSCLR_MENUHILITE,0); break; 1064 1062 // case SWT.COLOR_INFO_FOREGROUND: pixel = OS.GetSysColor (OS.COLOR_INFOTEXT); break; 1065 1063 // case SWT.COLOR_INFO_BACKGROUND: pixel = OS.GetSysColor (OS.COLOR_INFOBK); break; … … 1076 1074 // if (pixel == 0) pixel = OS.GetSysColor (OS.COLOR_INACTIVECAPTION); 1077 1075 // break; 1078 //default:1079 //return super.getSystemColor (id);1080 //}1081 // return Color.win32_new (this, pixel);1082 //}1076 default: 1077 return super.getSystemColor (id); 1078 } 1079 return Color.pm_new (this, pixel); 1080 } 1083 1081 1084 1082 /** … … 1762 1760 } 1763 1761 1764 //void setModal (Shell shell) {1765 //if (ModalWidgets == null) ModalWidgets = new Shell [4];1766 //int index = 0, length = ModalWidgets.length;1767 //while (index < length) {1768 //if (ModalWidgets [index] == shell) return;1769 //if (ModalWidgets [index] == null) break;1770 //index++;1771 //}1772 //if (index == length) {1773 //Shell [] newModalWidgets = new Shell [length + 4];1774 //System.arraycopy (ModalWidgets, 0, newModalWidgets, 0, length);1775 //ModalWidgets = newModalWidgets;1776 //}1777 //ModalWidgets [index] = shell;1778 //if (!TrimEnabled) return;1779 //Shell [] shells = getShells ();1780 //for (int i=0; i<shells.length; i++) shells [i].updateModal ();1781 //}1762 void setModal (Shell shell) { 1763 if (ModalWidgets == null) ModalWidgets = new Shell [4]; 1764 int index = 0, length = ModalWidgets.length; 1765 while (index < length) { 1766 if (ModalWidgets [index] == shell) return; 1767 if (ModalWidgets [index] == null) break; 1768 index++; 1769 } 1770 if (index == length) { 1771 Shell [] newModalWidgets = new Shell [length + 4]; 1772 System.arraycopy (ModalWidgets, 0, newModalWidgets, 0, length); 1773 ModalWidgets = newModalWidgets; 1774 } 1775 ModalWidgets [index] = shell; 1776 if (!TrimEnabled) return; 1777 Shell [] shells = getShells (); 1778 for (int i=0; i<shells.length; i++) shells [i].updateModal (); 1779 } 1782 1780 1783 1781 /** … … 1794 1792 * </ul> 1795 1793 */ 1796 //public void setSynchronizer (Synchronizer synchronizer) {1797 //checkDevice ();1798 //if (synchronizer == null) error (SWT.ERROR_NULL_ARGUMENT);1799 //if (this.synchronizer != null) {1800 //this.synchronizer.runAsyncMessages();1801 //}1802 //this.synchronizer = synchronizer;1803 //}1794 public void setSynchronizer (Synchronizer synchronizer) { 1795 checkDevice (); 1796 if (synchronizer == null) error (SWT.ERROR_NULL_ARGUMENT); 1797 if (this.synchronizer != null) { 1798 this.synchronizer.runAsyncMessages(); 1799 } 1800 this.synchronizer = synchronizer; 1801 } 1804 1802 1805 1803 //int shiftedKey (int key) { … … 1982 1980 * @see Control#update 1983 1981 */ 1984 //public void update() {1985 //checkDevice ();1986 //Shell[] shells = WidgetTable.shells ();1987 //for (int i=0; i<shells.length; i++) {1988 //Shell shell = shells [i];1989 //if (!shell.isDisposed () && this == shell.getDisplay ()) {1990 //shell.update ();1991 //}1992 //}1993 //}1982 public void update() { 1983 checkDevice (); 1984 Shell[] shells = WidgetTable.shells (); 1985 for (int i=0; i<shells.length; i++) { 1986 Shell shell = shells [i]; 1987 if (!shell.isDisposed () && this == shell.getDisplay ()) { 1988 shell.update (); 1989 } 1990 } 1991 } 1994 1992 1995 1993 //void updateFont () {
Note:
See TracChangeset
for help on using the changeset viewer.