Skip to content

Commit 687e5b3

Browse files
committed
Minor Changes
1 parent f461096 commit 687e5b3

File tree

6 files changed

+80
-17
lines changed

6 files changed

+80
-17
lines changed

README.ES.md

+13
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ Gracias a estas personas maravillosas ([emoji clave](https://allcontributors.org
102102
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=toolgood" title="Solicitudes de Extracción Revisadas">👀</a>
103103
</td>
104104
</tr>
105+
<tr>
106+
<td align="center">
107+
<a href="https://github.com/gmono">
108+
<img src="https://avatars3.githubusercontent.com/u/19236339?s=460&v=4" width="80px;" alt="gmono" />
109+
<br />
110+
<sub>
111+
<b>gmono</b>
112+
</sub>
113+
</a>
114+
<br />
115+
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=gmono" title="Solicitudes de Extracción Revisadas">👀</a>
116+
</td>
117+
</tr>
105118
</table>
106119

107120
Este proyecto sigue la especificación de [todos los contribuyentes](https://github.com/all-contributors/all-contributors). ¡Contribuciones de cualquier tipo de bienvenida!

README.TR.md

+13
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ Bu harika insanlara teşekkürler ([emoji anahtarı](https://allcontributors.org
102102
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=toolgood" title="İncelenen Çekme İstekleri">👀</a>
103103
</td>
104104
</tr>
105+
<tr>
106+
<td align="center">
107+
<a href="https://github.com/gmono">
108+
<img src="https://avatars3.githubusercontent.com/u/19236339?s=460&v=4" width="80px;" alt="gmono" />
109+
<br />
110+
<sub>
111+
<b>gmono</b>
112+
</sub>
113+
</a>
114+
<br />
115+
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=gmono" title="İncelenen Çekme İstekleri">👀</a>
116+
</td>
117+
</tr>
105118
</table>
106119

107120
Bu proje [tüm katkıda bulunanların](https://github.com/all-contributors/all-contributors) özelliklerini takip ediyor. Her türlü katkıda hoş geldiniz!

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,19 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
102102
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=toolgood" title="Reviewed Pull Requests">👀</a>
103103
</td>
104104
</tr>
105+
<tr>
106+
<td align="center">
107+
<a href="https://github.com/gmono">
108+
<img src="https://avatars3.githubusercontent.com/u/19236339?s=460&v=4" width="80px;" alt="gmono" />
109+
<br />
110+
<sub>
111+
<b>gmono</b>
112+
</sub>
113+
</a>
114+
<br />
115+
<a href="https://github.com/Taiizor/ReaLTaiizor/commits?author=gmono" title="Reviewed Pull Requests">👀</a>
116+
</td>
117+
</tr>
105118
</table>
106119

107120
This project follows the [all contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

src/ReaLTaiizor/Controls/ListBox/ForeverListBox.cs

+39-15
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
using ReaLTaiizor.Colors;
44
using ReaLTaiizor.Util;
5+
using System;
56
using System.ComponentModel;
67
using System.Drawing;
78
using System.Drawing.Drawing2D;
89
using System.Drawing.Text;
10+
using System.Linq;
911
using System.Windows.Forms;
1012

1113
#endregion
@@ -35,10 +37,10 @@ private ListBox ListBx
3537
}
3638
}
3739

38-
private string[] _items = { "" };
40+
private string[] _items = Array.Empty<string>();
3941

4042
[Category("Options")]
41-
public string[] items
43+
public string[] Items
4244
{
4345
get => _items;
4446
set
@@ -50,21 +52,37 @@ public string[] items
5052
}
5153
}
5254

53-
public object[] ListItems
55+
public object ListSelectedItem
5456
{
5557
get
5658
{
57-
return ListBx.Items.Cast<object>().OfType<object>().ToArray();
59+
if (Items.Any() && Items.Count() >= SelectedIndex)
60+
{
61+
return ListBx.Items[SelectedIndex];
62+
}
63+
64+
return null;
5865
}
5966
}
60-
public object ListSelectedItem => ListBx.Items[SelectedIndex];
61-
67+
6268
[Category("Colors")]
6369
public Color SelectedColor { get; set; } = ForeverLibrary.ForeverColor;
6470

65-
public string SelectedItem =>
71+
public string SelectedItem
72+
{
73+
get
74+
{
6675
//return ListBx.SelectedItem.ToString();
67-
(string)ListBx.Items[SelectedIndex];
76+
77+
if (Items.Any() && Items.Count() >= SelectedIndex)
78+
{
79+
return (string)ListSelectedItem;
80+
}
81+
82+
return string.Empty;
83+
}
84+
set => ListBx.SelectedItem = value;
85+
}
6886

6987
public int SelectedIndex
7088
{
@@ -77,7 +95,14 @@ public int SelectedIndex
7795
return functionReturnValue;
7896
}
7997

80-
return functionReturnValue;
98+
return ListBx.SelectedIndex;
99+
}
100+
set
101+
{
102+
if (Items.Any() && Items.Count() - 1 >= value && value >= 0)
103+
{
104+
ListBx.SelectedIndex = value;
105+
}
81106
}
82107
}
83108

@@ -96,7 +121,7 @@ public void ClearSelected()
96121

97122
public void Drawitem(object sender, DrawItemEventArgs e)
98123
{
99-
if (e.Index < 0)
124+
if (e.Index < 0 || !Items.Any())
100125
{
101126
return;
102127
}
@@ -106,8 +131,8 @@ public void Drawitem(object sender, DrawItemEventArgs e)
106131

107132
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
108133
e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
109-
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
110134
e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
135+
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
111136

112137
//-- if selected
113138
if (e.State.ToString().IndexOf("Selected,") >= 0)
@@ -133,6 +158,7 @@ public void Drawitem(object sender, DrawItemEventArgs e)
133158
protected override void OnCreateControl()
134159
{
135160
base.OnCreateControl();
161+
136162
if (!Controls.Contains(ListBx))
137163
{
138164
Controls.Add(ListBx);
@@ -141,13 +167,11 @@ protected override void OnCreateControl()
141167

142168
public void AddRange(object[] items)
143169
{
144-
ListBx.Items.Remove("");
145170
ListBx.Items.AddRange(items);
146171
}
147172

148173
public void AddItem(object item)
149174
{
150-
ListBx.Items.Remove("");
151175
ListBx.Items.Add(item);
152176
}
153177

@@ -156,10 +180,11 @@ public void AddItem(object item)
156180
public ForeverListBox()
157181
{
158182
ListBx = new ListBox();
183+
159184
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer, true);
160185
DoubleBuffered = true;
161186

162-
ListBx.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
187+
ListBx.DrawMode = DrawMode.OwnerDrawFixed;
163188
ListBx.ScrollAlwaysVisible = false;
164189
ListBx.HorizontalScrollbar = false;
165190
ListBx.BorderStyle = BorderStyle.None;
@@ -189,7 +214,6 @@ protected override void OnPaint(PaintEventArgs e)
189214
_with19.PixelOffsetMode = PixelOffsetMode.HighQuality;
190215
_with19.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
191216
_with19.Clear(BackColor);
192-
193217
//-- Size
194218
ListBx.Size = new(Width - 6, Height - 2);
195219

src/ReaLTaiizor/ReaLTaiizor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Creator: Taiizor
1414
// Website: www.vegalya.com
1515
// Created: 15.May.2019
16-
// Changed: 29.Nov.2024
16+
// Changed: 10.Dec.2024
1717
// Version: 3.8.1.1
1818
//
1919
// |---------DO-NOT-REMOVE---------|

src/ReaLTaiizor_CR/Catcher.Designer.cs

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)