コード例 #1
0
 protected override void CoordsChanges(PopUpCoords coords)
 {
     if (this.Client != null)
     {
         this.Client.dbConfig.AutoKey.WinPinned           = coords.IsPinned;
         this.Client.dbConfig.AutoKey.WinShowAttachParent = coords.IsAttach;
         this.Client.dbConfig.AutoKey.ScreenX             = coords.X;
         this.Client.dbConfig.AutoKey.ScreenY             = coords.Y;
         this.Client.dbConfig.PendingChanges = true;
     }
 }
コード例 #2
0
        public PopUpForm(ClientForm parent, PopUpCoords initial)
        {
            InitializeComponent();
            this.lTitle.Text = this.Title;

            this.ClientForm = parent;
            this.Coords     = initial;

            this.Deactivate += (sender, e) => this.SetShow(false);
            this.Activated  += (sender, e) => { CalculatePosition(); ReDraw(); this.Closeable = true; };
            this.ClientForm.OnCustomMove += (sender, e) => CalculatePosition();

            // Windows Move
            this.MouseDown += (sender, e) =>
            {
                WinMovePosition = new Point(Cursor.Position.X - Location.X, Cursor.Position.Y - Location.Y);
                WinMoveMover    = true;
                WinMoveMoved    = false;
            };
            this.MouseMove += (sender, e) => { if (WinMoveMover)
                                               {
                                                   this.Location = new Point(Cursor.Position.X - WinMovePosition.X, Cursor.Position.Y - WinMovePosition.Y); WinMoveMoved = true;
                                               }
            };
            this.MouseUp += (sender, e) =>
            {
                WinMoveMover = false;
                if (WinMoveMoved)
                {
                    this.Coords.IsAttach = false;
                    this.Coords.X        = this.Location.X;
                    this.Coords.Y        = this.Location.Y;
                    CoordsChanges(this.Coords);
                    ReDraw();
                }
            };
        }
コード例 #3
0
 protected virtual void CoordsChanges(PopUpCoords coords)
 {
 }