Changeset 95 for trunk/src/helpers/dialog.c
- Timestamp:
- Aug 7, 2001, 11:34:30 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/dialog.c
r91 r95 218 218 #define PM_GROUP_SPACING_TOP 20 219 219 220 VOIDProcessTable(PTABLEDEF pTableDef,221 const CONTROLPOS *pcpTable,222 PROCESSMODE ProcessMode,223 PDLGPRIVATE pDlgData);220 APIRET ProcessTable(PTABLEDEF pTableDef, 221 const CONTROLPOS *pcpTable, 222 PROCESSMODE ProcessMode, 223 PDLGPRIVATE pDlgData); 224 224 225 225 /* … … 436 436 */ 437 437 438 VOID ProcessColumn(PCOLUMNDEF pColumnDef, 439 PROWDEF pOwningRow, // in: current row from ProcessRow 440 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 441 PLONG plX, // in/out: PROCESS_CALC_POSITIONS only 442 PDLGPRIVATE pDlgData) 443 { 438 APIRET ProcessColumn(PCOLUMNDEF pColumnDef, 439 PROWDEF pOwningRow, // in: current row from ProcessRow 440 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 441 PLONG plX, // in/out: PROCESS_CALC_POSITIONS only 442 PDLGPRIVATE pDlgData) 443 { 444 APIRET arc = NO_ERROR; 445 444 446 pColumnDef->pOwningRow = pOwningRow; 445 447 … … 604 606 605 607 // recurse!! 606 ProcessTable(pTableDef, 607 NULL, 608 ProcessMode, 609 pDlgData); 610 611 // should we create a PM control around the table? 612 // (do this AFTER the other controls from recursing, 613 // otherwise the stupid container doesn't show up) 614 if (pTableDef->pCtlDef) 608 if (!(arc = ProcessTable(pTableDef, 609 NULL, 610 ProcessMode, 611 pDlgData))) 615 612 { 616 // yes: 617 pcp = &pColumnDef->cpColumn; // !! not control 618 pControlDef = pTableDef->pCtlDef; 619 pcszTitle = pControlDef->pcszText; 620 flStyle = pControlDef->flStyle; 613 // should we create a PM control around the table? 614 // (do this AFTER the other controls from recursing, 615 // otherwise the stupid container doesn't show up) 616 if (pTableDef->pCtlDef) 617 { 618 // yes: 619 pcp = &pColumnDef->cpColumn; // !! not control 620 pControlDef = pTableDef->pCtlDef; 621 pcszTitle = pControlDef->pcszText; 622 flStyle = pControlDef->flStyle; 623 } 621 624 } 625 else 626 break; 622 627 } 623 628 else … … 662 667 (PVOID)pcszFont); */ 663 668 664 pColumnDef->hwndControl669 if (pColumnDef->hwndControl 665 670 = WinCreateWindow(pDlgData->hwndDlg, // parent 666 671 (PSZ)pControlDef->pcszClass, … … 677 682 pControlDef->usID, 678 683 pControlDef->pvCtlData, 679 NULL); // ppp); 680 681 if ((pColumnDef->hwndControl) && (lHandleSet)) 684 NULL)) 682 685 { 683 // subclass the damn static 684 if ((flOld & 0x0F) == SS_ICON) 685 // this was a static: 686 ctlPrepareStaticIcon(pColumnDef->hwndControl, 687 1); 686 if (lHandleSet) 687 { 688 // subclass the damn static 689 if ((flOld & 0x0F) == SS_ICON) 690 // this was a static: 691 ctlPrepareStaticIcon(pColumnDef->hwndControl, 692 1); 693 else 694 // this was a bitmap: 695 ctlPrepareStretchedBitmap(pColumnDef->hwndControl, 696 TRUE); 697 698 WinSendMsg(pColumnDef->hwndControl, 699 SM_SETHANDLE, 700 (MPARAM)lHandleSet, 701 0); 702 } 688 703 else 689 // this was a bitmap: 690 ctlPrepareStretchedBitmap(pColumnDef->hwndControl, 691 TRUE); 692 693 WinSendMsg(pColumnDef->hwndControl, 694 SM_SETHANDLE, 695 (MPARAM)lHandleSet, 696 0); 697 } 698 else 699 if (pcszFont) 700 // we must set the font explicitly here... 701 // doesn't always work with WinCreateWindow 702 // presparams parameter, for some reason 703 // V0.9.12 (2001-05-31) [umoeller] 704 winhSetWindowFont(pColumnDef->hwndControl, 705 pcszFont); 706 707 if (pColumnDef->hwndControl) 708 { 704 if (pcszFont) 705 // we must set the font explicitly here... 706 // doesn't always work with WinCreateWindow 707 // presparams parameter, for some reason 708 // V0.9.12 (2001-05-31) [umoeller] 709 winhSetWindowFont(pColumnDef->hwndControl, 710 pcszFont); 711 709 712 lstAppendItem(&pDlgData->llControls, 710 713 pColumnDef); … … 717 720 pDlgData->hwndFirstFocus = pColumnDef->hwndControl; 718 721 } 722 else 723 // V0.9.14 (2001-08-03) [umoeller] 724 arc = DLGERR_CANNOT_CREATE_CONTROL; 719 725 } 720 726 break; } 721 727 } 722 728 729 return (arc); 723 730 } 724 731 … … 732 739 */ 733 740 734 VOIDProcessRow(PROWDEF pRowDef,735 PTABLEDEF pOwningTable, // in: current table from ProcessTable736 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll)737 PLONG plY, // in/out: current y position (decremented)738 PDLGPRIVATE pDlgData)739 { 740 // ULONG ul;741 APIRET ProcessRow(PROWDEF pRowDef, 742 PTABLEDEF pOwningTable, // in: current table from ProcessTable 743 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 744 PLONG plY, // in/out: current y position (decremented) 745 PDLGPRIVATE pDlgData) 746 { 747 APIRET arc = NO_ERROR; 741 748 LONG lX; 742 749 PLISTNODE pNode; … … 767 774 PCOLUMNDEF pColumnDefThis = (PCOLUMNDEF)pNode->pItemData; 768 775 769 ProcessColumn(pColumnDefThis, pRowDef, ProcessMode, &lX, pDlgData); 770 771 if (ProcessMode == PROCESS_CALC_SIZES) 772 { 773 // row width = sum of all columns 774 pRowDef->cpRow.cx += pColumnDefThis->cpColumn.cx; 775 776 // row height = maximum height of a column 777 if (pRowDef->cpRow.cy < pColumnDefThis->cpColumn.cy) 778 pRowDef->cpRow.cy = pColumnDefThis->cpColumn.cy; 779 } 780 } 776 if (!(arc = ProcessColumn(pColumnDefThis, pRowDef, ProcessMode, &lX, pDlgData))) 777 { 778 if (ProcessMode == PROCESS_CALC_SIZES) 779 { 780 // row width = sum of all columns 781 pRowDef->cpRow.cx += pColumnDefThis->cpColumn.cx; 782 783 // row height = maximum height of a column 784 if (pRowDef->cpRow.cy < pColumnDefThis->cpColumn.cy) 785 pRowDef->cpRow.cy = pColumnDefThis->cpColumn.cy; 786 } 787 } 788 } 789 790 return (arc); 781 791 } 782 792 … … 802 812 */ 803 813 804 VOIDProcessTable(PTABLEDEF pTableDef,805 const CONTROLPOS *pcpTable, // in: table position with PROCESS_CALC_POSITIONS806 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll)807 PDLGPRIVATE pDlgData)808 { 809 // ULONG ul;814 APIRET ProcessTable(PTABLEDEF pTableDef, 815 const CONTROLPOS *pcpTable, // in: table position with PROCESS_CALC_POSITIONS 816 PROCESSMODE ProcessMode, // in: processing mode (see ProcessAll) 817 PDLGPRIVATE pDlgData) 818 { 819 APIRET arc = NO_ERROR; 810 820 LONG lY; 811 821 PLISTNODE pNode; … … 829 839 PROWDEF pRowDefThis = (PROWDEF)pNode->pItemData; 830 840 831 ProcessRow(pRowDefThis, pTableDef, ProcessMode, &lY, pDlgData); 832 833 if (ProcessMode == PROCESS_CALC_SIZES) 834 { 835 // table width = maximum width of a row 836 if (pTableDef->cpTable.cx < pRowDefThis->cpRow.cx) 837 pTableDef->cpTable.cx = pRowDefThis->cpRow.cx; 838 839 // table height = sum of all rows 840 pTableDef->cpTable.cy += pRowDefThis->cpRow.cy; 841 } 842 } 841 if (!(arc = ProcessRow(pRowDefThis, pTableDef, ProcessMode, &lY, pDlgData))) 842 { 843 if (ProcessMode == PROCESS_CALC_SIZES) 844 { 845 // table width = maximum width of a row 846 if (pTableDef->cpTable.cx < pRowDefThis->cpRow.cx) 847 pTableDef->cpTable.cx = pRowDefThis->cpRow.cx; 848 849 // table height = sum of all rows 850 pTableDef->cpTable.cy += pRowDefThis->cpRow.cy; 851 } 852 } 853 else 854 break; 855 } 856 857 return (arc); 843 858 } 844 859 … … 876 891 */ 877 892 878 VOIDProcessAll(PDLGPRIVATE pDlgData,879 PSIZEL pszlClient,880 PROCESSMODE ProcessMode)881 { 882 // ULONG ul;893 APIRET ProcessAll(PDLGPRIVATE pDlgData, 894 PSIZEL pszlClient, 895 PROCESSMODE ProcessMode) 896 { 897 APIRET arc = NO_ERROR; 883 898 PLISTNODE pNode; 884 899 CONTROLPOS cpTable; … … 908 923 } 909 924 910 ProcessTable(pTableDefThis, 911 &cpTable, // start pos 912 ProcessMode, 913 pDlgData); 914 915 if (ProcessMode == PROCESS_CALC_SIZES) 916 { 917 pszlClient->cx += pTableDefThis->cpTable.cx; 918 pszlClient->cy += pTableDefThis->cpTable.cy; 919 } 920 } 925 if (!(arc = ProcessTable(pTableDefThis, 926 &cpTable, // start pos 927 ProcessMode, 928 pDlgData))) 929 { 930 if (ProcessMode == PROCESS_CALC_SIZES) 931 { 932 pszlClient->cx += pTableDefThis->cpTable.cx; 933 pszlClient->cy += pTableDefThis->cpTable.cy; 934 } 935 } 936 } 937 938 return (arc); 921 939 } 922 940
Note:
See TracChangeset
for help on using the changeset viewer.