GUI_DrawFocusRect.c
上传用户:zbk8730
上传日期:2017-08-10
资源大小:12168k
文件大小:2k
源码类别:

uCOS

开发平台:

C/C++

  1. /*
  2. *********************************************************************************************************
  3. *                                                uC/GUI
  4. *                        Universal graphic software for embedded applications
  5. *
  6. *                       (c) Copyright 2002, Micrium Inc., Weston, FL
  7. *                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
  8. *
  9. *              礐/GUI is protected by international copyright laws. Knowledge of the
  10. *              source code may not be used to write a similar product. This file may
  11. *              only be used in accordance with a license and should not be redistributed
  12. *              in any way. We appreciate your understanding and fairness.
  13. *
  14. ----------------------------------------------------------------------
  15. File        : GUI_DrawFocusRect.C
  16. Purpose     : Implementation of GUI_DrawFocusRect
  17. ---------------------------END-OF-HEADER------------------------------
  18. */
  19. #include "GUI_Protected.H"
  20. /*********************************************************************
  21. *
  22. *       Public code
  23. *
  24. **********************************************************************
  25. */
  26. static void _DrawFocusRect(const GUI_RECT* pr) {
  27.   int i; 
  28.   for (i = pr->x0; i <= pr->x1; i += 2) {
  29.     LCD_DrawPixel(i, pr->y0);
  30.     LCD_DrawPixel(i, pr->y1);
  31.   }
  32.   for (i = pr->y0; i <= pr->y1; i += 2) {
  33.     LCD_DrawPixel(pr->x0, i);
  34.     LCD_DrawPixel(pr->x1, i);
  35.   }
  36. }
  37. void GUI_DrawFocusRect(const GUI_RECT *pRect, int Dist) {
  38.   GUI_RECT r;
  39.   GUI__ReduceRect(&r, pRect, Dist);
  40.   GUI_LOCK();
  41.   #if (GUI_WINSUPPORT)
  42.     WM_ADDORG(r.x0, r.y0);
  43.     WM_ADDORG(r.x1, r.y1);
  44.     WM_ITERATE_START(&r); {
  45.   #endif
  46.     _DrawFocusRect(&r);
  47.   #if (GUI_WINSUPPORT)
  48.     } WM_ITERATE_END();
  49.   #endif
  50.   GUI_UNLOCK();
  51. }