Beispiel #1
0
        private Rectangle BarRectangle()
        {
            var scaler           = new DpiScaler();
            int marginHorizontal = scaler.S(32);
            int marginVertical   = scaler.S(16);

            return(new Rectangle(marginHorizontal, marginVertical, Width - 2 * marginHorizontal, Height - 2 * marginVertical));
        }
Beispiel #2
0
        public TapeManager(ListBox listBox)
        {
            this.listBox = listBox;

            this.contextMenuStrip        = new ContextMenuStrip();
            this.toolStripMenuItemLoadA  = new ToolStripMenuItem();
            this.toolStripMenuItemLoadB  = new ToolStripMenuItem();
            this.toolStripMenuItemEdit   = new ToolStripMenuItem();
            this.toolStripMenuItemDelete = new ToolStripMenuItem();

            normalFont = new Font(contextMenuStrip.Font, FontStyle.Regular);
            boldFont   = new Font(contextMenuStrip.Font, FontStyle.Bold);

            this.contextMenuStrip.Items.AddRange(new ToolStripItem[] {
                this.toolStripMenuItemLoadA,
                this.toolStripMenuItemLoadB,
                this.toolStripMenuItemEdit,
                this.toolStripMenuItemDelete
            });
            this.toolStripMenuItemLoadA.Text    = "Load Side A";
            this.toolStripMenuItemLoadA.Click  += ToolStripMenuItemLoadA_Click;
            this.toolStripMenuItemLoadB.Text    = "Load Side B";
            this.toolStripMenuItemLoadB.Click  += ToolStripMenuItemLoadB_Click;
            this.toolStripMenuItemEdit.Text     = "Edit";
            this.toolStripMenuItemEdit.Click   += ToolStripMenuItemEdit_Click;
            this.toolStripMenuItemDelete.Text   = "Delete";
            this.toolStripMenuItemDelete.Click += ToolStripMenuItemDelete_Click;

            DpiScaler scaler = new DpiScaler();

            this.listBox.DrawMode          = DrawMode.OwnerDrawFixed;
            this.listBox.ItemHeight        = scaler.S(50);
            this.listBox.DrawItem         += listBox_DrawItem;
            this.listBox.MouseDoubleClick += listBox_MouseDoubleClick;
            this.listBox.MouseDown        += listBox_MouseDown;

            listOfTapes = TapeList.Load(TapeListFile);
            this.listBox.Items.AddRange(listOfTapes.Tapes.ToArray());
        }