Ignore:
Timestamp:
May 22, 2000, 7:25:13 PM (25 years ago)
Author:
cbratschi
Message:

merged with Corel WINE 20000513, added new DPA_* functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/propsheet.cpp

    r3154 r3585  
    1 /* $Id: propsheet.cpp,v 1.3 2000-03-18 16:17:26 cbratschi Exp $ */
     1/* $Id: propsheet.cpp,v 1.4 2000-05-22 17:25:10 cbratschi Exp $ */
    22/*
    33 * Property Sheets
     
    1414
    1515/*
    16  - Corel WINE 20000317 level
     16 - Corel WINE 20000513 level
    1717 - (WINE 991212 level)
    1818*/
     
    380380       EnableWindow( owner, TRUE );
    381381   }
    382    retval = dlgInfo->idResult;
     382   retval = dlgInfo->dlgExtra->idResult;
    383383#endif
    384384   DestroyWindow( hwnd );
     
    10011001  DLGTEMPLATE* pTemplate;
    10021002  HWND hwndPage;
    1003   RECT rc;
     1003
    10041004  PropPageInfo* ppInfo = psInfo->proppage;
    1005   PADDING_INFO padding;
    10061005
    10071006//  TRACE("index %d\n", index);
     
    10441043  else
    10451044  {
    1046     pTemplate->style |= WS_CHILD | DS_CONTROL;
     1045    pTemplate->style |= WS_CHILDWINDOW | DS_CONTROL;
    10471046    pTemplate->style &= ~DS_MODALFRAME;
    10481047    pTemplate->style &= ~WS_CAPTION;
     
    10661065  ppInfo[index].hwndPage = hwndPage;
    10671066
    1068   rc.left = psInfo->x;
    1069   rc.top = psInfo->y;
    1070   rc.right = psInfo->width;
    1071   rc.bottom = psInfo->height;
    1072 
    1073   MapDialogRect(hwndParent, &rc);
    1074 
    1075   if (psInfo->ppshheader->dwFlags & PSH_WIZARD)
    1076     padding = PROPSHEET_GetPaddingInfoWizard(hwndParent);
    1077   else
    1078   {
    1079     /*
    1080      * Ask the Tab control to fit this page in.
    1081      */
    1082 
    1083     HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
    1084     SendMessageA(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc);
    1085     padding = PROPSHEET_GetPaddingInfo(hwndParent);
    1086   }
    1087 
    1088   SetWindowPos(hwndPage, HWND_TOP,
    1089                rc.left + padding.x,
    1090                rc.top + padding.y,
    1091                0, 0, SWP_NOSIZE);
    1092 
    10931067  return TRUE;
    10941068}
     
    11011075static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
    11021076{
     1077  RECT rc;
     1078  PADDING_INFO padding;
     1079  UINT pageWidth,pageHeight;
     1080
    11031081  if (index == psInfo->active_page)
    11041082    {
     
    11331111  }
    11341112
    1135   ShowWindow(psInfo->proppage[index].hwndPage, SW_SHOW);
     1113  if (psInfo->active_page != -1)
     1114  {
     1115     ShowWindow(psInfo->proppage[psInfo->active_page].hwndPage, SW_HIDE);
     1116  }
     1117
     1118  /* HACK: Sometimes a property page doesn't get displayed at the right place inside the
     1119   *       property sheet. This will force the window to be placed at the proper location
     1120   *       before it is displayed.
     1121   */
     1122  rc.left = psInfo->x;
     1123  rc.top = psInfo->y;
     1124  rc.right = psInfo->width;
     1125  rc.bottom = psInfo->height;
     1126
     1127  MapDialogRect(hwndDlg, &rc);
     1128
     1129  pageWidth = rc.right - rc.left;
     1130  pageHeight = rc.bottom - rc.top;
     1131
     1132  if (psInfo->ppshheader->dwFlags & PSH_WIZARD)
     1133    padding = PROPSHEET_GetPaddingInfoWizard(hwndDlg);
     1134  else
     1135  {
     1136    /*
     1137     * Ask the Tab control to fit this page in.
     1138     */
     1139
     1140    HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
     1141    SendMessageA(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc);
     1142    padding = PROPSHEET_GetPaddingInfo(hwndDlg);
     1143  }
     1144
     1145  SetWindowPos(psInfo->proppage[index].hwndPage, HWND_TOP,
     1146               rc.left + padding.x,
     1147               rc.top + padding.y,
     1148               pageWidth, pageHeight, SWP_SHOWWINDOW);
    11361149
    11371150  if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD))
     
    13051318  }
    13061319
     1320  EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY_BUTTON), FALSE);
     1321
    13071322  if(lParam)
    13081323  {
     1324     int result = TRUE;
     1325
    13091326     psInfo->activeValid = FALSE;
     1327
     1328     if (psInfo->restartWindows)
     1329        result = ID_PSRESTARTWINDOWS;
     1330
     1331     /* reboot system takes precedence over restart windows */
     1332     if (psInfo->rebootSystem)
     1333        result = ID_PSREBOOTSYSTEM;
     1334
     1335     if (!psInfo->isModeless)
     1336        EndDialog(hwndDlg, result);
    13101337  }
    13111338  else if(psInfo->active_page >= 0)
     
    14511478  {
    14521479    case PSBTN_APPLYNOW:
    1453       SendMessageA(hwndDlg, WM_COMMAND, IDC_APPLY_BUTTON, 0);
     1480      PROPSHEET_Apply(hwndDlg, 0);
    14541481      break;
     1482
    14551483    case PSBTN_BACK:
    14561484      PROPSHEET_Back(hwndDlg);
    14571485      break;
     1486
    14581487    case PSBTN_CANCEL:
    1459       SendMessageA(hwndDlg, WM_COMMAND, IDCANCEL, 0);
     1488      PROPSHEET_Cancel(hwndDlg, 0);
    14601489      break;
     1490
    14611491    case PSBTN_FINISH:
    14621492      PROPSHEET_Finish(hwndDlg);
    14631493      break;
     1494
    14641495    case PSBTN_HELP:
    1465       SendMessageA(hwndDlg, WM_COMMAND, IDHELP, 0);
     1496      PROPSHEET_Help(hwndDlg);
    14661497      break;
     1498
    14671499    case PSBTN_NEXT:
    14681500      PROPSHEET_Next(hwndDlg);
    14691501      break;
     1502
    14701503    case PSBTN_OK:
    1471       SendMessageA(hwndDlg, WM_COMMAND, IDOK, 0);
     1504      PROPSHEET_Apply(hwndDlg, 1);
    14721505      break;
    1473     default:
    1474         //FIXME(propsheet, "Invalid button index %d\n", buttonID);
    1475         break;
     1506
     1507    //default:
     1508    //  FIXME("Invalid button index %d\n", buttonID);
    14761509  }
    14771510}
     
    21852218    {
    21862219      WORD wID = LOWORD(wParam);
     2220      PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwnd,PropSheetInfoStr);
    21872221
    21882222      switch (wID)
     
    21902224        case IDOK:
    21912225        case IDC_APPLY_BUTTON:
    2192         {
    2193           HWND hwndApplyBtn = GetDlgItem(hwnd, IDC_APPLY_BUTTON);
    2194 
    2195           if (PROPSHEET_Apply(hwnd, wID == IDOK ? 1: 0) == FALSE)
    2196             break;
    2197 
    2198           if (wID == IDOK)
    2199           {
    2200             PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwnd,
    2201                                                             PropSheetInfoStr);
    2202             int result = TRUE;
    2203 
    2204             if (psInfo->restartWindows)
    2205               result = ID_PSRESTARTWINDOWS;
    2206 
    2207             /* reboot system takes precedence over restart windows */
    2208             if (psInfo->rebootSystem)
    2209               result = ID_PSREBOOTSYSTEM;
    2210 
    2211             if (psInfo->isModeless)
    2212               psInfo->activeValid = FALSE;
    2213             else
    2214               EndDialog(hwnd, result);
    2215           }
    2216           else
    2217              EnableWindow(hwndApplyBtn, FALSE);
    2218 
     2226          PROPSHEET_Apply(hwnd, wID == IDOK ? 1: 0);
    22192227          break;
    2220         }
    22212228
    22222229        case IDC_BACK_BUTTON:
     
    22392246          PROPSHEET_Help(hwnd);
    22402247          break;
     2248
     2249        default:
     2250          if(psInfo->active_page != -1)
     2251          {
     2252             return SendMessageA(psInfo->proppage[psInfo->active_page].hwndPage,
     2253                                 uMsg, wParam, lParam);
     2254          }
    22412255      }
    22422256
Note: See TracChangeset for help on using the changeset viewer.