Пример #1
0
        public static Matrix SetIdentity()
        {
            Matrix matrix = new Matrix();

            LibuiLibrary.uiDrawMatrixSetIdentity(LibuiConvert.ToLibuiDrawMatrix(matrix));
            return(matrix);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CheckBox"/> class with the specified text.
        /// </summary>
        /// <param name="text">The text specified by the <see cref="CheckBox"/>.</param>
        public CheckBox(string text)
        {
            IntPtr strPtr = LibuiConvert.ToLibuiString(text);

            Handle = new SafeControlHandle(LibuiLibrary.uiNewCheckbox(strPtr));
            Marshal.FreeHGlobal(strPtr);
            this.text = text;
            InitializeEvents();
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Window"/> class, with the options of specifying
        /// the window's width, height, title, and whether or not it has a <see cref="MenuStrip"/>.
        /// </summary>
        /// <param name="width">The width of the window.</param>
        /// <param name="height">The height of the window.</param>
        /// <param name="title">The title at the top of the window.</param>
        /// <param name="hasMenuStrip">Whether or not the window will have a menu.</param>
        public Window(int width = 500, int height = 300, string title = null, bool hasMenuStrip = false) : base()
        {
            if (string.IsNullOrEmpty(title))
            {
                title = "LibUISharp";
            }

            IntPtr strPtr = LibuiConvert.ToLibuiString(title);

            Handle = new SafeControlHandle(LibuiLibrary.uiNewWindow(strPtr, width, height, hasMenuStrip));
            Marshal.FreeHGlobal(strPtr);

            WindowCache.Add(Handle, this);
            this.title = title;
            size       = new Size(width, height);
            InitializeEvents();
        }
Пример #4
0
        /// <inheritdoc />
        protected sealed override void InitializeComponent()
        {
            if (PlatformHelper.IsWinNT)
            {
                IntPtr ptr = Kernel32Library.GetConsoleWindow();
                User32Library.ShowWindow(ptr, 0); // 0 = SW_HIDE, 4 = SW_SHOWNOACTIVATE
            }

            IntPtr errPtr = LibuiLibrary.uiInit(ref Options);
            string errStr = LibuiConvert.ToString(errPtr);

            if (string.IsNullOrEmpty(errStr))
            {
                Console.WriteLine(errStr);
                LibuiLibrary.uiFreeInitError(errPtr);
                throw new LibuiException(errStr);
            }
        }
Пример #5
0
 public void Transform(Matrix matrix) => LibuiLibrary.uiDrawTransform(Handle.DangerousGetHandle(), LibuiConvert.ToLibuiDrawMatrix(matrix));
Пример #6
0
 public SizeD TransformToSize()
 {
     LibuiLibrary.uiDrawMatrixTransformSize(LibuiConvert.ToLibuiDrawMatrix(this), out double width, out double height);
     return(new SizeD(width, height));
 }
Пример #7
0
 public PointD TransformToPoint()
 {
     LibuiLibrary.uiDrawMatrixTransformPoint(LibuiConvert.ToLibuiDrawMatrix(this), out double x, out double y);
     return(new PointD(x, y));
 }
Пример #8
0
 public void Invert() => LibuiLibrary.uiDrawMatrixInvert(LibuiConvert.ToLibuiDrawMatrix(this));
Пример #9
0
 public static void Multiply([Out]  Matrix dest, [In]  Matrix src) => LibuiLibrary.uiDrawMatrixMultiply(LibuiConvert.ToLibuiDrawMatrix(dest), LibuiConvert.ToLibuiDrawMatrix(src));
Пример #10
0
 public void Skew(double x, double y, double xamount, double yamount) => LibuiLibrary.uiDrawMatrixSkew(LibuiConvert.ToLibuiDrawMatrix(this), x, y, xamount, yamount);
Пример #11
0
 public void Rotate(double x, double y, double amount) => LibuiLibrary.uiDrawMatrixRotate(LibuiConvert.ToLibuiDrawMatrix(this), x, y, amount);
Пример #12
0
 public void Scale(double xCenter, double yCenter, double x, double y) => LibuiLibrary.uiDrawMatrixScale(LibuiConvert.ToLibuiDrawMatrix(this), xCenter, yCenter, x, y);
Пример #13
0
 public void Translate(double x, double y) => LibuiLibrary.uiDrawMatrixTranslate(LibuiConvert.ToLibuiDrawMatrix(this), x, y);