This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Appearances Editor.cs
76 lines (64 loc) · 2.82 KB
/
Appearances Editor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.LookAndFeel;
using DevExpress.XtraGrid.Views.Grid;
namespace WindowsApplication3 {
public partial class AppearancesEditor: DevExpress.XtraEditors.XtraForm {
GridView view;
public AppearancesEditor(GridView view) {
InitializeComponent();
this.view = view;
checkEdit1.Checked = view.OptionsView.EnableAppearanceEvenRow;
checkEdit2.Checked = view.OptionsView.EnableAppearanceOddRow;
checkEdit3.Checked = view.OptionsSelection.EnableAppearanceFocusedRow;
checkEdit4.Checked = view.OptionsSelection.EnableAppearanceFocusedCell;
comboBoxEdit1.EditValue = view.PaintStyleName;
propertyGridControl1.SelectedObject = view.Appearance;
}
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
comboBoxEdit1.Properties.Items.AddRange(new object[] { "Default", "WindowsXP", "MixedXP",
"Style3D", "UltraFlat", "Flat", "Office2003", "Web", "Skin"});
CenterToScreen();
}
private void comboBoxEdit1_EditValueChanged(object sender, EventArgs e) {
view.PaintStyleName = comboBoxEdit1.Text;
}
private void OnEnableAppearanceEvenRowChanged(object sender, EventArgs e) {
CheckEdit edit = sender as CheckEdit;
view.OptionsView.EnableAppearanceEvenRow = edit.Checked;
}
private void OnEnableAppearanceOddRowChanged(object sender, EventArgs e) {
CheckEdit edit = sender as CheckEdit;
view.OptionsView.EnableAppearanceOddRow = edit.Checked;
}
private void OnEnableAppearanceFocusedRowChanged(object sender, EventArgs e) {
CheckEdit edit = sender as CheckEdit;
view.OptionsSelection.EnableAppearanceFocusedRow = edit.Checked;
}
private void OnEnableAppearanceFocusedCellChanged(object sender, EventArgs e) {
CheckEdit edit = sender as CheckEdit;
view.OptionsSelection.EnableAppearanceFocusedCell= edit.Checked;
}
private void OnSaveButtonClick(object sender, EventArgs e) {
if(saveFileDialog1.ShowDialog() == DialogResult.OK)
try {
view.Appearance.SaveLayoutToXml(saveFileDialog1.FileName);
}
catch { }
}
private void OnLoadButtonClick(object sender, EventArgs e) {
if(openFileDialog1.ShowDialog() == DialogResult.OK)
try {
view.Appearance.RestoreLayoutFromXml(openFileDialog1.FileName);
}
catch { }
}
}
}