home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / UGAAppearance.cp < prev    next >
Encoding:
Text File  |  1998-04-08  |  15.0 KB  |  395 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifdef PowerPlant_PCH
  20. #include PowerPlant_PCH
  21. #endif
  22.  
  23. #include <UMemoryMgr.h>
  24. #include <UDrawingState.h>
  25. #include <UDrawingUtils.h>
  26. #include <UGAColorRamp.h>
  27.  
  28. #include "UGraphicGizmos.h"
  29. #include "UGAAppearance.h"
  30.  
  31. // GA Bevel tints.
  32.  
  33. Uint16    UGAAppearance::sGAOneGrayLevel         = 0x1111;
  34. Uint16    UGAAppearance::sGATwoGrayLevels     = 0x2222;
  35. Uint16    UGAAppearance::sGAThreeGrayLevels     = 0x3333;
  36. Uint16    UGAAppearance::sGAFourGrayLevels     = 0x4444;
  37. Uint16    UGAAppearance::sGAFiveGrayLevels     = 0x5555;
  38. Uint16    UGAAppearance::sGASixGrayLevels     = 0x6666;
  39. Uint16    UGAAppearance::sGASevenGrayLevels     = 0x7777;
  40.  
  41. Uint16    UGAAppearance::sGAHiliteContentTint    = 0x0500;
  42.  
  43. const Int16 gsPopup_ArrowButtonWidth     =     22;    //    Width used in drawing the arrow only
  44.  
  45.  
  46. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  47. //    Ñ    DrawGAButtonBevelTint
  48. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  49. //    This function is based in part on LGAPushButton::DrawButtonNormalColor().
  50. //    Given a rect and assuming the content of the rect is filled with 87% gray
  51. //    (0xDDDD, 0xDDDD, 0xDDDD), this function will apply tints such that it will
  52. //    look like a GA button
  53.  
  54. void UGAAppearance::DrawGAButtonBevelTint(
  55.     const Rect &inRect)
  56. {
  57.     StColorPenState thePenSaver;
  58.     thePenSaver.Normalize();
  59.  
  60.     Rect frame = inRect;
  61.  
  62.     //::RGBForeColor(&UGAColorRamp::GetBlackColor());
  63.     ::RGBForeColor(&UGAColorRamp::GetColor(colorRamp_Gray8));
  64.     ::FrameRoundRect(&frame, 8, 8);
  65.  
  66.     // bevel light side
  67.     ::InsetRect(&frame, 2, 2);
  68.     frame.bottom -= 1;
  69.     frame.right -= 1;
  70.     SBooleanRect sides = { true, true, false, false };
  71.     UGraphicGizmos::BevelTintPartialRect(frame, 1, sGATwoGrayLevels, sGAThreeGrayLevels, sides);
  72.  
  73.     // corner hilites            
  74.     UGraphicGizmos::BevelTintPixel(inRect.left + 3, inRect.top + 3, sGATwoGrayLevels, true);
  75.     UGraphicGizmos::BevelTintPixel(inRect.left + 1, inRect.top + 2, sGAThreeGrayLevels, false);
  76.     UGraphicGizmos::BevelTintPixel(inRect.left + 2, inRect.top + 1, sGAThreeGrayLevels, false);
  77.     UGraphicGizmos::BevelTintPixel(inRect.left + 1, inRect.bottom - 3, sGAThreeGrayLevels, false);
  78.     UGraphicGizmos::BevelTintPixel(inRect.left + 2, inRect.bottom - 2, sGAThreeGrayLevels, false);
  79.     UGraphicGizmos::BevelTintPixel(inRect.right - 3, inRect.top + 1, sGAThreeGrayLevels, false);
  80.     UGraphicGizmos::BevelTintPixel(inRect.right - 2, inRect.top + 2, sGAThreeGrayLevels, false);
  81.  
  82.     // bevel dark side
  83.     ::OffsetRect(&frame, 1, 1);
  84.     sides.left = sides.top = false;
  85.     sides.right = sides.bottom = true;
  86.     UGraphicGizmos::BevelTintPartialRect(frame, 1, sGATwoGrayLevels, sGAThreeGrayLevels, sides);
  87.  
  88.     UGraphicGizmos::BevelTintLine(frame.left, frame.bottom,
  89.                                   frame.right, frame.bottom,
  90.                                   sGASixGrayLevels, false);
  91.  
  92.     UGraphicGizmos::BevelTintLine(frame.right, frame.bottom - 1,
  93.                                   frame.right, frame.top,
  94.                                   sGASixGrayLevels, false);
  95.  
  96.     // lower right corner pixel dark "hilites"
  97.     UGraphicGizmos::BevelTintPixel(inRect.right - 3, inRect.bottom - 3, sGAThreeGrayLevels, false);
  98.     UGraphicGizmos::BevelTintPixel(inRect.right - 4, inRect.bottom - 4, sGAThreeGrayLevels, false);
  99. }
  100.  
  101.  
  102. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  103. //    Ñ    DrawGAButtonPressedBevelTint
  104. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  105. //    This function is based in part on LGAPushButton::DrawButtonHilitedColor().
  106. //    Given a rect and assuming the content of the rect is filled with 40% gray
  107. //    (0x6666, 0x6666, 0x6666), this function will apply tints such that it will
  108. //    look like a GA button that's pressed down.
  109.  
  110. void UGAAppearance::DrawGAButtonPressedBevelTint(
  111.     const Rect &inRect)
  112. {
  113.     StColorPenState thePenSaver;
  114.     thePenSaver.Normalize();
  115.  
  116.     Rect frame = inRect;
  117.  
  118.     // Draw frame
  119.     //::RGBForeColor(&UGAColorRamp::GetBlackColor());
  120.     ::RGBForeColor(&UGAColorRamp::GetColor(colorRamp_Gray8));
  121.     ::FrameRoundRect(&frame, 8, 8);
  122.  
  123.     // Ñ LIGHT EDGES
  124.     // Ñ Start by rendering the bevelled edges of the sides facing the light
  125.     // source
  126.     // Draw first dark bevel
  127.     // Left
  128.     UGraphicGizmos::BevelTintLine(frame.left + 1, frame.top + 2,
  129.                                   frame.left + 1, frame.bottom - 2,
  130.                                   sGATwoGrayLevels, false);
  131.     // Top
  132.     UGraphicGizmos::BevelTintLine(frame.left + 2, frame.top + 1,
  133.                                   frame.right - 2, frame.top + 1,
  134.                                   sGATwoGrayLevels, false);
  135.  
  136.     // second topleft dark bevel 
  137.     ::InsetRect(&frame, 2, 2);
  138.     frame.bottom -= 1;
  139.     frame.right -= 1;
  140.     SBooleanRect sides = { true, true, false, false };
  141.     UGraphicGizmos::BevelTintPartialRect(frame, -1, sGAOneGrayLevel, sGAOneGrayLevel, sides);
  142.  
  143.     // corner "hilites"
  144.     UGraphicGizmos::BevelTintPixel(inRect.left + 3, inRect.top + 3, sGAOneGrayLevel, false);
  145.     UGraphicGizmos::BevelTintPixel(inRect.left + 2, inRect.top + 2, sGAOneGrayLevel, false);
  146.     UGraphicGizmos::BevelTintPixel(inRect.left + 2, inRect.bottom - 2, sGAOneGrayLevel, true);
  147.     UGraphicGizmos::BevelTintPixel(inRect.right - 2, inRect.top + 2, sGAOneGrayLevel, true);
  148.  
  149.     // Ñ SHADOW EDGES
  150.     ::OffsetRect(&frame, 1, 1);
  151.     sides.left = sides.top = false;
  152.     sides.right = sides.bottom = true;
  153.     UGraphicGizmos::BevelTintPartialRect(frame, -1, sGAOneGrayLevel, sGAOneGrayLevel, sides);
  154.  
  155.     UGraphicGizmos::BevelTintLine(frame.left, frame.bottom,
  156.                                   frame.right, frame.bottom,
  157.                                   sGATwoGrayLevels, true);
  158.  
  159.     UGraphicGizmos::BevelTintLine(frame.right, frame.bottom - 1,
  160.                                   frame.right, frame.top,
  161.                                   sGATwoGrayLevels, true);
  162.  
  163.     // lower right corner pixel dark "hilites"
  164.     UGraphicGizmos::BevelTintPixel(inRect.right - 3, inRect.bottom - 3, sGAOneGrayLevel, true);
  165.     UGraphicGizmos::BevelTintPixel(inRect.right - 4, inRect.bottom - 4, sGAOneGrayLevel, true);    
  166. }
  167.  
  168.  
  169. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  170. //    Ñ    DrawGAButtonDimmedBevelTint
  171. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  172. //    This function is based in part on LGAPushButton::DrawButtonDimmedColor().
  173. //    Given a rect and assuming the content of the rect is filled with 87% gray
  174. //    (0xDDDD, 0xDDDD, 0xDDDD), this function will apply tints such that it will
  175. //    look like a dimmed GA button
  176.  
  177. void UGAAppearance::DrawGAButtonDimmedBevelTint(
  178.     const Rect &inRect)
  179. {
  180.     Rect frame = inRect;
  181.  
  182.     // Ñ Draw the frame for the control outside of everything else
  183. //    ::RGBForeColor ( &UGAColorRamp::GetColor(colorRamp_Gray7) );
  184. //    ::FrameRoundRect ( &frame, 8, 8 );
  185.     UGraphicGizmos::BevelTintRoundRect(frame, 8, 8, sGAFiveGrayLevels, false);
  186. }
  187.  
  188.  
  189. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  190. //    Ñ    DrawGAPopupBevelTint
  191. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  192. //    This function is based in part on LGAPopup::DrawPopupNormalColor().
  193. //    Given a rect and assuming the content of the rect is filled with 87% gray
  194. //    (0xDDDD, 0xDDDD, 0xDDDD), this function will apply tints such that it will
  195. //    look like a GA popup menu
  196.  
  197. void UGAAppearance::DrawGAPopupBevelTint(
  198.     const Rect &inRect)
  199. {
  200.     StColorPenState thePenSaver;
  201.     thePenSaver.Normalize();
  202.  
  203.     Rect frame = inRect;
  204.  
  205.     // Draw frame
  206.     ::RGBForeColor(&UGAColorRamp::GetBlackColor());
  207.     ::FrameRoundRect(&frame, 8, 8);
  208.  
  209.     // Ñ LIGHT EDGES
  210.     // Ñ Start by rendering the bevelled edges of the sides facing the light
  211.     // source
  212.     // Draw first dark bevel
  213.     // Left
  214.     UGraphicGizmos::BevelTintLine(frame.left + 1, frame.top + 2,
  215.                                   frame.left + 1, frame.bottom - 2,
  216.                                   sGATwoGrayLevels, true);
  217.     // Top
  218.     UGraphicGizmos::BevelTintLine(frame.left + 2, frame.top + 1,
  219.                                   frame.right - gsPopup_ArrowButtonWidth - 1, frame.top + 1,
  220.                                   sGATwoGrayLevels, true);
  221.  
  222.     // Ñ SHADOW EDGES
  223.     // Ñ Render the shadow bevels
  224.     // Bottom
  225.     UGraphicGizmos::BevelTintLine(frame.left + 2, frame.bottom - 2,
  226.                                   frame.right - gsPopup_ArrowButtonWidth, frame.bottom - 2,
  227.                                   sGAThreeGrayLevels, false);
  228.     // Right
  229.     UGraphicGizmos::BevelTintLine(frame.right - gsPopup_ArrowButtonWidth, frame.top + 2,
  230.                                   frame.right - gsPopup_ArrowButtonWidth, frame.bottom - 3,
  231.                                   sGAThreeGrayLevels, false);
  232.     // corner hilite
  233.     UGraphicGizmos::BevelTintPixel(frame.right - gsPopup_ArrowButtonWidth, frame.top + 1,
  234.                                    sGAOneGrayLevel, true);
  235.     // ÑÑ EDGES ON ARROW BUTTON
  236.     // Ñ LIGHT EDGES
  237.     // Ñ Start by rendering the bevelled edges of the sides facing the light
  238.     // source
  239.     // Left
  240.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 2), frame.top + 2,
  241.                                   frame.right - (gsPopup_ArrowButtonWidth - 2), frame.bottom - 4,
  242.                                   sGATwoGrayLevels, true);
  243.     // Top
  244.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 3), frame.top + 2,
  245.                                   frame.right - 4, frame.top + 2,
  246.                                   sGATwoGrayLevels, true);
  247.     // Ñ SHADOW EDGES
  248.     // Ñ Render the shadow bevels
  249.     // Light shadow bevel
  250.     // Bottom
  251.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 3), frame.bottom - 3,
  252.                                   frame.right - 3, frame.bottom - 3,
  253.                                   sGAThreeGrayLevels, false);
  254.     // Right
  255.     UGraphicGizmos::BevelTintLine(frame.right - 3, frame.top + 3,
  256.                                   frame.right - 3, frame.bottom - 4,
  257.                                   sGAThreeGrayLevels, false);
  258.     // Dark shadow bevel
  259.     // Bottom
  260.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 2), frame.bottom - 2,
  261.                                   frame.right - 2, frame.bottom - 2,
  262.                                   sGASixGrayLevels, false);
  263.     // Right
  264.     UGraphicGizmos::BevelTintLine(frame.right - 2, frame.top + 3,
  265.                                   frame.right - 2, frame.bottom - 2,
  266.                                   sGASixGrayLevels, false);
  267.     // corner hilites
  268.     UGraphicGizmos::BevelTintPixel(frame.right - 3, frame.top + 1,
  269.                                    sGATwoGrayLevels, false);
  270.     UGraphicGizmos::BevelTintPixel(frame.right - (gsPopup_ArrowButtonWidth - 1), frame.bottom - 2,
  271.                                    sGATwoGrayLevels, false);
  272.     UGraphicGizmos::BevelTintPixel(frame.right - 2, frame.top + 2,
  273.                                    sGAThreeGrayLevels, false);
  274.     UGraphicGizmos::BevelTintPixel(frame.right - 3, frame.bottom - 3,
  275.                                    sGAThreeGrayLevels, false);
  276. }
  277.  
  278.  
  279. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  280. //    Ñ    DrawGAPopupPressedBevelTint
  281. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  282. //    This function is based in part on LGAPopup::DrawPopupHilitedColor().
  283. //    Given a rect and assuming the content of the rect is filled with 40% gray
  284. //    (0x6666, 0x6666, 0x6666), this function will apply tints such that it will
  285. //    look like a GA popup menu that's pressed down.
  286.  
  287. void UGAAppearance::DrawGAPopupPressedBevelTint(
  288.     const Rect    &inRect)
  289. {
  290.     StColorPenState thePenSaver;
  291.     thePenSaver.Normalize();
  292.  
  293.     Rect frame = inRect;
  294.  
  295.     ::RGBForeColor(&UGAColorRamp::GetBlackColor());
  296.     ::FrameRoundRect(&frame, 8, 8);
  297.     
  298.     // Ñ LIGHT EDGES
  299.     // Ñ Start by rendering the bevelled edges of the sides facing the light
  300.     // source
  301.     // Left
  302.     UGraphicGizmos::BevelTintLine(frame.left + 1, frame.top + 2,
  303.                                   frame.left + 1, frame.bottom - 2,
  304.                                   sGAOneGrayLevel, false);
  305.     // Top
  306.     UGraphicGizmos::BevelTintLine(frame.left + 2, frame.top + 1,
  307.                                   frame.right - gsPopup_ArrowButtonWidth, frame.top + 1,
  308.                                   sGAOneGrayLevel, false);
  309.  
  310.     // Ñ SHADOW EDGES
  311.     // Ñ Render the shadow bevels
  312.     // Bottom
  313.     UGraphicGizmos::BevelTintLine(frame.left + 2, frame.bottom - 2,
  314.                                   frame.right - gsPopup_ArrowButtonWidth, frame.bottom - 2,
  315.                                   sGAOneGrayLevel, true);
  316.     // Right
  317.     UGraphicGizmos::BevelTintLine(frame.right - gsPopup_ArrowButtonWidth, frame.top + 2,
  318.                                   frame.right - gsPopup_ArrowButtonWidth, frame.bottom - 3,
  319.                                   sGAOneGrayLevel, true);
  320.  
  321.     // ÑÑ EDGES ON ARROW BUTTON
  322.     // Ñ LIGHT EDGES
  323.     // Ñ Start by rendering the bevelled edges of the sides facing the light
  324.     // source
  325.     // Draw first dark bevel
  326.     // Left
  327.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 1), frame.top + 1,
  328.                                   frame.right - (gsPopup_ArrowButtonWidth - 1), frame.bottom - 2,
  329.                                   sGATwoGrayLevels, false);
  330.     // Top
  331.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 2), frame.top + 1,
  332.                                   frame.right - 3, frame.top + 1,
  333.                                   sGATwoGrayLevels, false);
  334.     // Draw second dark bevel
  335.     // Left
  336.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 2), frame.top + 2,
  337.                                   frame.right - (gsPopup_ArrowButtonWidth - 2), frame.bottom - 4,
  338.                                   sGAOneGrayLevel, false);
  339.     // Top
  340.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 3), frame.top + 2,
  341.                                   frame.right - 4, frame.top + 2,
  342.                                   sGAOneGrayLevel, false);
  343.  
  344.     // Ñ SHADOW EDGES
  345.     // Ñ Render the shadow bevels
  346.     // First light bevel
  347.     // Right
  348.     UGraphicGizmos::BevelTintLine(frame.right - 3, frame.top + 3,
  349.                                   frame.right - 3, frame.bottom - 4,
  350.                                   sGAOneGrayLevel, true);
  351.     // Bottom
  352.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 3), frame.bottom - 3,
  353.                                   frame.right - 4, frame.bottom - 3,
  354.                                   sGAOneGrayLevel, true);
  355.     // Second light bevel
  356.     // Right
  357.     UGraphicGizmos::BevelTintLine(frame.right - 2, frame.top + 3,
  358.                                   frame.right - 2, frame.bottom - 3,
  359.                                   sGATwoGrayLevels, true);
  360.     // Bottom
  361.     UGraphicGizmos::BevelTintLine(frame.right - (gsPopup_ArrowButtonWidth - 2), frame.bottom - 2,
  362.                                   frame.right - 3, frame.bottom - 2,
  363.                                   sGATwoGrayLevels, true);
  364.     // corner hilite
  365.     UGraphicGizmos::BevelTintPixel(frame.right - 3, frame.bottom - 3,
  366.                                    sGATwoGrayLevels, true);
  367.  
  368. }
  369.  
  370.  
  371. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  372. //    Ñ    DrawGAPopupDimmedBevelTint
  373. // ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  374. //    This function is based in part on LGAPopup::DrawPopupDimmedColor().
  375. //    Given a rect and assuming the content of the rect is filled with 87% gray
  376. //    (0xDDDD, 0xDDDD, 0xDDDD), this function will apply tints such that it will
  377. //    look like a dimmed GA popup menu
  378.  
  379. void UGAAppearance::DrawGAPopupDimmedBevelTint(
  380.     const Rect    &inRect)
  381. {
  382.     Rect frame = inRect;
  383.  
  384.     // draw round rect frame
  385.     UGraphicGizmos::BevelTintRoundRect(frame, 8, 8, sGAFiveGrayLevels, false);
  386.     // draw seperator between text and arrow
  387.     UGraphicGizmos::BevelTintLine(frame.right - gsPopup_ArrowButtonWidth,
  388.                                   frame.top + 1,
  389.                                   frame.right - gsPopup_ArrowButtonWidth,
  390.                                   frame.bottom - 2,
  391.                                   sGAFiveGrayLevels,
  392.                                   false);
  393. }
  394.  
  395.