Esempio n. 1
0
        /// <summary>
        /// Paint the appearance of the status bar in the mini mode.
        /// </summary>
        /// <param name="e"></param>
        private void PaintMiniMode(PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            this.u_toolStrip.Visible = false;

            Size windowSize = new Size(this.u_toolStrip.Size.Width + this.u_toolStrip.Left + 10, this.u_toolStrip.Size.Height - 2);

            this.m_windowRect = new Rectangle(new Point(0, 0), windowSize);
            Rectangle windowRect = new Rectangle(0, 0, 64, windowSize.Height);
            Rectangle outside    = windowRect;

            outside.Height += 1;
            outside.Width  += 1;

            Region windowRegion = new Region(outside);

            this.Region = windowRegion;
            windowRegion.Dispose();
            // Paint the header of the status bar with a Yahoo! logo.
            g.DrawImage(this.m_barhead, 0, 0, 36, outside.Height);

            BIServerConnector callback = BIServerConnector.SharedInstance;

            if (callback != null)
            {
                // If we are now in the Alphanumeric mode, the icon on the status bar
                // in the mini mode should be a icon title "EN", otherwise, it should
                // be the icon of the current Chinese Input Method.

                Image i;
                if (callback.isAlphanumericMode())
                {
                    i = this.u_toggleAlphanumericMode.Image;
                }
                else
                {
                    i = this.u_toggleInputMethod.Image;
                }
                g.DrawImage(i, 40, 3, 20, 20);
            }

            Pen blackPen = new Pen(Color.Black);

            g.DrawRectangle(blackPen, windowRect);
            g.DrawLine(blackPen, new Point(36, 0), new Point(36, this.Height));
            blackPen.Dispose();
        }
Esempio n. 2
0
        /// <summary>
        /// Toggle English / Chinese mode.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToggleAlphanumericMode(object sender, EventArgs e)
        {
            BIServerConnector callback      = BIServerConnector.SharedInstance;
            string            currentLocale = CultureInfo.CurrentUICulture.Name;

            if (callback != null)
            {
                if (callback.isAlphanumericMode())
                {
                    this.u_toggleAlphanumericMode.Image = this.m_imageChinese;
                    if (currentLocale.Equals("zh-TW"))
                    {
                        this.Notify("\u4e2d\u6587\u6a21\u5f0f");
                    }
                    else if (currentLocale.Equals("zh-CN"))
                    {
                        this.Notify("\u4E2D\u6587\u6A21\u5F0F");
                    }
                    else
                    {
                        this.Notify("Switch to Chinese mode.");
                    }
                    callback.setAlphanumericMode(false);
                }
                else
                {
                    this.u_toggleAlphanumericMode.Image = this.m_imageEnglish;
                    if (currentLocale.Equals("zh-TW"))
                    {
                        this.Notify("\u82f1\u6587\u6a21\u5f0f");
                    }
                    else if (currentLocale.Equals("zh-CN"))
                    {
                        this.Notify("\u82F1\u6587\u6A21\u5F0F");
                    }
                    else
                    {
                        this.Notify("Switch to English mode.");
                    }
                    callback.setAlphanumericMode(true);
                }
                if (this.m_isMiniMode == true && m_isUsingSystemTrayMode == false)
                {
                    this.Refresh();
                }
            }
        }