WpfCefBrowser -dropdowns are not working

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

Moderator: fddima

WpfCefBrowser -dropdowns are not working

Postby MAHE202 » Wed Aug 28, 2013 6:57 am

Hi All,
I'm creating a WPF browser sample app with the provided CEFGlue WPFCefBrowser wrapper downloaded and used as it is. In which few things are not working as expected. Let say,
1) the dropdowns are not opening at all - http://www.w3schools.com/html/tryit.asp ... ml_select2
2) Textbox not allowing to select the text

Referring CefGlue & CefGlue.WPF downloaded referernces and think I have added all the required references and able to load and see other things working fine.

In Xaml:
<wpf:WpfCefBrowser Margin="30" Grid.Row="1" x:Name="browser" StartUrl="" Width="Auto" Height="400" />

Would like to know what is missing in this sample or need to do some custom coding to fix this issue.

Code: Select all
namespace Xilium.CefGlue.WPF
{
    internal sealed class WpfCefRenderHandler : CefRenderHandler
    {
       protected override void OnPaint(CefBrowser browser, CefPaintElementType type, CefRectangle[] dirtyRects, IntPtr buffer, int width, int height)
        {
            _logger.Debug("Type: {0} Buffer: {1:X8} Width: {2} Height: {3}", type, buffer, width, height);
            foreach (var rect in dirtyRects)
            {
                _logger.Debug("   DirtyRect: X={0} Y={1} W={2} H={3}", rect.X, rect.Y, rect.Width, rect.Height);
            }

            if (type == CefPaintElementType.View)
            {
                _owner.HandleViewPaint(browser, type, dirtyRects, buffer, width, height);
            }
            else if (type == CefPaintElementType.Popup)
            {
            // TODO: todo - not sure what to do here since drop down is of type POPUP when debugging <----------------------------------
            }
            //this.browser.HandleWidgetPaint(browser, type, dirtyRects, buffer, width, height);
        }


Pls provide some pointer to implement dropdown open and close and Text selecting within the text box in WPF.
MAHE202
Techie
 
Posts: 10
Joined: Wed Aug 28, 2013 6:05 am

Re: WpfCefBrowser -dropdowns are not working

Postby fddima » Wed Aug 28, 2013 1:22 pm

Hi.
You are on the right way. This is exactly place (popup drawing handling) which is not implemented. You need implement it. It must be not to be very hard. As reference implementation you can examine cefclient's soruces, or try make it forself.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: WpfCefBrowser -dropdowns are not working

Postby MAHE202 » Thu Aug 29, 2013 8:21 am

Thanks fddima. Finding difficulty in porting to C# from cpp. Not worked with cpp so don't know how to handle this in .NEt world.
Anybody who has done this pls throw some ideas. thanks in advance.
MAHE202
Techie
 
Posts: 10
Joined: Wed Aug 28, 2013 6:05 am

Re: WpfCefBrowser -dropdowns are not working

Postby fddima » Mon Sep 02, 2013 3:19 am

MAHE202 wrote:Thanks fddima. Finding difficulty in porting to C# from cpp. Not worked with cpp so don't know how to handle this in .NEt world.
Anybody who has done this pls throw some ideas. thanks in advance.

It is just specific drawing event. You need draw popup on required surface. Optionally you may want create native popup window.
And for first - why not using windowed (WinForms) mode? You always can integrate it via windows forms host in WPF application.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: WpfCefBrowser -dropdowns are not working

Postby beeplusplus » Wed Sep 04, 2013 1:08 am

Thank you, fddima for your guidance.
We have done with the popup stuffs last week. MAHE202 would be a providing a patch shortly.
beeplusplus
Techie
 
Posts: 17
Joined: Fri Aug 30, 2013 6:48 am

Re: WpfCefBrowser -dropdowns are not working

Postby fddima » Wed Sep 04, 2013 9:38 am

beeplusplus wrote:Thank you, fddima for your guidance.
We have done with the popup stuffs last week. MAHE202 would be a providing a patch shortly.

Thanks. It will be cool.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 18 guests