In Dart, is there an equivalent MessageBox functionality as in C# using WinForms - dart

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/

Related

How do wikipedia make the pop ups on certain links?

Wondering how Wikipedia make the small popups on their links. Is it a js library or something else? https://en.wikipedia.org/wiki/Main_Page
Hover over any of the links in the main body of content and you will see additional info pop up.
I was thinking it was some kind of place holder but can't see any reference in their code.
A JS library plus a Node.js service for the content of the popup. The code is in the Popups extension.

jquery-mobile dialog without hash change

I am new to jquery mobile. I want to open a dialog containing external page as content. At the same time not want to change hash in url.
I have link
Open dialog
which opens the dialog but changes the hash in url. Need help, thank in advance
From official docs:
Since dialogs are typically used to support actions within a page, the
framework does not include dialogs in the hash state history tracking.
This means that dialogs will not appear in your browsing history
chronology when the Back button is clicked.
http://api.jquerymobile.com/dialog/

How to show Find/Replace Dialog on SpreadsheetGear workbook?

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.

How do I create a confirmation dialog in jQuery Mobile?

I want to have a confirmation dialog (not plain javascript) show when the user clicks a button, but I'd rather have it embeded instead of referencing another page.
How do I embed a dialog for use on a jQuery Mobile page?
You have 2 options really - if you want it to popup and fill the page, you can create a JQM dialog page (even dynamicaly), and switch to it. JQM dialogs are explained more in detail here:
http://jquerymobile.com/demos/1.0b1/docs/pages/docs-dialogs.html
It is quite possible to append a new dialog to the same page (simple append it to the container above the one with data-role="page") and switch to it with $.changePage(...)
Another option, if you want it to popup "over" the existing content (modal mode from UI dialog), this plugin will do that:
http://dev.jtsage.com/jQM-SimpleDialog/
Full disclosure: I wrote the second one, so I am biased. However, it does employ a bit of option 1 above, and you are of course welcome to rip the code apart to see how it works if you'd rather roll your own.
Edit:
Another option is to use the builtin popup interface, added in the last major version (1.2.0 I think). It can be found here, and is included in the default:
http://jquerymobile.com/demos/1.2.0/docs/pages/popup/index.html

Cannot type into an editor in a xul panel

the Cannot type into an editor in a xul panel is a known bug in firefox.
I simply want to reuse my code from my google chrome extension by hosting a webapp online and including it in the extension both google chrome and firefox by using a popup window.
This is how I include the webapp
<popupset id="mainPopupSet">
<menupopup id="smsflatrate-popup">
<iframe height="500px" src="http://webapp.mysite.net/"
flex="1" type="content-primary"/>
</menupopup>
</popupset>
The problem is, it is possible to focus input elements but the input fields do not react on key-events, so no input can be provided.
It seems that there is some kind of solution for this problem, but I think I do not really understand what to do here.
E.g. from the link above, what would be a solution according to this post?
There are many ways to display HTML in a XUL UI:
1) including HTML inline in the XUL document. This should work fine everywhere,
including in panels.
2) include an HTML IFRAME in the XUL document. This currently works fine
everywhere, except that IF the iframe is in a panel, there are some problems
with focus. This bug is about that one issue.
3) instead of a panel, you can create a XUL window using window.open that
contains HTML inline or in an IFRAME, and everything should work.
Having said that, if I open this bug's testcase in a Firefox trunk build, I
*can* tab into the textbox and type into it, so it looks like focus is
basically working now? The problem is that I can't focus the textbox by
clicking on it. In fact, if you click on the arrow to do a search, you navigate
to a new page where there is a textbox that you *can* click to focus.
So I think we have here just some simple bug that's preventing click-to-focus
from working, sometimes. Enn, can you look into that?
It seems to me that given the list of suggestions your best choice is to open a new window to represent your popup. You can make it look like a popup by setting its position, turning off OS crhome, etc.

Resources