Flex 4 (Air) - ShowDialog-like behavior - actionscript-3

The ShowDialog function in VB.NET allows a child window (form) to be opened in front of another without letting the user interact with the parent window until the child is closed.
To see what I'm referring to (in Windows), open up notepad, click help > about, and then click back on the main window. You'll notice that the dialog flashes and makes a noise. That happens with dialogs in a great many applications, and that is what I'm trying to achieve.
I can't seem to find any way to replicate this in Flex 4 (Air) applications. Any suggestions?

EDIT 2
Based on your comment, you then have to create a new window component(mxml component with the functionality and interface you want defined in it) and can then attach it to the click event of the link/button on the main window. And for the focus issue you can use setFocus from IFocusManager component

Related

Drag and drop a window upwards in sikuli

Background:
I am trying to automate a desktop application using sikuli with Java.
When we click on a Browse button in the application, it will open a new window to select destination folder to download some files.
We need to click OK button once the folder is selected.
Problem:
Whenever we click on Browse button, an enlarged window is opened by default in the lab execution machine where the script is running.
Due to this, the OK button is not visible on screen.
We have to move the Browse window upwards in order to make it visible.
I tried using Region.dragDrop() method to move the window upwards.
However, it is not find the destination match which is behind the Browse window.
Please guide me in coming up with a working approach to this problem.
This is an indirect solution to your problem. Since drag/drop and other "visual" actions are usually more flaky and harder to automate, I suggest you use keyboard shortcuts as much as possible. In your case, if the blocking window is opened last, I assume it becomes the active window which means you can minimize it using Win+down combination (assuming you are in Windows).

How can I adjust the z-index of a form in Microsoft Access

I maintain a fairly large ms-access 2003 application. One of the recent changes that I was asked to make was to add a popup dialog box to warn used of a particular situation when the opened a form which is itself a pop up (although not modal) form.
Unfortunately, the new popup modal form comes up behind the original one, getting the user interface into an impossible position (you cannot close the modal dialog box because it is hidden, but you cannot move the others out the way because the modal dialog is preventing you).
I've temporarily made the new box come up to the very side of the screen but it is far from ideal.
Is there a way to specify the Z index of a form so I can control the layering? (or any other solution)
The only way to control this is by the order in which you open the forms.
I.e. you have to first open the original popup form, then open the new modal popup.
You could also consider using MsgBox() instead of the new form.

Using visual studio's spy++ tool:

I am trying to make a program that will click the button of another program. I have been informed that I need to use spy++ in order to get the ID of the button that I want to click, so I am using it right now. I have found the window which contains the button I wish to get the button ID from (there are 3 buttons in the window).
Where in spy++ can I find the specific buttons ID? I looked in the "window properties" of the window that contains the buttons and didn't find it. There are 3 buttons there so I am guessing I will find 3 button ID's somewhere but I haven't yet.
After you use Spy -> Find Window, select button you are interested in with Finder Tool:, make sure that Show Properties is selected, then press OK. On General tab you will see Control ID which is the value you are looking for.
Another way is to select Spy -> Windows and find you button in window hierarchy, then right select it and press properties, which will show you the same general tab as above.
Third alternative is to select parent (ie. dialog window) for your button (ie. it will be of Dialog class), and register for WM_COMMAND messages from it. Then after pressing it you button ID will be displayed as wID: XX in message window.
I have tested it on Calculator under win7 and win8, funny but spy++ from VS2005 didnt work for me on win7, while spy++ from VS2008 did work on win8. Also there is a 64 bit version of spy++.
You have to look in the properties of the button, not in the properties of the parent window (at low level buttons are in fact some special kind of windows).

Monodevelop: can't drag widgets

I am trying to use monodevelop. Just at the beginning I came across an issue:
I was following a tutorial on building a Gtk application (http://monodevelop.com/Stetic_GUI_Designer). I was trying to drag a button from the Widgets Palette. Nothing happened. I'd been trying quite a few times without any luck.
After a break I launched monodevelop again and I simply placed a button on the window of the application. After that I removed it, dragged VBox container, and placed menu bar on the window, according to the tutorial instructions. I was pleasantly surprised.
By the second try the same problem occurred - I was not able to drag any widgets. Dragging was beginning, there was a “+” sign at the cursor and then - nothing was happening. I cannot figure out what happened by the first time, what the difference was. Have anyone had a similar problem? Monodevelop looks promising, but I can't go on with it. (I tried placing 'Fixed' container on the window, with no result - I could not drag it.)
(monodevelop v. 2.4, ubuntu 11.04, Polish language.
I did look for an answer to my problem, without much luck, that is why I post this question. The problem is described quite precisely. There is a probability that others encountered the same issue.)
You need to drag a container on the form first before you can add widgets to it. The VBox container is an example of a place where you can put your widgets.
If you want to place widgets where ever you want you can use the Fixed container. If you want things to align you can use the VBox, HBox or Table containers. Placing in a widget in one of the fields will automatically adjust the size of this field to fit the widget you have dragged into it.
So basically,
Create a form
Drag a container on the form
Drag a widget inside the container.
These widgets are not to be confused with the custom made widgets (in your Solution browser, right click the folder User Interfaces and click Add Widget...). These are like forms. I use these to create GUI's in advance so I can call these while the program is running.
FYI: if you want to create code for a widget (like a button) you can't just double click it like in Visual Studio. You need to select it, the go to the properties pane, and change the tab from Properties to Signals. You can then double click the "signal" to create the event for which you want to create code. For a button this is usually the Clicked event (somewhere at the bottom of the list, you'll need to open the Button Signals)
You can always visit the IRC channel of Monodevelop on irc://irc.gimp.org/monodevelop (IRC.Gimp.org #monodevelop)
I also sit in this channel and can help with smaller problems and I also still use Monodevelop 2.4.

What is the best approach to building a popup inside of Flash AS3

I am trying to accomplish an "imagemap" in flash where you click on different areas in the image and when you click on it, a popup (within flash) comes up showing more information about the object that was clicked on. The popup has a close button that can will then close the popup.
My biggest trouble is the way I have my code right now is when you click on a region of the map, it creates a popup on the fly, and then I use addChild(_myPopup) to add it to the display list. The problem with this approach for me, is that the Popup is now a Child of the button I just pressed, but this object organization doesn't really make sense to me. I'd like to have the popup not be a child of the button and it be on it's own layer or a child of the stage directly.
What is a good approach and code architecture for building such an organization of objects? I'm fairly new to AS3 and I've built some small applications but my knowledge is limited.
Thanks
UPDATE
ok looks like calling stage.addChild(myPopup) from inside the button works pretty well. Is this good practice?
Assuming you have a hierarchy that looks something like this:
stage
Main class
Image class
Button
It's good practice to never call upwards in the displaylist, every object only deals with it's children. Events however, are a nice way of communicating upwards. Have the Button dispatch an event, preferrably a custom one, then handle that using a listener in the main class that then deals with creating a popup on top of everything.
An often encountered practise to organize the layers of the visible application is:
stage
main class with all children
popup container
tooltip container
mouse cursor container (apparently not longer necessary since player 10 supports custom cursors)
So you create your popups always in the popup container above the main class. If you would have tooltips, they should go into the tooltip container. This approach guarantees that popups are always visible above the main app and tooltips are always visible on top of everything.