Example #1
0
 /// <summary>
 /// Ctor: take parent.
 /// </summary>
 public CharPicker(ZenControl owner, ITextProvider tprov)
     : base(owner)
 {
     this.tprov = tprov;
     charRects  = new List <CharRect>();
     for (int i = 0; i != 10; ++i)
     {
         charRects.Add(new CharRect());
     }
     calibrateFont();
 }
Example #2
0
        /// <summary>
        /// Ctor.
        /// </summary>
        public ResultsControl(ZenControl owner, ITextProvider tprov,
                              LookupThroughLinkDelegate lookupThroughLink, GetEntryDelegate getEntry)
            : base(owner)
        {
            this.tprov             = tprov;
            this.lookupThroughLink = lookupThroughLink;
            this.getEntry          = getEntry;

            sbar = new ZenScrollBar(this, onTimerForScrollBar);
            RemoveChild(sbar); // Instead of setting visible to false
        }
Example #3
0
        /// <summary>
        /// Ctor: take parent etc.
        /// </summary>
        public SearchInputControl(ZenControl owner, ITextProvider tprov)
            : base(owner)
        {
            this.tprov = tprov;
            padding    = (int)Math.Round(4.0F * Scale);

            // The hinted text input control.
            txtInput             = new HintedTextBox();
            txtInput.Name        = "txtInput";
            txtInput.TabIndex    = 0;
            txtInput.BorderStyle = BorderStyle.None;
            RegisterWinFormsControl(txtInput);
            // My font family, and other properties to achieve a borderless inside input field.
            txtInput.Font = (SystemFontProvider.Instance as ZydeoSystemFontProvider).GetZhoButtonFont(
                FontStyle.Regular, 16F);
            txtInput.AutoSize = false;
            txtInput.Height   = txtInput.PreferredHeight + padding;
            txtInput.HintText = tprov.GetString("SearchTextHint");

            // My height depends on text box's height at current font settings.
            blockSizeChanged   = true;
            Height             = 2 + txtInput.Height;
            blockSizeChanged   = false;
            txtInput.KeyPress += onTextBoxKeyPress;

            // Search button
            Assembly a         = Assembly.GetExecutingAssembly();
            var      imgSearch = Image.FromStream(a.GetManifestResourceStream("ZD.Gui.Resources.search.png"));

            btnSearch             = new ZenImageButton(this);
            btnSearch.RelLocation = new Point(padding, padding);
            btnSearch.Size        = new Size(Height - 2 * padding, Height - 2 * padding);
            btnSearch.Image       = imgSearch;
            btnSearch.MouseClick += onClickSearch;

            // Clear text button.
            var imgCancel = Image.FromStream(a.GetManifestResourceStream("ZD.Gui.Resources.cancel.png"));

            btnCancel             = new ZenImageButton(this);
            btnCancel.Size        = new Size(Height - 2 * padding, Height - 2 * padding);
            btnCancel.Padding     = padding; // We want the X to be somewhat smaller
            btnCancel.RelLocation = new Point(Width - padding - btnCancel.Width, padding);
            btnCancel.Image       = imgCancel;
            btnCancel.Visible     = false;
            btnCancel.MouseClick += onClickCancel;

            txtInput.MouseEnter  += onTxtMouseEnter;
            txtInput.MouseLeave  += onTxtMouseLeave;
            txtInput.MouseMove   += onTxtMouseMove;
            txtInput.TextChanged += onTxtTextChanged;
        }
Example #4
0
 /// <summary>
 /// Ctor.
 /// </summary>
 public WritingPad(ZenControl owner, ITextProvider tprov)
     : base(owner)
 {
     this.tprov = tprov;
     createMyCursor();
 }