Exemple #1
0
 public virtual void CloseWindow()
 {
     base.RemoveControls();
     // Do cleanup
     mIsDisposing = true;
     mBuffer.Close();
     mBorderBuffer.Close();
     mCloseButtonSurf.Close();
     mMaximizeButtonSurf.Close();
     mMinimizeButtonSurf.Close();
     mTitleBarSurface.Close();
     WindowManager.RemoveWindowQuick(this);
     if (OnWindowClosed != null)
     {
         OnWindowClosed(this, null);
     }
 }
Exemple #2
0
        public SdlDotNet.Graphics.Surface RenderPassword(char passwordChar)
        {
            int charWidth = mFont.SizeText(passwordChar.ToString()).Width;

            SdlDotNet.Graphics.Surface tempSurf = new SdlDotNet.Graphics.Surface(mMaxWidth, mFont.Height);
            tempSurf.Fill(Color.Transparent);
            tempSurf.TransparentColor = Color.Transparent;
            tempSurf.Transparent      = true;
            int lastX = 0;

            for (int i = 0; i < mChars.Count; i++)
            {
                if (mChars[i].Char != "\n")
                {
                    if (mChars[i].CharOptions != null)
                    {
                        mFont.Bold      = mChars[i].CharOptions.Bold;
                        mFont.Italic    = mChars[i].CharOptions.Italic;
                        mFont.Underline = mChars[i].CharOptions.Underline;
                    }
                    Color bltColor;
                    if (mChars[i].CharColor == Color.Empty)
                    {
                        bltColor = mDefaultForeColor;
                    }
                    else
                    {
                        bltColor = mChars[i].CharColor;
                    }
                    SdlDotNet.Graphics.Surface charSurf = mFont.Render(passwordChar.ToString(), bltColor, false);
                    tempSurf.Blit(charSurf, new Point(lastX, 0));
                    charSurf.Close();
                    if (mFont.Bold == true)
                    {
                        mFont.Bold = false;
                    }
                    if (mFont.Italic == true)
                    {
                        mFont.Italic = false;
                    }
                    if (mFont.Underline == true)
                    {
                        mFont.Underline = false;
                    }
                    lastX += charWidth;
                }
            }

            return(tempSurf);
        }