Changeset 10
- Timestamp:
- 10/29/07 23:02:03 (5 years ago)
- Files:
-
- branches/win32/0.9.6-release/dfl/collections.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/control.d (modified) (9 diffs)
- branches/win32/0.9.6-release/dfl/form.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/groupbox.d (modified) (2 diffs)
- branches/win32/0.9.6-release/dfl/internal/winapi.d (modified) (4 diffs)
- branches/win32/0.9.6-release/dfl/label.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/listview.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/menu.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/progressbar.d (modified) (2 diffs)
- branches/win32/0.9.6-release/dfl/socket.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/statusbar.d (modified) (1 diff)
- branches/win32/0.9.6-release/dfl/treeview.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/win32/0.9.6-release/dfl/collections.d
r5 r10 265 265 else 266 266 { 267 if(getObjectString(onval) == value) // ?268 return true;267 if(getObjectString(onval) == value) 268 return idx; 269 269 } 270 270 } branches/win32/0.9.6-release/dfl/control.d
r5 r10 1070 1070 +/ 1071 1071 1072 sdock = cast(DockStyle)sdock.init; // Can't be set at the same time.1072 sdock = DockStyle.NONE; // Can't be set at the same time. 1073 1073 } 1074 1074 … … 1693 1693 sdock = ds; 1694 1694 /+ 1695 anch = cast(AnchorStyles)anch.init; // Can't be set at the same time.1695 anch = AnchorStyles.NONE; // Can't be set at the same time. 1696 1696 +/ 1697 1697 … … 7059 7059 result.height = result.height - dpad.bottom - dpad.top; 7060 7060 7061 // Add scroll width. 7061 7062 if(scrollSize.width > clientSize.width) 7062 7063 result.width = result.width + (scrollSize.width - clientSize.width); … … 7064 7065 result.height = result.height + (scrollSize.height - clientSize.height); 7065 7066 7067 // Adjust scroll position. 7068 result.location = Point(result.location.x - scrollPosition.x, result.location.y - scrollPosition.y); 7069 7066 7070 return result; 7067 7071 } … … 7196 7200 7197 7201 const Size DEFAULT_SCALE = { 5, 13 }; 7198 7199 7200 protected:7201 7202 7202 7203 /// … … 7241 7242 return (_style() & WS_VSCROLL) != 0; 7242 7243 } 7244 7245 7246 protected: 7243 7247 7244 7248 … … 7309 7313 case SB_THUMBTRACK: 7310 7314 case SB_THUMBPOSITION: 7311 delta = cast(int)HIWORD(m.wParam) - yspos; 7315 //delta = cast(int)HIWORD(m.wParam) - yspos; // Limited to 16-bits. 7316 delta = si.nTrackPos - yspos; 7312 7317 break; 7313 7318 case SB_BOTTOM: … … 7371 7376 case SB_THUMBTRACK: 7372 7377 case SB_THUMBPOSITION: 7373 delta = cast(int)HIWORD(m.wParam) - xspos; 7378 //delta = cast(int)HIWORD(m.wParam) - xspos; // Limited to 16-bits. 7379 delta = si.nTrackPos - xspos; 7374 7380 break; 7375 7381 case SB_RIGHT: … … 7575 7581 /// 7576 7582 Control activeControl(); // getter 7577 /// ditto7583 7578 7584 deprecated void activeControl(Control); // setter 7579 7585 7580 ///7581 7586 deprecated bool activateControl(Control); 7582 7587 } branches/win32/0.9.6-release/dfl/form.d
r5 r10 733 733 | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); // Recalculate the frame. 734 734 } 735 736 invalidate(true); 735 737 736 738 _resetSystemMenu(); branches/win32/0.9.6-release/dfl/groupbox.d
r5 r10 50 50 _initButton(); 51 51 52 if( _defTextHeight.init== _defTextHeight)52 if(DEFTEXTHEIGHT_INIT == _defTextHeight) 53 53 { 54 54 _recalcTextHeight(defaultFont); … … 122 122 private: 123 123 124 static int _defTextHeight = -1; 124 const int DEFTEXTHEIGHT_INIT = -1; 125 static int _defTextHeight = DEFTEXTHEIGHT_INIT; 125 126 int _textHeight = -1; 126 127 branches/win32/0.9.6-release/dfl/internal/winapi.d
r5 r10 1169 1169 LVN_FIRST = cast(UINT)-100, 1170 1170 1171 LVN_ITEMCHANGING = (LVN_FIRST - 0), 1172 LVN_ITEMCHANGED = (LVN_FIRST - 1), 1173 1174 LVN_BEGINLABELEDITA = LVN_FIRST - 5, 1175 LVN_BEGINLABELEDITW = LVN_FIRST - 75, 1176 1177 LVN_ENDLABELEDITA = LVN_FIRST - 6, 1178 LVN_ENDLABELEDITW = LVN_FIRST - 76, 1179 1171 1180 LVN_COLUMNCLICK = LVN_FIRST - 8, 1172 1181 … … 1426 1435 SM_CYSMICON = 50, 1427 1436 1437 SM_CYSMCAPTION = 51, 1438 1428 1439 SM_CXSIZEFRAME = SM_CXFRAME, 1429 1440 SM_CYSIZEFRAME = SM_CYFRAME, … … 1916 1927 1917 1928 1929 struct TVITEMW 1930 { 1931 UINT mask; 1932 HTREEITEM hItem; 1933 UINT state; 1934 UINT stateMask; 1935 LPWSTR pszText; 1936 int cchTextMax; 1937 int iImage; 1938 int iSelectedImage; 1939 int cChildren; 1940 LPARAM lParam; 1941 } 1942 alias TVITEMW* LPTVITEMW; 1943 alias TVITEMW* PTVITEMW; 1944 alias TVITEMW TV_ITEMW; 1945 alias TVITEMW* LPTV_ITEMW; 1946 alias TVITEMW* PTV_ITEMW; 1947 1948 1918 1949 struct TVHITTESTINFO 1919 1950 { … … 1957 1988 alias NMTVDISPINFOA TV_DISPINFOA; 1958 1989 alias NMTVDISPINFOA* LPTV_DISPINFOA; 1990 1991 1992 struct NMTVDISPINFOW 1993 { 1994 NMHDR hdr; 1995 TVITEMW item; 1996 } 1997 alias NMTVDISPINFOW* LPNMTVDISPINFOW; 1998 alias NMTVDISPINFOW TV_DISPINFOW; 1999 alias NMTVDISPINFOW* LPTV_DISPINFOW; 1959 2000 1960 2001 branches/win32/0.9.6-release/dfl/label.d
r5 r10 350 350 { 351 351 case WM_GETDLGCODE: 352 //m.result = 0;352 super.wndProc(m); 353 353 //if(useMnemonic) 354 m.result = DLGC_STATIC;354 m.result |= DLGC_STATIC; 355 355 break; 356 356 branches/win32/0.9.6-release/dfl/listview.d
r5 r10 1986 1986 { 1987 1987 case LVN_GETDISPINFOA: 1988 if(dfl.internal.utf.useUnicode) 1989 break; 1988 1990 { 1989 1991 LV_DISPINFOA* lvdi; branches/win32/0.9.6-release/dfl/menu.d
r5 r10 99 99 fType = ~MFT_SEPARATOR; 100 100 mii.cbSize = mii.sizeof; 101 mii.fMask = MIIM_TYPE ;101 mii.fMask = MIIM_TYPE | MIIM_STATE; // Not setting the state can cause implicit disabled/gray if the text was empty. 102 102 mii.fType = fType; 103 mii.fState = fState; 103 104 //mii.dwTypeData = stringToStringz(txt); 104 105 branches/win32/0.9.6-release/dfl/progressbar.d
r5 r10 168 168 super.onHandleCreated(ea); 169 169 170 if(_min != _min.init || _max != _max.init)170 if(_min != MIN_INIT || _max != MAX_INIT) 171 171 { 172 172 prevwproc(PBM_SETRANGE, 0, MAKELPARAM(_min, _max)); 173 173 } 174 174 175 if(_step != _step.init)175 if(_step != STEP_INIT) 176 176 { 177 177 prevwproc(PBM_SETSTEP, _step, 0); 178 178 } 179 179 180 if(_val != _val.init)180 if(_val != VAL_INIT) 181 181 { 182 182 prevwproc(PBM_SETPOS, _val, 0); … … 214 214 private: 215 215 216 int _min = 0, _max = 100, _step = 10, _val = 0; 216 const int MIN_INIT = 0; 217 const int MAX_INIT = 100; 218 const int STEP_INIT = 10; 219 const int VAL_INIT = 0; 220 221 int _min = MIN_INIT, _max = MAX_INIT, _step = STEP_INIT, _val = VAL_INIT; 217 222 218 223 branches/win32/0.9.6-release/dfl/socket.d
r5 r10 189 189 190 190 191 override void close() 192 { 193 unregisterEvent(this); 194 super.close(); 191 static if(is(typeof(&this.detach))) 192 { 193 override void detach() 194 { 195 unregisterEvent(this); 196 super.detach(); 197 } 198 } 199 else 200 { 201 override void close() 202 { 203 unregisterEvent(this); 204 super.close(); 205 } 195 206 } 196 207 branches/win32/0.9.6-release/dfl/statusbar.d
r5 r10 517 517 super.onHandleCreated(ea); 518 518 519 panels._setcurparts(); 520 521 if(_issimple && _simpletext.length) 522 _sendidxtext(255, 0, _simpletext); 523 prevwproc(SB_SIMPLE, cast(WPARAM)_issimple, 0); 524 525 panels._setcurparts(); 519 if(_issimple) 520 { 521 prevwproc(SB_SIMPLE, cast(WPARAM)true, 0); 522 panels._setcurparts(); 523 if(_simpletext.length) 524 _sendidxtext(255, 0, _simpletext); 525 } 526 else 527 { 528 panels._setcurparts(); 529 prevwproc(SB_SIMPLE, cast(WPARAM)false, 0); 530 } 526 531 } 527 532 branches/win32/0.9.6-release/dfl/treeview.d
r5 r10 1797 1797 { 1798 1798 case TVE_COLLAPSE: 1799 onAfterCollapse(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 1800 TreeViewAction.COLLAPSE)); 1799 { 1800 scope TreeViewEventArgs tvea = new TreeViewEventArgs( 1801 cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 1802 TreeViewAction.COLLAPSE); 1803 onAfterCollapse(tvea); 1804 } 1801 1805 break; 1802 1806 1803 1807 case TVE_EXPAND: 1804 onAfterExpand(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 1805 TreeViewAction.EXPAND)); 1808 { 1809 scope TreeViewEventArgs tvea = new TreeViewEventArgs( 1810 cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 1811 TreeViewAction.EXPAND); 1812 onAfterExpand(tvea); 1813 } 1806 1814 break; 1807 1815 … … 1821 1829 TV_DISPINFOA* nmdi; 1822 1830 nmdi = cast(TV_DISPINFOA*)nmh; 1823 NodeLabelEditEventArgs nleea;1824 1831 TreeNode node; 1825 1832 node = cast(TreeNode)cast(void*)nmdi.item.lParam; 1826 // The nleea.label should contain the NEW text, which 1827 // there is no new text before it's edited... ? 1828 // TODO: check if correct implementation. 1829 nleea = new NodeLabelEditEventArgs(node /+ , node.text +/); 1833 scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node); 1830 1834 onBeforeLabelEdit(nleea); 1831 1835 m.result = nleea.cancelEdit; … … 1834 1838 1835 1839 case TVN_ENDLABELEDITW: 1836 goto end_label_edit; 1840 { 1841 char[] label; 1842 TV_DISPINFOW* nmdi; 1843 nmdi = cast(TV_DISPINFOW*)nmh; 1844 if(nmdi.item.pszText) 1845 { 1846 TreeNode node; 1847 node = cast(TreeNode)cast(void*)nmdi.item.lParam; 1848 label = fromUnicodez(nmdi.item.pszText); 1849 scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node, label); 1850 onAfterLabelEdit(nleea); 1851 if(nleea.cancelEdit) 1852 { 1853 m.result = FALSE; 1854 } 1855 else 1856 { 1857 // TODO: check if correct implementation. 1858 // Update the node's cached text.. 1859 node.ttext = label; 1860 1861 m.result = TRUE; 1862 } 1863 } 1864 } 1865 break; 1837 1866 1838 1867 case TVN_ENDLABELEDITA: 1839 1868 if(dfl.internal.utf.useUnicode) 1840 1869 break; 1841 end_label_edit:1842 1843 1870 { 1844 1871 char[] label; 1845 1872 TV_DISPINFOA* nmdi; 1846 1873 nmdi = cast(TV_DISPINFOA*)nmh; 1847 NodeLabelEditEventArgs nleea;1848 TreeNode node;1849 // TODO: check if correct implementation.1850 node = cast(TreeNode)cast(void*)nmdi.item.lParam;1851 1874 if(nmdi.item.pszText) 1852 label = stringFromStringz(nmdi.item.pszText).dup;1853 nleea = new NodeLabelEditEventArgs(node, label);1854 if(!nmdi.item.pszText)1855 nleea.cancelEdit = true;1856 onAfterLabelEdit(nleea);1857 if(nleea.cancelEdit)1858 1875 { 1859 m.result = FALSE; 1860 } 1861 else 1862 { 1863 // TODO: check if correct implementation. 1864 // Update the node's cached text.. 1865 node.ttext = label; 1866 1867 m.result = TRUE; 1876 TreeNode node; 1877 node = cast(TreeNode)cast(void*)nmdi.item.lParam; 1878 label = fromAnsiz(nmdi.item.pszText); 1879 scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node, label); 1880 onAfterLabelEdit(nleea); 1881 if(nleea.cancelEdit) 1882 { 1883 m.result = FALSE; 1884 } 1885 else 1886 { 1887 // TODO: check if correct implementation. 1888 // Update the node's cached text.. 1889 node.ttext = label; 1890 1891 m.result = TRUE; 1892 } 1868 1893 } 1869 1894 }
