I want to know how can I achieve a button (in kivy) like the image that I have attached below. I want to know how to create a shade/shadow like this. I just need a hint to know where to start and what are the essentials.
Thanks
kivy button
The look of a Button is determined by its properties background_normal, background_down, background_disabled_normal, and background_disabled_down. Those are just strings naming the images that are used to represent the different states of the Button. So you can create new image files containing your desired look and just set those properties to those new files.
You can see the default Button images and how they are handled in the kivy style.kv and the defaulttheme.atlas.
Related
I want to do the next.
I have a program that must search and show some files. Before, I will do it with a QTextEdit, searching in the system and appending it when I found one.
Now I want to to the next: I want to show the name of the files but I want to select it in the GUI and, in anohter text edit, show the first line in the document.
So, I want to transform any file in something that I can select it (like a Radio Button, a check button or something like this).
I search info in the web but I dont found anything.
Anyone knows what I can do?
Usually you use something like a list view (list of selectable items) to do this. Fortunatley Qt has one! called QListView :)
See this link: QListView
You add one entry to the listview per file (for exampe). And then when you click/select an entry this triggers an event which you can make display the contents of the file in a nearby text box.
I have created one button component using one Bitmap and one Label in it.
Thing is that when user Clicks on on the button I want to changes button's Icon/Image and Label Text.
I want to do this using FlashCS5 and ActionScript-3.
I have tried following but it gives me runtime Error
[Bindable]
[Embed(source="/Images/test.png")]
var testIcon:Class;
testButton.setStyle("icon", testIcon);
Is there any other way of doing this.
Thanks.
You need to instantiate testIcon first. Try doing this:
[Embed(source="/Images/test.png")]
var testIcon:Class;
var btnGraphics:Bitmap = new testIcon();
testButton.setStyle("icon", btnGraphics);
Looking at what you want to archive i think you should follow following steps
1. Create one movie clip using new symbol
2. Create Two new Button Symbol using 2 different images and label
3. insert these button into the key frames for the created movie clip
you can use this movieClip to create new buttons that can have 2 states
just use gotoAndStop to display the proper button.
This is an answer for a followup that ppp asked:
There is a property labelPlacement="right|left|bottom|top" property. Default is right if you set it to bottom, the icon will show above the text.
You can create a button skin in flash and import them into flex. My experience with flex 3 skins imported from Flash is that it takes a bit of work and back and forth to get it working perfectly. Flash Catalyst for Flex 4 has greatly improved that workflow.
Attached is the screenshot of the UI that I would like to have in my app. When I click on the listitems on the fragment on the left side I see a arrow pointing(question mark in red) on the list item which was clicked, I would like to know how can we achieve this in UI layout. Any special settings to be set?
I was looking at the same feature.
To implement similar, I'd suggest showing an image on the selected item in the list, this would require code rather than Layout XML, It would be controlled by the list fragment when an item is selected. That way you get the visual effect that the two fragments are related via the arrow image.
Did you end up giving it a go for yourself?
I have been searching regards this question for months.
By default, the iconFunction of List and Tree return only Class as the icon, which is for embeded images or iconUtility kindly provided by this site http://blog.benstucki.net/?p=42. It works very well with pre-created images.
But what I really want is to accept a completely runtime generate sprite object, similar to what is done by Legend, with the color changes according to what the current status. I assume I could do something to make the ListBase to accept icon argument other than Class. Am I rite? or please kindly advise what I shall do.
Thank you very much!
Wildog
Instead of setting the icon for the tree item, I would create a custom item renderer using TreeItemRenderer as a starting point. Then put whatever component you want to the left of the text and move the text to the right a bit. Another advantage of this approach is that you can have your sprite change dynamically as the data that gets set to the item renderer changes. Hope that helps.
I'm not sure if this is exactly what you want to do, but you can turn your sprite into BitmapData easily enough (Which you can use to create a BitmapAsset)
e.g.
var bmp:BitmapData = new BitmapData(sprite.width, sprite.height);
bmp.draw(sprite);
var bmpasset:BitmapAsset = new BitmapAsset(bmp);
The following page shows how to load external images in AS3 DataGrid: http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/ (image and text are displayed in two columns)
But I wonder how the image and text can be loaded together within the same DataGrid. Within one column: Image followed by the text.
I cannot get it work so I'd be grateful for any help with examples. Thanks
You just have to write a custom CellRenderer that does it. If you really read and understand that page you linked, they explain how to make custom CellRenderers, and you can put whatever you want in a cell. An image with text, a button, a game of tetris, whatever.