I want to get the Mozilla menu handle but GetMenu returns zero. On Notepad it is true. Why?
Because Mozilla uses its own engine to display the menu, while Notepad uses the menu system provided by the Windows API.
If you need to read the menus then of course you can always use the accessibility APIs.
Related
How can I show from code SpreadsheetGear dialogs like Find/Replace?
There is WorkbookDesigner form which has most of those dialogs in main menu, but how can I implement it myself?
The "Find and Replace" dialog is not part of SpreadsheetGear's public API and so cannot be instantiated from code. Developers using Windows Forms have been able to "hack" this since a keyboard shortcut does exist to launch this dialog from the WinForms WorkbookView. This has been done by sending a Ctrl+F keystroke to the WorkbookView, using something like the following:
workbookView.Focus();
System.Windows.Forms.SendKeys.Send("^f");
WPF doesn't support this model since it is part of Windows Forms. However, it appears that using System.Windows.Forms.SendKeys.SendWait("^f") might work instead, but I make no guarantees of this.
Generally speaking, if a particular "dialog", such as the Find and Replace dialog, is not listed in the SpreadsheetGear.Windows.Forms namespace, then it is not available to instantiate from code.
I know there is a MessageBox class in the isolate library but that is not what I need. I am looking for the pop-up style messagebox functionality found in desktop windows apps (i.e. WinForm apps) where you ask a simple confirmation question and the user can click a yes or no button in response. Is there an equivalent in Dart, if not can anyone suggest some alternatives?
You can display a message box easily with :
window.alert('test');
don't forget this in the top of your file:
import 'dart:html';
This will behave like the alert function in JavaScript. If you want to add buttons (other then the default "ok" button) to your message window, then you will need to make a custom window, which would not be very hard. You create an element which you add to your document body. This element should be absolute positionned. Adding an overlay in front of your document will be useful to prevent user clicks on the page.
this is in javascript, but it is useful to know what to do with dom and css :
http://raventools.com/blog/create-a-modal-dialog-using-css-and-javascript/
I've seen numerous references to browser.js while trying to create a Firefox sidebar. I don't have a good understanding of what this file is though. It has a method toggleSidebar in it. Can I call that method from a web page? Can I call it from a browser extension? Do I need to include browser.js in my extension somehow first? Can I call it from the add-on SDK or is it only available from the old style XUL extensions?
I don't have a good understanding of what this file is though.
It is the code driving the Firefox browser window, lots of code actually.
Can I call that method from a web page?
No. You can use window.sidebar.addPanel() to add a sidebar however.
Can I call it from a browser extension?
Yes.
Do I need to include browser.js in my extension somehow first?
No, it is already included in the browser window.
Can I call it from the add-on SDK or is it only available from the old style XUL extensions?
You can use it from the Add-on SDK as well but you will need to access the browser window directly - either via one of the low-level modules or chrome authority.
I am creating a windows 7.1 phone app where I am using webbrowser to display some web content.
I want to know how to enable JavaScript in the browser object in my app?
I have set the IsScriptEnabled property to true but that does not seem to help.
Any ideas? Thanks in advance.
Following the MSDN WebBrowser.IsScriptEnabled help you have to refresh WebBrowser content after enabling scripts to make it really happen:
WebBrowser.IsScriptEnabled Property
Enables or disables scripting.
This applies to the next document that is navigated to, not the
current document. This property is false by default. Set this property
to true to enable scripting, or false to disable scripting.
It's more than enabling the scripts in the webbrowser, you also need to add a ScriptNotify handler.
<phone:WebBrowser Name="browser"
IsScriptEnabled="True"
ScriptNotify="browser_ScriptNotify"
Source="HTML/Default.html"/>
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.