예제 #1
0
        private void listChars_DrawItem(object sender, System.Windows.Forms.DrawListViewItemEventArgs e)
        {
            if ((e.State & (ListViewItemStates.Selected | ListViewItemStates.Hot)) != 0)
            {
                e.Graphics.FillRectangle(System.Drawing.SystemBrushes.Highlight, e.Bounds);
            }
            else
            {
                e.Graphics.FillRectangle(System.Drawing.SystemBrushes.Info, e.Bounds);
            }
            e.Graphics.DrawRectangle(System.Drawing.Pens.Black, e.Bounds);

            Types.C64Character character = (Types.C64Character)e.Item.Tag;
            if (character == null)
            {
                return;
            }
            System.Drawing.Brush brush = System.Drawing.SystemBrushes.WindowText;

            if ((e.State & (ListViewItemStates.Selected | ListViewItemStates.Hot)) != 0)
            {
                brush = System.Drawing.SystemBrushes.HighlightText;
            }
            e.Graphics.DrawString(e.Item.Text, listChars.Font, brush, new System.Drawing.PointF(e.Bounds.Left + 2, e.Bounds.Top + 2));
            e.Graphics.DrawString(character.PetSCIIValue.ToString("X02"), _DefaultFont, brush, new System.Drawing.PointF(e.Bounds.Left + 40, e.Bounds.Top + 2));
            e.Graphics.DrawString(character.Desc, _DefaultFont, brush, new System.Drawing.PointF(e.Bounds.Left, e.Bounds.Top + e.Bounds.Height * 0.5f));

            if ((e.State & ListViewItemStates.Focused) != 0)
            {
                e.DrawFocusRectangle();
            }
        }
예제 #2
0
        private void listPETSCII_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listPETSCII.SelectedIndex == -1)
            {
                return;
            }
            Types.C64Character character = (Types.C64Character)listPETSCII.Items[listPETSCII.SelectedIndex].Value;

            editFilename.CurrentChar = character.CharValue;
            ++editFilename.CursorPos;
        }
예제 #3
0
        private void listPETSCII_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listPETSCII.SelectedIndex == -1)
            {
                return;
            }
            Types.C64Character character = (Types.C64Character)listPETSCII.Items[listPETSCII.SelectedIndex].Value;
            BaseDocument       doc       = Core.MainForm.ActiveDocument;

            if (doc != null)
            {
                doc.InsertText("" + character.CharValue);
            }
        }
예제 #4
0
        private void listChars_ItemActivate(object sender, EventArgs e)
        {
            if (listChars.SelectedItems.Count == 0)
            {
                return;
            }
            Types.C64Character character = (Types.C64Character)listChars.SelectedItems[0].Tag;
            BaseDocument       doc       = Core.MainForm.ActiveDocument;

            if (doc != null)
            {
                doc.InsertText("" + character.CharValue);
            }
        }
예제 #5
0
        static void AddC64Key(byte ScreenCodeValue, bool HasScreenCode, byte PetSCIIValue, bool HasPetSCII, char CharValue, bool HasChar, string Desc, string ShortDesc)
        {
            C64Character c64Char = new C64Character(ScreenCodeValue, HasScreenCode, PetSCIIValue, HasPetSCII, CharValue, HasChar, Desc, ShortDesc);

            if (HasScreenCode)
            {
                ScreenCodeToChar[ScreenCodeValue] = c64Char;
            }
            if (HasPetSCII)
            {
                PetSCIIToChar[PetSCIIValue] = c64Char;
            }
            if (HasChar)
            {
                CharToC64Char[CharValue] = c64Char;
            }
        }