Esempio n. 1
0
        private void InitializeComponents()
        {
            this.theForm = new Form {
                BackColor = this.BackColor, WindowState = this.fullscreen ? FormWindowState.Maximized : FormWindowState.Normal
            };
            this.theForm.Text = "Fleux.Net";

            if (!this.fullscreen)
            {
                var mainMenu1 = new System.Windows.Forms.MainMenu();
                this.theForm.Menu = mainMenu1;

                // MenuItems
                this.LeftMenu = new MenuHandler {
                    Visible = true, Enabled = true
                };
                this.RightMenu = new MenuHandler {
                    Visible = true, Enabled = true
                };
                this.LeftMenu.PropertyChanged  += this.MenuPropertyChanged;
                this.RightMenu.PropertyChanged += this.MenuPropertyChanged;
                this.SyncWinFormsMenuItems();
            }

            this.theForm.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            this.theForm.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Dpi;
            this.theForm.AutoScroll          = true;
            this.theForm.BackColor           = System.Drawing.Color.Black;
            this.theForm.ClientSize          = new System.Drawing.Size(240, 268);

            // DpiHelper Set
            if (!FleuxApplication.Initialized)
            {
                FleuxApplication.Initialize(this.theForm.CreateGraphics());
            }

            this.theForm.Activated += (s, e) => this.OnActivated();
        }
Esempio n. 2
0
        public Font CreateFont(string fontFace, int size, FontStyle fontStyle)
        {
#if WINCE
            var logFont = new LogFont
            {
                FaceName = fontFace,
                Height   = FleuxApplication.FromPointsToPixels(size),
                //// Width = (int) (FleuxApplication.FromPointsToPixels(size) * 0.425),
                Weight = ((fontStyle & FontStyle.Bold) == FontStyle.Bold) ? LogFontWeight.ExtraLight : LogFontWeight.Thin
            };
            switch (this.fontQuality)
            {
            case FontQualityNormal:
                logFont.Quality = LogFontQuality.Default;
                break;

            case FontQualityDraft:
                logFont.Quality = LogFontQuality.Draft;
                break;

            case FontQualityAntialiased:
                logFont.Quality = LogFontQuality.AntiAliased;
                break;

            case FontQualityClearType:
                logFont.Quality = LogFontQuality.ClearType;
                break;

            default:
                break;
            }
            return(Font.FromLogFont(logFont));
#else
            return(new Font(fontFace, size, fontStyle));
#endif
        }