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.

88 lines
2.1 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. /* This file contains routines that change dialog boxes or the menu for the
  5. ruler. */
  6. #define NOGDICAPMASKS
  7. #define NOVIRTUALKEYCODES
  8. #define NOWINMESSAGES
  9. #define NOWINSTYLES
  10. #define NOCLIPBOARD
  11. #include <windows.h>
  12. #include "mw.h"
  13. #include "menudefs.h"
  14. #include "str.h"
  15. extern HMENU vhMenu;
  16. extern CHAR stBuf[256];
  17. extern int utCur;
  18. SetRulerMenu(fShowRuler)
  19. BOOL fShowRuler;
  20. {
  21. /* This routine puts "Ruler On" into the menu if fShowRuler is true; else,
  22. "Ruler Off" is put into the menu. */
  23. FillStId(stBuf, fShowRuler ? IDSTRShowRuler : IDSTRHideRuler, sizeof(stBuf));
  24. ChangeMenu(vhMenu, imiShowRuler, (LPSTR)&stBuf[1], imiShowRuler, MF_CHANGE);
  25. }
  26. #ifdef RULERALSO
  27. #include "cmddefs.h"
  28. #include "propdefs.h"
  29. #include "rulerdef.h"
  30. #include "dlgdefs.h"
  31. extern HWND vhDlgIndent;
  32. extern int mprmkdxa[];
  33. extern int vdxaTextRuler;
  34. SetIndentText(rmk, dxa)
  35. int rmk; /* ruler mark */
  36. unsigned dxa;
  37. {
  38. /* This routine reflects the changes made on the ruler in the Indentd dialog
  39. box. */
  40. unsigned dxaShow;
  41. int idi;
  42. CHAR sz[cchMaxNum];
  43. CHAR *pch = &sz[0];
  44. /* Get the dialog item number and the measurement. */
  45. switch (rmk)
  46. {
  47. case rmkLMARG:
  48. dxaShow = dxa;
  49. idi = idiParLfIndent;
  50. break;
  51. case rmkINDENT:
  52. dxaShow = dxa - mprmkdxa[rmkLMARG];
  53. idi = idiParFirst;
  54. break;
  55. case rmkRMARG:
  56. dxaShow = vdxaTextRuler - dxa;
  57. idi = idiParRtIndent;
  58. break;
  59. }
  60. CchExpZa(&pch, dxaShow, utCur, cchMaxNum);
  61. SetDlgItemText(vhDlgIndent, idi, (LPSTR)sz);
  62. if (rmk == rmkLMARG)
  63. {
  64. /* If the left indent changes, then we need to update the first line
  65. indent. */
  66. dxaShow = mprmkdxa[rmkINDENT] - dxaShow;
  67. pch = sz;
  68. CchExpZa(&pch, dxaShow, utCur, cchMaxNum);
  69. idi = idiParFirst;
  70. SetDlgItemText(vhDlgIndent, idi, (LPSTR)sz);
  71. }
  72. }
  73. #endif /* RULERALSO */
  74.