Example #1
0
        void DrawKey(int scancode, int extended, ref int left, int top, BlankButton button, int horizontalStretch, int verticalStretch)
        {
            KeyPictureBox box = new KeyPictureBox(scancode, extended, button, this._buttonScale, horizontalStretch, verticalStretch);

            box.Left = left;
            box.Top  = top;

            this.KeyboardPanel.Controls.Add(box);

            // Set the event handler unless filter is boot mappings and user can't write to boot mappings and this isn't Vista
            if (((MappingsManager.Filter == MappingFilter.Boot &&
                  !AppController.UserCanWriteBootMappings &&
                  !operatingSystemCapability.ImplementsUAC)) == false)
            {
                box.DoubleClick += KeyDoubleClick;
            }

            string toolTipText = box.Map.MappingDescription;

            if (String.IsNullOrEmpty(toolTipText) == false)
            {
                FormToolTip.SetToolTip(box, toolTipText);
            }

            // left is a ref parameter.
            left += box.Image.Width + _paddingWidth; // Width varies eg for double-width blanks
        }
Example #2
0
        private void KeyDoubleClick(object sender, EventArgs e)
        {
            KeyPictureBox box = sender as KeyPictureBox;

            if (box == null)
            {
                return;
            }
            FormsManager.ShowEditMappingForm(box.Map, false);
        }
Example #3
0
        private void DrawKey(int scanCode, int extended, ref int left, int top, BlankButton button, int horizontalStretch, int verticalStretch)
        {
            var box = new KeyPictureBox(scanCode, extended, button, buttonScale, horizontalStretch, verticalStretch);

            box.Left = left;
            box.Top  = top;

            KeyboardPanel.Controls.Add(box);

            box.DoubleClick += KeyDoubleClick;

            string toolTipText = box.Map.MappingDescription;

            if (string.IsNullOrEmpty(toolTipText) == false)
            {
                FormToolTip.SetToolTip(box, toolTipText);
            }

            // left is a ref parameter.
            left += box.Image.Width + paddingWidth; // Width varies eg for double-width blanks
        }