Read-only CEF Window

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Read-only CEF Window

Postby pabloko » Mon Nov 22, 2010 3:43 pm

Hi, there are any way to prevent user selection (of text, objects...) will be nice for WebUIs if this can be achived

Thanks a lot
pabloko
Techie
 
Posts: 15
Joined: Wed Dec 23, 2009 6:38 am

Re: Read-only CEF Window

Postby magreenblatt » Mon Nov 22, 2010 4:06 pm

You could customize the context menus in CefHandler::HandleBeforeMenu so that the user doesn't have select/copy/paste options, but I don't think there's any way to disable selection completely.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Read-only CEF Window

Postby magreenblatt » Mon Nov 22, 2010 4:09 pm

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Read-only CEF Window

Postby pabloko » Mon Nov 22, 2010 4:14 pm

Great! Thanks marshall
pabloko
Techie
 
Posts: 15
Joined: Wed Dec 23, 2009 6:38 am

Re: Read-only CEF Window

Postby pabloko » Mon Nov 22, 2010 4:23 pm

Oh Marshal, i have a finish question, I have a Lua core created on my app, I've created a public pointer to my lua engine, but, how I can access it from cef classes?

I triying to create a javascript binding like widow.lua.call("function",["arg1","arg2"...]) I'm successful with that, but I like to do a luaL_dostring(&L,"function(arg1,arg2)") so I can't access to my painter.

I think on modify the functions of cef classes to pass the Lua pointer as argument on the functions... but, wath kind of thing you recomend me to do?

Thanks for all, your help are very appreciated
pabloko
Techie
 
Posts: 15
Joined: Wed Dec 23, 2009 6:38 am

Re: Read-only CEF Window

Postby magreenblatt » Mon Nov 22, 2010 4:36 pm

I'm not sure I understand what you're trying to do. Are you hosting CEF in a native application and then exposing certain Lua-based functions to the web content via JavaScript? Or are you trying to create a Lua wrapper for CEF so that you can embed CEF in a Lua application and control it via Lua-like APIs?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Read-only CEF Window

Postby pabloko » Mon Nov 22, 2010 4:43 pm

somthing near, I have a MFC app, and I use lua for common actions like sqlite access and these things, I have a complete wrapper for work with my mfc app using lua, the point is get the LuaState pointer in the ClientV8FunctionHandler, so I will be able to send something to lua, that will process the result, for example I have a lua string and I like to know it with javascript using var mystring=window.lua.getstring("mystring"). I don't have problems doing this, the only problem that i have is pass the lua pointer to work with it
pabloko
Techie
 
Posts: 15
Joined: Wed Dec 23, 2009 6:38 am

Re: Read-only CEF Window

Postby magreenblatt » Mon Nov 22, 2010 4:49 pm

Perhaps one of the following options:
1. If there's only one Lua pointer for the whole application then provide a static or global function for retrieving it.
2. If there are multiple Lua pointers and the pointer is associated with a particular ClientV8FunctionHandler implementation then store that pointer as a member variable of the ClientV8FunctionHandler implementation.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 54 guests