Ignore:
Timestamp:
Sep 26, 1999, 1:01:11 PM (26 years ago)
Author:
achimha
Message:

merged latest WINE 990923 changes

File:
1 edited

Legend:

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

    r722 r1058  
    1 /* $Id: propsheet.c,v 1.8 1999-08-28 09:25:56 achimha Exp $ */
     1/* $Id: propsheet.c,v 1.9 1999-09-26 11:01:10 achimha Exp $ */
    22/*
    33 * Property Sheets
     
    99 *
    1010 * TODO:
    11  *   - Modeless mode
    12  *   - Wizard mode
     11 *   - Tab order
    1312 *   - Unicode property sheets
    1413 */
    1514
    16 /* WINE 990815 level */
     15/* WINE 990923 level */
    1716
    1817/* CB: Odin problems:
     
    108107static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo);
    109108static PADDING_INFO PROPSHEET_GetPaddingInfo(HWND hwndDlg);
     109static BOOL PROPSHEET_Back(HWND hwndDlg);
     110static BOOL PROPSHEET_Next(HWND hwndDlg);
     111static BOOL PROPSHEET_Finish(HWND hwndDlg);
    110112static BOOL PROPSHEET_Apply(HWND hwndDlg);
    111113static void PROPSHEET_Cancel(HWND hwndDlg);
     
    114116static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage);
    115117static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID);
     118static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText);
    116119static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText);
    117120static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
     
    130133static void PROPSHEET_CleanUp();
    131134static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, PropSheetInfo* psInfo);
     135static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags);
     136static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg);
    132137
    133138BOOL WINAPI
     
    282287  p += lstrlenW((LPCWSTR)p) + 1;
    283288
     289  if (dwFlags & PSP_USETITLE)
     290  {
     291//AH: todo
     292//    psInfo->proppage[index].pszText = HEAP_strdupAtoW(GetProcessHeap(),
     293//                                                      0,
     294//                                                      lppsp->pszTitle);
     295  }
     296
    284297  /*
    285298   * Build the image list for icons
     
    311324 * Creates the actual property sheet.
    312325 */
     326
     327//AH: WINE 990923 not merged due to changes from CB
     328
    313329BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo)
    314330{
     
    407423
    408424/******************************************************************************
     425 *            PROPSHEET_IsTooSmallWizard
     426 *
     427 * Verify that the default property sheet is big enough.
     428 */
     429static BOOL PROPSHEET_IsTooSmallWizard(HWND hwndDlg, PropSheetInfo* psInfo)
     430{
     431  RECT rcSheetRect, rcPage, rcLine, rcSheetClient;
     432  HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
     433  PADDING_INFO padding = PROPSHEET_GetPaddingInfoWizard(hwndDlg);
     434
     435  GetClientRect(hwndDlg, &rcSheetClient);
     436  GetWindowRect(hwndDlg, &rcSheetRect);
     437  GetWindowRect(hwndLine, &rcLine);
     438
     439  /* Remove the space below the sunken line */
     440  rcSheetClient.bottom -= (rcSheetRect.bottom - rcLine.top);
     441
     442  /* Remove the buffer zone all around the edge */
     443  rcSheetClient.bottom -= (padding.y * 2);
     444  rcSheetClient.right -= (padding.x * 2);
     445
     446  /*
     447   * Biggest page size.
     448   */
     449  rcPage.left   = psInfo->x;
     450  rcPage.top    = psInfo->y;
     451  rcPage.right  = psInfo->width;
     452  rcPage.bottom = psInfo->height;
     453
     454  MapDialogRect(hwndDlg, &rcPage);
     455//  TRACE("biggest page %d %d %d %d\n", rcPage.left, rcPage.top,
     456//        rcPage.right, rcPage.bottom);
     457
     458  if (rcPage.right > rcSheetClient.right)
     459    return TRUE;
     460
     461  if (rcPage.bottom > rcSheetClient.bottom)
     462    return TRUE;
     463
     464  return FALSE;
     465}
     466
     467/******************************************************************************
    409468 *            PROPSHEET_AdjustSize
    410469 *
     
    453512  rc.right += ((padding.x * 2) + tabOffsetX);
    454513  rc.bottom += (buttonHeight + (3 * padding.y) + tabOffsetY);
     514
     515  /*
     516   * Resize the property sheet.
     517   */
     518  SetWindowPos(hwndDlg, 0, 0, 0, rc.right, rc.bottom,
     519               SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
     520
     521  return TRUE;
     522}
     523
     524/******************************************************************************
     525 *            PROPSHEET_AdjustSizeWizard
     526 *
     527 * Resizes the property sheet to fit the largest page.
     528 */
     529static BOOL PROPSHEET_AdjustSizeWizard(HWND hwndDlg, PropSheetInfo* psInfo)
     530{
     531  HWND hwndButton = GetDlgItem(hwndDlg, IDCANCEL);
     532  HWND hwndLine = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
     533  RECT rc;
     534  int buttonHeight, lineHeight;
     535  PADDING_INFO padding = PROPSHEET_GetPaddingInfoWizard(hwndDlg);
     536
     537  /* Get the height of buttons */
     538  GetClientRect(hwndButton, &rc);
     539  buttonHeight = rc.bottom;
     540
     541  GetClientRect(hwndLine, &rc);
     542  lineHeight = rc.bottom;
     543
     544  /*
     545   * Biggest page size.
     546   */
     547  rc.left   = psInfo->x;
     548  rc.top    = psInfo->y;
     549  rc.right  = psInfo->width;
     550  rc.bottom = psInfo->height;
     551
     552  MapDialogRect(hwndDlg, &rc);
     553
     554//  TRACE("Biggest page %d %d %d %d\n", rc.left, rc.top, rc.right, rc.bottom);
     555
     556  /* Make room */
     557  rc.right += (padding.x * 2);
     558  rc.bottom += (buttonHeight + (5 * padding.y) + lineHeight);
    455559
    456560  /*
     
    559663
    560664/******************************************************************************
     665 *            PROPSHEET_AdjustButtonsWizard
     666 *
     667 * Adjusts the buttons' positions.
     668 */
     669static BOOL PROPSHEET_AdjustButtonsWizard(HWND hwndParent,
     670                                          PropSheetInfo* psInfo)
     671{
     672  HWND hwndButton = GetDlgItem(hwndParent, IDCANCEL);
     673  HWND hwndLine = GetDlgItem(hwndParent, IDC_SUNKEN_LINE);
     674  RECT rcSheet;
     675  int x, y;
     676  int num_buttons = 3;
     677  int buttonWidth, buttonHeight, lineHeight, lineWidth;
     678  PADDING_INFO padding = PROPSHEET_GetPaddingInfoWizard(hwndParent);
     679
     680  if (psInfo->hasHelp)
     681    num_buttons++;
     682
     683  /*
     684   * Obtain the size of the buttons.
     685   */
     686  GetClientRect(hwndButton, &rcSheet);
     687  buttonWidth = rcSheet.right;
     688  buttonHeight = rcSheet.bottom;
     689
     690  GetClientRect(hwndLine, &rcSheet);
     691  lineHeight = rcSheet.bottom;
     692
     693  /*
     694   * Get the size of the property sheet.
     695   */
     696  GetClientRect(hwndParent, &rcSheet);
     697
     698  /*
     699   * All buttons will be at this y coordinate.
     700   */
     701  y = rcSheet.bottom - (padding.y + buttonHeight);
     702
     703  /*
     704   * Position the Next and the Finish buttons.
     705   */
     706  hwndButton = GetDlgItem(hwndParent, IDC_NEXT_BUTTON);
     707
     708  x = rcSheet.right - ((padding.x + buttonWidth) * (num_buttons - 1));
     709
     710  SetWindowPos(hwndButton, 0, x, y, 0, 0,
     711               SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     712
     713  hwndButton = GetDlgItem(hwndParent, IDC_FINISH_BUTTON);
     714
     715  SetWindowPos(hwndButton, 0, x, y, 0, 0,
     716               SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     717
     718  ShowWindow(hwndButton, SW_HIDE);
     719
     720  /*
     721   * Position the Back button.
     722   */
     723  hwndButton = GetDlgItem(hwndParent, IDC_BACK_BUTTON);
     724
     725  x -= buttonWidth;
     726
     727  SetWindowPos(hwndButton, 0, x, y, 0, 0,
     728               SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     729
     730  /*
     731   * Position the Cancel button.
     732   */
     733  hwndButton = GetDlgItem(hwndParent, IDCANCEL);
     734
     735  x = rcSheet.right - ((padding.x + buttonWidth) * (num_buttons - 2));
     736
     737  SetWindowPos(hwndButton, 0, x, y, 0, 0,
     738               SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     739
     740  /*
     741   * Position Help button.
     742   */
     743  hwndButton = GetDlgItem(hwndParent, IDHELP);
     744
     745  if (psInfo->hasHelp)
     746  {
     747    x = rcSheet.right - (padding.x + buttonWidth);
     748
     749    SetWindowPos(hwndButton, 0, x, y, 0, 0,
     750                 SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
     751  }
     752  else
     753    ShowWindow(hwndButton, SW_HIDE);
     754
     755  /*
     756   * Position and resize the sunken line.
     757   */
     758  x = padding.x;
     759  y = rcSheet.bottom - ((padding.y * 2) + buttonHeight + lineHeight);
     760
     761  GetClientRect(hwndParent, &rcSheet);
     762  lineWidth = rcSheet.right - (padding.x * 2);
     763
     764  SetWindowPos(hwndLine, 0, x, y, lineWidth, 2,
     765               SWP_NOZORDER | SWP_NOACTIVATE);
     766
     767  return TRUE;
     768}
     769
     770/******************************************************************************
    561771 *            PROPSHEET_GetPaddingInfo
    562772 *
     
    579789  padding.x = tl.x;
    580790  padding.y = tl.y;
     791
     792  return padding;
     793}
     794
     795/******************************************************************************
     796 *            PROPSHEET_GetPaddingInfoWizard
     797 *
     798 * Returns the layout information.
     799 * Horizontal spacing is the distance between the Cancel and Help buttons.
     800 * Vertical spacing is the distance between the line and the buttons.
     801 */
     802static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg)
     803{
     804  PADDING_INFO padding;
     805  RECT rc;
     806  HWND hwndControl;
     807  POINT ptHelp, ptCancel, ptLine;
     808
     809  /* Help button */
     810  hwndControl = GetDlgItem(hwndDlg, IDHELP);
     811  GetWindowRect(hwndControl, &rc);
     812
     813  ptHelp.x = rc.left;
     814  ptHelp.y = rc.top;
     815
     816  ScreenToClient(hwndDlg, &ptHelp);
     817
     818  /* Cancel button */
     819  hwndControl = GetDlgItem(hwndDlg, IDCANCEL);
     820  GetWindowRect(hwndControl, &rc);
     821
     822  ptCancel.x = rc.right;
     823  ptCancel.y = rc.top;
     824
     825  ScreenToClient(hwndDlg, &ptCancel);
     826
     827  /* Line */
     828  hwndControl = GetDlgItem(hwndDlg, IDC_SUNKEN_LINE);
     829  GetWindowRect(hwndControl, &rc);
     830
     831  ptLine.x = 0;
     832  ptLine.y = rc.bottom;
     833
     834  ScreenToClient(hwndDlg, &ptLine);
     835
     836  padding.x = ptHelp.x - ptCancel.x;
     837  padding.y = ptHelp.y - ptLine.y;
    581838
    582839  return padding;
     
    640897  RECT rc;
    641898  PropPageInfo* ppInfo = psInfo->proppage;
    642   PADDING_INFO padding = PROPSHEET_GetPaddingInfo(hwndParent);
    643   HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
     899  PADDING_INFO padding;
     900  HWND hwndAfter;
    644901
    645902//  TRACE(propsheet, "index %d\n", index);
     
    696953  MapDialogRect(hwndParent, &rc);
    697954
    698   /*
    699    * Ask the Tab control to fit this page in.
    700    */
    701   SendMessageA(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc);
    702 
    703   SetWindowPos(hwndPage, HWND_TOP,
     955  if (psInfo->ppshheader->dwFlags & PSH_WIZARD)
     956  {
     957    GetWindowRect(hwndParent, &rc);
     958    padding = PROPSHEET_GetPaddingInfoWizard(hwndParent);
     959    hwndAfter = hwndParent;
     960  }
     961  else
     962  {
     963    /*
     964     * Ask the Tab control to fit this page in.
     965     */
     966
     967    HWND hwndTabCtrl = GetDlgItem(hwndParent, IDC_TABCONTROL);
     968    SendMessageA(hwndTabCtrl, TCM_ADJUSTRECT, FALSE, (LPARAM)&rc);
     969    padding = PROPSHEET_GetPaddingInfo(hwndParent);
     970    hwndAfter = HWND_TOP;
     971  }
     972
     973  SetWindowPos(hwndPage, hwndAfter,
    704974               rc.left + padding.x,
    705975               rc.top + padding.y,
     
    7471017
    7481018  psInfo->active_page = index;
     1019
     1020  return TRUE;
     1021}
     1022
     1023/******************************************************************************
     1024 *            PROPSHEET_Back
     1025 */
     1026static BOOL PROPSHEET_Back(HWND hwndDlg)
     1027{
     1028  BOOL res;
     1029  NMHDR hdr;
     1030  HWND hwndPage;
     1031  HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
     1032  PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg,
     1033                                                    PropSheetInfoStr);
     1034
     1035  hdr.code = PSN_WIZBACK;
     1036
     1037  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
     1038
     1039  if (SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr) == -1)
     1040    return FALSE;
     1041
     1042  res = PROPSHEET_SetCurSel(hwndDlg, psInfo->active_page - 1, 0);
     1043
     1044  /* if we went to page 0, disable Back button */
     1045  if (res && (psInfo->active_page == 0))
     1046    EnableWindow(hwndBack, FALSE);
     1047
     1048  return TRUE;
     1049}
     1050
     1051/******************************************************************************
     1052 *            PROPSHEET_Next
     1053 */
     1054static BOOL PROPSHEET_Next(HWND hwndDlg)
     1055{
     1056  NMHDR hdr;
     1057  HWND hwndPage;
     1058  LRESULT msgResult = 0;
     1059  PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg,
     1060                                                    PropSheetInfoStr);
     1061
     1062  hdr.code = PSN_WIZNEXT;
     1063
     1064  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
     1065
     1066  msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr);
     1067
     1068//  TRACE("msg result %ld\n", msgResult);
     1069
     1070  if (msgResult == -1)
     1071    return FALSE;
     1072
     1073  PROPSHEET_SetCurSel(hwndDlg, psInfo->active_page + 1, 0);
     1074
     1075  return TRUE;
     1076}
     1077
     1078/******************************************************************************
     1079 *            PROPSHEET_Finish
     1080 */
     1081static BOOL PROPSHEET_Finish(HWND hwndDlg)
     1082{
     1083  NMHDR hdr;
     1084  HWND hwndPage;
     1085  LRESULT msgResult = 0;
     1086  PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwndDlg,
     1087                                                    PropSheetInfoStr);
     1088
     1089  hdr.code = PSN_WIZFINISH;
     1090
     1091  hwndPage = psInfo->proppage[psInfo->active_page].hwndPage;
     1092
     1093  msgResult = SendMessageA(hwndPage, WM_NOTIFY, 0, (LPARAM) &hdr);
     1094
     1095//  TRACE("msg result %ld\n", msgResult);
     1096
     1097  if (msgResult != 0)
     1098    return FALSE;
     1099
     1100  if (psInfo->isModeless)
     1101    psInfo->active_page = -1;
     1102  else
     1103    EndDialog(hwndDlg, TRUE);
    7491104
    7501105  return TRUE;
     
    9031258      break;
    9041259    case PSBTN_BACK:
    905 //      FIXME(propsheet, "Wizard mode not implemented.\n");
     1260      PROPSHEET_Back(hwndDlg);
    9061261      break;
    9071262    case PSBTN_CANCEL:
     
    9091264      break;
    9101265    case PSBTN_FINISH:
    911 //      FIXME(propsheet, "Wizard mode not implemented.\n");
     1266      PROPSHEET_Finish(hwndDlg);
    9121267      break;
    9131268    case PSBTN_HELP:
     
    9151270      break;
    9161271    case PSBTN_NEXT:
    917 //      FIXME(propsheet, "Wizard mode not implemented.\n");
     1272      PROPSHEET_Next(hwndDlg);
    9181273      break;
    9191274    case PSBTN_OK:
     
    10161371  else
    10171372    SetWindowTextA(hwndDlg, lpszText);
     1373}
     1374
     1375/******************************************************************************
     1376 *            PROPSHEET_SetFinishTextA
     1377 */
     1378static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
     1379{
     1380  HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
     1381
     1382  /* Set text, show and enable the Finish button */
     1383  SetWindowTextA(hwndButton, lpszText);
     1384  ShowWindow(hwndButton, SW_SHOW);
     1385  EnableWindow(hwndButton, TRUE);
     1386
     1387  /* Make it default pushbutton */
     1388  SendMessageA(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
     1389
     1390  /* Hide Back button */
     1391  hwndButton = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
     1392  ShowWindow(hwndButton, SW_HIDE);
     1393
     1394  /* Hide Next button */
     1395  hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
     1396  ShowWindow(hwndButton, SW_HIDE);
    10181397}
    10191398
     
    11961575
    11971576/******************************************************************************
     1577 *            PROPSHEET_SetWizButtons
     1578 *
     1579 * This code will work if (and assumes that) the Next button is on top of the
     1580 * Finish button. ie. Finish comes after Next in the Z order.
     1581 * This means make sure the dialog template reflects this.
     1582 *
     1583 */
     1584static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
     1585{
     1586  HWND hwndButton;
     1587
     1588//  TRACE("%ld\n", dwFlags);
     1589
     1590  if (dwFlags & PSWIZB_BACK)
     1591  {
     1592    hwndButton = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
     1593    EnableWindow(hwndButton, TRUE);
     1594  }
     1595
     1596  if (dwFlags & PSWIZB_NEXT)
     1597  {
     1598    /* Hide the Finish button */
     1599    hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
     1600    ShowWindow(hwndButton, SW_HIDE);
     1601
     1602    /* Show and enable the Next button */
     1603    hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
     1604   
     1605    ShowWindow(hwndButton, SW_SHOW);
     1606    EnableWindow(hwndButton, TRUE);
     1607
     1608    /* Set the Next button as the default pushbutton  */
     1609    SendMessageA(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0);
     1610  }
     1611
     1612  if ((dwFlags & PSWIZB_FINISH) || (dwFlags & PSWIZB_DISABLEDFINISH))
     1613  {
     1614    /* Hide the Next button */
     1615    hwndButton = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
     1616    ShowWindow(hwndButton, SW_HIDE);
     1617
     1618    /* Show the Finish button */
     1619    hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
     1620    ShowWindow(hwndButton, SW_SHOW);
     1621
     1622    if (dwFlags & PSWIZB_FINISH)
     1623      EnableWindow(hwndButton, TRUE);
     1624    else
     1625      EnableWindow(hwndButton, FALSE);
     1626
     1627    /* Set the Finish button as the default pushbutton  */
     1628    SendMessageA(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0);
     1629  }
     1630}
     1631
     1632/******************************************************************************
    11981633 *            PROPSHEET_GetPageIndex
    11991634 *
     
    13221757      LPCPROPSHEETPAGEA ppshpage;
    13231758
     1759      /*
     1760       * Small icon in the title bar.
     1761       */
     1762      if ((psInfo->ppshheader->dwFlags & PSH_USEICONID) ||
     1763          (psInfo->ppshheader->dwFlags & PSH_USEHICON))
     1764      {
     1765        HICON hIcon;
     1766        int icon_cx = GetSystemMetrics(SM_CXSMICON);
     1767        int icon_cy = GetSystemMetrics(SM_CYSMICON);
     1768
     1769        if (psInfo->ppshheader->dwFlags & PSH_USEICONID)
     1770          hIcon = LoadImageA(psInfo->ppshheader->hInstance,
     1771                             psInfo->ppshheader->u1.pszIcon,
     1772                             IMAGE_ICON,
     1773                             icon_cx, icon_cy,
     1774                             LR_DEFAULTCOLOR);
     1775        else
     1776          hIcon = psInfo->ppshheader->u1.hIcon;
     1777
     1778        SendMessageA(hwnd, WM_SETICON, 0, hIcon);
     1779      }
     1780     
     1781      if (psInfo->ppshheader->dwFlags & PSH_USEHICON)
     1782        SendMessageA(hwnd, WM_SETICON, 0, psInfo->ppshheader->u1.hIcon);
     1783
    13241784      psInfo->strPropertiesFor = strCaption;
    13251785
    13261786      GetWindowTextA(hwnd, psInfo->strPropertiesFor, MAX_CAPTION_LENGTH);
    13271787
    1328       PROPSHEET_CreateTabControl(hwnd, psInfo);
    1329 
    1330       if (PROPSHEET_IsTooSmall(hwnd, psInfo))
     1788      if (psInfo->ppshheader->dwFlags & PSH_WIZARD)
    13311789      {
    1332         PROPSHEET_AdjustSize(hwnd, psInfo);
    1333         PROPSHEET_AdjustButtons(hwnd, psInfo);
     1790        HWND hwndBack = GetDlgItem(hwnd, IDC_BACK_BUTTON);
     1791
     1792        if (PROPSHEET_IsTooSmallWizard(hwnd, psInfo))
     1793        {
     1794          PROPSHEET_AdjustSizeWizard(hwnd, psInfo);
     1795          PROPSHEET_AdjustButtonsWizard(hwnd, psInfo);
     1796        }
     1797
     1798        /* Disable Back button if we start at page 0 */
     1799        if (psInfo->active_page == 0)
     1800          EnableWindow(hwndBack, FALSE);
    13341801      }
    1335 
    1336       ppshpage = PROPSHEET_GetPSPPage(psInfo, psInfo->active_page);
     1802      else
     1803      {
     1804        PROPSHEET_CreateTabControl(hwnd, psInfo);
     1805
     1806        if (PROPSHEET_IsTooSmall(hwnd, psInfo))
     1807        {
     1808          PROPSHEET_AdjustSize(hwnd, psInfo);
     1809          PROPSHEET_AdjustButtons(hwnd, psInfo);
     1810        }
     1811      }
     1812
     1813      ppshpage = PROPSHEET_GetPSPPage(psInfo, psInfo->active_page);     
    13371814      PROPSHEET_CreatePage(hwnd, psInfo->active_page, psInfo, ppshpage, TRUE);
    1338       SendMessageA(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
     1815
     1816      if (!(psInfo->ppshheader->dwFlags & PSH_WIZARD))
     1817        SendMessageA(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
    13391818
    13401819      SetPropA(hwnd, PropSheetInfoStr, (HANDLE)psInfo);
     
    13931872        }
    13941873
     1874        case IDC_BACK_BUTTON:
     1875          PROPSHEET_Back(hwnd);
     1876          break;
     1877
     1878        case IDC_NEXT_BUTTON:
     1879          PROPSHEET_Next(hwnd);
     1880          break;
     1881
     1882        case IDC_FINISH_BUTTON:
     1883          PROPSHEET_Finish(hwnd);
     1884          break;
     1885
    13951886        case IDCANCEL:
    13961887          PROPSHEET_Cancel(hwnd);
     
    14841975    case PSM_REBOOTSYSTEM:
    14851976    {
    1486       PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwnd,
     1977      PropSheetInfo* psInfo = (PropSheetInfo*) GetPropA(hwnd, 
    14871978                                                        PropSheetInfoStr);
    14881979
     
    15232014    case PSM_ISDIALOGMESSAGE:
    15242015    {
    1525 //      FIXME (propsheet, "Unimplemented msg PSM_ISDIALOGMESSAGE\n");
     2016//      FIXME("Unimplemented msg PSM_ISDIALOGMESSAGE\n");
    15262017      return 0;
    15272018    }
     
    15312022      return TRUE;
    15322023
     2024    case PSM_SETFINISHTEXTA:
     2025      PROPSHEET_SetFinishTextA(hwnd, (LPCSTR) lParam);       
     2026      return TRUE;
     2027
     2028    case PSM_SETWIZBUTTONS:
     2029      PROPSHEET_SetWizButtons(hwnd, (DWORD)lParam);
     2030      return TRUE;
     2031
    15332032    case PSM_SETTITLEW:
    1534 //        FIXME (propsheet, "Unimplemented msg PSM_SETTITLE32W\n");
    1535         return 0;
    1536     case PSM_SETWIZBUTTONS:
    1537 //        FIXME (propsheet, "Unimplemented msg PSM_SETWIZBUTTONS\n");
     2033//        FIXME("Unimplemented msg PSM_SETTITLE32W\n");
    15382034        return 0;
    15392035    case PSM_SETCURSELID:
    1540 //        FIXME (propsheet, "Unimplemented msg PSM_SETCURSELID\n");
    1541         return 0;
    1542     case PSM_SETFINISHTEXTA:
    1543 //        FIXME (propsheet, "Unimplemented msg PSM_SETFINISHTEXT32A\n");
     2036//        FIXME("Unimplemented msg PSM_SETCURSELID\n");
    15442037        return 0;
    15452038    case PSM_SETFINISHTEXTW:
    1546 //        FIXME (propsheet, "Unimplemented msg PSM_SETFINISHTEXT32W\n");
     2039//        FIXME("Unimplemented msg PSM_SETFINISHTEXT32W\n");
    15472040        return 0;
    15482041
Note: See TracChangeset for help on using the changeset viewer.