Xilium.CefGlue/3 & CefGlue/1

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Wed May 08, 2013 7:57 am

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.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby deepshi03 » Thu May 09, 2013 7:33 am

CefGlue.Samples.WpfOsr doesn't support combo box or drop down box functionality in any webpage. How can we correct this problem??
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Thu May 09, 2013 9:17 am

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.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby deepshi03 » Fri May 10, 2013 1:20 am

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
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Fri May 10, 2013 8:58 am

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.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby deepshi03 » Sat May 11, 2013 8:54 am

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
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Sat May 11, 2013 9:12 am

@deepshi03, look on cefclient's implementation.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby deepshi03 » Sun May 19, 2013 11:14 pm

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??
deepshi03
Techie
 
Posts: 14
Joined: Sun Mar 03, 2013 10:20 pm

Re: Xilium.CefGlue/3 & CefGlue/1

Postby fddima » Mon May 20, 2013 3:15 am

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?
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Xilium.CefGlue/3 & CefGlue/1

Postby Desu » Mon Jun 24, 2013 3:18 pm

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.
Desu
Techie
 
Posts: 11
Joined: Mon Jun 24, 2013 3:05 pm

PreviousNext

Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 19 guests