Changeset 54
- Timestamp:
- Apr 7, 2005, 11:36:37 PM (19 years ago)
- Location:
- trunk/MacFaceFloat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/Configuration.cs
r30 r54 48 48 [Category("çtH["), Description("}EXbZ[Wð§ß³¹é©Ç¤©ðwèµÜ·B")] 49 49 public bool TransparentMouseMessage; 50 51 [AutoConfigure("form.status.point")] 52 [Category("Xe[^XEChE"), Description("\¦Êu")] 53 public Point StatusWindowLocation; 50 54 51 55 public static Configuration GetInstance() -
trunk/MacFaceFloat/MacFaceApp.cs
r53 r54 32 32 private MemoryUsageCounter memoryCounter; 33 33 34 private FormstatusWindow;34 private StatusWindow statusWindow; 35 35 private Bitmap cpuGraph; 36 36 private Bitmap memoryGraph; … … 107 107 // p^[EChE 108 108 this.patternWindow = new PatternWindow(); 109 this.patternWindow.Closing += new System.ComponentModel.CancelEventHandler(patternWindow_Closing); 109 110 110 111 // Xe[^XEChE 111 112 cpuGraph = new Bitmap(5*60, 100); 112 113 memoryGraph = new Bitmap(5*60, 100); 113 114 statusWindow = new Form(); 115 statusWindow.ClientSize = new System.Drawing.Size(310, 215); 116 statusWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; 117 statusWindow.ControlBox = false; 118 statusWindow.MaximizeBox = false; 119 statusWindow.MinimizeBox = false; 120 statusWindow.Icon = new Icon(asm.GetManifestResourceStream("MacFace.FloatApp.App.ico")); 121 statusWindow.Text = "Xe[^X"; 122 statusWindow.Paint +=new PaintEventHandler(statusWindow_Paint); 114 statusWindow = new StatusWindow(); 115 patternWindow.Closing += new System.ComponentModel.CancelEventHandler(patternWindow_Closing); 116 statusWindow.cpuGraphPicBox.Image = cpuGraph; 117 statusWindow.memoryGraphPicBox.Image = memoryGraph; 123 118 } 124 119 … … 143 138 drawCPUGraph(); 144 139 drawMemoryGraph(); 140 statusWindow.Location = config.StatusWindowLocation; 145 141 statusWindow.Show(); 146 142 … … 164 160 // Û¶ 165 161 config.Location = patternWindow.Location; 162 config.StatusWindowLocation = statusWindow.Location; 166 163 config.Save(); 167 164 } … … 281 278 drawCPUGraph(); 282 279 drawMemoryGraph(); 283 statusWindow.Invalidate(); 280 statusWindow.cpuGraphPicBox.Invalidate(); 281 statusWindow.memoryGraphPicBox.Invalidate(); 284 282 } 285 283 … … 402 400 Brush commitedBrush = new SolidBrush(Color.FromArgb(180, 255, 145, 0)); 403 401 Brush uncommitedBrush = new SolidBrush(Color.FromArgb(180, 180, 200, 255)); 404 Brush availableBrush = new SolidBrush(Color.FromArgb(1 00, 100, 100, 255));402 Brush availableBrush = new SolidBrush(Color.FromArgb(180, 100, 100, 255)); 405 403 Brush spaceBrush = new SolidBrush(Color.FromArgb(180, 240, 230, 255)); 406 404 … … 416 414 w = 5; 417 415 418 h = 100 - border; 416 h = (int)(usage.Available * rate); 417 y = 100 - h; 418 g.FillRectangle(availableBrush, x, y, w, h); 419 420 h = (int)(usage.Committed * rate); 421 y -= h; 422 g.FillRectangle(commitedBrush, x, y, w, h); 423 424 if (y > 100 - border) 425 { 426 h = y - (100 - border); 427 y = 100 - border; 428 g.FillRectangle(uncommitedBrush, x, y, w, h); 429 } 430 431 h = y; 419 432 y = 0; 420 433 g.FillRectangle(spaceBrush, x, y, w, h); 421 422 h = (int)(usage.Committed * rate);423 y = 100 - h;424 g.FillRectangle(commitedBrush, x, y, w, h);425 426 if (h < border)427 {428 h = border - h;429 y = 100 - border;430 g.FillRectangle(uncommitedBrush, x, y, w, h);431 }432 433 h = (int)(usage.Available * rate);434 y = 100 - border;435 g.FillRectangle(availableBrush, x, y, w, h);436 434 437 435 x = 300 - i * 5 - 5; … … 455 453 g.Dispose(); 456 454 } 455 456 private void patternWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) 457 { 458 e.Cancel = true; 459 } 457 460 } 458 461 }
Note: See TracChangeset
for help on using the changeset viewer.