Skip to content

Commit fa43bfb

Browse files
committed
ScrollBar theme setting case fix + Paint events added to few controls...
1 parent fffe048 commit fa43bfb

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

External/Plugins/ProjectManager/Helpers/TreeViews/MultiSelectTreeView.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ private void labelEditTimer_Tick(object sender, EventArgs e)
6767
// prevents some flicker
6868
protected override void WndProc(ref Message m)
6969
{
70-
// Stop erase background message
71-
if (m.Msg == (int)0x0014 )
72-
m.Msg = (int) 0x0000; // Set to null
73-
70+
switch (m.Msg)
71+
{
72+
case 0x0014: // Stop erase background message
73+
m.Msg = (int)0x0000; // Set to null
74+
break;
75+
case 0xf: // WM_PAINT
76+
OnPaint(new PaintEventArgs(Graphics.FromHwnd(this.Handle), this.Bounds));
77+
break;
78+
}
7479
base.WndProc(ref m);
7580
}
7681

PluginCore/PluginCore/Controls/Common.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,20 @@ public override Size GetPreferredSize(Size constrainingSize)
155155

156156
}
157157

158+
public class RichTextBoxEx : RichTextBox
159+
{
160+
protected override void WndProc(ref Message message)
161+
{
162+
switch (message.Msg)
163+
{
164+
case 0xf: // WM_PAINT
165+
OnPaint(new PaintEventArgs(Graphics.FromHwnd(this.Handle), this.Bounds));
166+
break;
167+
}
168+
base.WndProc(ref message);
169+
}
170+
}
171+
158172
public class DataGridViewEx : DataGridView, IEventHandler
159173
{
160174
public DataGridViewEx()
@@ -269,8 +283,8 @@ protected override void WndProc(ref Message message)
269283
switch (message.Msg)
270284
{
271285
case 0xf: // WM_PAINT
272-
// Delay column expand...
273-
this.expandDelay.Enabled = true;
286+
this.expandDelay.Enabled = true; // Delay column expand...
287+
OnPaint(new PaintEventArgs(Graphics.FromHwnd(this.Handle), this.Bounds));
274288
break;
275289
}
276290
base.WndProc(ref message);
@@ -384,6 +398,17 @@ private void OnDrawNode(Object sender, DrawTreeNodeEventArgs e)
384398
TextRenderer.DrawText(e.Graphics, e.Node.Text, nodeFont, textRect, textColor);
385399
}
386400

401+
protected override void WndProc(ref Message message)
402+
{
403+
switch (message.Msg)
404+
{
405+
case 0xf: // WM_PAINT
406+
OnPaint(new PaintEventArgs(Graphics.FromHwnd(this.Handle), this.Bounds));
407+
break;
408+
}
409+
base.WndProc(ref message);
410+
}
411+
387412
}
388413

389414
public class ToolStripComboBoxEx : ToolStripControlHost

PluginCore/ScintillaNet/ScintillaControl.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
9090
{
9191
Color color = PluginBase.MainForm.GetThemeColor("ScrollBar.ForeColor");
9292
String value = PluginBase.MainForm.GetThemeValue("ScrollBar.UseCustom");
93-
Boolean enabled = value == "true" || (value == null && color != Color.Empty);
93+
Boolean enabled = value == "True" || (value == null && color != Color.Empty);
9494
if (enabled && !this.Controls.Contains(this.vScrollBar))
9595
{
9696
this.AddScrollBars(this);
@@ -140,7 +140,7 @@ private void InitScrollBars(ScintillaControl sender)
140140
sender.hScrollBar.Dock = DockStyle.Bottom;
141141
Color color = PluginBase.MainForm.GetThemeColor("ScrollBar.ForeColor");
142142
String value = PluginBase.MainForm.GetThemeValue("ScrollBar.UseCustom");
143-
if (value == "true" || (value == null && color != Color.Empty))
143+
if (value == "True" || (value == null && color != Color.Empty))
144144
{
145145
sender.AddScrollBars(sender);
146146
sender.UpdateScrollBarTheme(sender);

0 commit comments

Comments
 (0)