Changeset 155 for trunk/src/helpers/dialog.c
- Timestamp:
- Apr 17, 2002, 10:11:38 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dialog.c
r153 r155 46 46 #define INCL_WINWINDOWMGR 47 47 #define INCL_WINFRAMEMGR 48 #define INCL_WINPOINTERS 49 #define INCL_WININPUT 48 50 #define INCL_WINDIALOGS 49 #define INCL_WININPUT50 51 #define INCL_WINSTATICS 51 52 #define INCL_WINBUTTONS … … 123 124 LONG lcidLast; 124 125 FONTMETRICS fmLast; 126 127 LONG cxBorder, 128 cyBorder; // cached now V0.9.19 (2002-04-17) [umoeller] 125 129 126 130 } DLGPRIVATE, *PDLGPRIVATE; … … 409 413 else if (!(pControlDef->flStyle & BS_USERBUTTON)) 410 414 { 411 pszlAuto->cx += (2 * WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER)+ 15);412 pszlAuto->cy += (2 * WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER)+ 15);415 pszlAuto->cx += (2 * pDlgData->cxBorder + 15); 416 pszlAuto->cy += (2 * pDlgData->cyBorder + 15); 413 417 } 414 418 } … … 477 481 PDLGPRIVATE pDlgData) 478 482 { 479 APIRET arc = NO_ERROR;480 483 APIRET arc = NO_ERROR; 484 PCONTROLDEF pControlDef = NULL; 481 485 ULONG ulExtraCX = 0, 482 486 ulExtraCY = 0; 487 483 488 if (pColumnDef->fIsNestedTable) 484 489 { … … 519 524 { 520 525 // no nested table, but control: 521 PCONTROLDEF pControlDef = (PCONTROLDEF)pColumnDef->pvDefinition;522 526 SIZEL szlAuto; 527 528 pControlDef = (PCONTROLDEF)pColumnDef->pvDefinition; 523 529 524 530 // do auto-size calculations only on the first loop … … 576 582 } // end if (ProcessMode == PROCESS_1_CALC_SIZES) 577 583 578 579 584 ulExtraCX 580 585 = ulExtraCY … … 586 591 pColumnDef->cpColumn.cy = pColumnDef->cpControl.cy 587 592 + ulExtraCY; 593 594 if ( (pControlDef) 595 && ((ULONG)pControlDef->pcszClass == 0xffff0002L) 596 ) 597 { 598 // hack the stupid drop-down combobox where the 599 // size of the drop-down is the full size of the 600 // control: when creating the control, we _do_ 601 // specify the full size, but for the column, 602 // we must rather use a single line with 603 // the current font 604 // V0.9.19 (2002-04-17) [umoeller] 605 if (pControlDef->flStyle & (CBS_DROPDOWN | CBS_DROPDOWNLIST)) 606 { 607 LONG cyMargin = 3 * pDlgData->cyBorder; 608 609 SetDlgFont(pControlDef, pDlgData); 610 611 pColumnDef->cpColumn.cy 612 = pDlgData->fmLast.lMaxBaselineExt 613 + pDlgData->fmLast.lExternalLeading 614 + 2 * cyMargin 615 + ulExtraCY; 616 } 617 } 588 618 589 619 return (arc); … … 802 832 803 833 case 0xffff0002L: // combobox 804 // hack the stupid drop-down combobox which doesn't 805 // expand otherwise (the size of the drop-down is 806 // the full size of the control... duh) 834 { 807 835 if (flStyle & (CBS_DROPDOWN | CBS_DROPDOWNLIST)) 808 836 { 809 y -= 100; 810 cy += 100; 837 // in ColumnCalcSizes, we have set pColumnDef->cpColumn.cy 838 // to the height of a single line to get the position 839 // calculations right... 840 // present cy is pColumnDef->cpControl.cy, 841 // the user-specified size of the expanded combo 842 // present y is the bottom of the combo's entry field 843 ULONG cyDelta = pColumnDef->cpControl.cy - pColumnDef->cpColumn.cy; 844 _Pmpf((__FUNCTION__ ": combo cpColumn.cy = %d, cpControl.cy = %d", 845 pColumnDef->cpColumn.cy, 846 pColumnDef->cpControl.cy)); 847 _Pmpf((" cyDelta = %d", cyDelta)); 848 y -= cyDelta + 3 * pDlgData->cyBorder + pControlDef->ulSpacing; 849 // cy += cyDelta; 811 850 } 851 } 812 852 break; 813 853 … … 819 859 if (flStyle & ES_MARGIN) 820 860 { 821 LONG cxMargin = 3 * WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER);822 LONG cyMargin = 3 * WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER);861 LONG cxMargin = 3 * pDlgData->cxBorder; 862 LONG cyMargin = 3 * pDlgData->cyBorder; 823 863 824 864 x += cxMargin; … … 877 917 NULL, 878 918 NULL); 919 winhSetPresColor(hwndDebug, PP_FOREGROUNDCOLOR, RGBCOL_DARKGREEN); 920 921 /* 922 // and another one for the control size 923 hwndDebug = 924 WinCreateWindow(pDlgData->hwndDlg, // parent 925 WC_STATIC, 926 "", 927 WS_VISIBLE | SS_FGNDFRAME, 928 pColumnDef->cpControl.x + pDlgData->ptlTotalOfs.x, 929 pColumnDef->cpControl.y + pDlgData->ptlTotalOfs.y, 930 pColumnDef->cpControl.cx, 931 pColumnDef->cpControl.cy, 932 pDlgData->hwndDlg, // owner 933 HWND_BOTTOM, 934 -1, 935 NULL, 936 NULL); 879 937 winhSetPresColor(hwndDebug, PP_FOREGROUNDCOLOR, RGBCOL_RED); 938 */ 880 939 } 881 940 #endif … … 1472 1531 1473 1532 pDlgData->pcszControlsFont = pcszControlsFont; 1533 1534 // cache these now too V0.9.19 (2002-04-17) [umoeller] 1535 pDlgData->cxBorder = WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER); 1536 pDlgData->cyBorder = WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER); 1474 1537 1475 1538 *ppDlgData = pDlgData; … … 1799 1862 * A regular standard dialog would use something like 1800 1863 * 1801 + FCF_TITLEBAR | FCF_SYSMENU | FCF_DLGBORDER | FCF_NOBYTEALIGN 1864 + FCF_TITLEBAR | FCF_SYSMENU | FCF_DLGBORDER | FCF_NOBYTEALIGN | FCF_CLOSEBUTTON 1802 1865 * 1803 1866 * for flCreateFlags. To make the dlg sizeable, specify 1804 1867 * FCF_SIZEBORDER instead of FCF_DLGBORDER. 1868 * 1869 * dialog.h defines FCF_FIXED_DLG and FCF_SIZEABLE_DLG 1870 * to make this more handy. 1805 1871 * 1806 1872 * <B>Usage:</B>
Note:
See TracChangeset
for help on using the changeset viewer.