Custom shape panel/form in Flex - apache-flex

What I'm trying to do is to create a fancy custom-shaped login panel. It's functions and containing components should be pretty standard, just like in regular login panel - FormItem, TextInput, Validators, etc. I did some research and found that it is possible to create skins using Fireworks, however this does not solve my problem because it does not allow me to manipulate with panel shape. What would be the best way to do it?

My recommendation would be to use Degrafa framework for something like this. You could programmatically affect the skin of your component at runtime to change its shape.
Another route would be to use a simple canvas with image backgrounds that conform to your needs, but this isn't very flexible.

I would do the following:
Export the asset from Fireworks as a PNG with appropriate transparency
Embed the asset into your app and supply the appropriate Scale9 coordinates
Reference the embedded asset as the "borderSkin" style for your Panel.
Here's an example of doing this to a TitleWindow which is a subclass of Panel, so the same approach should apply:
http://butterfliesandbugs.wordpress.com/2008/02/15/using-a-border-skin-for-a-titlewindow-in-flex-3/

I'd agree with Joel, Degrafa is the way to go for total custom skins etc. Failing that (as it is an extra hurdle to figure out) I'd fudge it be using a Canvas instead of a Panel. Extend the Canvas class and make it look like whatever shape you are trying to do. Set the Canvas's background alpha to 0, then add the shapes you need. Using this approach you may well have to duplicate things that the panel can do that the Cavnas can't but you'll be able to customise the look.

Related

Qt and UI Skinning

I wanted to consult with the sages here regarding Qt and skinning, get your opinion and chart a path for my development. My requirements are as follows:
My Qt/C++ application (cross platform with Mac, Windows and Linux versions) needs to have modular skins.
A skin is defined as a set of one or more elements: - Window background texture - Look/feel of UI controls such as edit boxes, drop down, radio buttons, buttons etc. - Look/feel of window "caption", resize grips etc.
Skins will be installed with the application installer, allowing the user to choose which one he/she wants to use. Users should be able to change skins on the fly.
Can I go the QML route? should this be custom and based on simple resources which are built into the application? Any design advice will be appreciated.
Thanks.
If I understood you correctly then stylesheet is the best way forward. You can create stylesheets similar to CSS and then pass them as command line option to your application or load on invocation to style your application at runtime. That way you can create multiple stylesheets each having a different look and feel and allow user to load them at will. Since its CSS it doesn't need any new learning and you can keep all your styling outside your source code.
Here are a list of resources that can get you up and running quickly:
http://blog.qt.io/blog/2007/11/27/theming-qt-for-fun-and-profit/
http://doc.qt.io/qt-5/stylesheet.html
I haven't played with QML yet, but you could also create a custom QStyle implementation that supports your resource format. Note that you'd lose style sheet support if you went this route.
Changing window captions is a little trickier if you want portability.
QML, if I understand correctly, doesn't really skin the widgets, it mainly deals with GUI layout etc etc.
QStyle is used to change the looks. It is a bit low-level though, and requires programming, so if you want to load different user-created skins (from an XML or so) it might be tricky to support extensive skinning. Chaining colors and a few items are easy enough though. (There might be someone else who've done something you could re-use.. not sure.)
For modifying widgets, use QStyle::polish(). You could use that to change the background picture (if it's a top-level window, or of a certain class). There are numerous repaint method to change almost every part of every widget.
Store/load the style using QSettings, by reading and setting the desired Style just after QApplication but before your main window is constructed.

Create drag-able panels in Flex like its in netvibes.com

I want to create a news application for my website.
My question is how should i create drag-able panels/canvas inside another panel/canvas.
What i exactly intend to do can be seen on netvibes.com . The website has different panels of every news group, and this panel could be moved from one place to other, but in a well defined manner. And the other panel take over the place of dragged panel.
Is there any component in flex, which can help me make something like that.
If i was unable to make my question clear, plz let me know, i will try to make it more clear.
Regards
Zeeshan
A TileList with drag and drop enabled should be able to accomplish something like that. Or, use a Spark List with a custom layout that you create.
It might be a bit tricky getting the list elements to drag and drop based on clicking the title, but it should be doable.
I think you should consider a more advanced solution with drap-n-drop with a custom panel based component. The places the panels can move can be implemented with a different custom canvas based component. The advantage would be to move the components into different custom positions and panels can be resized independent of each other.
Adobe has some good tutorials for drag-drop operations.

Does Flex allow full control over UI components?

I'm wondering what the best tool is for developing a mobile UI is. My requirements are that I retain full control over the look and movement of every UI component. I think Flex might be the best way to do this but I can't tell if I'll have that level of control using their UI components.
Any links would be appreciated. Thanks!
Edit: For example, looking at the documentation I see there's a an 'enabled' field which dims the color of a container and it's children if false. Am I able to change that so, maybe a repeated bitmap pattern appears if false?
Or, if there's a sliding menu can I edit the speed and change in speed as it closes?
You can create any component you like and make it look like anything you want. You don't have to use standard components. You can reskin any components just by specifying a new skin. It's really pretty easy.
You can create custom skins for Flex, for both Spark and Halo components. You also can create custom components, either based on other existing components, or based on the base component. You could even create custom objects which are just based on Sprites or similar (if you like to have control over everything :P).
edit
In response to your updated question. Regarding the enabled/disabled property, yes, it is possible to skin that. Spark components have states, for example a Button has a up, over and down state – and an disabled state. That state is exactly what is active when the enabled property is set to false. So yes, you can skin that.
Regarding the sliding menu animation, I'm not totally sure if that would be easily possible as I believe that this is coded into the component itself and not part of the skin to decide. However even if that is the case, you could instead create your own component that basically features exactly the same functionality but has a changed animation there.
I'm not sure if the Spark skinning wouldn't be able to do this though, because what you definitely can do is creating transitions between states. So if the slide is made with different states, you'll probably be able to change the transition as well.

flex - flip down digits display, like retro clock?

I want to display a number in my app so that the digits are styled like a retro-style clock, where each digit looks like a flippable tag (e.g., http://net.tutsplus.com/tutorials/html-css-techniques/learn-how-to-create-a-retro-animated-flip-down-clock/). I don't actually require any animation or effects.
Does such a component exist in an open source library? If not, and I want to make my own component, what suggestions do you have for proceeding (e.g., should I just style a label or button, or ...)?
I've looked into this before too. I couldn't find any open source versions, but I did find a few available on activeden.net that were relatively inexpensive. None of them suited my needs though. If I were to create one myself for Flex 3, I would create a custom component that had hours and minutes for properties, then override the updateDisplayList method to draw my flip numbers. Alternatively you could have your custom component display a couple of images and update their source properties to point to the appropriate embedded flip number image. If Flex 4 is an option for you, you could do all of this in a custom skin for your component. Hope that helps.

Classes to use for a flexible image selection/tagging widget in Qt

I'm new with Qt and am looking for advice on how to structure this.
I want a flexible widget that can display a set of images (normally read from a directory but other sources too) and let the user select images with the arrow keys and/or mouse and also apply custom tags.
For example there might be 5 tags defined by the application. A user can press a key to select one, and then a little icon would appear in or near the image preview showing that it was selected for that tag.
Would I need to implement this from scratch via drawing on a QWidget or is there something that would make a sensible base class? Thanks!
I would use a QListView base class, and then subclass QStyledItemDelegate.
There is an example here which might help you.

Resources