Example #1
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 #2
0
 public BundleEntry GetEntry(int index)
 {
     if (InvokeRequired)
     {
         GetEntryDelegate del = GetEntry;
         return((BundleEntry)Invoke(del, index));
     }
     else
     {
         return(CurrentArchive.Entries[index]);
     }
 }
Example #3
0
        /// <summary>
        /// Ctor: takes data to display.
        /// </summary>
        /// <param name="owner">Zen control that owns me.</param>
        /// <param name="tprov">Localized display text provider.</param>
        /// <param name="lookupThroughLink">Delegate to call when user initiates lookup by clicking on a link.</param>
        /// <param name="getEntry">Delegate to call when an entry must be retrieved (for "copy" context menu).</param>
        /// <param name="entryProvider">Dictionary entry provider.</param>
        /// <param name="cr">The lookup result this control will show.</param>
        /// <param name="maxHeadLength">Longest headword in full results list.</param>
        /// <param name="script">Scripts to show in headword.</param>
        /// <param name="odd">Odd/even position in list, for alternating BG color.</param>
        public OneResultControl(ZenControlBase owner, float scale, ITextProvider tprov,
                                LookupThroughLinkDelegate lookupThroughLink,
                                ParentPaintDelegate parentPaint, GetEntryDelegate getEntry,
                                ICedictEntryProvider entryProvider, CedictResult cr,
                                SearchScript script, bool last)
            : base(owner)
        {
            this.scale             = scale;
            this.tprov             = tprov;
            this.lookupThroughLink = lookupThroughLink;
            this.parentPaint       = parentPaint;
            this.getEntry          = getEntry;
            this.entry             = entryProvider.GetEntry(cr.EntryId);
            this.res            = cr;
            this.analyzedScript = script;
            this.last           = last;

            padLeft   = (int)(5.0F * scale);
            padTop    = (int)(4.0F * scale);
            padBottom = (int)(8.0F * scale);
            padMid    = (int)(20.0F * scale);
            padRight  = (int)(10.0F * scale);
        }
Example #4
0
        /// <summary>
        /// Ctor: takes data to display.
        /// </summary>
        /// <param name="owner">Zen control that owns me.</param>
        /// <param name="tprov">Localized display text provider.</param>
        /// <param name="lookupThroughLink">Delegate to call when user initiates lookup by clicking on a link.</param>
        /// <param name="getEntry">Delegate to call when an entry must be retrieved (for "copy" context menu).</param>
        /// <param name="entryProvider">Dictionary entry provider.</param>
        /// <param name="cr">The lookup result this control will show.</param>
        /// <param name="maxHeadLength">Longest headword in full results list.</param>
        /// <param name="script">Scripts to show in headword.</param>
        /// <param name="odd">Odd/even position in list, for alternating BG color.</param>
        public OneResultControl(ZenControlBase owner, float scale, ITextProvider tprov,
            LookupThroughLinkDelegate lookupThroughLink,
            ParentPaintDelegate parentPaint, GetEntryDelegate getEntry,
            ICedictEntryProvider entryProvider, CedictResult cr,
            SearchScript script, bool last)
            : base(owner)
        {
            this.scale = scale;
            this.tprov = tprov;
            this.lookupThroughLink = lookupThroughLink;
            this.parentPaint = parentPaint;
            this.getEntry = getEntry;
            this.entry = entryProvider.GetEntry(cr.EntryId);
            this.res = cr;
            this.analyzedScript = script;
            this.last = last;

            padLeft = (int)(5.0F * scale);
            padTop = (int)(4.0F * scale);
            padBottom = (int)(8.0F * scale);
            padMid = (int)(20.0F * scale);
            padRight = (int)(10.0F * scale);
        }
Example #5
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
        }