@@ -35,34 +35,35 @@ public BlacklistWindow(string title, string[] items) {
35
35
MinimizeBox = MaximizeBox = false ;
36
36
MinimumSize = Size ;
37
37
DialogResult = DialogResult . Cancel ;
38
+ TopMost = true ;
38
39
39
40
BlacklistView = new ListBox {
40
41
TabIndex = 101 ,
41
42
IntegralHeight = false ,
42
43
Anchor = AnchorStyles . Top | AnchorStyles . Bottom | AnchorStyles . Left | AnchorStyles . Right ,
43
- Location = new Point ( BUTTON_WIDTH + ( SPACING * 2 ) , SPACING ) ,
44
+ Location = new Point ( SPACING , SPACING ) ,
44
45
ClientSize = new Size ( ClientSize . Width - BUTTON_WIDTH - ( int ) ( SPACING * 3.5 ) , ClientSize . Height - ( int ) ( SPACING * 2.5 ) ) ,
45
46
} ;
46
47
BlacklistView . SelectedIndexChanged += BlacklistView_SelectedIndexChanged ;
47
48
BlacklistView . MouseDoubleClick += BlacklistView_MouseDoubleClick ;
48
49
49
50
AddButton = new Button {
50
- Anchor = AnchorStyles . Top | AnchorStyles . Left ,
51
- Text = @"Add" ,
51
+ Anchor = AnchorStyles . Top | AnchorStyles . Right ,
52
+ Text = Locale . String ( @"BlacklistAdd" ) ,
52
53
ClientSize = new Size ( BUTTON_WIDTH , BUTTON_HEIGHT ) ,
53
- Location = new Point ( SPACING , SPACING ) ,
54
+ Location = new Point ( BlacklistView . Width + ( SPACING * 2 ) , SPACING ) ,
54
55
TabIndex = 201 ,
55
56
} ;
56
57
EditButton = new Button {
57
- Text = @"Edit" ,
58
+ Text = Locale . String ( @"BlacklistEdit" ) ,
58
59
Location = new Point ( AddButton . Location . X , AddButton . Location . Y + AddButton . Height + SPACING ) ,
59
60
Enabled = false ,
60
61
Anchor = AddButton . Anchor ,
61
62
ClientSize = AddButton . ClientSize ,
62
63
TabIndex = 202 ,
63
64
} ;
64
65
RemoveButton = new Button {
65
- Text = @"Remove" ,
66
+ Text = Locale . String ( @"BlacklistRemove" ) ,
66
67
Location = new Point ( AddButton . Location . X , EditButton . Location . Y + AddButton . Height + SPACING ) ,
67
68
Enabled = false ,
68
69
Anchor = AddButton . Anchor ,
@@ -75,16 +76,16 @@ public BlacklistWindow(string title, string[] items) {
75
76
RemoveButton . Click += RemoveButton_Click ;
76
77
77
78
CancelButton = new Button {
78
- Anchor = AnchorStyles . Bottom | AnchorStyles . Left ,
79
- Text = @"Cancel" ,
80
- Location = new Point ( SPACING , ClientSize . Height - AddButton . ClientSize . Height - SPACING ) ,
79
+ Anchor = AnchorStyles . Bottom | AnchorStyles . Right ,
80
+ Text = Locale . String ( @"BlacklistCancel" ) ,
81
+ Location = new Point ( AddButton . Location . X , ClientSize . Height - AddButton . ClientSize . Height - SPACING ) ,
81
82
ClientSize = AddButton . ClientSize ,
82
83
TabIndex = 10001 ,
83
84
} ;
84
85
Button acceptButton = new Button {
85
- Anchor = AnchorStyles . Bottom | AnchorStyles . Left ,
86
- Text = @"Done" ,
87
- Location = new Point ( SPACING , ClientSize . Height - ( ( AddButton . ClientSize . Height + SPACING ) * 2 ) ) ,
86
+ Anchor = AnchorStyles . Bottom | AnchorStyles . Right ,
87
+ Text = Locale . String ( @"BlacklistDone" ) ,
88
+ Location = new Point ( AddButton . Location . X , ClientSize . Height - ( ( AddButton . ClientSize . Height + SPACING ) * 2 ) ) ,
88
89
ClientSize = AddButton . ClientSize ,
89
90
TabIndex = 10002 ,
90
91
} ;
@@ -106,24 +107,26 @@ private class BlacklistEditorWindow : Form {
106
107
public string Original { get ; }
107
108
public string String { get => TextBox . Text ; }
108
109
109
- private TextBox TextBox ;
110
+ private readonly TextBox TextBox ;
110
111
111
112
public BlacklistEditorWindow ( string original = null ) {
112
113
Original = original ?? string . Empty ;
113
- Text = original == null ? @"Adding new entry..." : $@ "Editing { original } ...";
114
+ Text = Locale . String ( original == null ? @"BlacklistEditorAdding" : @"BlacklistEditorEditing" , original ) ;
115
+ Icon = Icon . ExtractAssociatedIcon ( Application . ExecutablePath ) ;
114
116
StartPosition = FormStartPosition . CenterParent ;
115
- FormBorderStyle = FormBorderStyle . FixedToolWindow ;
117
+ FormBorderStyle = FormBorderStyle . FixedSingle ;
116
118
ClientSize = new Size ( 500 , 39 ) ;
117
119
MaximizeBox = MinimizeBox = false ;
118
120
MaximumSize = MinimumSize = Size ;
121
+ TopMost = true ;
119
122
120
123
Button cancelButton = new Button {
121
124
Anchor = AnchorStyles . Top | AnchorStyles . Bottom | AnchorStyles . Right ,
122
125
Location = new Point ( ClientSize . Width - 75 - 8 , 8 ) ,
123
126
Name = @"cancelButton" ,
124
127
Size = new Size ( 75 , 23 ) ,
125
128
TabIndex = 102 ,
126
- Text = @"Cancel" ,
129
+ Text = Locale . String ( @"BlacklistEditorCancel" ) ,
127
130
} ;
128
131
cancelButton . Click += ( s , e ) => { DialogResult = DialogResult . Cancel ; Close ( ) ; } ;
129
132
@@ -133,14 +136,14 @@ public BlacklistEditorWindow(string original = null) {
133
136
Name = @"saveButton" ,
134
137
Size = new Size ( 75 , 23 ) ,
135
138
TabIndex = 101 ,
136
- Text = @"Save" ,
139
+ Text = Locale . String ( @"BlacklistEditorSave" ) ,
137
140
} ;
138
141
saveButton . Click += ( s , e ) => { DialogResult = DialogResult . OK ; Close ( ) ; } ;
139
142
140
143
TextBox = new TextBox {
141
144
Anchor = AnchorStyles . Top | AnchorStyles . Bottom | AnchorStyles . Left | AnchorStyles . Right ,
142
145
Location = new Point ( 8 , 9 ) ,
143
- Name = @"deviceSelection" ,
146
+ Name = @"deviceSelection" , // ??????
144
147
Size = new Size ( ClientSize . Width - 8 - cancelButton . Width - saveButton . Width - 19 , 23 ) ,
145
148
TabIndex = 100 ,
146
149
Text = Original ,
0 commit comments