Source code of Windows XP (NT5)
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.

59 lines
1.3 KiB

  1. /*
  2. * Windows Calendar
  3. * Copyright (c) 1985 by Microsoft Corporation, all rights reserved.
  4. * Written by Mark L. Chamberlin, consultant to Microsoft.
  5. *
  6. */
  7. /*
  8. *****
  9. ***** calmark.c
  10. *****
  11. */
  12. #include "cal.h"
  13. /**** CmdMark - mark or unmark the selected day. */
  14. VOID APIENTRY CmdMark ()
  15. {
  16. register DT dt;
  17. INT itdd;
  18. RECT rect;
  19. register DD *pdd;
  20. /* Note that the Mark command only operates on the selected date,
  21. and this must be in the tdd, so there is no need to check the
  22. return result of FSearchTdd.
  23. */
  24. dt = DtFromPd3 (&vd3Sel);
  25. FSearchTdd (dt, &itdd);
  26. /* Mark or unmark the DD (toggle its state). */
  27. pdd = TddLock () + itdd;
  28. /* Update the month array by toggling the marked bit for the current
  29. day.
  30. */
  31. /* clear old marked bits on day */
  32. vrgbMonth [vwWeekdayFirst + vd3Sel.wDay] &= CLEARMARKEDBITS;
  33. /* set new marked bits */
  34. vrgbMonth [vwWeekdayFirst + vd3Sel.wDay] |= viMarkSymbol;
  35. pdd -> fMarked = (SINT)viMarkSymbol;
  36. TddUnlock();
  37. /* If in month mode, cause the marking box to be drawn or erased. */
  38. if (!vfDayMode)
  39. {
  40. MapDayToRect (vd3Sel.wDay, &rect);
  41. InvalidateRect (vhwnd2B, (LPRECT)&rect, TRUE);
  42. }
  43. /* Marking a date makes the file dirty. */
  44. vfDirty = TRUE;
  45. }