Changeset 54


Ignore:
Timestamp:
Apr 7, 2005, 11:36:37 PM (19 years ago)
Author:
altba\rryu
Message:

・Alt+F4でウインドウを閉じなくした。
・ステータスウインドウの表示位置を保存するようにした。

Location:
trunk/MacFaceFloat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MacFaceFloat/Configuration.cs

    r30 r54  
    4848                [Category("ŠçƒtƒH[ƒ€"), Description("ƒ}ƒEƒXƒƒbƒZ[ƒW‚𓧉߂³‚¹‚é‚©‚Ç‚¤‚©‚ðŽw’肵‚Ü‚·B")]
    4949                public bool TransparentMouseMessage;
     50
     51                [AutoConfigure("form.status.point")]
     52                [Category("ƒXƒe[ƒ^ƒXƒEƒCƒ“ƒhƒE"), Description("•\Ž¦ˆÊ’u")]
     53                public Point StatusWindowLocation;
    5054
    5155                public static Configuration GetInstance()
  • trunk/MacFaceFloat/MacFaceApp.cs

    r53 r54  
    3232                private MemoryUsageCounter memoryCounter;
    3333
    34                 private Form statusWindow;
     34                private StatusWindow statusWindow;
    3535                private Bitmap cpuGraph;
    3636                private Bitmap memoryGraph;
     
    107107                        // ƒpƒ^[ƒ“ƒEƒCƒ“ƒhƒE
    108108                        this.patternWindow = new PatternWindow();
     109                        this.patternWindow.Closing += new System.ComponentModel.CancelEventHandler(patternWindow_Closing);
    109110
    110111                        // ƒXƒe[ƒ^ƒXƒEƒCƒ“ƒhƒE
    111112                        cpuGraph = new Bitmap(5*60, 100);
    112113                        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 = "ƒXƒe[ƒ^ƒ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;
    123118                }
    124119
     
    143138                        drawCPUGraph();
    144139                        drawMemoryGraph();
     140                        statusWindow.Location = config.StatusWindowLocation;
    145141                        statusWindow.Show();
    146142
     
    164160                        // •Û‘¶
    165161                        config.Location = patternWindow.Location;
     162                        config.StatusWindowLocation = statusWindow.Location;
    166163                        config.Save();
    167164                }
     
    281278                        drawCPUGraph();
    282279                        drawMemoryGraph();
    283                         statusWindow.Invalidate();
     280                        statusWindow.cpuGraphPicBox.Invalidate();
     281                        statusWindow.memoryGraphPicBox.Invalidate();
    284282                }
    285283
     
    402400                        Brush commitedBrush = new SolidBrush(Color.FromArgb(180, 255, 145, 0));
    403401                        Brush uncommitedBrush = new SolidBrush(Color.FromArgb(180, 180, 200, 255));
    404                         Brush availableBrush = new SolidBrush(Color.FromArgb(100, 100, 100, 255));
     402                        Brush availableBrush = new SolidBrush(Color.FromArgb(180, 100, 100, 255));
    405403                        Brush spaceBrush = new SolidBrush(Color.FromArgb(180, 240, 230, 255));
    406404
     
    416414                                w = 5;
    417415
    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;
    419432                                y = 0;
    420433                                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);
    436434
    437435                                x = 300 - i * 5 - 5;
     
    455453                        g.Dispose();
    456454                }
     455
     456                private void patternWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
     457                {
     458                        e.Cancel = true;
     459                }
    457460        }
    458461}
Note: See TracChangeset for help on using the changeset viewer.