I am new to flex and i am trying to create a title window with no padding whatsoever on the sides. In the adobe documentation http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/containers/TitleWindow.html it says that the title window has a 4px padding. I was wondering if i could get rid of it by overriding the updateDisplayList function and set the padding to 0 (I have been trying this but I cant seem to find the right attribute to set). Basically what i want to do is to have a button on the bottom left corner of the title window and the edge of the button should be 0px from the border of the window.
PS: I only need to do this for title window. There is probably another way of doing it with a Panel or some other component which im not interested in.
The link to the TitleWindow docs has a styles section. It has styles for paddingTop, paddingBottom, paddingLeft, and paddingRight.
CSS styles are set a little differently in Actionscript versus MXML. Since css styles are not properties of the object, you have to use the setStyle() method in Actionscript. You can also use a style sheet.
MXML:
<mx:TitleWindow paddingLeft="0" paddingRight="0" />
Actionscript:
var tw:TitleWindow = new TitleWindow();
tw.setStyle("paddingLeft", 0);
tw.setStyle("paddingRight", 0);
Related
In my app I have a deeply nested components structure. I have a component with a very long form which is scrolling vertically. Inside that scrolling block I have components with a 'cog' icon. When you click that icon, a popover should appear next to it (inside the scrolling block).
However, the popover should consider the height of that scrolling block. And depending on the position of the 'cog' icon should appear either to the bottom or to the top of it in order to fit within the scrolling block.
So, to summarise, I somehow need to know the innerHeight of the scrolling block contents and its absolute position (getBoundingClientRect) in order to position my popover properly.
Right now I've done it using the html element id. And then simply find element by id in the popover component constructor:
constructor(#Inject(DOCUMENT) private doc: Document) {
this.scrollingBlock = doc.getElementById('scrollingBlock');
}
And then simply get the properties I need from it. Like the following:
this.scrollingBlockHeight = (this.scrollingBlock.firstChild as HTMLElement).scrollHeight;
this.scrollingBlockRect = this.scrollingBlock.getBoundingClientRect();
Although, everything works now, I believe it's not very elegant/Angular-way solution. I'm using Angular 6 for my app. Is there any better way to achieve the same result?
I'm trying to make a material design inspired Tab component, and I'm having a lot of trouble getting a bottom border to show up on the selected tab. I understand that the best way to do this is to override the Tab style in the theme, but there's no way to set just a bottom border there. I even went so far as to use an ActionListener to set the border when the tab is clicked, but then the border only flashes for a moment, as it seems the UIID gets reset immediately after being selected.
I'm looking for an effect similar to the Skype android app, where the current tab is 'underlined' at all times.
How can I make the border appear?
You can set a 9 piece border in the style that has a solid or transparent/translucent color and a line on the bottom.
No need to subclass.
i'm a new Yiier, i have a question that how could creat 2 colume layout with yii 1.1,
i means the width 190px of left div is for menu, the right is for body,the width of right is 100%,and i need a div as footer under the body div,height is 50px.
Thank you very much for your Help.
If you are using default Yii layout and style.
You should enable column2 layout in the controller of the views where you need 2 column. Or if you need it project wise do it in protected/components/Controller.php as every Controller extends this one.
So the property declartion is:
public $layout = "column2";
This file can be found under protected/views/layouts/column2.php
In this file you will find two divs with classes span-5 and span-19. If you open screen.css you will see widths of those classes 190px and 750px respectively. In the div with class-5 you can find widget CMenu in a Portlet which you should use for your menu, it is getting item list from property $menu which is simple associative array.
Similar property declaration as before:
public $menu = array(array("label"=>"Hello", "url"=>"world.com"));
Now that you have set up this, you will find your menu on the right side, you can easily rearange this. Put the div with class span-5 under the div with class span-19 and move class last from span-5 to span-19
The div footer doesn't have property height defined which means it expands but you can easily add your own style with property height set to 50px and maybe add overflow: hidden which will hide everything that goes beyond 50px. You add these properties in your own file under ../protected/css/ directory and call it with
Yii::app()->clientScript->registerCssFile(Yii::app()->request->baseUrl."/css/yourFileName.css","screen, projection");
How can I set something like corner radius for the default rectangle which appears when an item is hovered?
Your question is a bit non-specific, which is why people are down voting you.
If you're talking about a Flex Button; the rounded corners on roll-over are part of an FXG asset; which is not changed by use of the cornerRadius style. At least in the mobile skin; I imagine the desktop skin is similar.
We put together a mobile skin that will create a square button; and something that should have been trivial took a few days. It's available as part of the Flextras Mobile Flex Components Package and usable for free.
Here is a sample we put together to show the button differences.
You can use in a non-mobile project at your own risk, though.
Trival in Flex3.
You did not specify what you are styling so this is how I would style a button
<mx:Style>
.roundedbtn{
cornerRadius: 10;
}
</mx:Style>
<mx:Button id='btn' styleName='mybtnnormal />
// or in ActionScript
btn.styleName = 'roundedbtn';
// or without the styles
<mx:Button cornerRadius="10" />
I need to popup some buttons in Flex 4. Users should be able to see the background (ideally a little faded, but not important) around and in between the buttons. And clicking anywhere except the buttons should dismiss them all.
So I created a spark Panel and added a spark VGroup with some buttons. Then I call
PopupManager.addPopUp(myNewPanel, background, true);
My 2 main problems are the panel is not transparent and clicking outside the buttons doesn't dismiss them... How do I implement that?
UPDATE: Figured out how to dismiss the popup when clicking outside the panel with:
addEventListener("mouseDownOutside", close);
private function close(event:FlexMouseEvent):void {
PopUpManager.removePopUp(this);
}
Now I just need to figure out how to make the Panel transparent so you can see the background around and in between the buttons.
You should use FlexMouseEvent.MOUSE_DOWN_OUTSIDE instead of the string "mouseDownOutside". Code completion, compile-time checking and makes it easier for others to read your code.
For the background, you can use css to style it. Heres a list of all the css properties for a spark panel - http://docs.huihoo.com/flex/4/spark/components/Panel.html#styleSummary