Mercurial > dwindows
comparison win/dw.c @ 1370:e705051d841c
Test change on Windows to allow dw_container_cursor() to work on unsized containers.
I also removed an old hack of initializing unpacked windows to a large size.
There was a reason for this at one time, but I am hoping it isn't necessary anymore.
My testing has not shown any issues so far.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 20 Nov 2011 16:34:44 +0000 |
parents | a595e368a393 |
children | 896347a9be19 |
comparison
equal
deleted
inserted
replaced
1369:960ea1ec245e | 1370:e705051d841c |
---|---|
1 /* | 1 /* |
2 * Dynamic Windows: | 2 * Dynamic Windows: |
3 * A GTK like implementation of the Win32 GUI | 3 * A GTK like implementation of the Win32 GUI |
4 * | 4 * |
5 * (C) 2000-2011 Brian Smith <brian@dbsoft.org> | 5 * (C) 2000-2011 Brian Smith <brian@dbsoft.org> |
6 * (C) 2003-2005 Mark Hessling <m.hessling@qut.edu.au> | 6 * (C) 2003-2011 Mark Hessling <m.hessling@qut.edu.au> |
7 * | 7 * |
8 */ | 8 */ |
9 #define _WIN32_IE 0x0500 | 9 #define _WIN32_IE 0x0500 |
10 #define WINVER 0x500 | 10 #define WINVER 0x500 |
11 #include <windows.h> | 11 #include <windows.h> |
1604 GetClientRect(handle,&rect); | 1604 GetClientRect(handle,&rect); |
1605 TabCtrl_AdjustRect(handle,FALSE,&rect); | 1605 TabCtrl_AdjustRect(handle,FALSE,&rect); |
1606 MoveWindow(array[pageid]->hwnd, rect.left, rect.top, | 1606 MoveWindow(array[pageid]->hwnd, rect.left, rect.top, |
1607 rect.right - rect.left, rect.bottom-rect.top, FALSE); | 1607 rect.right - rect.left, rect.bottom-rect.top, FALSE); |
1608 } | 1608 } |
1609 } | |
1610 /* So does the List View... handle delayed cursoring */ | |
1611 if(strnicmp(tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1)==0 && width + vectorx > 10 && height + vectory > 10) | |
1612 { | |
1613 int index = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_cursor")); | |
1614 | |
1615 if(index > 0) | |
1616 ListView_EnsureVisible(handle, index, TRUE); | |
1609 } | 1617 } |
1610 | 1618 |
1611 if(thisbox->type == DW_HORZ) | 1619 if(thisbox->type == DW_HORZ) |
1612 currentx += width + vectorx + (pad * 2); | 1620 currentx += width + vectorx + (pad * 2); |
1613 if(thisbox->type == DW_VERT) | 1621 if(thisbox->type == DW_VERT) |
4562 newbox->cinfo.fore = newbox->cinfo.back = -1; | 4570 newbox->cinfo.fore = newbox->cinfo.back = -1; |
4563 | 4571 |
4564 hwndframe = CreateWindow(FRAMECLASSNAME, | 4572 hwndframe = CreateWindow(FRAMECLASSNAME, |
4565 "", | 4573 "", |
4566 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, | 4574 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, |
4567 0,0,2000,1000, | 4575 0,0,0,0, |
4568 DW_HWND_OBJECT, | 4576 DW_HWND_OBJECT, |
4569 NULL, | 4577 NULL, |
4570 DWInstance, | 4578 DWInstance, |
4571 NULL); | 4579 NULL); |
4572 | 4580 |
4593 cinfo->fore = cinfo->back = -1; | 4601 cinfo->fore = cinfo->back = -1; |
4594 | 4602 |
4595 hwndframe = CreateWindow(ScrollClassName, | 4603 hwndframe = CreateWindow(ScrollClassName, |
4596 "", | 4604 "", |
4597 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL, | 4605 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL, |
4598 0,0,2000,1000, | 4606 0,0,0,0, |
4599 DW_HWND_OBJECT, | 4607 DW_HWND_OBJECT, |
4600 NULL, | 4608 NULL, |
4601 DWInstance, | 4609 DWInstance, |
4602 NULL); | 4610 NULL); |
4603 | 4611 |
4679 newbox->cinfo.fore = newbox->cinfo.back = -1; | 4687 newbox->cinfo.fore = newbox->cinfo.back = -1; |
4680 | 4688 |
4681 hwndframe = CreateWindow(FRAMECLASSNAME, | 4689 hwndframe = CreateWindow(FRAMECLASSNAME, |
4682 "", | 4690 "", |
4683 WS_VISIBLE | WS_CHILD, | 4691 WS_VISIBLE | WS_CHILD, |
4684 0,0,2000,1000, | 4692 0,0,0,0, |
4685 DW_HWND_OBJECT, | 4693 DW_HWND_OBJECT, |
4686 NULL, | 4694 NULL, |
4687 DWInstance, | 4695 DWInstance, |
4688 NULL); | 4696 NULL); |
4689 | 4697 |
4690 newbox->grouphwnd = CreateWindow(BUTTONCLASSNAME, | 4698 newbox->grouphwnd = CreateWindow(BUTTONCLASSNAME, |
4691 title, | 4699 title, |
4692 WS_CHILD | BS_GROUPBOX | | 4700 WS_CHILD | BS_GROUPBOX | |
4693 WS_VISIBLE | WS_CLIPCHILDREN, | 4701 WS_VISIBLE | WS_CLIPCHILDREN, |
4694 0,0,2000,1000, | 4702 0,0,0,0, |
4695 hwndframe, | 4703 hwndframe, |
4696 NULL, | 4704 NULL, |
4697 DWInstance, | 4705 DWInstance, |
4698 NULL); | 4706 NULL); |
4699 | 4707 |
4716 ccs.idFirstChild = 0; | 4724 ccs.idFirstChild = 0; |
4717 | 4725 |
4718 hwndframe = CreateWindow("MDICLIENT", | 4726 hwndframe = CreateWindow("MDICLIENT", |
4719 "", | 4727 "", |
4720 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, | 4728 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, |
4721 0,0,2000,1000, | 4729 0,0,0,0, |
4722 DW_HWND_OBJECT, | 4730 DW_HWND_OBJECT, |
4723 (HMENU)id, | 4731 (HMENU)id, |
4724 DWInstance, | 4732 DWInstance, |
4725 &ccs); | 4733 &ccs); |
4726 return hwndframe; | 4734 return hwndframe; |
4735 { | 4743 { |
4736 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) | 4744 #if (defined(BUILD_DLL) || defined(BUILD_HTML)) && !defined(__MINGW32__) |
4737 return CreateWindow(BrowserClassName, | 4745 return CreateWindow(BrowserClassName, |
4738 "", | 4746 "", |
4739 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, | 4747 WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS, |
4740 0,0,2000,1000, | 4748 0,0,0,0, |
4741 DW_HWND_OBJECT, | 4749 DW_HWND_OBJECT, |
4742 (HMENU)id, | 4750 (HMENU)id, |
4743 DWInstance, | 4751 DWInstance, |
4744 NULL); | 4752 NULL); |
4745 #else | 4753 #else |
4812 { | 4820 { |
4813 return CreateWindow(STATICCLASSNAME, | 4821 return CreateWindow(STATICCLASSNAME, |
4814 "", | 4822 "", |
4815 SS_BITMAP | SS_CENTERIMAGE | WS_VISIBLE | | 4823 SS_BITMAP | SS_CENTERIMAGE | WS_VISIBLE | |
4816 WS_CHILD | WS_CLIPCHILDREN, | 4824 WS_CHILD | WS_CLIPCHILDREN, |
4817 0,0,2000,1000, | 4825 0,0,0,0, |
4818 DW_HWND_OBJECT, | 4826 DW_HWND_OBJECT, |
4819 (HMENU)id, | 4827 (HMENU)id, |
4820 DWInstance, | 4828 DWInstance, |
4821 NULL); | 4829 NULL); |
4822 } | 4830 } |
4837 flags = TCS_BOTTOM; | 4845 flags = TCS_BOTTOM; |
4838 | 4846 |
4839 tmp = CreateWindow(WC_TABCONTROL, | 4847 tmp = CreateWindow(WC_TABCONTROL, |
4840 "", | 4848 "", |
4841 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | flags, | 4849 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | flags, |
4842 0,0,2000,1000, | 4850 0,0,0,0, |
4843 DW_HWND_OBJECT, | 4851 DW_HWND_OBJECT, |
4844 (HMENU)id, | 4852 (HMENU)id, |
4845 DWInstance, | 4853 DWInstance, |
4846 NULL); | 4854 NULL); |
4847 dw_window_set_data(tmp, "_dw_array", (void *)array); | 4855 dw_window_set_data(tmp, "_dw_array", (void *)array); |
5234 WS_VISIBLE | WS_CHILD | | 5242 WS_VISIBLE | WS_CHILD | |
5235 (multi ? 0 : LVS_SINGLESEL) | | 5243 (multi ? 0 : LVS_SINGLESEL) | |
5236 LVS_REPORT | LVS_SHOWSELALWAYS | | 5244 LVS_REPORT | LVS_SHOWSELALWAYS | |
5237 LVS_SHAREIMAGELISTS | WS_BORDER | | 5245 LVS_SHAREIMAGELISTS | WS_BORDER | |
5238 WS_CLIPCHILDREN, | 5246 WS_CLIPCHILDREN, |
5239 0,0,2000,1000, | 5247 0,0,0,0, |
5240 DW_HWND_OBJECT, | 5248 DW_HWND_OBJECT, |
5241 (HMENU)id, | 5249 (HMENU)id, |
5242 DWInstance, | 5250 DWInstance, |
5243 NULL); | 5251 NULL); |
5244 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); | 5252 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); |
5276 "", | 5284 "", |
5277 WS_VISIBLE | WS_CHILD | | 5285 WS_VISIBLE | WS_CHILD | |
5278 TVS_HASLINES | TVS_SHOWSELALWAYS | | 5286 TVS_HASLINES | TVS_SHOWSELALWAYS | |
5279 TVS_HASBUTTONS | TVS_LINESATROOT | | 5287 TVS_HASBUTTONS | TVS_LINESATROOT | |
5280 WS_BORDER | WS_CLIPCHILDREN, | 5288 WS_BORDER | WS_CLIPCHILDREN, |
5281 0,0,2000,1000, | 5289 0,0,0,0, |
5282 DW_HWND_OBJECT, | 5290 DW_HWND_OBJECT, |
5283 (HMENU)id, | 5291 (HMENU)id, |
5284 DWInstance, | 5292 DWInstance, |
5285 NULL); | 5293 NULL); |
5286 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); | 5294 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); |
5341 HWND tmp = CreateWindow(STATICCLASSNAME, | 5349 HWND tmp = CreateWindow(STATICCLASSNAME, |
5342 text, | 5350 text, |
5343 SS_NOPREFIX | | 5351 SS_NOPREFIX | |
5344 BS_TEXT | WS_VISIBLE | | 5352 BS_TEXT | WS_VISIBLE | |
5345 WS_CHILD | WS_CLIPCHILDREN, | 5353 WS_CHILD | WS_CLIPCHILDREN, |
5346 0,0,2000,1000, | 5354 0,0,0,0, |
5347 DW_HWND_OBJECT, | 5355 DW_HWND_OBJECT, |
5348 (HMENU)id, | 5356 (HMENU)id, |
5349 DWInstance, | 5357 DWInstance, |
5350 NULL); | 5358 NULL); |
5351 dw_window_set_font(tmp, DefaultFont); | 5359 dw_window_set_font(tmp, DefaultFont); |
5362 { | 5370 { |
5363 HWND tmp = CreateWindow(ObjectClassName, | 5371 HWND tmp = CreateWindow(ObjectClassName, |
5364 text, | 5372 text, |
5365 BS_TEXT | WS_VISIBLE | | 5373 BS_TEXT | WS_VISIBLE | |
5366 WS_CHILD | WS_CLIPCHILDREN, | 5374 WS_CHILD | WS_CLIPCHILDREN, |
5367 0,0,2000,1000, | 5375 0,0,0,0, |
5368 DW_HWND_OBJECT, | 5376 DW_HWND_OBJECT, |
5369 (HMENU)id, | 5377 (HMENU)id, |
5370 DWInstance, | 5378 DWInstance, |
5371 NULL); | 5379 NULL); |
5372 dw_window_set_font(tmp, DefaultFont); | 5380 dw_window_set_font(tmp, DefaultFont); |
5387 "", | 5395 "", |
5388 WS_VISIBLE | WS_BORDER | | 5396 WS_VISIBLE | WS_BORDER | |
5389 WS_VSCROLL | ES_MULTILINE | | 5397 WS_VSCROLL | ES_MULTILINE | |
5390 ES_WANTRETURN | WS_CHILD | | 5398 ES_WANTRETURN | WS_CHILD | |
5391 WS_CLIPCHILDREN, | 5399 WS_CLIPCHILDREN, |
5392 0,0,2000,1000, | 5400 0,0,0,0, |
5393 DW_HWND_OBJECT, | 5401 DW_HWND_OBJECT, |
5394 (HMENU)id, | 5402 (HMENU)id, |
5395 DWInstance, | 5403 DWInstance, |
5396 NULL); | 5404 NULL); |
5397 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); | 5405 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); |
5423 EDITCLASSNAME, | 5431 EDITCLASSNAME, |
5424 text, | 5432 text, |
5425 ES_WANTRETURN | WS_CHILD | | 5433 ES_WANTRETURN | WS_CHILD | |
5426 WS_BORDER | ES_AUTOHSCROLL | | 5434 WS_BORDER | ES_AUTOHSCROLL | |
5427 WS_VISIBLE | WS_CLIPCHILDREN, | 5435 WS_VISIBLE | WS_CLIPCHILDREN, |
5428 0,0,2000,1000, | 5436 0,0,0,0, |
5429 DW_HWND_OBJECT, | 5437 DW_HWND_OBJECT, |
5430 (HMENU)id, | 5438 (HMENU)id, |
5431 DWInstance, | 5439 DWInstance, |
5432 NULL); | 5440 NULL); |
5433 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); | 5441 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); |
5452 EDITCLASSNAME, | 5460 EDITCLASSNAME, |
5453 text, | 5461 text, |
5454 ES_WANTRETURN | WS_CHILD | | 5462 ES_WANTRETURN | WS_CHILD | |
5455 ES_PASSWORD | WS_BORDER | WS_VISIBLE | | 5463 ES_PASSWORD | WS_BORDER | WS_VISIBLE | |
5456 ES_AUTOHSCROLL | WS_CLIPCHILDREN, | 5464 ES_AUTOHSCROLL | WS_CLIPCHILDREN, |
5457 0,0,2000,1000, | 5465 0,0,0,0, |
5458 DW_HWND_OBJECT, | 5466 DW_HWND_OBJECT, |
5459 (HMENU)id, | 5467 (HMENU)id, |
5460 DWInstance, | 5468 DWInstance, |
5461 NULL); | 5469 NULL); |
5462 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); | 5470 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); |
5492 { | 5500 { |
5493 HWND tmp = CreateWindow(COMBOBOXCLASSNAME, | 5501 HWND tmp = CreateWindow(COMBOBOXCLASSNAME, |
5494 text, | 5502 text, |
5495 WS_CHILD | CBS_DROPDOWN | WS_VSCROLL | | 5503 WS_CHILD | CBS_DROPDOWN | WS_VSCROLL | |
5496 WS_CLIPCHILDREN | CBS_AUTOHSCROLL | WS_VISIBLE, | 5504 WS_CLIPCHILDREN | CBS_AUTOHSCROLL | WS_VISIBLE, |
5497 0,0,2000,1000, | 5505 0,0,0,0, |
5498 DW_HWND_OBJECT, | 5506 DW_HWND_OBJECT, |
5499 (HMENU)id, | 5507 (HMENU)id, |
5500 DWInstance, | 5508 DWInstance, |
5501 NULL); | 5509 NULL); |
5502 ColorInfo *cinfo = (ColorInfo *)calloc(1, sizeof(ColorInfo)); | 5510 ColorInfo *cinfo = (ColorInfo *)calloc(1, sizeof(ColorInfo)); |
5535 | 5543 |
5536 HWND tmp = CreateWindow(BUTTONCLASSNAME, | 5544 HWND tmp = CreateWindow(BUTTONCLASSNAME, |
5537 text, | 5545 text, |
5538 WS_CHILD | BS_PUSHBUTTON | | 5546 WS_CHILD | BS_PUSHBUTTON | |
5539 WS_VISIBLE | WS_CLIPCHILDREN, | 5547 WS_VISIBLE | WS_CLIPCHILDREN, |
5540 0,0,2000,1000, | 5548 0,0,0,0, |
5541 DW_HWND_OBJECT, | 5549 DW_HWND_OBJECT, |
5542 (HMENU)id, | 5550 (HMENU)id, |
5543 DWInstance, | 5551 DWInstance, |
5544 NULL); | 5552 NULL); |
5545 bubble->cinfo.fore = bubble->cinfo.back = -1; | 5553 bubble->cinfo.fore = bubble->cinfo.back = -1; |
5566 tmp = CreateWindow(BUTTONCLASSNAME, | 5574 tmp = CreateWindow(BUTTONCLASSNAME, |
5567 "", | 5575 "", |
5568 WS_CHILD | BS_PUSHBUTTON | | 5576 WS_CHILD | BS_PUSHBUTTON | |
5569 WS_VISIBLE | WS_CLIPCHILDREN | | 5577 WS_VISIBLE | WS_CLIPCHILDREN | |
5570 (icon ? BS_ICON : BS_BITMAP), | 5578 (icon ? BS_ICON : BS_BITMAP), |
5571 0,0,2000,1000, | 5579 0,0,0,0, |
5572 DW_HWND_OBJECT, | 5580 DW_HWND_OBJECT, |
5573 (HMENU)id, | 5581 (HMENU)id, |
5574 DWInstance, | 5582 DWInstance, |
5575 NULL); | 5583 NULL); |
5576 | 5584 |
5625 #endif | 5633 #endif |
5626 | 5634 |
5627 tmp = CreateWindow( BUTTONCLASSNAME, | 5635 tmp = CreateWindow( BUTTONCLASSNAME, |
5628 "", | 5636 "", |
5629 windowtype | WS_CHILD | BS_PUSHBUTTON | WS_CLIPCHILDREN | WS_VISIBLE, | 5637 windowtype | WS_CHILD | BS_PUSHBUTTON | WS_CLIPCHILDREN | WS_VISIBLE, |
5630 0,0,2000,1000, | 5638 0,0,0,0, |
5631 DW_HWND_OBJECT, | 5639 DW_HWND_OBJECT, |
5632 (HMENU)id, | 5640 (HMENU)id, |
5633 DWInstance, | 5641 DWInstance, |
5634 NULL); | 5642 NULL); |
5635 | 5643 |
5708 tmp = CreateWindow( BUTTONCLASSNAME, | 5716 tmp = CreateWindow( BUTTONCLASSNAME, |
5709 "", | 5717 "", |
5710 WS_CHILD | BS_PUSHBUTTON | | 5718 WS_CHILD | BS_PUSHBUTTON | |
5711 windowtype | WS_CLIPCHILDREN | | 5719 windowtype | WS_CLIPCHILDREN | |
5712 WS_VISIBLE, | 5720 WS_VISIBLE, |
5713 0,0,2000,1000, | 5721 0,0,0,0, |
5714 DW_HWND_OBJECT, | 5722 DW_HWND_OBJECT, |
5715 (HMENU)id, | 5723 (HMENU)id, |
5716 DWInstance, | 5724 DWInstance, |
5717 NULL ); | 5725 NULL ); |
5718 | 5726 |
5745 HWND buddy = CreateWindowEx(WS_EX_CLIENTEDGE, | 5753 HWND buddy = CreateWindowEx(WS_EX_CLIENTEDGE, |
5746 EDITCLASSNAME, | 5754 EDITCLASSNAME, |
5747 text, | 5755 text, |
5748 WS_CHILD | WS_BORDER | WS_VISIBLE | | 5756 WS_CHILD | WS_BORDER | WS_VISIBLE | |
5749 ES_NUMBER | WS_CLIPCHILDREN, | 5757 ES_NUMBER | WS_CLIPCHILDREN, |
5750 0,0,2000,1000, | 5758 0,0,0,0, |
5751 DW_HWND_OBJECT, | 5759 DW_HWND_OBJECT, |
5752 NULL, | 5760 NULL, |
5753 DWInstance, | 5761 DWInstance, |
5754 NULL); | 5762 NULL); |
5755 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, | 5763 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, |
5756 UPDOWN_CLASS, | 5764 UPDOWN_CLASS, |
5757 NULL, | 5765 NULL, |
5758 WS_CHILD | UDS_ALIGNRIGHT | WS_BORDER | | 5766 WS_CHILD | UDS_ALIGNRIGHT | WS_BORDER | |
5759 UDS_ARROWKEYS | UDS_SETBUDDYINT | | 5767 UDS_ARROWKEYS | UDS_SETBUDDYINT | |
5760 UDS_WRAP | UDS_NOTHOUSANDS | WS_VISIBLE, | 5768 UDS_WRAP | UDS_NOTHOUSANDS | WS_VISIBLE, |
5761 0,0,2000,1000, | 5769 0,0,0,0, |
5762 DW_HWND_OBJECT, | 5770 DW_HWND_OBJECT, |
5763 (HMENU)id, | 5771 (HMENU)id, |
5764 DWInstance, | 5772 DWInstance, |
5765 NULL); | 5773 NULL); |
5766 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); | 5774 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); |
5799 { | 5807 { |
5800 HWND tmp = CreateWindow(BUTTONCLASSNAME, | 5808 HWND tmp = CreateWindow(BUTTONCLASSNAME, |
5801 text, | 5809 text, |
5802 WS_CHILD | BS_AUTORADIOBUTTON | | 5810 WS_CHILD | BS_AUTORADIOBUTTON | |
5803 WS_CLIPCHILDREN | WS_VISIBLE, | 5811 WS_CLIPCHILDREN | WS_VISIBLE, |
5804 0,0,2000,1000, | 5812 0,0,0,0, |
5805 DW_HWND_OBJECT, | 5813 DW_HWND_OBJECT, |
5806 (HMENU)id, | 5814 (HMENU)id, |
5807 DWInstance, | 5815 DWInstance, |
5808 NULL); | 5816 NULL); |
5809 BubbleButton *bubble = calloc(1, sizeof(BubbleButton)); | 5817 BubbleButton *bubble = calloc(1, sizeof(BubbleButton)); |
5826 { | 5834 { |
5827 HWND tmp = CreateWindow(TRACKBAR_CLASS, | 5835 HWND tmp = CreateWindow(TRACKBAR_CLASS, |
5828 "", | 5836 "", |
5829 WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | | 5837 WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | |
5830 (vertical ? TBS_VERT : TBS_HORZ), | 5838 (vertical ? TBS_VERT : TBS_HORZ), |
5831 0,0,2000,1000, | 5839 0,0,0,0, |
5832 DW_HWND_OBJECT, | 5840 DW_HWND_OBJECT, |
5833 (HMENU)id, | 5841 (HMENU)id, |
5834 DWInstance, | 5842 DWInstance, |
5835 NULL); | 5843 NULL); |
5836 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); | 5844 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); |
5854 { | 5862 { |
5855 HWND tmp = CreateWindow(SCROLLBARCLASSNAME, | 5863 HWND tmp = CreateWindow(SCROLLBARCLASSNAME, |
5856 "", | 5864 "", |
5857 WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | | 5865 WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | |
5858 (vertical ? SBS_VERT : SBS_HORZ), | 5866 (vertical ? SBS_VERT : SBS_HORZ), |
5859 0,0,2000,1000, | 5867 0,0,0,0, |
5860 DW_HWND_OBJECT, | 5868 DW_HWND_OBJECT, |
5861 (HMENU)id, | 5869 (HMENU)id, |
5862 DWInstance, | 5870 DWInstance, |
5863 NULL); | 5871 NULL); |
5864 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); | 5872 ColorInfo *cinfo = calloc(1, sizeof(ColorInfo)); |
5879 HWND API dw_percent_new(ULONG id) | 5887 HWND API dw_percent_new(ULONG id) |
5880 { | 5888 { |
5881 return CreateWindow(PROGRESS_CLASS, | 5889 return CreateWindow(PROGRESS_CLASS, |
5882 "", | 5890 "", |
5883 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, | 5891 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, |
5884 0,0,2000,1000, | 5892 0,0,0,0, |
5885 DW_HWND_OBJECT, | 5893 DW_HWND_OBJECT, |
5886 (HMENU)id, | 5894 (HMENU)id, |
5887 DWInstance, | 5895 DWInstance, |
5888 NULL); | 5896 NULL); |
5889 } | 5897 } |
5899 BubbleButton *bubble = calloc(1, sizeof(BubbleButton)); | 5907 BubbleButton *bubble = calloc(1, sizeof(BubbleButton)); |
5900 HWND tmp = CreateWindow(BUTTONCLASSNAME, | 5908 HWND tmp = CreateWindow(BUTTONCLASSNAME, |
5901 text, | 5909 text, |
5902 WS_CHILD | BS_AUTOCHECKBOX | | 5910 WS_CHILD | BS_AUTOCHECKBOX | |
5903 BS_TEXT | WS_CLIPCHILDREN | WS_VISIBLE, | 5911 BS_TEXT | WS_CLIPCHILDREN | WS_VISIBLE, |
5904 0,0,2000,1000, | 5912 0,0,0,0, |
5905 DW_HWND_OBJECT, | 5913 DW_HWND_OBJECT, |
5906 (HMENU)id, | 5914 (HMENU)id, |
5907 DWInstance, | 5915 DWInstance, |
5908 NULL); | 5916 NULL); |
5909 bubble->checkbox = 1; | 5917 bubble->checkbox = 1; |
5927 "", | 5935 "", |
5928 WS_VISIBLE | LBS_NOINTEGRALHEIGHT | | 5936 WS_VISIBLE | LBS_NOINTEGRALHEIGHT | |
5929 WS_CHILD | LBS_HASSTRINGS | | 5937 WS_CHILD | LBS_HASSTRINGS | |
5930 LBS_NOTIFY | WS_BORDER | WS_CLIPCHILDREN | | 5938 LBS_NOTIFY | WS_BORDER | WS_CLIPCHILDREN | |
5931 WS_VSCROLL | (multi ? LBS_MULTIPLESEL : 0) , | 5939 WS_VSCROLL | (multi ? LBS_MULTIPLESEL : 0) , |
5932 0,0,2000,1000, | 5940 0,0,0,0, |
5933 DW_HWND_OBJECT, | 5941 DW_HWND_OBJECT, |
5934 (HMENU)id, | 5942 (HMENU)id, |
5935 DWInstance, | 5943 DWInstance, |
5936 NULL); | 5944 NULL); |
5937 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); | 5945 ContainerInfo *cinfo = (ContainerInfo *)calloc(1, sizeof(ContainerInfo)); |
8583 | 8591 |
8584 ListView_GetItem( handle, &lvi ); | 8592 ListView_GetItem( handle, &lvi ); |
8585 | 8593 |
8586 if ( (textcomp && lvi.lParam && strcmp( (char *)lvi.lParam, text ) == 0) || (!textcomp && (char *)lvi.lParam == text) ) | 8594 if ( (textcomp && lvi.lParam && strcmp( (char *)lvi.lParam, text ) == 0) || (!textcomp && (char *)lvi.lParam == text) ) |
8587 { | 8595 { |
8588 | 8596 unsigned long width, height; |
8597 | |
8589 ListView_SetItemState( handle, index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED ); | 8598 ListView_SetItemState( handle, index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED ); |
8599 dw_window_get_pos_size( handle, NULL, NULL, &width, &height); | |
8600 if(width < 10 || height < 10) | |
8601 dw_window_set_data( handle, "_dw_cursor", DW_INT_TO_POINTER(index) ); | |
8590 ListView_EnsureVisible( handle, index, TRUE ); | 8602 ListView_EnsureVisible( handle, index, TRUE ); |
8591 return; | 8603 return; |
8592 } | 8604 } |
8593 | 8605 |
8594 index = ListView_GetNextItem( handle, index, LVNI_ALL ); | 8606 index = ListView_GetNextItem( handle, index, LVNI_ALL ); |
10031 HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) | 10043 HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) |
10032 { | 10044 { |
10033 HWND tmp = CreateWindow(SplitbarClassName, | 10045 HWND tmp = CreateWindow(SplitbarClassName, |
10034 "", | 10046 "", |
10035 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, | 10047 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN, |
10036 0,0,2000,1000, | 10048 0,0,0,0, |
10037 DW_HWND_OBJECT, | 10049 DW_HWND_OBJECT, |
10038 (HMENU)id, | 10050 (HMENU)id, |
10039 DWInstance, | 10051 DWInstance, |
10040 NULL); | 10052 NULL); |
10041 | 10053 |
10108 MONTHDAYSTATE mds[3]; | 10120 MONTHDAYSTATE mds[3]; |
10109 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, | 10121 HWND tmp = CreateWindowEx(WS_EX_CLIENTEDGE, |
10110 MONTHCAL_CLASS, | 10122 MONTHCAL_CLASS, |
10111 "", | 10123 "", |
10112 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | MCS_DAYSTATE, | 10124 WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | MCS_DAYSTATE, |
10113 0,0,2000,1000, // resize it later | 10125 0,0,0,0, |
10114 DW_HWND_OBJECT, | 10126 DW_HWND_OBJECT, |
10115 (HMENU)id, | 10127 (HMENU)id, |
10116 DWInstance, | 10128 DWInstance, |
10117 NULL); | 10129 NULL); |
10118 if ( tmp ) | 10130 if ( tmp ) |