diff --git a/DS4Control/DS4LightBar.cs b/DS4Control/DS4LightBar.cs index b2c2b3c..6989a87 100644 --- a/DS4Control/DS4LightBar.cs +++ b/DS4Control/DS4LightBar.cs @@ -121,7 +121,7 @@ namespace DS4Control }; if (haptics.IsLightBarSet()) { - if (device.Battery <= Global.getFlashAt(deviceNum)) + if (device.Battery <= Global.getFlashAt(deviceNum) && !defualtLight) { int level = device.Battery / 10; if (level >= 10) diff --git a/DS4Control/ScpUtil.cs b/DS4Control/ScpUtil.cs index 262dc6b..e372b08 100644 --- a/DS4Control/ScpUtil.cs +++ b/DS4Control/ScpUtil.cs @@ -597,9 +597,13 @@ namespace DS4Control } public DS4KeyType GetCustomKeyType(int device, DS4Controls controlName) { - if (customMapKeyTypes[device].ContainsKey(controlName)) - return customMapKeyTypes[device][controlName]; - else return 0; + try + { + if (customMapKeyTypes[device].ContainsKey(controlName)) + return customMapKeyTypes[device][controlName]; + else return 0; + } + catch { return 0; } } diff --git a/DS4Tool/DS4Tool.csproj b/DS4Tool/DS4Tool.csproj index e44df50..66aa008 100644 --- a/DS4Tool/DS4Tool.csproj +++ b/DS4Tool/DS4Tool.csproj @@ -198,34 +198,34 @@ + + - - - + - - - - + + + + diff --git a/DS4Tool/KBM360.Designer.cs b/DS4Tool/KBM360.Designer.cs index 8c0d436..95c4f6a 100644 --- a/DS4Tool/KBM360.Designer.cs +++ b/DS4Tool/KBM360.Designer.cs @@ -1430,7 +1430,7 @@ this.pictureBox2.Location = new System.Drawing.Point(747, 41); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(97, 140); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox2.TabIndex = 290; this.pictureBox2.TabStop = false; // @@ -1713,7 +1713,7 @@ this.pictureBox1.Location = new System.Drawing.Point(2, 226); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(851, 177); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 316; this.pictureBox1.TabStop = false; // @@ -1759,8 +1759,8 @@ // // KBM360 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(854, 403); this.Controls.Add(this.lBMacroOrder); this.Controls.Add(this.KBMlabel); diff --git a/DS4Tool/Options.Designer.cs b/DS4Tool/Options.Designer.cs index 0045944..9ad357b 100644 --- a/DS4Tool/Options.Designer.cs +++ b/DS4Tool/Options.Designer.cs @@ -306,12 +306,13 @@ // // pBController // + this.pBController.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.pBController.Enabled = false; this.pBController.Image = global::ScpServer.Properties.Resources.DS4_Controller; this.pBController.Location = new System.Drawing.Point(0, 0); this.pBController.Name = "pBController"; this.pBController.Size = new System.Drawing.Size(245, 132); - this.pBController.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pBController.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pBController.TabIndex = 1; this.pBController.TabStop = false; // @@ -695,7 +696,7 @@ this.pBSticks.Location = new System.Drawing.Point(0, 1); this.pBSticks.Name = "pBSticks"; this.pBSticks.Size = new System.Drawing.Size(245, 132); - this.pBSticks.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pBSticks.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.pBSticks.TabIndex = 161; this.pBSticks.TabStop = false; // @@ -970,7 +971,7 @@ this.pBRainbow.Location = new System.Drawing.Point(159, 18); this.pBRainbow.Name = "pBRainbow"; this.pBRainbow.Size = new System.Drawing.Size(16, 16); - this.pBRainbow.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pBRainbow.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pBRainbow.TabIndex = 166; this.pBRainbow.TabStop = false; this.pBRainbow.Click += new System.EventHandler(this.pbRainbow_Click); @@ -1188,7 +1189,6 @@ // lBButtonMouseSens // this.lBButtonMouseSens.AutoSize = true; - this.lBButtonMouseSens.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lBButtonMouseSens.Location = new System.Drawing.Point(11, 16); this.lBButtonMouseSens.Name = "lBButtonMouseSens"; this.lBButtonMouseSens.Size = new System.Drawing.Size(92, 13); @@ -1243,7 +1243,6 @@ // lBControllerOff // this.lBControllerOff.AutoSize = true; - this.lBControllerOff.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lBControllerOff.Location = new System.Drawing.Point(11, 44); this.lBControllerOff.Name = "lBControllerOff"; this.lBControllerOff.Size = new System.Drawing.Size(84, 13); @@ -1309,7 +1308,6 @@ // this.flushHIDQueue.AccessibleName = "flushHIDQueue"; this.flushHIDQueue.AutoSize = true; - this.flushHIDQueue.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.flushHIDQueue.Location = new System.Drawing.Point(302, 39); this.flushHIDQueue.Name = "flushHIDQueue"; this.flushHIDQueue.RightToLeft = System.Windows.Forms.RightToLeft.Yes; @@ -1432,7 +1430,6 @@ // lB6Accel // this.lB6Accel.AutoSize = true; - this.lB6Accel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lB6Accel.Location = new System.Drawing.Point(220, 6); this.lB6Accel.Name = "lB6Accel"; this.lB6Accel.Size = new System.Drawing.Size(72, 13); @@ -1455,7 +1452,6 @@ // lB6Gryo // this.lB6Gryo.AutoSize = true; - this.lB6Gryo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lB6Gryo.Location = new System.Drawing.Point(5, 6); this.lB6Gryo.Name = "lB6Gryo"; this.lB6Gryo.Size = new System.Drawing.Size(67, 13); @@ -1488,7 +1484,6 @@ // lbFull // this.lbFull.AutoSize = true; - this.lbFull.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lbFull.Location = new System.Drawing.Point(7, 7); this.lbFull.Name = "lbFull"; this.lbFull.Size = new System.Drawing.Size(26, 13); @@ -1573,7 +1568,6 @@ // lBEmpty // this.lBEmpty.AutoSize = true; - this.lBEmpty.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lBEmpty.Location = new System.Drawing.Point(7, 9); this.lBEmpty.Name = "lBEmpty"; this.lBEmpty.Size = new System.Drawing.Size(39, 13); @@ -2000,8 +1994,9 @@ // // Options // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.BackColor = System.Drawing.Color.White; this.CancelButton = this.btnCancel; this.ClientSize = new System.Drawing.Size(888, 295); @@ -2027,10 +2022,8 @@ this.Text = "Options"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Options_Closed); this.MainPanel.ResumeLayout(false); - this.MainPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pBController)).EndInit(); this.SticksPanel.ResumeLayout(false); - this.SticksPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pBSticks)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numUDRainbow)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pBRainbow)).EndInit(); diff --git a/DS4Tool/Options.cs b/DS4Tool/Options.cs index 22a8175..d6a64b0 100644 --- a/DS4Tool/Options.cs +++ b/DS4Tool/Options.cs @@ -21,6 +21,7 @@ namespace ScpServer private Color reg, full; private Image colored, greyscale; ToolTip tp = new ToolTip(); + Graphics g; ScpForm root; public Options(DS4Control.Control bus_device, int deviceNum, string name, ScpForm rt) { @@ -30,6 +31,7 @@ namespace ScpServer filename = name; colored = pBRainbow.Image; root = rt; + g = CreateGraphics(); greyscale = GreyscaleImage((Bitmap)pBRainbow.Image); if (deviceNum < 4) nUDSixaxis.Value = deviceNum + 1; @@ -407,7 +409,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); pBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void greenBar_ValueChanged(object sender, EventArgs e) { @@ -420,7 +425,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); pBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void blueBar_ValueChanged(object sender, EventArgs e) { @@ -433,7 +441,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); pBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveColor(device, (byte)redBar.Value, (byte)greenBar.Value, (byte)blueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void lowRedBar_ValueChanged(object sender, EventArgs e) @@ -447,7 +458,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void lowGreenBar_ValueChanged(object sender, EventArgs e) @@ -461,7 +475,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void lowBlueBar_ValueChanged(object sender, EventArgs e) @@ -475,7 +492,10 @@ namespace ScpServer full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); lowColorChooserButton.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); Global.saveLowColor(device, (byte)lowRedBar.Value, (byte)lowGreenBar.Value, (byte)lowBlueBar.Value); - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } public Color HuetoRGB(float hue, float light, Color rgb) @@ -843,7 +863,10 @@ namespace ScpServer private void LightBar_MouseDown(object sender, MouseEventArgs e) { - tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0); + if (g.DpiX == 120) + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); + else + tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 100, 0, 2000); } private void Lightbar_MouseUp(object sender, MouseEventArgs e) diff --git a/DS4Tool/Resources/DS4 Controller.png b/DS4Tool/Resources/DS4 Controller.png index 18bc0dd..a8e4059 100644 Binary files a/DS4Tool/Resources/DS4 Controller.png and b/DS4Tool/Resources/DS4 Controller.png differ diff --git a/DS4Tool/Resources/LeftTouch.png b/DS4Tool/Resources/LeftTouch.png index f691ac5..72470c2 100644 Binary files a/DS4Tool/Resources/LeftTouch.png and b/DS4Tool/Resources/LeftTouch.png differ diff --git a/DS4Tool/Resources/MultiTouch.png b/DS4Tool/Resources/MultiTouch.png index 7ad39aa..976e639 100644 Binary files a/DS4Tool/Resources/MultiTouch.png and b/DS4Tool/Resources/MultiTouch.png differ diff --git a/DS4Tool/Resources/Pairmode.png b/DS4Tool/Resources/Pairmode.png index 2f97754..8ff4eaa 100644 Binary files a/DS4Tool/Resources/Pairmode.png and b/DS4Tool/Resources/Pairmode.png differ diff --git a/DS4Tool/Resources/RightTouch.png b/DS4Tool/Resources/RightTouch.png index 95dab65..855a95d 100644 Binary files a/DS4Tool/Resources/RightTouch.png and b/DS4Tool/Resources/RightTouch.png differ diff --git a/DS4Tool/Resources/UpperTouch.png b/DS4Tool/Resources/UpperTouch.png index 2487bb8..94ee8a2 100644 Binary files a/DS4Tool/Resources/UpperTouch.png and b/DS4Tool/Resources/UpperTouch.png differ diff --git a/DS4Tool/Resources/sticks.png b/DS4Tool/Resources/sticks.png index 1265c60..5576921 100644 Binary files a/DS4Tool/Resources/sticks.png and b/DS4Tool/Resources/sticks.png differ diff --git a/DS4Tool/ScpForm.Designer.cs b/DS4Tool/ScpForm.Designer.cs index 1b5c59e..b623081 100644 --- a/DS4Tool/ScpForm.Designer.cs +++ b/DS4Tool/ScpForm.Designer.cs @@ -189,7 +189,7 @@ // this.llbHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.llbHelp.AutoSize = true; - this.llbHelp.Location = new System.Drawing.Point(642, 5); + this.llbHelp.Location = new System.Drawing.Point(649, 5); this.llbHelp.Name = "llbHelp"; this.llbHelp.Size = new System.Drawing.Size(79, 13); this.llbHelp.TabIndex = 13; @@ -212,7 +212,7 @@ // this.lnkControllers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.lnkControllers.AutoSize = true; - this.lnkControllers.Location = new System.Drawing.Point(727, 5); + this.lnkControllers.Location = new System.Drawing.Point(734, 5); this.lnkControllers.Name = "lnkControllers"; this.lnkControllers.Size = new System.Drawing.Size(56, 13); this.lnkControllers.TabIndex = 11; @@ -239,7 +239,7 @@ this.lbLastMessage.ForeColor = System.Drawing.SystemColors.GrayText; this.lbLastMessage.Location = new System.Drawing.Point(8, 5); this.lbLastMessage.Name = "lbLastMessage"; - this.lbLastMessage.Size = new System.Drawing.Size(628, 17); + this.lbLastMessage.Size = new System.Drawing.Size(635, 18); this.lbLastMessage.TabIndex = 41; // // startMinimizedCheckBox @@ -396,7 +396,7 @@ this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.34039F)); this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.31077F)); this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 117F)); - this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 45F)); + this.tLPControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 48F)); this.tLPControllers.Controls.Add(this.pBStatus1, 1, 1); this.tLPControllers.Controls.Add(this.lbPad1, 0, 1); this.tLPControllers.Controls.Add(this.lbPad2, 0, 2); @@ -438,7 +438,7 @@ this.pBStatus1.Anchor = System.Windows.Forms.AnchorStyles.None; this.pBStatus1.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus1.Image"))); this.pBStatus1.InitialImage = global::ScpServer.Properties.Resources.BT; - this.pBStatus1.Location = new System.Drawing.Point(373, 19); + this.pBStatus1.Location = new System.Drawing.Point(370, 19); this.pBStatus1.Name = "pBStatus1"; this.pBStatus1.Size = new System.Drawing.Size(39, 20); this.pBStatus1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -470,7 +470,7 @@ // bnEditC3 // this.bnEditC3.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.bnEditC3.Location = new System.Drawing.Point(742, 76); + this.bnEditC3.Location = new System.Drawing.Point(739, 76); this.bnEditC3.Name = "bnEditC3"; this.bnEditC3.Size = new System.Drawing.Size(40, 23); this.bnEditC3.TabIndex = 43; @@ -482,7 +482,7 @@ // bnEditC4 // this.bnEditC4.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.bnEditC4.Location = new System.Drawing.Point(742, 105); + this.bnEditC4.Location = new System.Drawing.Point(739, 105); this.bnEditC4.Name = "bnEditC4"; this.bnEditC4.Size = new System.Drawing.Size(40, 23); this.bnEditC4.TabIndex = 43; @@ -517,7 +517,7 @@ // this.cBController1.Anchor = System.Windows.Forms.AnchorStyles.Left; this.cBController1.FormattingEnabled = true; - this.cBController1.Location = new System.Drawing.Point(625, 19); + this.cBController1.Location = new System.Drawing.Point(622, 19); this.cBController1.Name = "cBController1"; this.cBController1.Size = new System.Drawing.Size(111, 21); this.cBController1.TabIndex = 42; @@ -527,7 +527,7 @@ // bnEditC2 // this.bnEditC2.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.bnEditC2.Location = new System.Drawing.Point(742, 47); + this.bnEditC2.Location = new System.Drawing.Point(739, 47); this.bnEditC2.Name = "bnEditC2"; this.bnEditC2.Size = new System.Drawing.Size(40, 23); this.bnEditC2.TabIndex = 43; @@ -540,7 +540,7 @@ // this.cBController2.Anchor = System.Windows.Forms.AnchorStyles.Left; this.cBController2.FormattingEnabled = true; - this.cBController2.Location = new System.Drawing.Point(625, 48); + this.cBController2.Location = new System.Drawing.Point(622, 48); this.cBController2.Name = "cBController2"; this.cBController2.Size = new System.Drawing.Size(111, 21); this.cBController2.TabIndex = 42; @@ -551,7 +551,7 @@ // this.cBController3.Anchor = System.Windows.Forms.AnchorStyles.Left; this.cBController3.FormattingEnabled = true; - this.cBController3.Location = new System.Drawing.Point(625, 77); + this.cBController3.Location = new System.Drawing.Point(622, 77); this.cBController3.Name = "cBController3"; this.cBController3.Size = new System.Drawing.Size(111, 21); this.cBController3.TabIndex = 42; @@ -561,7 +561,7 @@ // bnEditC1 // this.bnEditC1.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.bnEditC1.Location = new System.Drawing.Point(742, 18); + this.bnEditC1.Location = new System.Drawing.Point(739, 18); this.bnEditC1.Name = "bnEditC1"; this.bnEditC1.Size = new System.Drawing.Size(40, 23); this.bnEditC1.TabIndex = 43; @@ -574,7 +574,7 @@ // this.cBController4.Anchor = System.Windows.Forms.AnchorStyles.Left; this.cBController4.FormattingEnabled = true; - this.cBController4.Location = new System.Drawing.Point(625, 106); + this.cBController4.Location = new System.Drawing.Point(622, 106); this.cBController4.Name = "cBController4"; this.cBController4.Size = new System.Drawing.Size(111, 21); this.cBController4.TabIndex = 42; @@ -586,7 +586,7 @@ this.label2.Anchor = System.Windows.Forms.AnchorStyles.None; this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(626, 0); + this.label2.Location = new System.Drawing.Point(623, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(109, 15); this.label2.TabIndex = 45; @@ -608,7 +608,7 @@ this.label4.Anchor = System.Windows.Forms.AnchorStyles.None; this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.Location = new System.Drawing.Point(369, 0); + this.label4.Location = new System.Drawing.Point(366, 0); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(47, 15); this.label4.TabIndex = 45; @@ -619,7 +619,7 @@ this.label5.Anchor = System.Windows.Forms.AnchorStyles.None; this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.Location = new System.Drawing.Point(518, 0); + this.label5.Location = new System.Drawing.Point(515, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(51, 15); this.label5.TabIndex = 45; @@ -630,7 +630,7 @@ this.lBBatt1.Anchor = System.Windows.Forms.AnchorStyles.None; this.lBBatt1.AutoSize = true; this.lBBatt1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lBBatt1.Location = new System.Drawing.Point(524, 22); + this.lBBatt1.Location = new System.Drawing.Point(521, 22); this.lBBatt1.Name = "lBBatt1"; this.lBBatt1.Size = new System.Drawing.Size(39, 15); this.lBBatt1.TabIndex = 44; @@ -641,7 +641,7 @@ this.lBBatt2.Anchor = System.Windows.Forms.AnchorStyles.None; this.lBBatt2.AutoSize = true; this.lBBatt2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lBBatt2.Location = new System.Drawing.Point(524, 51); + this.lBBatt2.Location = new System.Drawing.Point(521, 51); this.lBBatt2.Name = "lBBatt2"; this.lBBatt2.Size = new System.Drawing.Size(39, 15); this.lBBatt2.TabIndex = 44; @@ -652,7 +652,7 @@ this.lBBatt3.Anchor = System.Windows.Forms.AnchorStyles.None; this.lBBatt3.AutoSize = true; this.lBBatt3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lBBatt3.Location = new System.Drawing.Point(524, 80); + this.lBBatt3.Location = new System.Drawing.Point(521, 80); this.lBBatt3.Name = "lBBatt3"; this.lBBatt3.Size = new System.Drawing.Size(39, 15); this.lBBatt3.TabIndex = 44; @@ -663,7 +663,7 @@ this.lBBatt4.Anchor = System.Windows.Forms.AnchorStyles.None; this.lBBatt4.AutoSize = true; this.lBBatt4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lBBatt4.Location = new System.Drawing.Point(524, 109); + this.lBBatt4.Location = new System.Drawing.Point(521, 109); this.lBBatt4.Name = "lBBatt4"; this.lBBatt4.Size = new System.Drawing.Size(39, 15); this.lBBatt4.TabIndex = 44; @@ -674,7 +674,7 @@ this.pBStatus2.Anchor = System.Windows.Forms.AnchorStyles.None; this.pBStatus2.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus2.Image"))); this.pBStatus2.InitialImage = global::ScpServer.Properties.Resources.BT; - this.pBStatus2.Location = new System.Drawing.Point(373, 48); + this.pBStatus2.Location = new System.Drawing.Point(370, 48); this.pBStatus2.Name = "pBStatus2"; this.pBStatus2.Size = new System.Drawing.Size(39, 20); this.pBStatus2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -686,7 +686,7 @@ this.pBStatus3.Anchor = System.Windows.Forms.AnchorStyles.None; this.pBStatus3.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus3.Image"))); this.pBStatus3.InitialImage = global::ScpServer.Properties.Resources.BT; - this.pBStatus3.Location = new System.Drawing.Point(373, 77); + this.pBStatus3.Location = new System.Drawing.Point(370, 77); this.pBStatus3.Name = "pBStatus3"; this.pBStatus3.Size = new System.Drawing.Size(39, 20); this.pBStatus3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -698,7 +698,7 @@ this.pBStatus4.Anchor = System.Windows.Forms.AnchorStyles.None; this.pBStatus4.Image = ((System.Drawing.Image)(resources.GetObject("pBStatus4.Image"))); this.pBStatus4.InitialImage = global::ScpServer.Properties.Resources.BT; - this.pBStatus4.Location = new System.Drawing.Point(373, 106); + this.pBStatus4.Location = new System.Drawing.Point(370, 106); this.pBStatus4.Name = "pBStatus4"; this.pBStatus4.Size = new System.Drawing.Size(39, 20); this.pBStatus4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; @@ -982,8 +982,8 @@ // ScpForm // this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(794, 393); this.Controls.Add(this.tabMain); diff --git a/DS4Tool/ScpForm.cs b/DS4Tool/ScpForm.cs index dee5874..b538880 100644 --- a/DS4Tool/ScpForm.cs +++ b/DS4Tool/ScpForm.cs @@ -15,7 +15,7 @@ namespace ScpServer { public partial class ScpForm : Form { - double version = 9.3; + double version = 9.33; private DS4Control.Control rootHub; delegate void LogDebugDelegate(DateTime Time, String Data); @@ -104,9 +104,22 @@ namespace ScpServer CheckDrivers(); tSOptions.Visible = false; } + float dpix, dpiy; protected void Form_Load(object sender, EventArgs e) { + SetupArrays(); + + Graphics g = this.CreateGraphics(); + try + { + dpix = g.DpiX; + dpiy = g.DpiY; + } + finally + { + g.Dispose(); + } Icon = Properties.Resources.DS4; notifyIcon1.Icon = Properties.Resources.DS4; rootHub = new DS4Control.Control(); @@ -132,14 +145,13 @@ namespace ScpServer startMinimizedCheckBox.CheckedChanged += startMinimizedCheckBox_CheckedChanged; RegistryKey KeyLoc = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", false); - StartWindowsCheckBox.Checked = (KeyLoc.GetValue("DS4Tool") != null); - - SetupArrays(); + StartWindowsCheckBox.Checked = (KeyLoc.GetValue("DS4Tool") != null); if (startMinimizedCheckBox.Checked) { this.WindowState = FormWindowState.Minimized; - Form_Resize(sender, e); + //Form_Resize(sender, e); } + Form_Resize(sender, e); RefreshProfiles(); for (int i = 0; i < 4; i++) Global.LoadProfile(i); @@ -171,7 +183,7 @@ namespace ScpServer private void test_Tick(object sender, EventArgs e) { label1.Visible = true; - label1.Text = DS4LightBar.fadetimer[0].ToString(); + label1.Text = dpix + " " + dpiy; } void Hotkeys(object sender, EventArgs e) @@ -648,7 +660,9 @@ namespace ScpServer tSOptions.Visible = true; toolStrip1.Visible = false; if (profile != "") - tSTBProfile.Text = profile; + tSTBProfile.Text = profile; + else + tSTBProfile.Text = ""; opt = new Options(rootHub, devID, profile, this); opt.Text = "Options for Controller " + (devID + 1); opt.Icon = this.Icon; @@ -673,10 +687,20 @@ namespace ScpServer toolStrip1.Enabled = true; }; oldsize = this.Size; - if (this.Size.Height < 442) - this.Size = new System.Drawing.Size(this.Size.Width, 442); - if (this.Size.Width < 910) - this.Size = new System.Drawing.Size(910, this.Size.Height); + if (dpix == 120) + { + if (this.Size.Height < 560) + this.Size = new System.Drawing.Size(this.Size.Width, 560); + if (this.Size.Width < 1125) + this.Size = new System.Drawing.Size(1125, this.Size.Height); + } + else + { + if (this.Size.Height < 442) + this.Size = new System.Drawing.Size(this.Size.Width, 442); + if (this.Size.Width < 910) + this.Size = new System.Drawing.Size(910, this.Size.Height); + } tabMain.SelectedIndex = 1; } } @@ -818,12 +842,24 @@ namespace ScpServer lbLastMessage.Visible = tabMain.SelectedIndex != 2; if (tabMain.SelectedIndex == 3 && opt == null) { - if (this.Size.Width < 755 || this.Size.Height < 340) - oldsize = Size; - if (this.Size.Height < 340) - this.Size = new System.Drawing.Size(this.Size.Width, 340); - if (this.Size.Width < 755) - this.Size = new System.Drawing.Size(755, this.Size.Height); + if (dpix == 120) + { + if (this.Size.Width < 930 || this.Size.Height < 415) + oldsize = Size; + if (this.Size.Height < 415) + this.Size = new System.Drawing.Size(this.Size.Width, 415); + if (this.Size.Width < 930) + this.Size = new System.Drawing.Size(930, this.Size.Height); + } + else + { + if (this.Size.Width < 755 || this.Size.Height < 340) + oldsize = Size; + if (this.Size.Height < 340) + this.Size = new System.Drawing.Size(this.Size.Width, 340); + if (this.Size.Width < 755) + this.Size = new System.Drawing.Size(755, this.Size.Height); + } } else if (oldsize != new System.Drawing.Size(0, 0) && opt == null) diff --git a/DS4Tool/WelcomeDialog.Designer.cs b/DS4Tool/WelcomeDialog.Designer.cs index 1cf6b80..8512f11 100644 --- a/DS4Tool/WelcomeDialog.Designer.cs +++ b/DS4Tool/WelcomeDialog.Designer.cs @@ -78,7 +78,7 @@ this.pictureBox1.Location = new System.Drawing.Point(36, 197); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(245, 132); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 2; this.pictureBox1.TabStop = false; // @@ -144,8 +144,8 @@ // WelcomeDialog // this.AcceptButton = this.bnFinish; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(315, 422); this.Controls.Add(this.linkBluetoothSettings); this.Controls.Add(this.labelBluetooth); diff --git a/DS4Tool/WinProgs.Designer.cs b/DS4Tool/WinProgs.Designer.cs index f1e0617..f3c7aa4 100644 --- a/DS4Tool/WinProgs.Designer.cs +++ b/DS4Tool/WinProgs.Designer.cs @@ -173,8 +173,8 @@ // // WinProgs // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(736, 230); this.Controls.Add(this.label6);