Skip to content

Commit aa51628

Browse files
committed
Breaking changes:
renamed some unoriginal properties in ComboBox, ListBox, FileDialog, TreeView; improved FileDialog look, fixed possible values for Filter that were causing exception; fixed TreeNode Bounds property, where Y had an absolute value that does not depend on scrollIndex;
1 parent 6165c48 commit aa51628

19 files changed

+479
-494
lines changed

Examples/FormExamples.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public FormExamples()
4949
AddNode(nodeControls, "CheckBox", typeof(PanelCheckBox));
5050
AddNode(nodeControls, "ComboBox", typeof(PanelComboBox));
5151
AddNode(nodeControls, "DateTimePicker", typeof(PanelDateTimePicker));
52-
AddNode(nodeControls, "Button", typeof(PanelButton));
5352
AddNode(nodeControls, "FileDialog", typeof(PanelFileDialog));
5453
AddNode(nodeControls, "Form", typeof(PanelForm));
5554
AddNode(nodeControls, "GroupBox", typeof(PanelGroupBox));

Examples/Panels/PanelFileDialog.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ public class PanelFileDialog : BaseExamplePanel
66
{
77
public override void Initialize()
88
{
9-
var labelPath = this.Create<Label>("path");
9+
var labelFilter = this.Create<Label>("Filter:");
10+
var textFilter = this.Create<TextBox>();
11+
textFilter.Text = "All files|*.*";
12+
textFilter.Width = 320;
13+
14+
var labelPath = this.Create<Label>("Selected path");
1015
var buttonOpen = this.Create<Button>("Open");
1116
var buttonSave = this.Create<Button>("Save");
1217

1318
buttonOpen.Click += (sender, args) =>
1419
{
1520
var ofd = new OpenFileDialog();
21+
ofd.Filter = textFilter.Text;
1622
ofd.ShowDialog(
1723
(form, result) =>
1824
{
@@ -23,6 +29,7 @@ public override void Initialize()
2329
buttonSave.Click += (sender, args) =>
2430
{
2531
var sfd = new SaveFileDialog();
32+
sfd.Filter = textFilter.Text;
2633
sfd.ShowDialog(
2734
(form, result) =>
2835
{

Resources/filedialog_back.png

475 Bytes
Loading

Resources/filedialog_file.png

432 Bytes
Loading

Resources/filedialog_folder.png

722 Bytes
Loading

Resources/filedialog_refresh.png

339 Bytes
Loading

Resources/filedialog_up.png

210 Bytes
Loading

System/Windows/Forms/AppGdiImages.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ internal class AppGdiImages
1818
public Bitmap CurvedArrowUp;
1919
public Bitmap DateTimePicker;
2020
public Bitmap DropDownRightArrow;
21+
public Bitmap FileDialogBack;
22+
public Bitmap FileDialogFile;
23+
public Bitmap FileDialogFolder;
24+
public Bitmap FileDialogRefresh;
25+
public Bitmap FileDialogUp;
2126
public Bitmap FormResize;
2227
public Bitmap NumericDown;
2328
public Bitmap NumericUp;

System/Windows/Forms/Button.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ public override string ToString()
3131

3232
protected override void OnClick(EventArgs e)
3333
{
34-
Form form = FindFormInternal();
34+
var form = FindFormInternal();
3535
if (form != null)
36-
{
3736
form.DialogResult = dialogResult;
38-
/*if (form.AcceptButton == this && form.dialog)
39-
form.Close();*/
40-
}
4137

4238
base.OnClick(e);
4339
}

System/Windows/Forms/ButtonBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class ButtonBase : Control
1212
internal Color uwfHoverColor = Color.FromArgb(223, 238, 252);
1313
internal Bitmap uwfImageHover;
1414
internal Color uwfImageColor = Color.White;
15+
internal Color uwfImageDisabledColor = Color.White;
1516
internal Color uwfImageHoverColor = Color.White;
1617

1718
private const float IMAGE_BORDER_OFFSET = 2f;
@@ -168,7 +169,9 @@ private void DrawImage(Graphics g)
168169
var imageWidth = imageToPaint.Width;
169170
var imageHeight = imageToPaint.Height;
170171
var imageColorToPaint = uwfImageColor;
171-
if (uwfHovered)
172+
if (Enabled == false)
173+
imageColorToPaint = uwfImageDisabledColor;
174+
else if (uwfHovered)
172175
{
173176
if (uwfImageHover != null)
174177
imageToPaint = uwfImageHover;

0 commit comments

Comments
 (0)