@@ -51,6 +51,7 @@ namespace Cloud2BatteryMonitorUI {
51
51
private: System::Windows::Forms::Label^ lbText;
52
52
private: System::Windows::Forms::Label^ lbRefresh;
53
53
private: System::Windows::Forms::NumericUpDown^ numRefreshMinutes;
54
+ private: System::Windows::Forms::CheckBox^ cbBatIcon;
54
55
55
56
private:
56
57
// / <summary>
@@ -81,6 +82,7 @@ namespace Cloud2BatteryMonitorUI {
81
82
this ->lbText = (gcnew System::Windows::Forms::Label ());
82
83
this ->lbRefresh = (gcnew System::Windows::Forms::Label ());
83
84
this ->numRefreshMinutes = (gcnew System::Windows::Forms::NumericUpDown ());
85
+ this ->cbBatIcon = (gcnew System::Windows::Forms::CheckBox ());
84
86
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this ->numRefreshMinutes ))->BeginInit ();
85
87
this ->SuspendLayout ();
86
88
//
@@ -115,7 +117,7 @@ namespace Cloud2BatteryMonitorUI {
115
117
//
116
118
this ->cbStart ->Anchor = static_cast <System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left));
117
119
this ->cbStart ->AutoSize = true ;
118
- this ->cbStart ->Location = System::Drawing::Point (12 , 154 );
120
+ this ->cbStart ->Location = System::Drawing::Point (12 , 180 );
119
121
this ->cbStart ->Name = L" cbStart" ;
120
122
this ->cbStart ->Size = System::Drawing::Size (139 , 17 );
121
123
this ->cbStart ->TabIndex = 6 ;
@@ -200,7 +202,7 @@ namespace Cloud2BatteryMonitorUI {
200
202
this ->btnSaveSettings ->Anchor = static_cast <System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
201
203
this ->btnSaveSettings ->BackColor = System::Drawing::Color::LightGray;
202
204
this ->btnSaveSettings ->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
203
- this ->btnSaveSettings ->Location = System::Drawing::Point (165 , 150 );
205
+ this ->btnSaveSettings ->Location = System::Drawing::Point (165 , 176 );
204
206
this ->btnSaveSettings ->Name = L" btnSaveSettings" ;
205
207
this ->btnSaveSettings ->Size = System::Drawing::Size (138 , 23 );
206
208
this ->btnSaveSettings ->TabIndex = 16 ;
@@ -249,12 +251,25 @@ namespace Cloud2BatteryMonitorUI {
249
251
this ->numRefreshMinutes ->TabIndex = 20 ;
250
252
this ->numRefreshMinutes ->Value = System::Decimal (gcnew cli::array< System::Int32 >(4 ) { 1 , 0 , 0 , 0 });
251
253
//
254
+ // cbBatIcon
255
+ //
256
+ this ->cbBatIcon ->Anchor = static_cast <System::Windows::Forms::AnchorStyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left));
257
+ this ->cbBatIcon ->AutoSize = true ;
258
+ this ->cbBatIcon ->Location = System::Drawing::Point (12 , 150 );
259
+ this ->cbBatIcon ->Name = L" cbBatIcon" ;
260
+ this ->cbBatIcon ->Size = System::Drawing::Size (120 , 17 );
261
+ this ->cbBatIcon ->TabIndex = 21 ;
262
+ this ->cbBatIcon ->Text = L" Use battery as icon." ;
263
+ this ->cbBatIcon ->UseVisualStyleBackColor = true ;
264
+ this ->cbBatIcon ->CheckStateChanged += gcnew System::EventHandler (this , &SettingsForm::CBBatIcon_CheckChange);
265
+ //
252
266
// SettingsForm
253
267
//
254
268
this ->AutoScaleDimensions = System::Drawing::SizeF (6 , 13 );
255
269
this ->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
256
270
this ->BackColor = System::Drawing::Color::Silver;
257
- this ->ClientSize = System::Drawing::Size (316 , 183 );
271
+ this ->ClientSize = System::Drawing::Size (316 , 209 );
272
+ this ->Controls ->Add (this ->cbBatIcon );
258
273
this ->Controls ->Add (this ->numRefreshMinutes );
259
274
this ->Controls ->Add (this ->lbRefresh );
260
275
this ->Controls ->Add (this ->lbText );
@@ -272,8 +287,8 @@ namespace Cloud2BatteryMonitorUI {
272
287
this ->Controls ->Add (this ->lbSettingsHigh );
273
288
this ->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject (L" $this.Icon" )));
274
289
this ->MaximizeBox = false ;
275
- this ->MaximumSize = System::Drawing::Size (332 , 222 );
276
- this ->MinimumSize = System::Drawing::Size (332 , 222 );
290
+ this ->MaximumSize = System::Drawing::Size (332 , 248 );
291
+ this ->MinimumSize = System::Drawing::Size (332 , 248 );
277
292
this ->Name = L" SettingsForm" ;
278
293
this ->Text = L" Settings" ;
279
294
this ->Load += gcnew System::EventHandler (this , &SettingsForm::SettingsForm_Load);
@@ -284,6 +299,11 @@ namespace Cloud2BatteryMonitorUI {
284
299
}
285
300
#pragma endregion
286
301
302
+ #define FILL_STRING " Fill"
303
+ #define OUTLINE_STRING " Outline"
304
+ #define BACKGROUND_STRING " Background"
305
+ #define TEXT_STRING " Text"
306
+
287
307
private: System::Void SettingsForm_Load (System::Object^ sender, System::EventArgs^ e)
288
308
{
289
309
@@ -296,10 +316,32 @@ namespace Cloud2BatteryMonitorUI {
296
316
this ->btnLow ->BackColor = settingsHelper->getColorLow ();
297
317
this ->btnLowText ->BackColor = settingsHelper->getColorLowText ();
298
318
this ->cbStart ->Checked = settingsHelper->getAutostart ();
319
+ this ->cbBatIcon ->Checked = settingsHelper->getBatIcon ();
320
+
321
+ if (cbBatIcon->Checked )
322
+ {
323
+ this ->lbBackground ->Text = FILL_STRING;
324
+ this ->lbText ->Text = OUTLINE_STRING;
325
+ }
299
326
300
327
delete settingsHelper;
301
328
}
302
329
330
+ private: System::Void CBBatIcon_CheckChange (System::Object^ sender, System::EventArgs^ e)
331
+ {
332
+
333
+ if (cbBatIcon->Checked )
334
+ {
335
+ this ->lbBackground ->Text = FILL_STRING;
336
+ this ->lbText ->Text = OUTLINE_STRING;
337
+ }
338
+ else
339
+ {
340
+ this ->lbBackground ->Text = BACKGROUND_STRING;
341
+ this ->lbText ->Text = TEXT_STRING;
342
+ }
343
+ }
344
+
303
345
private: System::Void colorBtnClick (System::Object^ sender, System::EventArgs^ e)
304
346
{
305
347
ColorDialog^ colorDlg = gcnew ColorDialog ();
@@ -326,6 +368,7 @@ namespace Cloud2BatteryMonitorUI {
326
368
settingsHelper->setColorLow (this ->btnLow ->BackColor );
327
369
settingsHelper->setColorLowText (this ->btnLowText ->BackColor );
328
370
settingsHelper->setAutostart (this ->cbStart ->Checked );
371
+ settingsHelper->setBatIcon (this ->cbBatIcon ->Checked );
329
372
330
373
settingsHelper->saveSettings ();
331
374
0 commit comments