Ejemplo n.º 1
0
 // ERROR: Handles clauses are not supported in C#
 private void Clock_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (WindowComposition.ShuttingDown == false)
     {
         e.Cancel = true;
         WindowComposition.CloseForm(this.ParentForm, pbtn, API.CurrentSkin.WindowCloseAnimation);
     }
 }
Ejemplo n.º 2
0
 private void titlebar_MouseMove(object sender, MouseEventArgs e)
 {
     if (Resizing == true)
     {
         int left = 0;
         int top  = 0;
         if (e.X < LastMouseX)
         {
             left = -1;
         }
         else if (e.X > LastMouseX)
         {
             left = 1;
         }
         if (e.Y < LastMouseY)
         {
             top = -1;
         }
         else if (e.Y > LastMouseY)
         {
             top = 1;
         }
         if (API.CurrentSkin.DragAnimation == WindowDragEffect.Shake)
         {
             WindowComposition.AnimateDragWindow(this.ParentForm, API.CurrentSkin.DragAnimation, true, left, top);
         }
         else
         {
             ParentForm.Left += left;
             ParentForm.Top  += top;
             ParentForm.Tag   = ParentForm.Location;
         }
     }
     if (Viruses.InfectedWith("windowspazzer"))
     {
         int left = 0;
         int top  = 0;
         if (e.X < LastMouseX)
         {
             left = -1;
         }
         else if (e.X > LastMouseX)
         {
             left = 1;
         }
         if (e.Y < LastMouseY)
         {
             top = -1;
         }
         else if (e.Y > LastMouseY)
         {
             top = 1;
         }
         WindowComposition.AnimateDragWindow(this.ParentForm, API.CurrentSkin.DragAnimation, true, left, top);
     }
 }
Ejemplo n.º 3
0
 private void titlebar_MouseDown(object sender, MouseEventArgs e)
 {
     // Handle Draggable Windows
     if (API.Upgrades["draggablewindows"] == true)
     {
         if (e.Button == MouseButtons.Left)
         {
             WindowComposition.AnimateDragWindow(this.ParentForm, API.CurrentSkin.DragAnimation, true);
             LastMouseX = e.X;
             LastMouseY = e.Y;
             Resizing   = true;
         }
         //ShiftOSDesktop.log = //ShiftOSDesktop.log + My.Computer.Clock.LocalTime + " User dragged " + this.Name + " to " + this.Location.ToString + Environment.NewLine;
     }
 }
Ejemplo n.º 4
0
        // ERROR: Handles clauses are not supported in C#
        private void Template_Load(object sender, EventArgs e)
        {
            setupall();
            if (ParentForm.Name == "Terminal" && API.Upgrades["windowedterminal"] == false)
            {
                HideAll();
            }
            string x = ParentForm.Width.ToString();
            string y = ParentForm.Height.ToString();

            ParentForm.MinimumSize = new Size(Convert.ToInt16(x), Convert.ToInt16(y));
            string mx  = ParentForm.MinimumSize.Width.ToString();
            string my  = ParentForm.MinimumSize.Height.ToString();
            Form   frm = ParentForm;

            pbtn = new PanelButton(AppName, AppIcon, ref frm);
            API.PanelButtons.Add(pbtn);
            if (API.CurrentSession != null)
            {
                API.CurrentSession.SetupPanelButtons();
            }
            ParentForm.FormClosing += new FormClosingEventHandler(this.Clock_FormClosing);
            var vtimer = new Timer();

            vtimer.Interval = 1000;
            vtimer.Tick    += (object s, EventArgs a) =>
            {
                try {
                    if (API.Upgrades["titlebar"] == true)
                    {
                        titlebar.Show();
                    }
                    else
                    {
                        titlebar.Hide();
                    }
                }
                catch (Exception ex)
                {
                    API.LogException(ex.Message, false);
                }
                if (Viruses.InfectedWith("windowmicrofier"))
                {
                    if (this.Width > 0)
                    {
                        this.ParentForm.MinimumSize = new Size(0, 0);
                        this.ParentForm.Width      -= 1;
                    }
                    if (this.Height > 0)
                    {
                        this.ParentForm.Height -= 1;
                    }
                }
                try {
                    if (this.ParentForm.TopMost == API.CurrentSession.UnityEnabled)
                    {
                        this.ParentForm.TopMost = !this.ParentForm.TopMost;
                    }
                }
                catch
                {
                    //FAIL.
                }
            };
            vtimer.Start();
            //try {
            ParentForm.Name = AppName.ToLower().Replace(" ", "_");

            /*}
             * catch(Exception ex)
             * {
             *  ParentForm.Name = "null";
             * }*/
            ParentForm.Tag = ParentForm.Location;
            WindowComposition.WindowsEverywhere(this.ParentForm);
        }
Ejemplo n.º 5
0
        private void titlebar_MouseUp(object s, MouseEventArgs e)
        {
            WindowComposition.AnimateDragWindow(this.ParentForm, API.CurrentSkin.DragAnimation, false);

            Resizing = false;
        }