コード例 #1
0
ファイル: MHText.cs プロジェクト: mcgoober/mheg-dotnet
 public override void Print(TextWriter writer, int nTabs)
 {
     Logging.PrintTabs(writer, nTabs); writer.Write("{:Text ");
     base.Print(writer, nTabs + 1);
     if (m_OrigFont.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":OrigFont "); m_OrigFont.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_OriginalFontAttrs.Size > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":FontAttributes "); m_OriginalFontAttrs.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_OriginalTextColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":TextColour "); m_OriginalTextColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_OriginalBgColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":BackgroundColour "); m_OriginalBgColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_nCharSet >= 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":CharacterSet {0}\n", m_nCharSet);
     }
     if (m_HorizJ != Start)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":HJustification {0}\n", rchJustification[m_HorizJ - 1]);
     }
     if (m_VertJ != Start)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":VJustification {0}\n", rchJustification[m_VertJ - 1]);
     }
     if (m_LineOrientation != Horizontal)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":LineOrientation {0}\n", rchlineOrientation[m_LineOrientation - 1]);
     }
     if (m_StartCorner != UpperLeft)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":StartCorner {0}\n", rchStartCorner[m_StartCorner - 1]);
     }
     if (m_fTextWrap)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":TextWrapping true\n");
     }
     Logging.PrintTabs(writer, nTabs); writer.Write("}\n");
 }
コード例 #2
0
ファイル: MHLineArt.cs プロジェクト: mcgoober/mheg-dotnet
 public override void Print(TextWriter writer, int nTabs)
 {
     base.Print(writer, nTabs);
     if (!m_fBorderedBBox)
     {
         Logging.PrintTabs(writer, nTabs); writer.Write(":BBBox false\n");
     }
     if (m_nOriginalLineWidth != 1)
     {
         Logging.PrintTabs(writer, nTabs); writer.Write(":OrigLineWidth {0}\n", m_nOriginalLineWidth);
     }
     if (m_OriginalLineStyle != LineStyleSolid)
     {
         Logging.PrintTabs(writer, nTabs); writer.Write(":OrigLineStyle {0}\n", m_OriginalLineStyle);
     }
     if (m_OrigLineColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs); writer.Write(":OrigRefLineColour "); m_OrigLineColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_OrigFillColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs); writer.Write(":OrigRefFillColour "); m_OrigFillColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
 }
コード例 #3
0
ファイル: MHText.cs プロジェクト: mcgoober/mheg-dotnet
        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;
        }
コード例 #4
0
 public override void Print(TextWriter writer, int nTabs)
 {
     Logging.PrintTabs(writer, nTabs);
     writer.Write("{:Application ");
     base.Print(writer, nTabs);
     if (m_OnSpawnCloseDown.Size != 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":OnSpawnCloseDown");
         m_OnSpawnCloseDown.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_OnRestart.Size != 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":OnRestart");
         m_OnRestart.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_nCharSet > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":CharacterSet {0}\n", m_nCharSet);
     }
     if (m_BGColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":BackgroundColour "); m_BGColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_nTextCHook > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":TextCHook {0}\n", m_nTextCHook);
     }
     if (m_TextColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":TextColour "); m_TextColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_Font.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":Font "); m_Font.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_FontAttrs.Size > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":FontAttributes "); m_FontAttrs.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_nIPCHook > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":InterchgPrgCHook {0}\n", m_nIPCHook);
     }
     if (m_nStrCHook > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":StreamCHook {0}\n", m_nStrCHook);
     }
     if (m_nBitmapCHook > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":BitmapCHook {0}\n", m_nBitmapCHook);
     }
     if (m_nLineArtCHook > 0)
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":LineArtCHook {0}\n", m_nLineArtCHook);
     }
     if (m_ButtonRefColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":ButtonRefColour "); m_ButtonRefColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_HighlightRefColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":HighlightRefColour "); m_HighlightRefColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     if (m_SliderRefColour.IsSet())
     {
         Logging.PrintTabs(writer, nTabs + 1); writer.Write(":SliderRefColour "); m_SliderRefColour.Print(writer, nTabs + 1); writer.Write("\n");
     }
     writer.Write("}\n");
 }