Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.5 KiB

  1. //
  2. // PSDLG.HPP
  3. // Page Sorter Dialog
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #ifndef __PSDLG_HPP_
  8. #define __PSDLG_HPP_
  9. #define INSERT_BEFORE 1
  10. #define INSERT_AFTER 2
  11. #define WM_LBTRACKPOINT 0x0131
  12. #define RENDERED_WIDTH (DRAW_WIDTH / 16)
  13. #define RENDERED_HEIGHT (DRAW_HEIGHT / 16)
  14. //
  15. // Data we store in the GWL_USERDATA of the dialog. Some is passed in
  16. // by the DialogBox caller. Some is used just by the dialog. Some is
  17. // returned back to the DialogBox caller.
  18. //
  19. typedef struct tagPAGESORT
  20. {
  21. UINT hCurPage;
  22. BOOL fPageOpsAllowed;
  23. BOOL fChanged;
  24. BOOL fDragging;
  25. HWND hwnd;
  26. int iCurPageNo;
  27. int iPageDragging;
  28. HCURSOR hCursorCurrent;
  29. HCURSOR hCursorDrag;
  30. HCURSOR hCursorNoDrop;
  31. HCURSOR hCursorNormal;
  32. }
  33. PAGESORT;
  34. //
  35. // Messages the caller can send to the page sort dialog
  36. //
  37. enum
  38. {
  39. WM_PS_GETCURRENTPAGE = WM_APP,
  40. WM_PS_HASCHANGED,
  41. WM_PS_ENABLEPAGEOPS, // wParam == TRUE or FALSE
  42. WM_PS_LOCKCHANGE,
  43. WM_PS_PAGECLEARIND, // wParam == hPage
  44. WM_PS_PAGEDELIND, // wParam == hPage
  45. WM_PS_PAGEORDERUPD
  46. };
  47. //
  48. // The page sorter dialog uses a horizontal listbox to display the
  49. // thumbnail views of pages. Each item holds a bitmap of data for the
  50. // page. We render this bitmap the first time the item is painted. The
  51. // listbox takes care of scrolling and keyboard navigation for us.
  52. //
  53. BOOL CALLBACK PageSortDlgProc(HWND, UINT, WPARAM, LPARAM);
  54. void OnInitDialog(HWND hwndPS, PAGESORT * pps);
  55. void OnMeasureItem(HWND hwndPS, UINT id, LPMEASUREITEMSTRUCT lpmi);
  56. void OnDeleteItem(HWND hwndPS, UINT id, LPDELETEITEMSTRUCT lpdi);
  57. void OnDrawItem(HWND hwndPS, UINT id, LPDRAWITEMSTRUCT lpdi);
  58. void OnCommand(PAGESORT * pps, UINT id, UINT code, HWND hwndCtl);
  59. BOOL OnSetCursor(PAGESORT * pps, HWND hwnd, UINT ht, UINT msg);
  60. void OnDelete(PAGESORT * pps);
  61. void InsertPage(PAGESORT * pps, UINT uiBeforeAfter);
  62. void OnPageClearInd(PAGESORT * pps, WB_PAGE_HANDLE hPage);
  63. void OnPageDeleteInd(PAGESORT * pps, WB_PAGE_HANDLE hPage);
  64. void OnPageOrderUpdated(PAGESORT * pps);
  65. void OnStartDragDrop(PAGESORT * pps, UINT iItem, int x, int y);
  66. void WhileDragging(PAGESORT * pps, int x, int y);
  67. void OnEndDragDrop(PAGESORT * pps, BOOL fComplete, int x, int y);
  68. void EnableButtons(PAGESORT * pps);
  69. void MovePage(PAGESORT * pps, int iOldPageNo, int iNewPageNo);
  70. #endif // __PSDLG_HPP_