View previous topic :: View next topic |
Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Mon Jul 07, 2014 4:11 pm Post subject: VDSBrw and contentEditable |
|
|
I am working on an editor that I want to give "richedit" support. When I use VDSBrw and apply the javascript contentEditable to it, it locks up. I used richeditpa from http://forum.vdsworld.com/viewtopic.php?t=5159 in that app and it works fine. When trying to add to my app, it locks up. Any ideas as to why?
Thanks _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 5:42 pm Post subject: |
|
|
If you are using VDS 6, be sure to check which version of VDS is being used in the project manager. I have found many times that this is the cause of many of my errors. I'll be trying to run VDS 6 code, but the project is set for VDS 5 and vice versa. Even resulting in lock ups, crashes and spitting in my face. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Mon Jul 07, 2014 5:47 pm Post subject: |
|
|
Yeah. I made sure to check that before I posted. Using VDS 6 with vdsbrw60.dll _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 6:00 pm Post subject: |
|
|
But! is the code you are using from the forums VDS 6 compatible, or was it from a VDS 5 project?
Trying switching the whole project out to a VDS 5 project and browser object and see if that makes any difference.
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Mon Jul 07, 2014 6:03 pm Post subject: |
|
|
The code from the forum was VDS 5, but I have used the javascript code before on a VDS 6 project and it worked fine.... I may try to switch it over to test, but the app uses A LOT of VDS 6 features that I would rather not lose. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 6:05 pm Post subject: |
|
|
Ah... Well, just for the testing sake, backup your files, remove the vds 6 stuff and give it a try and see..
I know, easy for me to say.. LOL Trust me though, I've done this a few times myself to find that the project either had to be rewritten from scratch or demoted to VDS 5. I don't like demoting a project so I always end up rewriting from scratch for VDS 6.
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Mon Jul 07, 2014 6:31 pm Post subject: |
|
|
I just did a test using the much the same code on a new script and the javascript works. It must be something else in my code that is causing it to lock up.... great... _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 6:33 pm Post subject: |
|
|
_________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Mon Jul 07, 2014 7:16 pm Post subject: |
|
|
You have VDS 6 yeah? I figured out when it locks up. Can you try this please?
Compile the code below. Run it an enter some text. Then select the menu item Make Read-Only. Then Select Save Test.... It should save a test.html file in the same location but it does not and the EXE will not close. You have to End Task.... Any ideas as to why....
.... Any one know how to fix this? ......
Code: |
EXTERNAL VDSBRW60.DLL
#DEFINE COMMAND,BROWSER
#DEFINE FUNCTION,BROWSER,richedit
DIALOG CREATE,New Dialog,-1,0,761,478,RESIZABLE
DIALOG ADD,BROWSER,E1,0,0,@dlgpos(,w),@dlgpos(,h),<html><body contenteditable=true><font face=arial></body></html>,,nonavigate,offline
DIALOG ADD,MENU,&File,&Make Editable|&Make Read-only|Save Test|-|E&xit
dialog add,menu,format,Bold|Link
DIALOG SHOW
#dialog set,E1,<html><body contenteditable=true>this is a test<font face=arial></body></html>
:evloop
:EVENTLOOP
WAIT EVENT
GOTO @event()
:EXITMENU
:CLOSE
EXIT
:RESIZE
DIALOG SETPOS,E1,,,@dlgpos(,w),@dlgpos(,h)
GOTO EVENTLOOP
:BoldMenu
dialog set,E1,javascript:document.execCommand('Bold');void(0);
goto evloop
:LinkMenu
dialog set,E1,"javascript:document.execCommand('CreateLink',true);void(0);"
goto evloop
:Make EditableMENU
dialog set,E1,javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
GOTO EVENTLOOP
:Make Read-onlyMENU
dialog set,E1,"javascript:document.body.contentEditable='false'; document.designMode='off'; void 0"
GOTO EVENTLOOP
:Save TestMenu
browser savefile,E1,@path(%0)test.html
goto evloop
:Browser1Navigate
%l = @browser(E1,navurl)
shell open,%l
goto eventloop
|
_________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 9:53 pm Post subject: |
|
|
As you anticipated, it did not save. Plus, it would not close for me.. had to kill it via Task Manager.
My only thought is that maybe it's not saving due to the javascript. Haven't played with that thought yet though. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jul 07, 2014 9:57 pm Post subject: |
|
|
If I do not apply the readonly, I can save the file and the program exits as it should. But the only thing that is saved is this:
Code: | <html><body contenteditable=true><font face=arial></body></html> |
If I apply any of the options, bold, link, anything where VDS injects the javascript, it won't save and the program won't close. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Jul 08, 2014 1:09 pm Post subject: |
|
|
Yeah, and I don't understand why. The one that Brandon made works fine, but it uses a sep dialog attached to the main dialog. Not sure if that is the work around, but I cannot do that on my application. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Jul 08, 2014 3:46 pm Post subject: |
|
|
I think the main problem with using the browser element is that it's very much disabled compared to IE itself. Many of the features are just not available to use in the browser element as it is in IE.
Though I do find uses for the browser element now and then. Like a few days back I made a character map / font viewer type program and used the browser as the display method for both the char map and the font example viewer.
I think Brandon's method was to use Chrome and slap the Chrome window on the dialog, which means you have to have Chrome installed.
Wish I had a fix for you on this, but this is beyond my capabilities.
~Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Jul 08, 2014 7:35 pm Post subject: |
|
|
No I have not. I'll give that a try. Fingers crossed. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
|