mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-13 23:41:17 -05:00
Fixed problems with DataGridView DoubleBuffered property using reflection
This commit is contained in:
parent
6046ae6712
commit
bfdfe89279
|
|
@ -92,6 +92,7 @@
|
|||
<Compile Include="AB.cs" />
|
||||
<Compile Include="AreaData.cs" />
|
||||
<Compile Include="DSUtils.cs" />
|
||||
<Compile Include="ExtensionMethods.cs" />
|
||||
<Compile Include="PokeDatabase.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
|
@ -179,9 +180,6 @@
|
|||
<Compile Include="ScriptFile.cs" />
|
||||
<Compile Include="Matrix.cs" />
|
||||
<Compile Include="EventFile.cs" />
|
||||
<Compile Include="DataGridViewDoubleBuffered.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LibNDSFormats\bytearrayoutputstream.cs" />
|
||||
<Compile Include="LibNDSFormats\convertir.cs" />
|
||||
<Compile Include="LibNDSFormats\EndianBinaryReader.cs" />
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
// DataGridView with double buffering to speed up performance
|
||||
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE
|
||||
{
|
||||
public class DataGridViewDoubleBuffered : DataGridView {
|
||||
public DataGridViewDoubleBuffered() {
|
||||
DoubleBuffered = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
DS_Map/ExtensionMethods.cs
Normal file
17
DS_Map/ExtensionMethods.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class ExtensionMethods {
|
||||
public static void DoubleBuffered(this DataGridView dgv, bool setting) {
|
||||
Type dgvType = dgv.GetType();
|
||||
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
pi.SetValue(dgv, setting, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
DS_Map/Main Window.Designer.cs
generated
15
DS_Map/Main Window.Designer.cs
generated
|
|
@ -592,9 +592,9 @@
|
|||
this.headerSearchToolStripButton = new System.Windows.Forms.ToolStripButton();
|
||||
this.versionLabel = new System.Windows.Forms.Label();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.headersGridView = new DSPRE.DataGridViewDoubleBuffered();
|
||||
this.heightsGridView = new DSPRE.DataGridViewDoubleBuffered();
|
||||
this.mapFilesGridView = new DSPRE.DataGridViewDoubleBuffered();
|
||||
this.headersGridView = new System.Windows.Forms.DataGridView();
|
||||
this.heightsGridView = new System.Windows.Forms.DataGridView();
|
||||
this.mapFilesGridView = new System.Windows.Forms.DataGridView();
|
||||
this.mainTabControl.SuspendLayout();
|
||||
this.headerEditorTabPage.SuspendLayout();
|
||||
this.worldmapCoordsGroupBox.SuspendLayout();
|
||||
|
|
@ -7424,6 +7424,7 @@
|
|||
//
|
||||
// headersGridView
|
||||
//
|
||||
this.headersGridView.DoubleBuffered(true);
|
||||
this.headersGridView.AllowUserToAddRows = false;
|
||||
this.headersGridView.AllowUserToDeleteRows = false;
|
||||
this.headersGridView.AllowUserToResizeColumns = false;
|
||||
|
|
@ -7480,6 +7481,7 @@
|
|||
//
|
||||
// heightsGridView
|
||||
//
|
||||
this.heightsGridView.DoubleBuffered(true);
|
||||
this.heightsGridView.AllowUserToAddRows = false;
|
||||
this.heightsGridView.AllowUserToDeleteRows = false;
|
||||
this.heightsGridView.AllowUserToResizeColumns = false;
|
||||
|
|
@ -7534,6 +7536,7 @@
|
|||
//
|
||||
// mapFilesGridView
|
||||
//
|
||||
this.mapFilesGridView.DoubleBuffered(true);
|
||||
this.mapFilesGridView.AllowUserToAddRows = false;
|
||||
this.mapFilesGridView.AllowUserToDeleteRows = false;
|
||||
this.mapFilesGridView.AllowUserToResizeColumns = false;
|
||||
|
|
@ -7822,9 +7825,9 @@
|
|||
private System.Windows.Forms.TabControl matrixTabControl;
|
||||
private System.Windows.Forms.TabPage headersTabPage;
|
||||
private System.Windows.Forms.TabPage heightsTabPage;
|
||||
private DSPRE.DataGridViewDoubleBuffered heightsGridView;
|
||||
private System.Windows.Forms.DataGridView heightsGridView;
|
||||
private System.Windows.Forms.TabPage mapFilesTabPage;
|
||||
private DSPRE.DataGridViewDoubleBuffered mapFilesGridView;
|
||||
private System.Windows.Forms.DataGridView mapFilesGridView;
|
||||
private System.Windows.Forms.TextBox matrixNameTextBox;
|
||||
private System.Windows.Forms.NumericUpDown heightUpDown;
|
||||
private System.Windows.Forms.NumericUpDown widthUpDown;
|
||||
|
|
@ -7832,7 +7835,7 @@
|
|||
private System.Windows.Forms.Label widthLabel;
|
||||
private System.Windows.Forms.ComboBox selectMatrixComboBox;
|
||||
private System.Windows.Forms.Button saveMatrixButton;
|
||||
private DSPRE.DataGridViewDoubleBuffered headersGridView;
|
||||
private System.Windows.Forms.DataGridView headersGridView;
|
||||
private System.Windows.Forms.Button addHeadersButton;
|
||||
private System.Windows.Forms.Button addHeightsButton;
|
||||
private System.Windows.Forms.Button removeHeadersButton;
|
||||
|
|
|
|||
|
|
@ -2340,7 +2340,7 @@ namespace DSPRE {
|
|||
if (disableHandlers)
|
||||
return;
|
||||
disableHandlers = true;
|
||||
|
||||
|
||||
/* Add or remove rows in DataGridView control */
|
||||
int delta = (int)widthUpDown.Value - currentMatrix.width;
|
||||
for (int i = 0; i < Math.Abs(delta); i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user