Пример #1
0
 public override void Preparation(MHEngine engine)
 {
     if (AvailabilityStatus)
     {
         return;                     // Already prepared
     }
     // Set up the internal attributes.
     m_nLineWidth = m_nOriginalLineWidth;
     m_LineStyle  = m_OriginalLineStyle;
     if (m_OrigLineColour.IsSet())
     {
         m_LineColour.Copy(m_OrigLineColour);
     }
     else
     {
         m_LineColour.SetFromString("\u0000\u0000\u0000\u0000");  // Default is black
     }
     if (m_OrigFillColour.IsSet())
     {
         m_FillColour.Copy(m_OrigFillColour);
     }
     else
     {
         m_FillColour.SetFromString("\u0000\u0000\u0000\u00FF"); // Default is transparent
     }
     base.Preparation(engine);                                   // Prepare the base class.
 }
Пример #2
0
        public override void Preparation(MHEngine engine)
        {
            if (AvailabilityStatus)
            {
                return;
            }
            // Set the colours and font up from the originals if specified otherwise use the application defaults.
            //  if (m_OrigFont.IsSet()) m_Font.Copy(m_OrigFont);
            //  else m_Font.Copy(engine->m_DefaultFont);
            if (m_OriginalTextColour.IsSet())
            {
                m_textColour.Copy(m_OriginalTextColour);
            }
            else
            {
                engine.GetDefaultTextColour(m_textColour);
            }
            Logging.Assert(m_textColour.IsSet());
            if (m_OriginalBgColour.IsSet())
            {
                m_bgColour.Copy(m_OriginalBgColour);
            }
            else
            {
                engine.GetDefaultBGColour(m_bgColour);
            }
            Logging.Assert(m_bgColour.IsSet());
            if (m_OriginalFontAttrs.Size > 0)
            {
                m_fontAttrs.Copy(m_OriginalFontAttrs);
            }
            else
            {
                engine.GetDefaultFontAttrs(m_fontAttrs);
            }
            base.Preparation(engine);

            m_pDisplay.SetSize(m_nBoxWidth, m_nBoxHeight);
            m_NeedsRedraw = true;
        }
Пример #3
0
 public MHText(MHText reference) : base(reference)
 {
     m_OrigFont.Copy(reference.m_OrigFont);
     m_OriginalFontAttrs.Copy(reference.m_OriginalFontAttrs);
     m_OriginalTextColour.Copy(reference.m_OriginalTextColour);
     m_OriginalBgColour.Copy(reference.m_OriginalBgColour);
     m_nCharSet        = reference.m_nCharSet;
     m_HorizJ          = reference.m_HorizJ;
     m_VertJ           = reference.m_VertJ;
     m_LineOrientation = reference.m_LineOrientation;
     m_StartCorner     = reference.m_StartCorner;
     m_fTextWrap       = reference.m_fTextWrap;
     m_pDisplay        = null;
 }