Changeset 38
- Timestamp:
- 05/13/07 13:43:49 (2 years ago)
- Files:
-
- branches/bughunt/dsss.conf (modified) (1 diff)
- branches/bughunt/minwin/app.d (modified) (1 diff)
- branches/bughunt/minwin/mswindows.d (modified) (8 diffs)
- branches/bughunt/minwin/paint.d (modified) (2 diffs)
- branches/bughunt/minwin/text.d (modified) (1 diff)
- branches/bughunt/minwin/window.d (modified) (8 diffs)
- branches/bughunt/samples/menus.d (modified) (1 diff)
- branches/bughunt/samples/notepad.d (modified) (1 diff)
- branches/bughunt/samples/widgets.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/bughunt/dsss.conf
r35 r38 3 3 [*] 4 4 version(Windows) { 5 buildflags = -version=MinWin32 -lluser32 -llgdi32 -llcomdlg32 5 buildflags = -version=MinWin32 -lluser32 -llgdi32 -llcomdlg32 -llcomctl32 6 6 } else { 7 7 buildflags = -version=GTK -llgtk-x11-2.0 branches/bughunt/minwin/app.d
r33 r38 143 143 extern (Windows) 144 144 int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { 145 /*{ 146 INITCOMMONCONTROLSEX icc; 147 icc.dwSize = INITCOMMONCONTROLSEX.sizeof; 148 icc.dwICC = ICC_WIN95_CLASSES; 149 InitCommonControlsEx(&icc); 150 }*/ 151 145 152 int result; 146 153 gc_init(); // initialize garbage collector branches/bughunt/minwin/mswindows.d
r33 r38 38 38 export int GetSystemMetrics(int nIndex); 39 39 40 /*41 40 struct INITCOMMONCONTROLSEX { 42 41 DWORD dwSize; 43 42 DWORD dwICC; 44 43 } 44 enum : DWORD { 45 ICC_LISTVIEW_CLASSES = 0x00000001, 46 ICC_TREEVIEW_CLASSES = 0x00000002, 47 ICC_BAR_CLASSES = 0x00000004, 48 ICC_TAB_CLASSES = 0x00000008, 49 ICC_UPDOWN_CLASS = 0x00000010, 50 ICC_PROGRESS_CLASS = 0x00000020, 51 ICC_HOTKEY_CLASS = 0x00000040, 52 ICC_ANIMATE_CLASS = 0x00000080, 53 ICC_WIN95_CLASSES = 0x000000FF, 54 ICC_DATE_CLASSES = 0x00000100, 55 ICC_USEREX_CLASSES = 0x00000200, 56 ICC_COOL_CLASSES = 0x00000400, 57 ICC_INTERNET_CLASSES = 0x00000800, 58 ICC_PAGESCROLLER_CLASS = 0x00001000, 59 ICC_NATIVEFNTCTL_CLASS = 0x00002000 60 } 45 61 export void InitCommonControls(); 46 62 export BOOL InitCommonControlsEx(INITCOMMONCONTROLSEX*); 47 */ 63 48 64 export DWORD GetSysColor(int); 49 50 const uint WM_PAINTICON = 0x0026; 51 const uint WM_ICONERASEBKGND = 0x0027; 52 const uint WM_NEXTDLGCTL = 0x0028; 53 const uint WM_SPOOLERSTATUS = 0x002A; 54 const uint WM_DRAWITEM = 0x002B; 55 const uint WM_MEASUREITEM = 0x002C; 56 const uint WM_DELETEITEM = 0x002D; 57 const uint WM_VKEYTOITEM = 0x002E; 58 const uint WM_CHARTOITEM = 0x002F; 59 const uint WM_SETFONT = 0x0030; 60 const uint WM_GETFONT = 0x0031; 61 const uint WM_SETHOTKEY = 0x0032; 62 const uint WM_GETHOTKEY = 0x0033; 63 const uint WM_QUERYDRAGICON = 0x0037; 64 const uint WM_COMPAREITEM = 0x0039; 65 66 const uint WM_SIZING= 0x0214; 67 const uint WM_CAPTURECHANGED= 0x0215; 68 const uint WM_MOVING= 0x0216; 69 const uint WM_POWERBROADCAST= 0x0218; 70 const uint WM_DEVICECHANGE= 0x0219; 71 72 const uint DS_MODALFRAME = 0x80; 73 const uint ICON_SMALL = 0; 74 const uint ICON_BIG = 1; 65 export HBRUSH GetSysColorBrush(int); 66 67 enum : uint { 68 WM_PAINTICON = 0x0026, 69 WM_ICONERASEBKGND = 0x0027, 70 WM_NEXTDLGCTL = 0x0028, 71 WM_SPOOLERSTATUS = 0x002A, 72 WM_DRAWITEM = 0x002B, 73 WM_MEASUREITEM = 0x002C, 74 WM_DELETEITEM = 0x002D, 75 WM_VKEYTOITEM = 0x002E, 76 WM_CHARTOITEM = 0x002F, 77 WM_SETFONT = 0x0030, 78 WM_GETFONT = 0x0031, 79 WM_SETHOTKEY = 0x0032, 80 WM_GETHOTKEY = 0x0033, 81 WM_QUERYDRAGICON = 0x0037, 82 WM_COMPAREITEM = 0x0039, 83 84 WM_SIZING= 0x0214, 85 WM_CAPTURECHANGED= 0x0215, 86 WM_MOVING= 0x0216, 87 WM_POWERBROADCAST= 0x0218, 88 WM_DEVICECHANGE= 0x0219, 89 90 DS_MODALFRAME = 0x80, 91 ICON_SMALL = 0, 92 ICON_BIG = 1 93 } 75 94 76 95 export BOOL GdiFlush(); … … 82 101 alias SIZE* PSIZE; 83 102 84 const uint SBM_SETPOS =0x00E0; 85 const uint SBM_GETPOS =0x00E1; 86 const uint SBM_SETRANGE =0x00E2; 87 const uint SBM_SETRANGEREDRAW =0x00E6; 88 const uint SBM_GETRANGE =0x00E3; 89 const uint SBM_ENABLE_ARROWS =0x00E4; 90 const uint SBM_SETSCROLLINFO =0x00E9; 91 const uint SBM_GETSCROLLINFO =0x00EA; 92 const uint SIF_RANGE =0x0001; 93 const uint SIF_PAGE =0x0002; 94 const uint SIF_POS =0x0004; 95 const uint SIF_DISABLENOSCROLL =0x0008; 96 const uint SIF_TRACKPOS =0x0010; 97 const uint SIF_ALL =(SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS); 98 const uint SW_SCROLLCHILDREN =0x0001; 99 const uint SW_INVALIDATE =0x0002; 100 const uint SW_ERASE =0x0004; 103 enum : uint { 104 SBM_SETPOS =0x00E0, 105 SBM_GETPOS =0x00E1, 106 SBM_SETRANGE =0x00E2, 107 SBM_SETRANGEREDRAW =0x00E6, 108 SBM_GETRANGE =0x00E3, 109 SBM_ENABLE_ARROWS =0x00E4, 110 SBM_SETSCROLLINFO =0x00E9, 111 SBM_GETSCROLLINFO =0x00EA, 112 SIF_RANGE =0x0001, 113 SIF_PAGE =0x0002, 114 SIF_POS =0x0004, 115 SIF_DISABLENOSCROLL =0x0008, 116 SIF_TRACKPOS =0x0010, 117 SIF_ALL =(SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS), 118 SW_SCROLLCHILDREN =0x0001, 119 SW_INVALIDATE =0x0002, 120 SW_ERASE =0x0004 121 } 101 122 102 123 struct SCROLLINFO { … … 134 155 enum { IMAGE_BITMAP, IMAGE_CURSOR, IMAGE_ICON }; 135 156 136 const uint GW_HWNDFIRST = 0; 137 const uint GW_HWNDLAST = 1; 138 const uint GW_HWNDNEXT = 2; 139 const uint GW_HWNDPREV = 3; 140 const uint GW_OWNER = 4; 141 const uint GW_CHILD = 5; 142 const uint GW_MAX = 5; 143 144 const int GWL_USERDATA = -21; 157 enum : uint { 158 GW_HWNDFIRST = 0, 159 GW_HWNDLAST = 1, 160 GW_HWNDNEXT = 2, 161 GW_HWNDPREV = 3, 162 GW_OWNER = 4, 163 GW_CHILD = 5, 164 GW_MAX = 5 165 } 166 167 enum : int { GWL_USERDATA = -21 } 145 168 146 169 export HWND GetWindow (HWND hWnd, int dir); 147 170 148 const uint MF_INSERT =0x00000000L; 149 const uint MF_CHANGE =0x00000080L; 150 const uint MF_APPEND =0x00000100L; 151 const uint MF_DELETE =0x00000200L; 152 const uint MF_REMOVE =0x00001000L; 153 const uint MF_BYCOMMAND =0x00000000L; 154 const uint MF_BYPOSITION =0x00000400L; 155 const uint MF_SEPARATOR =0x00000800L; 156 const uint MF_ENABLED =0x00000000L; 157 const uint MF_GRAYED =0x00000001L; 158 const uint MF_DISABLED =0x00000002L; 159 const uint MF_UNCHECKED =0x00000000L; 160 const uint MF_CHECKED =0x00000008L; 161 const uint MF_USECHECKBITMAPS =0x00000200L; 162 const uint MF_STRING =0x00000000L; 163 const uint MF_BITMAP =0x00000004L; 164 const uint MF_OWNERDRAW =0x00000100L; 165 const uint MF_POPUP =0x00000010L; 166 const uint MF_MENUBARBREAK =0x00000020L; 167 const uint MF_MENUBREAK =0x00000040L; 168 const uint MF_UNHILITE =0x00000000L; 169 const uint MF_HILITE =0x00000080L; 170 const uint MF_SYSMENU =0x00002000L; 171 const uint MF_HELP =0x00004000L; 172 const uint MF_MOUSESELECT =0x00008000L; 171 enum : uint { 172 MF_INSERT =0x00000000L, 173 MF_CHANGE =0x00000080L, 174 MF_APPEND =0x00000100L, 175 MF_DELETE =0x00000200L, 176 MF_REMOVE =0x00001000L, 177 MF_BYCOMMAND =0x00000000L, 178 MF_BYPOSITION =0x00000400L, 179 MF_SEPARATOR =0x00000800L, 180 MF_ENABLED =0x00000000L, 181 MF_GRAYED =0x00000001L, 182 MF_DISABLED =0x00000002L, 183 MF_UNCHECKED =0x00000000L, 184 MF_CHECKED =0x00000008L, 185 MF_USECHECKBITMAPS =0x00000200L, 186 MF_STRING =0x00000000L, 187 MF_BITMAP =0x00000004L, 188 MF_OWNERDRAW =0x00000100L, 189 MF_POPUP =0x00000010L, 190 MF_MENUBARBREAK =0x00000020L, 191 MF_MENUBREAK =0x00000040L, 192 MF_UNHILITE =0x00000000L, 193 MF_HILITE =0x00000080L, 194 MF_SYSMENU =0x00002000L, 195 MF_HELP =0x00004000L, 196 MF_MOUSESELECT =0x00008000L 197 } 173 198 174 199 export HMENU CreateMenu(); … … 250 275 * Combo Box messages 251 276 */ 252 const uint CB_GETEDITSEL =0x0140; 253 const uint CB_LIMITTEXT =0x0141; 254 const uint CB_SETEDITSEL =0x0142; 255 const uint CB_ADDSTRING =0x0143; 256 const uint CB_DELETESTRING =0x0144; 257 const uint CB_DIR =0x0145; 258 const uint CB_GETCOUNT =0x0146; 259 const uint CB_GETCURSEL =0x0147; 260 const uint CB_GETLBTEXT =0x0148; 261 const uint CB_GETLBTEXTLEN =0x0149; 262 const uint CB_INSERTSTRING =0x014A; 263 const uint CB_RESETCONTENT =0x014B; 264 const uint CB_FINDSTRING =0x014C; 265 const uint CB_SELECTSTRING =0x014D; 266 const uint CB_SETCURSEL =0x014E; 267 const uint CB_SHOWDROPDOWN =0x014F; 268 const uint CB_GETITEMDATA =0x0150; 269 const uint CB_SETITEMDATA =0x0151; 270 const uint CB_GETDROPPEDCONTROLRECT =0x0152; 271 const uint CB_SETITEMHEIGHT =0x0153; 272 const uint CB_GETITEMHEIGHT =0x0154; 273 const uint CB_SETEXTENDEDUI =0x0155; 274 const uint CB_GETEXTENDEDUI =0x0156; 275 const uint CB_GETDROPPEDSTATE =0x0157; 276 const uint CB_FINDSTRINGEXACT =0x0158; 277 const uint CB_SETLOCALE =0x0159; 278 const uint CB_GETLOCALE =0x015A; 279 const uint CB_GETTOPINDEX =0x015b; 280 const uint CB_SETTOPINDEX =0x015c; 281 const uint CB_GETHORIZONTALEXTENT =0x015d; 282 const uint CB_SETHORIZONTALEXTENT =0x015e; 283 const uint CB_GETDROPPEDWIDTH =0x015f; 284 const uint CB_SETDROPPEDWIDTH =0x0160; 285 const uint CB_INITSTORAGE =0x0161; 286 const uint CBN_SELCHANGE =1; 287 const uint CBN_DBLCLK =2; 288 const uint CBN_SETFOCUS =3; 289 const uint CBN_KILLFOCUS =4; 290 const uint CBN_EDITCHANGE =5; 291 const uint CBN_EDITUPDATE =6; 292 const uint CBN_DROPDOWN =7; 293 const uint CBN_CLOSEUP =8; 294 const uint CBN_SELENDOK =9; 295 const uint CBN_SELENDCANCEL =10; 296 297 /* 298 * Combo Box styles 299 */ 300 const uint CBS_SIMPLE =0x0001L; 301 const uint CBS_DROPDOWN =0x0002L; 302 const uint CBS_DROPDOWNLIST =0x0003L; 303 const uint CBS_OWNERDRAWFIXED =0x0010L; 304 const uint CBS_OWNERDRAWVARIABLE =0x0020L; 305 const uint CBS_AUTOHSCROLL =0x0040L; 306 const uint CBS_OEMCONVERT =0x0080L; 307 const uint CBS_SORT =0x0100L; 308 const uint CBS_HASSTRINGS =0x0200L; 309 const uint CBS_NOINTEGRALHEIGHT =0x0400L; 310 const uint CBS_DISABLENOSCROLL =0x0800L; 311 const uint CBS_UPPERCASE =0x2000L; 312 const uint CBS_LOWERCASE =0x4000L; 313 314 /* 315 * Listbox messages 316 */ 317 const uint LB_ADDSTRING =0x0180; 318 const uint LB_INSERTSTRING =0x0181; 319 const uint LB_DELETESTRING =0x0182; 320 const uint LB_SELITEMRANGEEX =0x0183; 321 const uint LB_RESETCONTENT =0x0184; 322 const uint LB_SETSEL =0x0185; 323 const uint LB_SETCURSEL =0x0186; 324 const uint LB_GETSEL =0x0187; 325 const uint LB_GETCURSEL =0x0188; 326 const uint LB_GETTEXT =0x0189; 327 const uint LB_GETTEXTLEN =0x018A; 328 const uint LB_GETCOUNT =0x018B; 329 const uint LB_SELECTSTRING =0x018C; 330 const uint LB_DIR =0x018D; 331 const uint LB_GETTOPINDEX =0x018E; 332 const uint LB_FINDSTRING =0x018F; 333 const uint LB_GETSELCOUNT =0x0190; 334 const uint LB_GETSELITEMS =0x0191; 335 const uint LB_SETTABSTOPS =0x0192; 336 const uint LB_GETHORIZONTALEXTENT =0x0193; 337 const uint LB_SETHORIZONTALEXTENT =0x0194; 338 const uint LB_SETCOLUMNWIDTH =0x0195; 339 const uint LB_ADDFILE =0x0196; 340 const uint LB_SETTOPINDEX =0x0197; 341 const uint LB_GETITEMRECT =0x0198; 342 const uint LB_GETITEMDATA =0x0199; 343 const uint LB_SETITEMDATA =0x019A; 344 const uint LB_SELITEMRANGE =0x019B; 345 const uint LB_SETANCHORINDEX =0x019C; 346 const uint LB_GETANCHORINDEX =0x019D; 347 const uint LB_SETCARETINDEX =0x019E; 348 const uint LB_GETCARETINDEX =0x019F; 349 const uint LB_SETITEMHEIGHT =0x01A0; 350 const uint LB_GETITEMHEIGHT =0x01A1; 351 const uint LB_FINDSTRINGEXACT =0x01A2; 352 const uint LB_SETLOCALE =0x01A5; 353 const uint LB_GETLOCALE =0x01A6; 354 const uint LB_SETCOUNT =0x01A7; 355 const uint LB_INITSTORAGE =0x01A8; 356 const uint LB_ITEMFROMPOINT =0x01A9; 357 358 359 /* 360 * Listbox Styles 361 */ 362 const uint LBS_NOTIFY =0x0001L; 363 const uint LBS_SORT =0x0002L; 364 const uint LBS_NOREDRAW =0x0004L; 365 const uint LBS_MULTIPLESEL =0x0008L; 366 const uint LBS_OWNERDRAWFIXED =0x0010L; 367 const uint LBS_OWNERDRAWVARIABLE =0x0020L; 368 const uint LBS_HASSTRINGS =0x0040L; 369 const uint LBS_USETABSTOPS =0x0080L; 370 const uint LBS_NOINTEGRALHEIGHT =0x0100L; 371 const uint LBS_MULTICOLUMN =0x0200L; 372 const uint LBS_WANTKEYBOARDINPUT =0x0400L; 373 const uint LBS_EXTENDEDSEL =0x0800L; 374 const uint LBS_DISABLENOSCROLL =0x1000L; 375 const uint LBS_NODATA =0x2000L; 376 const uint LBS_NOSEL =0x4000L; 377 const uint LBS_STANDARD =(LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER); 378 379 const uint OFN_READONLY =0x00000001; 380 const uint OFN_OVERWRITEPROMPT =0x00000002; 381 const uint OFN_HIDEREADONLY =0x00000004; 382 const uint OFN_NOCHANGEDIR =0x00000008; 383 const uint OFN_SHOWHELP =0x00000010; 384 const uint OFN_ENABLEHOOK =0x00000020; 385 const uint OFN_ENABLETEMPLATE =0x00000040; 386 const uint OFN_ENABLETEMPLATEHANDLE =0x00000080; 387 const uint OFN_NOVALIDATE =0x00000100; 388 const uint OFN_ALLOWMULTISELECT =0x00000200; 389 const uint OFN_EXTENSIONDIFFERENT =0x00000400; 390 const uint OFN_PATHMUSTEXIST =0x00000800; 391 const uint OFN_FILEMUSTEXIST =0x00001000; 392 const uint OFN_CREATEPROMPT =0x00002000; 393 const uint OFN_SHAREAWARE =0x00004000; 394 const uint OFN_NOREADONLYRETURN =0x00008000; 395 const uint OFN_NOTESTFILECREATE =0x00010000; 396 const uint OFN_NONETWORKBUTTON =0x00020000; 397 const uint OFN_NOLONGNAMES =0x00040000; 398 const uint OFN_EXPLORER =0x00080000; 399 const uint OFN_NODEREFERENCELINKS =0x00100000; 400 const uint OFN_LONGNAMES =0x00200000; 401 402 const uint SBS_HORZ =0x0000; 403 const uint SBS_VERT =0x0001; 404 const uint SBS_TOPALIGN =0x0002; 405 const uint SBS_LEFTALIGN =0x0002; 406 const uint SBS_BOTTOMALIGN =0x0004; 407 const uint SBS_RIGHTALIGN =0x0004; 408 const uint SBS_SIZEBOXTOPLEFTALIGN =0x0002; 409 const uint SBS_SIZEBOXBOTTOMRIGHTALIGN =0x0004; 410 const uint SBS_SIZEBOX =0x0008; 277 enum : uint { 278 CB_GETEDITSEL =0x0140, 279 CB_LIMITTEXT =0x0141, 280 CB_SETEDITSEL =0x0142, 281 CB_ADDSTRING =0x0143, 282 CB_DELETESTRING =0x0144, 283 CB_DIR =0x0145, 284 CB_GETCOUNT =0x0146, 285 CB_GETCURSEL =0x0147, 286 CB_GETLBTEXT =0x0148, 287 CB_GETLBTEXTLEN =0x0149, 288 CB_INSERTSTRING =0x014A, 289 CB_RESETCONTENT =0x014B, 290 CB_FINDSTRING =0x014C, 291 CB_SELECTSTRING =0x014D, 292 CB_SETCURSEL =0x014E, 293 CB_SHOWDROPDOWN =0x014F, 294 CB_GETITEMDATA =0x0150, 295 CB_SETITEMDATA =0x0151, 296 CB_GETDROPPEDCONTROLRECT =0x0152, 297 CB_SETITEMHEIGHT =0x0153, 298 CB_GETITEMHEIGHT =0x0154, 299 CB_SETEXTENDEDUI =0x0155, 300 CB_GETEXTENDEDUI =0x0156, 301 CB_GETDROPPEDSTATE =0x0157, 302 CB_FINDSTRINGEXACT =0x0158, 303 CB_SETLOCALE =0x0159, 304 CB_GETLOCALE =0x015A, 305 CB_GETTOPINDEX =0x015b, 306 CB_SETTOPINDEX =0x015c, 307 CB_GETHORIZONTALEXTENT =0x015d, 308 CB_SETHORIZONTALEXTENT =0x015e, 309 CB_GETDROPPEDWIDTH =0x015f, 310 CB_SETDROPPEDWIDTH =0x0160, 311 CB_INITSTORAGE =0x0161, 312 CBN_SELCHANGE =1, 313 CBN_DBLCLK =2, 314 CBN_SETFOCUS =3, 315 CBN_KILLFOCUS =4, 316 CBN_EDITCHANGE =5, 317 CBN_EDITUPDATE =6, 318 CBN_DROPDOWN =7, 319 CBN_CLOSEUP =8, 320 CBN_SELENDOK =9, 321 CBN_SELENDCANCEL =10, 322 323 /* 324 * Combo Box styles 325 */ 326 CBS_SIMPLE =0x0001L, 327 CBS_DROPDOWN =0x0002L, 328 CBS_DROPDOWNLIST =0x0003L, 329 CBS_OWNERDRAWFIXED =0x0010L, 330 CBS_OWNERDRAWVARIABLE =0x0020L, 331 CBS_AUTOHSCROLL =0x0040L, 332 CBS_OEMCONVERT =0x0080L, 333 CBS_SORT =0x0100L, 334 CBS_HASSTRINGS =0x0200L, 335 CBS_NOINTEGRALHEIGHT =0x0400L, 336 CBS_DISABLENOSCROLL =0x0800L, 337 CBS_UPPERCASE =0x2000L, 338 CBS_LOWERCASE =0x4000L, 339 340 /* 341 * Listbox messages 342 */ 343 LB_ADDSTRING =0x0180, 344 LB_INSERTSTRING =0x0181, 345 LB_DELETESTRING =0x0182, 346 LB_SELITEMRANGEEX =0x0183, 347 LB_RESETCONTENT =0x0184, 348 LB_SETSEL =0x0185, 349 LB_SETCURSEL =0x0186, 350 LB_GETSEL =0x0187, 351 LB_GETCURSEL =0x0188, 352 LB_GETTEXT =0x0189, 353 LB_GETTEXTLEN =0x018A, 354 LB_GETCOUNT =0x018B, 355 LB_SELECTSTRING =0x018C, 356 LB_DIR =0x018D, 357 LB_GETTOPINDEX =0x018E, 358 LB_FINDSTRING =0x018F, 359 LB_GETSELCOUNT =0x0190, 360 LB_GETSELITEMS =0x0191, 361 LB_SETTABSTOPS =0x0192, 362 LB_GETHORIZONTALEXTENT =0x0193, 363 LB_SETHORIZONTALEXTENT =0x0194, 364 LB_SETCOLUMNWIDTH =0x0195, 365 LB_ADDFILE =0x0196, 366 LB_SETTOPINDEX =0x0197, 367 LB_GETITEMRECT =0x0198, 368 LB_GETITEMDATA =0x0199, 369 LB_SETITEMDATA =0x019A, 370 LB_SELITEMRANGE =0x019B, 371 LB_SETANCHORINDEX =0x019C, 372 LB_GETANCHORINDEX =0x019D, 373 LB_SETCARETINDEX =0x019E, 374 LB_GETCARETINDEX =0x019F, 375 LB_SETITEMHEIGHT =0x01A0, 376 LB_GETITEMHEIGHT =0x01A1, 377 LB_FINDSTRINGEXACT =0x01A2, 378 LB_SETLOCALE =0x01A5, 379 LB_GETLOCALE =0x01A6, 380 LB_SETCOUNT =0x01A7, 381 LB_INITSTORAGE =0x01A8, 382 LB_ITEMFROMPOINT =0x01A9, 383 384 385 /* 386 * Listbox Styles 387 */ 388 LBS_NOTIFY =0x0001L, 389 LBS_SORT =0x0002L, 390 LBS_NOREDRAW =0x0004L, 391 LBS_MULTIPLESEL =0x0008L, 392 LBS_OWNERDRAWFIXED =0x0010L, 393 LBS_OWNERDRAWVARIABLE =0x0020L, 394 LBS_HASSTRINGS =0x0040L, 395 LBS_USETABSTOPS =0x0080L, 396 LBS_NOINTEGRALHEIGHT =0x0100L, 397 LBS_MULTICOLUMN =0x0200L, 398 LBS_WANTKEYBOARDINPUT =0x0400L, 399 LBS_EXTENDEDSEL =0x0800L, 400 LBS_DISABLENOSCROLL =0x1000L, 401 LBS_NODATA =0x2000L, 402 LBS_NOSEL =0x4000L, 403 LBS_STANDARD =(LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER), 404 405 OFN_READONLY =0x00000001, 406 OFN_OVERWRITEPROMPT =0x00000002, 407 OFN_HIDEREADONLY =0x00000004, 408 OFN_NOCHANGEDIR =0x00000008, 409 OFN_SHOWHELP =0x00000010, 410 OFN_ENABLEHOOK =0x00000020, 411 OFN_ENABLETEMPLATE =0x00000040, 412 OFN_ENABLETEMPLATEHANDLE =0x00000080, 413 OFN_NOVALIDATE =0x00000100, 414 OFN_ALLOWMULTISELECT =0x00000200, 415 OFN_EXTENSIONDIFFERENT =0x00000400, 416 OFN_PATHMUSTEXIST =0x00000800, 417 OFN_FILEMUSTEXIST =0x00001000, 418 OFN_CREATEPROMPT =0x00002000, 419 OFN_SHAREAWARE =0x00004000, 420 OFN_NOREADONLYRETURN =0x00008000, 421 OFN_NOTESTFILECREATE =0x00010000, 422 OFN_NONETWORKBUTTON =0x00020000, 423 OFN_NOLONGNAMES =0x00040000, 424 OFN_EXPLORER =0x00080000, 425 OFN_NODEREFERENCELINKS =0x00100000, 426 OFN_LONGNAMES =0x00200000, 427 428 SBS_HORZ =0x0000, 429 SBS_VERT =0x0001, 430 SBS_TOPALIGN =0x0002, 431 SBS_LEFTALIGN =0x0002, 432 SBS_BOTTOMALIGN =0x0004, 433 SBS_RIGHTALIGN =0x0004, 434 SBS_SIZEBOXTOPLEFTALIGN =0x0002, 435 SBS_SIZEBOXBOTTOMRIGHTALIGN =0x0004, 436 SBS_SIZEBOX =0x0008 437 } 411 438 412 439 export HWND CreateWindowExW( … … 442 469 443 470 // PIXELFORMATDESCRIPTOR stuff 444 const uint PFD_TYPE_RGBA = 0; 445 const uint PFD_TYPE_COLORINDEX = 1; 446 const uint PFD_MAIN_PLANE = 0; 447 const uint PFD_OVERLAY_PLANE = 1; 448 const uint PFD_DOUBLEBUFFER = 1; 449 const uint PFD_STEREO = 2; 450 const uint PFD_DRAW_TO_WINDOW = 4; 451 const uint PFD_DRAW_TO_BITMAP = 8; 452 const uint PFD_SUPPORT_GDI = 16; 453 const uint PFD_SUPPORT_OPENGL = 32; 454 const uint PFD_GENERIC_FORMAT = 64; 455 const uint PFD_NEED_PALETTE = 128; 456 const uint PFD_NEED_SYSTEM_PALETTE = 0x00000100; 457 const uint PFD_SWAP_EXCHANGE = 0x00000200; 458 const uint PFD_SWAP_COPY = 0x00000400; 459 const uint PFD_SWAP_LAYER_BUFFERS = 0x00000800; 460 const uint PFD_GENERIC_ACCELERATED = 0x00001000; 461 const uint PFD_DEPTH_DONTCARE = 0x20000000; 462 const uint PFD_DOUBLEBUFFER_DONTCARE = 0x40000000; 463 const uint PFD_STEREO_DONTCARE = 0x80000000; 464 471 enum : uint { 472 PFD_TYPE_RGBA = 0, 473 PFD_TYPE_COLORINDEX = 1, 474 PFD_MAIN_PLANE = 0, 475 PFD_OVERLAY_PLANE = 1, 476 PFD_DOUBLEBUFFER = 1, 477 PFD_STEREO = 2, 478 PFD_DRAW_TO_WINDOW = 4, 479 PFD_DRAW_TO_BITMAP = 8, 480 PFD_SUPPORT_GDI = 16, 481 PFD_SUPPORT_OPENGL = 32, 482 PFD_GENERIC_FORMAT = 64, 483 PFD_NEED_PALETTE = 128, 484 PFD_NEED_SYSTEM_PALETTE = 0x00000100, 485 PFD_SWAP_EXCHANGE = 0x00000200, 486 PFD_SWAP_COPY = 0x00000400, 487 PFD_SWAP_LAYER_BUFFERS = 0x00000800, 488 PFD_GENERIC_ACCELERATED = 0x00001000, 489 PFD_DEPTH_DONTCARE = 0x20000000, 490 PFD_DOUBLEBUFFER_DONTCARE = 0x40000000, 491 PFD_STEREO_DONTCARE = 0x80000000 492 } 465 493 export int ChoosePixelFormat(HDC hdc, PIXELFORMATDESCRIPTOR* ppfd); 466 494 export int DescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR* ppfd); … … 468 496 alias HANDLE HGLRC; 469 497 470 const int WGL_SWAP_MAIN_PLANE = 1; 498 enum : int { WGL_SWAP_MAIN_PLANE = 1 } 499 471 500 //int wglUseFontOutlinesW(HDC, uint, uint, uint, float, float, int, _GLYPHMETRICSFLOAT *); 472 501 //int wglUseFontOutlinesA(HDC, uint, uint, uint, float, float, int, _GLYPHMETRICSFLOAT *); … … 478 507 //int wglDescribeLayerPlane(HDC*, int, int, uint, LAYERPLANEDESCRIPTOR *); 479 508 //HGLRC wglCreateLayerContext(HDC, int); 509 480 510 export int wglSwapLayerBuffers(HDC, uint); 481 511 export int wglShareLists(HGLRC, HGLRC); … … 490 520 export BOOL SwapBuffers(HDC); 491 521 492 const int SM_CXBORDER = 5; 493 const int SM_CYBORDER = 5; 494 const int SM_CXFIXEDFRAME = 7; 495 const int SM_CYFIXEDFRAME = 8; 496 const int SM_CXEDGE = 45; 497 const int SM_CYEDGE= 46; 498 const int SM_CXMENUCHECK = 71; 499 const int SM_CYMENUCHECK = 72; 522 enum : int { 523 SM_CXBORDER = 5, 524 SM_CYBORDER = 5, 525 SM_CXFIXEDFRAME = 7, 526 SM_CYFIXEDFRAME = 8, 527 SM_CXEDGE = 45, 528 SM_CYEDGE= 46, 529 SM_CXMENUCHECK = 71, 530 SM_CYMENUCHECK = 72 531 } 500 532 501 533 // branches/bughunt/minwin/paint.d
r33 r38 280 280 void drawText(int x, int y, char[] str) { 281 281 BOOL ok; 282 //int old = SetBkMode(peer,1); 282 283 if (useWfuncs) { 283 284 wchar[] buf = toUTF16(str); … … 288 289 ok = TextOutA(peer, x, y, buf, std.c.string.strlen(buf)); 289 290 } 291 //SetBkMode(peer,old); 290 292 sysAssert(ok != false, "Failed to draw text"); 291 293 } branches/bughunt/minwin/text.d
r35 r38 81 81 } 82 82 class MultiLineText : WindowChild { 83 this(Component parent, char[] text = "", char[] name = "") {83 this(Component parent, char[] text = "", bool vscroll = true, bool hscroll = true, char[] name = "") { 84 84 HINSTANCE hInst = GetModuleHandleA(null); 85 85 PeerForAdd parentp = parent.getPeerForAdd(); 86 DWORD dwStyle = (vscroll?ES_AUTOVSCROLL|WS_VSCROLL:0) | (hscroll?ES_AUTOHSCROLL|WS_HSCROLL:0); 86 87 peer = CreateWindowX("EDIT",text, 87 ES_MULTILINE | WS_CHILD | WS_VISIBLE ,88 ES_MULTILINE | WS_CHILD | WS_VISIBLE | dwStyle, 88 89 0,0,10,10,parentp, 89 90 cast(HMENU)0,hInst,null); branches/bughunt/minwin/window.d
r36 r38 37 37 template CommonEventSourceImpl() { 38 38 version (MinWin32) { 39 HBRUSH backgroundPeer;40 39 void repaintNow() { 41 40 UpdateWindow(peer); … … 136 135 137 136 alias HWND WindowPeer; 137 alias HBRUSH BackgroundPeer; 138 138 139 139 const int MinWinWindowStyle = WS_OVERLAPPEDWINDOW; … … 152 152 WindowPeer peer; 153 153 MenuBar menubar; 154 BackgroundPeer backgroundPeer; 155 private bool ownsBackgroundPeer; 154 156 155 157 mixin CommonWindowImpl!(); … … 185 187 } 186 188 hasPeer = NO_PEER; 189 if (backgroundPeer && ownsBackgroundPeer) 190 DeleteObject(backgroundPeer); 191 backgroundPeer = null; 192 ownsBackgroundPeer = false; 187 193 //delete WindowList[this]; // remove global reference 188 194 WindowList.remove(this); // remove global reference … … 213 219 cast(int)c.green, 214 220 cast(int)c.blue); 215 if (backgroundPeer )221 if (backgroundPeer && ownsBackgroundPeer) 216 222 DeleteObject(backgroundPeer); 217 223 backgroundPeer = CreateSolidBrush(c.native); 224 ownsBackgroundPeer = true; 218 225 // use GetSysColorBrush? 219 226 } … … 391 398 this.name = name; 392 399 setWindowPeer(this,peer,OWNS_PEER); 393 //backgroundPeer = GetStockObject(WHITE_BRUSH); 400 backgroundPeer = cast(HBRUSH)COLOR_WINDOW;//GetSysColorBrush(COLOR_WINDOW);//GetStockObject(WHITE_BRUSH); 401 ownsBackgroundPeer = false; 394 402 WindowList[this] = this; // prevent garbage collection 395 403 } … … 421 429 WNDCLASSA wc; 422 430 wc.lpszClassName = "MinWinWindow"; 423 wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;431 wc.style = CS_OWNDC;// | CS_HREDRAW | CS_VREDRAW; 424 432 wc.lpfnWndProc = &MinWinWindowProc; 425 433 wc.hInstance = hInst; … … 427 435 //wc.hIconSm = DefaultWindowSmallIcon.peer; 428 436 wc.hCursor = LoadCursorA(cast(HINSTANCE) null, IDC_ARROW); 429 //wc.hbrBackground = null;430 wc.hbrBackground = cast(HBRUSH)COLOR_WINDOW;437 wc.hbrBackground = null; 438 //wc.hbrBackground = cast(HBRUSH)COLOR_WINDOW; 431 439 wc.lpszMenuName = null; 432 440 wc.cbClsExtra = 0; branches/bughunt/samples/menus.d
r33 r38 51 51 }; 52 52 win.paintDelegate ~= delegate void(Component source, GContext gc) { 53 auto Font font = new Font("",12);54 Fontoldfont = gc.setFont(font);53 auto font = standardFont(StandardFont.Gui); 54 auto oldfont = gc.setFont(font); 55 55 gc.drawText(100,100,text); 56 56 gc.setFont(oldfont); branches/bughunt/samples/notepad.d
r35 r38 30 30 31 31 MultiLineText text = new MultiLineText(win); 32 text.userPreferredSize(200,200); 32 33 33 34 win.commandDelegate ~= (Component c, int cmd) { branches/bughunt/samples/widgets.d
r37 r38 35 35 36 36 auto t2 = new MultiLineText(win,"multi line\ntext area"); 37 t2.userPreferredSize(1 00,60);37 t2.userPreferredSize(120,120); 38 38 39 39 char[][] strs = ["hello","world","The","D","Programming","Language","is","great"];
