Ejemplo n.º 1
0
        private void find_override_url_control(Form form)
        {
            if (new_override_url_control != null || override_url_control != null)
            {
                return;
            }

            new_override_url_control = get_control_from_form(form, "m_cmbOverrideUrl") as ImageComboBoxEx;
            if (new_override_url_control == null)            //older keepass
            {
                override_url_control = get_control_from_form(form, "m_tbOverrideUrl") as TextBox;
            }
        }
Ejemplo n.º 2
0
        public EditAutoTypeExtraControls(EditAutoTypeItemForm parent)
            : this()
        {
            mParent = parent;

            mWindowTitleControls = (from controlName in new[] { "m_lblOpenHint",
                                                                "m_lblOpenHint",
                                                                "m_lblTargetWindow",
                                                                "m_lnkWildcardRegexHint" }
                                    let control = FindControl(controlName)
                                                  where control != null
                                                  select control).ToList();


            m_cmbWindow = FindControl("m_cmbWindow") as ImageComboBoxEx;
            if (m_cmbWindow == null)
            {
                System.Diagnostics.Debug.Fail("Could not find combo window");
                m_cmbWindow = new ImageComboBoxEx();                 // Create null stub to avoid crashing out
            }

            m_cmbWindow.TextChanged += m_cmbWindow_TextChanged;

            // Create an Imposter combo box over it
            mWindowTitleComboImposter = new ImageComboBoxEx
            {
                IntegralHeight = false,
                Name           = "mWindowTitleComboImposter",
                TabIndex       = m_cmbWindow.TabIndex,
            };

            mWindowTitleComboImposter.TextChanged += mWindowTitleComboImposter_TextChanged;
            mWindowTitleComboImposter.DropDown    += mWindowTitleComboImposter_DropDown;

            // Track changes to size and position and items
            m_cmbWindow.LocationChanged += SyncComboImposter;
            m_cmbWindow.SizeChanged     += SyncComboImposter;

            // Ignore any direct changes itself
            mWindowTitleComboImposter.LocationChanged += SyncComboImposter;

            // Take initial values
            SyncComboImposter(null, EventArgs.Empty);

            // Replace the combo with its imposter
            m_cmbWindow.Parent.Controls.Add(mWindowTitleComboImposter);
            m_cmbWindow.Visible = false;

            mWindowTitleControls.Add(mWindowTitleComboImposter);

            // Add a separator between the two groups of radio buttons
            mSeparator = new Label
            {
                BorderStyle = BorderStyle.Fixed3D,
                Location    = new Point(SeparatorIndent, mWindowTitleControls.Max(c => c.Bottom) + 7),
                Size        = new Size(mParent.ClientSize.Width - SeparatorIndent * 2, 2),
                Anchor      = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right,
                TabStop     = false,
            };

            m_cmbWindow.Parent.Controls.Add(mSeparator);
        }