I would like to display the yahoo weather widget (or any similar flash or java based widget) in a Delphi application. I freely admit I don't quite understand what would be required to make this work.
Any suggestions on how this could be accomplished would be appreciated.
I'm using Delphi 7. All of the Widgets are just HTML Code, which when I cut & paste them to my Blogger page for instance, show up and work fine. I'm not sure how to take that same html code and use it in a Delphi form to get similar results.
Detailed instructions would be appreciated as well as an explanation. Clearly I don't quite understand how this works... I only know what outcome I'd like ;-)
Thanks Rob, it wasn't a memory issue, butt he admins did take care of it as you suggested.
Mark
Basically, you want to host the SWF ActiveXObject.
http://delphi.about.com/od/graphics/l/aa040103a.htm
As mentioned above you could host Flash's active X control for a flash control.
The other option is to use an embedded webpage (possibly loaded off the local disk) using the built in Delphi TWebBrowser control to show any web content including Java or Flash controls (as long as they are installed on the client).
Hope that helps.
I have a video on embedding flash into Delphi Applications Available Here. If the widget is a flash file (.swf) it should be fairly easy. The other option (as already mentioned) is to use the Delphi TWebBrowser component.
Related
Im using Umbraco 7 for an Intranet. I was hoping to replicate some functionality that is in the backend, ive noticed when it renders the macro in the backend it will load the macro after / during the full page load.
I was hoping to replicated that same functionality in the front end, so that it can load the full page quickly then render the macros as and when theyve fully rendered
Has anyone else done anything like this before?
Thanks
Ian
The reason it works like that in the back end of Umbraco is that the Macros are stored as custom markup in the RichText editor. There's some JS that looks for the code and then parses the macro details and loads in a representation of the markup into the editor.
If you want to copy the functionality of the back office, have a look at the source code for Umbraco and see if you can use the method that they use.
How can I print .docx,doc,xls,csv in rails 4?
I tried window.open and window.print using javascript, but each time when it invokes window.open it downloads the file.
I tried to embed that in an iframe, that also fails.
Displaying a specific type of file isn't something that relies on your application it relies on the browser. In common browsers there is no support to display the file formats you mentioned.
What you can do is implementing some document viewers based on js if they are available for your usage. For example I know there is a plugin viewer.js that provides functionality to convert office and pdf to html. That might help you out... https://developers.box.com/viewer-js-tutorial/
I tried doing this some time back and this is the blog which i refereed. Helped a great deal.
Hope this helps.
We are trying to change the builtin browser component from TWebBrowser to TChromium.
It is used mostly for displaying maps from Google and Bing. The communication from the javascript to Delphi is done with COM.
When trying to change the browser to TChromium it fails to compile this code.
if supports(fBrowser.defaultInterface, IOleObject, fOLE) then
because defaultInterface is missing from TChromium.
EDIT:
Is it possible to still communicate from javascript to Delphi with Chromium?
I'm aware of that they are not compatible and I have to rewrite code. I just want to know how to get a result from javascript to delphi. Note I am using Delphi 2007 so the extended RTTI cannot be used.
Regards
Roland Bengtsson
I never used it myself, but TChromium appears to be a wrapper around the "Chromium" web browser, while the original TWebBrowser from Delphi is a wrapper around an IE Browser.
TWebBrowser.defaultInstance gives you the COM object of the IE Browser. For the Chromium browser you can apparently use TChromium.Browser, it gives you an object of type ICefBrowser. The TChromium people were smart not to name the property defaultInstance because there's a lot of code out there casting from the return of defaultInstance to other interface types: If TChromium.Browser was named the same, the cast would compile and fail at run time. Because the IE Browser is obviously not a Chrome browser, and I doubt the Chromium browser fully implements all IE interfaces.
Using TChromium, you can invoke scripts easily via ExecuteJavaScript. And you can invoke Delphi code from scripts, which you can use to send return values back from a JavaScript function to Delphi.
See this question and my answer there about doing this using extensions.
There also seems to be work in progress for functions like EexecuteScriptAndReturnValue but as the time of writing they are not contained in the trunk.
And regarding TWebBrowser.DefaultInterface I agree with Cosmin: the best analogy is probably TChromium.Browser as you can access frames and subsequently DOM, etc. from there.
This stems from my question that i started at MVC Beginner Question
Im now confident in developing a MVC website from the MVC side of things.
My fatal floor now is the UI level designing. i.e. designing views and master pages including css styling.
Just wanting to get any advice on where i should start? Im currently about to look at the expression studio to see if that will help.
I need to get up and running in this quickly so that it doesnt hold back the development of the website.
Thanks in advance
I would look at a CSS grid-framework like 960 Grid System or Blueprint.
There is often controversy from CSS/Markup purists as to whether the use of such frameworks is valid, but they often overlook that not everyone is a CSS expert. I have found that the use of these frameworks has saved me hours of productivity since my CSS skills (as a programmer) are not that great.
As far as using Expression, I tend to use this as a "test-bed" with simple HTML files. The Designer and CSS Style support seem to be more interactive than that which Visual Studio supports, so for quick mock-ups -- Expression, then move that HTML/CSS over to VS as soon as possible.
One other priceless tool to use while designing is the add-on "Firebug" for Firefox ... it allows you to inspect single elements on your page, the CSS properties affecting that element - it even allows you to change CSS attributes "on-the-fly" to immediately see the ramificatiions. This tool has saved me HOURS!
Consider finding a suitable theme in a free open source template.
Consider something that suits at http://www.freecsstemplates.org/.
how can I render a part of website to a bitmap using delphi?
recently I've seen Raudus framework which is ExtJs binding/wrapper for delphi. However what is unique about that, it does render components to look exactly like in the browser. Simply, it works like kind of WYSIWYG designer for Javascript components in delphi IDE. I was unable to try it since I'm using delphi personal (it requires dbrtl).
However looking on the demo movie it takes some time to render the components (even after resizing them), thus I believe it is rendered through web browser rendering engine or something similar...
if anyone knows something similar but open sourced, please let me know...
thanks in advance,
m
A while ago I discovered an arcane ActiveX call: OleDraw. As it turns out, it works just great to use an embedded WebBrowser component (IWebBrowser2) to render HTML and grab the output into a bitmap.
The code may look a little like this:
uses ActiveX, OleCtrls, SHDocVw;
b:=TBitmap.Create;
try
b.Width:=SizeX;
b.Height:=SizeY;
OleDraw(WebBrowser1.OleObject,DVASPECT_CONTENT,b.Canvas.Handle,Rect(0,0,SizeX,SizeY));
b.SaveToFile(FileName);
finally
b.Free;
end;
If you're cool with how Internet Explorer renders the page, it will show properly in the TWebBrowser (built in component), and you can generate bitmaps from there.
http://delphi.about.com/od/vclusing/a/wb_scren_shot.htm
http://www.delphi3000.com/articles/article_4132.asp?SK=
Dave Baldwin's HTML display components are now freeware with source (even the Professional version) and work in Delphi up to 2006 (which means also 2007). I don't know if those will help, since you didn't specify which version of Delphi you're using.