Skinning AIR application window - apache-flex

I'm using mx:WindowedApplication, I'm wondering how I can skin the title bar and close/minimize button for the window. I can see application like Pandora One is using it and setting transparency. Any pointer to a doc?
Thanks,

In your application.xml file, uncomment and set:
<systemChrome>none</systemChrome>
and
<transparent>true</transparent>
Then draw whatever you want for window controls. You'll have to implement your own dragging IIRC, as well as making the appropriate AIR API calls for minimize and maximize.

Related

Is it possible in QML to add button to the window system menu?

I want to add button to the window main panel (where there are a buttons close-resize-move window).
Please dont propose to draw all window by myself (without using window class).
Is it possible in qml somehow, maybe redefine window slass or draw menu bar over the window menu? Any ideas are wellcome!
I don't think that is possible since the window bar is a native thing and not rendered in the qml flow. There are some flags on qwindow that allow you to modify them a bit but thats as far as it goes. I would suggest digging into your OS-specific API (you didn't specify wich os) to see if it can be done.

how to get a "lightbox" like behaviour in Qt

I have a Qt project where I'm using QGraphicsView framework, also I have popup windows on the scenes. (QDialogs)
When someone clicks on a certain button a popup window appears, and I'm invoking it with the .exec() method instead of .show() to make it the active one. Also I want to give it a visual effect like lightbox provides for html pages, so it would be obvious for the user too, that the background window won't communicate. Do you know any simple solution to make it work? or is it hard to implement in Qt?
EDIT: I don't know if it's obvious of not, but it's a desktop application, not a web application.
Just create QFrame over necessary area with customized background and transparency. For animation effect you may use QPropertyAnimation + QGraphicEffects and other stuff from qt animation framework.
Now I found another way to accomplish what I wanted. Like this:
QWidget* mytranswidget = new QWidget(mybgwidget);
mytranswidget->setStyleSheet( "background:transparent; background-color:rgba(0,0,0‌​,95)");
mytranswidget->setWindowFlag(Qt::FramelessWindowHint);
mytranswidget->setGeometry(mybgwidget->rect());
mytranswidget->show();
I'm doing it at the beginning of my popup widget's constructor so it's being drawn before draw my popup, so it will be shown in the right order.

a question about flex preloaders

I'm moving to a pure as3 environment into flex and I have a question about preloaders.
For one of my apps in particular when the swf loaded I would add a screen with an animated preloader. Then at a particular point in my code when I know all of my xml has been parsed, UI built and all initiliztion done I dispatch a "done" event which removes the preloader.
How can I achieve this is flex? I've only ever really seen flex preloaders that are percentage based which I believe represent the actual loading of the swf itself?
Please read the flex cookbook for preloaders, they have some demo applications, that could help u out
actually there is a preloader property in the application tag,
that could be wht u might help u out
tc
Ankur Sharma
Flex has a ProgressBar control that you can use for similar purposes. If you want to continue to use your own custom animated progress bar, you can add that Sprite to the rawChildren of a Container (preferably Canvas) and show it as a modal pop-up using the PopUpManager - remove the pop-up from the done event's handler.
The overriden addChild method of the Container class will throw an error if you pass a child that doesn't extend UIComponent - that's why you should use rawChildren.addChild.
Yep default flex preloader represents the loading of the swf itself.
If I were you, I would use the Task library from the Cairngorm 3 Libs, works perfectly with a preloader :
http://opensource.adobe.com/svn/opensource/cairngorm3/trunk/libraries/TaskTest/src/samples/TaskFlowPreloader.as

Can a flex app (or a portion of a flex app) be made transparent to mouse clicks?

I need to superimpose my Flex app above a plain HTML control on a web page, and be able to click through the Flex app to interact with the HTML control. Is there any way to do this? No permutation of mouseEnabled="false" or mouseChildren="false" seems to have the desired effect.
Context: trying to integrate Google Earth API (JavaScript/HTML) with my flex app. I am leaving a portion of the flex app transparent and empty, and positioning the Google Earth widget just below that point in the z-index. Google Earth has to be behind flex, because there are some Flex controls periodically displayed in that space.
I'm pretty sure there is no direct way for you to get mouse events to go through a Flash app.
You may be able to accomplish this with a combination of Javascript. Flash can call Javascript on your page, so you can create a function that passes clicks detected by Flash to the function and it will send the event to the page below it. I'm not 100% this will work but it's worth a try (You might have some trouble getting the correct coordinates).
Have you considered embedding Google Earth into the Flex app?
Some example here

Air application created with Flex - How do I create a fly-out window to the left/right

I have an Air application with a main window. I would like to have a new window fly out from the side of the main window when the user clicks on a button in the main window. The window that appears needs to display information based on value passed from the main form. How can I achieve this with Flex Builder 3?
Target platform: any version of Flash/Flex/Air.
You'll probably want to use view states. Check out the Flex in one Week video tutorial on "Creating View States":
http://www.adobe.com/devnet/flex/videotraining/
What you want to do is what tweenMax was made for. it's a .swc that you add into your project. It will allow you to use the tweenLite (or tweenMax) command.
import com.greensock.*;
TweenLite.to(mc, 1, {x:65, y:117});
So you would say if your stage was 500 px wide and you want the box to come in from the right. Add the child at maybe 505, and then tween.to whatever x value you want. Yep. it's that easy. And the other parameters are for duration and easing and even alpha so you have control over that too. They even have a swf in the website so you an play with it and practice. http://www.greensock.com/tweenmax/

Resources