Changeset 95
- Timestamp:
- Aug 7, 2001, 11:34:30 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/dialog.h
r85 r95 50 50 #define DLGERR_TABLE_NOT_CLOSED (DLGERR_FIRST + 5) 51 51 #define DLGERR_TOO_MANY_TABLES_CLOSED (DLGERR_FIRST + 6) 52 #define DLGERR_CANNOT_CREATE_CONTROL (DLGERR_FIRST + 7) 52 53 53 54 /* ****************************************************************** … … 172 173 // -- with TYPE_CONTROL_DEF: _CONTROLDEF pointer to a control definition 173 174 } DLGHITEM, *PDLGHITEM; 175 176 /* ****************************************************************** 177 * 178 * Macros 179 * 180 ********************************************************************/ 181 182 #define CONTROLDEF_GROUP(pcsz, id) { WC_STATIC, pcsz, \ 183 WS_VISIBLE | SS_GROUPBOX | DT_MNEMONIC, \ 184 id, CTL_COMMON_FONT, 0, { -1, -1 }, 0 } 185 186 #define CONTROLDEF_TEXT(pcsz, id, cx, cy) { WC_STATIC, pcsz, \ 187 WS_VISIBLE | SS_TEXT | DT_LEFT | DT_VCENTER | DT_MNEMONIC, \ 188 id, CTL_COMMON_FONT, 0, {cx, cy}, 5 } 189 190 #define CONTROLDEF_DEFPUSHBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \ 191 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | BS_DEFAULT, \ 192 id, CTL_COMMON_FONT, 0, {cx, cy}, 5 } 193 194 #define CONTROLDEF_PUSHBUTTON(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \ 195 WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, \ 196 id, CTL_COMMON_FONT, 0, {cx, cy}, 5 } 197 198 #define CONTROLDEF_AUTOCHECKBOX(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \ 199 WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, \ 200 id, CTL_COMMON_FONT, 0, { cx, cy }, 5 } 201 202 #define CONTROLDEF_FIRST_AUTORADIO(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \ 203 WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON | WS_GROUP, \ 204 id, CTL_COMMON_FONT, 0, { cx, cy }, 5 } 205 206 #define CONTROLDEF_NEXT_AUTORADIO(pcsz, id, cx, cy) { WC_BUTTON, pcsz, \ 207 WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, \ 208 id, CTL_COMMON_FONT, 0, { cx, cy }, 5 } 209 210 #define CONTROLDEF_ENTRYFIELD(pcsz, id, cx, cy) { WC_ENTRYFIELD, pcsz, \ 211 WS_VISIBLE | WS_TABSTOP | ES_MARGIN, \ 212 id, CTL_COMMON_FONT, 0, { cx, cy }, 5 } 213 214 #define CONTROLDEF_SPINBUTTON(id, cx, cy) { WC_SPINBUTTON, NULL, \ 215 WS_VISIBLE | WS_TABSTOP | SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTCENTER | SPBS_FASTSPIN, \ 216 id, CTL_COMMON_FONT, 0, {cx, cy}, 5 } 174 217 175 218 /* ****************************************************************** -
trunk/src/helpers/apps.c
r91 r95 570 570 *@@added V0.9.9 (2001-03-07) [umoeller] 571 571 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from winh.c to apps.c 572 *@@changed V0.9.14 (2001-08-07) [pr]: use FAPPTYP_* constants 572 573 */ 573 574 … … 583 584 if (_ulDosAppType == 0) 584 585 *pulWinAppType = PROG_FULLSCREEN; 585 else if (_ulDosAppType & 0x40)586 else if (_ulDosAppType & FAPPTYP_PHYSDRV) // 0x40 586 587 *pulWinAppType = PROG_PDD; 587 else if (_ulDosAppType & 0x80)588 else if (_ulDosAppType & FAPPTYP_VIRTDRV) // 0x80) 588 589 *pulWinAppType = PROG_VDD; 589 else if ((_ulDosAppType & 0xF0) == 0x10)590 else if ((_ulDosAppType & 0xF0) == FAPPTYP_DLL) // 0x10) 590 591 // DLL bit set 591 592 *pulWinAppType = PROG_XWP_DLL; 592 else if (_ulDosAppType & 0x20)593 else if (_ulDosAppType & FAPPTYP_DOS) // 0x20) 593 594 // DOS bit set? 594 595 *pulWinAppType = PROG_WINDOWEDVDM; 595 else if ((_ulDosAppType & 0x0003) ==0x0003) // "Window-API" == PM596 else if ((_ulDosAppType & FAPPTYP_WINDOWAPI) == FAPPTYP_WINDOWAPI) // 0x0003) // "Window-API" == PM 596 597 *pulWinAppType = PROG_PM; 597 else if ( ((_ulDosAppType & 0xFFFF) == 0x1000) // windows program (?!?)598 || ((_ulDosAppType & 0xFFFF) == 0x0400) // windows program (?!?)598 else if ( ((_ulDosAppType & 0xFFFF) == FAPPTYP_WINDOWSPROT31) // 0x1000) // windows program (?!?) 599 || ((_ulDosAppType & 0xFFFF) == FAPPTYP_WINDOWSPROT) // ) // windows program (?!?) 599 600 ) 600 *pulWinAppType = PROG_31_ENH ;601 *pulWinAppType = PROG_31_ENHSEAMLESSCOMMON; // PROG_31_ENH; 601 602 // *pulWinAppType = PROG_31_ENHSEAMLESSVDM; 602 else if ((_ulDosAppType & 0x03) ==0x02)603 else if ((_ulDosAppType & FAPPTYP_WINDOWAPI /* 0x03 */ ) == FAPPTYP_WINDOWCOMPAT) // 0x02) 603 604 *pulWinAppType = PROG_WINDOWABLEVIO; 604 else if ((_ulDosAppType & 0x03) ==0x01)605 else if ((_ulDosAppType & FAPPTYP_WINDOWAPI /* 0x03 */ ) == FAPPTYP_NOTWINDOWCOMPAT) // 0x01) 605 606 *pulWinAppType = PROG_FULLSCREEN; 606 607 } … … 762 763 *@@changed V0.9.12 (2001-05-26) [umoeller]: fixed PROG_DEFAULT 763 764 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from winh.c to apps.c 765 *@@changed V0.9.14 (2001-08-07) [pr]: removed some env. strings for Win. apps. 764 766 */ 765 767 … … 931 933 "KBD_CTRL_BYPASS=CTRL_ESC", 932 934 FALSE); // add last 935 /* 936 * These should be set by the default environment. It is 937 * not our business to override them really. V0.9.14 938 * 933 939 appSetEnvironmentVar(&Env, 934 940 "KBD_ALTHOME_BYPASS=1", … … 952 958 "VIDEO_8514A_XGA_IOTRAP=0", 953 959 FALSE); // add last 960 */ 954 961 955 962 if (!appConvertEnvironment(&Env, -
trunk/src/helpers/cctl_chart.c
r91 r95 50 50 * against the sum of all values. In other words, 51 51 * 52 + (dValue / dTotal) == (sizeSli ze / sizeTotal).52 + (dValue / dTotal) == (sizeSlice / sizeTotal). 53 53 * 54 54 * The display depends on whether the chart control operates in … … 651 651 // specified with GpiPartialArc (while GpiFullArc 652 652 // uses the current pen position... 653 // Who created these APIs?!? This might be a most 654 // flexible way to do things, but where's the 655 // simple stuff?!?) 653 // Who created these APIs?!?) 656 654 ap.lP = ptlCenter.x; // X-axis X 657 655 ap.lS = 0; // X-axis Y -
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 -
trunk/src/helpers/winh.c
r91 r95 1362 1362 * this func after you have received SPBN_UP/DOWNARROW, 1363 1363 * the spin button's value will always in/decrease 1364 * in steps of 100. 1364 * so that the spin button's value is a multiple of 100. 1365 * 1366 * By contrast, if (lGrid < 0), this will not really 1367 * snap the value to a multiple of -lGrid, but instead 1368 * in/decrease the value by -lGrid. The value will not 1369 * necessarily be a multiple of the grid. (0.9.14) 1365 1370 * 1366 1371 * This returns the "snapped" value to which the spin … … 1368 1373 * 1369 1374 * If you specify lGrid == 0, this returns the spin 1370 * button's value only (V0.9.0).1375 * button's value only without snapping (V0.9.0). 1371 1376 * 1372 1377 *@@changed V0.9.0 [umoeller]: added check for lGrid == 0 (caused division by zero previously) 1378 *@@changed V0.9.14 (2001-08-03) [umoeller]: added fixes for age-old problems with wrap around 1379 *@@changed V0.9.14 (2001-08-03) [umoeller]: added lGrid < 0 mode 1373 1380 */ 1374 1381 … … 1380 1387 HWND hwndSpin = WinWindowFromID(hwndDlg, usItemID); 1381 1388 LONG lBottom, lTop, lValue; 1389 1382 1390 // get value, which has already increased / 1383 1391 // decreased by 1 … … 1397 1405 // manually enters something (SPBN_CHANGE), 1398 1406 // we'll accept that value 1399 lValue = (lValue / lGrid) * lGrid; 1400 // add /subtract grid 1401 if (usNotifyCode == SPBN_UPARROW) 1402 lValue += lGrid; 1403 // else we'll have -= lGrid already 1407 LONG lChanged = (usNotifyCode == SPBN_UPARROW) 1408 // if the spin button went up, subtract 1 1409 ? -1 1410 : +1; 1411 LONG lPrev = lValue + lChanged; 1412 1413 // if grid is negative, it is assumed to 1414 // not be a "real" grid but jump in those 1415 // steps only 1416 if (lGrid < 0) 1417 { 1418 // add /subtract grid 1419 if (usNotifyCode == SPBN_UPARROW) 1420 lValue = lPrev - lGrid; 1421 else 1422 lValue = lPrev + lGrid; 1423 1424 // lValue = (lValue / lGrid) * lGrid; 1425 } 1426 else 1427 { 1428 // add /subtract grid 1429 if (usNotifyCode == SPBN_UPARROW) 1430 lValue = lPrev + lGrid; 1431 else 1432 lValue = lPrev - lGrid; 1433 1434 lValue = (lValue / lGrid) * lGrid; 1435 } 1404 1436 1405 1437 // balance with spin button limits
Note:
See TracChangeset
for help on using the changeset viewer.