Ejemplo n.º 1
0
 /// <summary>
 /// Allow for the form to be dragged around.
 /// </summary>
 private void MainFormSmall_MouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         WinAPIComponents.ReleaseCapture();
         WinAPIComponents.SendMessage(Handle, WinAPIComponents.WM_NCLBUTTONDOWN, WinAPIComponents.HT_CAPTION, 0);
         this.Invalidate();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Apply correct theming to each page/MDI client.
 /// </summary>
 private void ThemeMDIClients()
 {
     foreach (MdiClient Control in this.Controls.OfType <MdiClient>())
     {
         // Set the BackColor of the MdiClient control.
         Control.BackColor  = this.BackColor;
         Control.MouseMove += MainFormSmall_MouseMove;
         WinAPIComponents.SetBevel(this, false);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets up all of the aspects of the application which are governed by this form.
 /// </summary>
 public void Setup_Application()
 {
     // Set reference in Program to this being the main window.
     Program.xSmallMainWindow = this;
     // Do not draw an outline on toolstrips!
     Toolstrip_Bottom.Renderer = new MyToolStrip();
     // Set the region of this form to be a rectangle such that the application gains rounded edges.
     this.Region = System.Drawing.Region.FromHrgn(WinAPIComponents.CreateRoundRectRgn(0, 0, this.Width, this.Height, 30, 30));
     // Set the theme controls from which other controls will inherit their colour and theme properties.
     RedirectThemeValues();
     // Automatic theming of all assets in this form.
     ThemeMethods.DoThemeAssets(this);
     // Create an instance of each form, theme the form, add it to the list of opened form and set the Multiple Document Interface parent.
     SetupSwappableScreens();
     // Automatically load the application theme.
     ThemeMethods.AutoLoadCurrentTheme();
     // Shows the default menu.
     Show_Default_Menu();
     // If the game is not Sonic Heroes, hide all irrelevant menus.
     if (!Program.Game_Is_Sonic_Heroes)
     {
         Hide_NonSonicHeroes();
     }
 }