Page 9 of 10

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Wed May 08, 2013 7:57 am
by fddima
deepshi03 wrote:How can i get the same functionality in CefGlue.Samples.WpfOsr??

It is not implemented in CEF - follow issue 554 Drag and Drop not support on Windows with offscreen rendering enabled.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Thu May 09, 2013 7:33 am
by deepshi03
CefGlue.Samples.WpfOsr doesn't support combo box or drop down box functionality in any webpage. How can we correct this problem??

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Thu May 09, 2013 9:17 am
by fddima
deepshi03 wrote:CefGlue.Samples.WpfOsr doesn't support combo box or drop down box functionality in any webpage. How can we correct this problem??

It must fully implement CefRenderHandler's method (OnPaint) method. Good point to start making it - is look on cefclient code.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Fri May 10, 2013 1:20 am
by deepshi03
fddima wrote:It must fully implement CefRenderHandler's method (OnPaint) method. Good point to start making it - is look on cefclient code.


While implementing OnPaint method x and y coordinates of dirty rect is always 0,0 and so the drop down box opens up at the top left corner. How to get the correct x,y coordinate?? Please help

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Fri May 10, 2013 8:58 am
by fddima
deepshi03 wrote:
fddima wrote:It must fully implement CefRenderHandler's method (OnPaint) method. Good point to start making it - is look on cefclient code.


While implementing OnPaint method x and y coordinates of dirty rect is always 0,0 and so the drop down box opens up at the top left corner. How to get the correct x,y coordinate?? Please help

Hm. But this is work with cefclient. Try use it on different pages, may be something changes. It must not be always 0, 0.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Sat May 11, 2013 8:54 am
by deepshi03
I have already implemented OnPopupShow() as:

Code: Select all
protected override void OnPopupShow(CefBrowser browser, bool show)
        {
            if (!show)
            {
                CefRectangle popup_rect = new CefRectangle();
                popup_rect.X = 0;
                popup_rect.Y = 0;
                popup_rect.Height = 0;
                popup_rect.Width = 0;
                browser.GetHost().Invalidate(popup_rect, CefPaintElementType.View);
            }
        }


OnPopupSize as:
Code: Select all
private CefRectangle directRectPopup;
        protected override void OnPopupSize(CefBrowser browser, CefRectangle rect)
        {           
            if (rect.Width <= 0 || rect.Height <= 0)
            {
                return;
            }
            CefRectangle original_popup_Rect= rect;
          directRectPopup= _owner.GetPopupRectInWebView(original_popup_Rect);
        }
  internal CefRectangle GetPopupRectInWebView(CefRectangle popop_rect)
        {
            if (popop_rect.X < 0)
                popop_rect.X = 0;
            if (popop_rect.Y < 0)
                popop_rect.Y = 0;

            if (popop_rect.X + popop_rect.Width > _browserWidth)
                popop_rect.Width =(int)_browserWidth - (int)popop_rect.Width;
            if (popop_rect.Y + popop_rect.Height > _browserHeight)
                popop_rect.Height = (int)_browserHeight - (int)popop_rect.Height;

            return(popop_rect);
        }


and HandleViewPaint_Popup as:
Code: Select all
internal void HandleViewPaint_Popup(CefBrowser browser, CefPaintElementType type, CefRectangle dirtyRect, IntPtr buffer, int width, int height)
        {
            //browser.SetShowHidePopup(this.EnablePopup);
            _mainUiDispatcher.Invoke(DispatcherPriority.Render, new Action(delegate
            {
                try
                {
                    if (_browserSizeChanged)
                    {
                        _browserPageBitmap = new WriteableBitmap((int)_browserWidth, (int)_browserHeight, 96, 96, PixelFormats.Bgr32, null);
                        _browserPageImage.Source = _browserPageBitmap;

                        _browserSizeChanged = false;
                    }

                    int stride = width * 4;
                    int sourceBufferSize = stride * height;

                    int adjustedWidth = (int)dirtyRect.Width;
                    if (dirtyRect.X + dirtyRect.Width > (int)_browserPageBitmap.Width)
                        adjustedWidth = (int)_browserPageBitmap.Width - (int)dirtyRect.X;

                    int adjustedHeight = (int)dirtyRect.Height;
                    if (dirtyRect.Y + dirtyRect.Height > (int)_browserPageBitmap.Height)
                        adjustedHeight = (int)_browserPageBitmap.Height - (int)dirtyRect.Y;

                    Int32Rect sourceRect = new Int32Rect((int)0, (int)0, adjustedWidth, adjustedHeight);
                    _browserPageBitmap.WritePixels(sourceRect, buffer, sourceBufferSize, stride, dirtyRect.X, dirtyRect.Y;
                   
                }
                catch (Exception ex)
                {
                    //LogWriter.WriteMsg(LogLevel.Error, "WpfCefBrowser: Caught exception in HandleViewPaint(): {0} - {1}", ex.GetType(), ex.Message);
                }
            }));
        }


but still, if the coordinates are (0,0), only then the drop down menu is drawn. If the coordinates are not (0,0), then it gives "Buffer Size Not Enough" error

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Sat May 11, 2013 9:12 am
by fddima
@deepshi03, look on cefclient's implementation.

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Sun May 19, 2013 11:14 pm
by deepshi03
Hi!!
While we set auto scroll by clicking middle button of the mouse, we get a strange CC character image in the web page. How can we change or remove that??

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Mon May 20, 2013 3:15 am
by fddima
deepshi03 wrote:Hi!!
While we set auto scroll by clicking middle button of the mouse, we get a strange CC character image in the web page. How can we change or remove that??

Please create new threads for questions. And next - can you describe problem, more understandable?

Re: Xilium.CefGlue/3 & CefGlue/1

PostPosted: Mon Jun 24, 2013 3:18 pm
by Desu
Hello,
I am using Xiliuö.CefGlue and I have a problem with
CefFrame.LoadString(str,url)

I have a simple request handler which simply prints request url to console.
I load a html string with <img>s in it. If i pass an empty string as url my string loads fine but none of the <img>s or other resources try to load. If i pass a url starting with http as it loads that page. Documentation says i need to use a standart scheme for url so i assume custom schemes wont do?

I am guessing i am completely missing concept of url part of the LoadString function, can you please enlighten me? How can i get it to load these resources?

my imgs look like this:
Code: Select all
<img src="test.jpg" />


i need to load test.jpg from a zip file, when i open it with LoadUrl with a file:/// url it works fine.