StyleName for a Button - can I set width & height?
Hi folks,
I've declared a style in my app's css file like this:
.styButtonSmall {
width: 15;
height: 35;
And declared a button like this:
<mx:Button id="bSave" click="doSave()" label="Save"
styleName="styButtonSmall"/>
The style seems to have no effect - I get standard size
buttons. I've also tried specifying numbers like "15px" rather than
15, and also tried setting maxHeight and maxWidth in the style
specification. No luck. However, if I set height and width directly
on the button, they size themselves correctly.
So my question is: How do I use a style to specify button
height and width?
Thanks,
ws
Changing the width and height of components is not supported
in styles in Flex:
http://www.adobe.com/devnet/flex/quickstart/styling_components
Similar Messages
-
i am a teacher and my school has given all of us a ipad to use. it is set up with my school email and a shared itunues and icloud account. they have told us we can use it for anything that can be used for education purposes. i have downloaded books and other items that i have marked up for my use. however if there is ever a problem i cant identify my applications or books if other teachers have downloaded the same apps or books as well as my documents. is there a way to set up a 2nd itunes account and icloud account so that i may use that when backing up anything that would be personalized by me so that i can find what is rightfully mine. they are ok with it but were unsure how to do this, so can anyone help me? thanks
Sorry, you cannot use more than one iTunes account at a time.
-
Setting width/height of a control with CSS
Hi,
I am styling a button a button in CSS and set a background-image for the button in my stylesheet.
The problem is, that the button should scale to the width/height of the image.
I added:
-fx-width: 32px;
-fx-height: 32px;
but it has no effect.
I also tried it with
-fx-min-width: 32px;
-fx-min-height: 32px;
If I use setMinWidth(32); in Java, it works.
But I rather want to set it in my stylesheets, because the image can change, if we use another skin.CSS documentation (http://docs.oracle.com/javafx/2.0/api/javafx/scene/doc-files/cssref.html) states:
"JavaFX CSS does not support CSS layout properties such as float, position, overflow, and width. However, the CSS padding and margins properties are supported on some JavaFX scene graph objects. All other aspects of layout are handled programmatically in JavaFX code."
I thought you might be able to do something using the -fx-shape property, but the shape does not affect the size of the button - so that didn't work.
I had more luck with the -fx-graphic property - you could try to enhance the stylesheet below to get what you want.
.root { -fx-background-color: azure; -fx-padding: 20; }
#smurf-button { -fx-graphic: url("http://bluebuddies.com/smurf_fun/smurf_race/jpg/Smurf_Race_100x100.jpg"); -fx-background-color: transparent; }
#smurf-button:hover { -fx-effect: dropshadow( three-pass-box , rgba(184,134,11,0.6) , 20, 0.0 , 0 , 0 ); }
#smurf-button:armed { -fx-effect: innershadow( three-pass-box , rgba(0,200,0,0.6) , 30, 0.0 , 0 , 0 ); }
public class ButtonStyle extends Application {
public static void main(String[] args) throws Exception { launch(args); }
public void start(final Stage stage) throws Exception {
final Button button = new Button();
button.setId("smurf-button");
final Scene scene = new Scene(StackPaneBuilder.create().children(button).build());
scene.getStylesheets().add(this.getClass().getResource("style.css").toExternalForm());
stage.setScene(scene);
stage.show();
} -
Setting width/height too early??
I noticed if I set width and/or height before adding it to
displayList, the displayObject simply won't show up. The following
code is a cut&paste from livedoc (SimpleButton), except that I
add a line of "button.width=20".
If, however, I move the line to after addChild(), things work
normally.
Why?:confused: :confused: :confused:
[CODE]
package {
import flash.display.*;
import flash.events.*;
public class SimpleButtonDemo extends Sprite {
public function SimpleButtonDemo( ) {
// Create a simple button and configure its location
var button:SimpleButton = new SimpleButton( );
button.x = 20;
button.y = 20;
//// ################# Added by me. Button won't show up any
more.
button.width = 80;
// Create the different states of the button, using the
// helper method to create different colors circles
button.upState = createCircle( 0x00FF00, 15 );
button.overState = createCircle( 0xFFFFFF, 16 );
button.downState = createCircle( 0xCCCCCC, 15 );
button.hitTestState = button.upState;
// Add an event listener for the click event to be notified
// when the user clicks the mouse on the button
button.addEventListener( MouseEvent.CLICK, handleClick );
// Finally, add the button to the display list
addChild( button );
//// ############### This works, if added here!!!!
// button.width = 20;
// Helper function to create a circle shape with a given
color
// and radius
private function createCircle( color:uint, radius:Number
):Shape {
var circle:Shape = new Shape( );
circle.graphics.lineStyle( 1, 0x000000 );
circle.graphics.beginFill( color );
circle.graphics.drawCircle( 0, 0, radius );
circle.graphics.endFill( );
return circle;
// Event handler invoked whenever the user presses the
button
private function handleClick( event:MouseEvent ):void {
trace( "Mouse clicked on the button" );
}[/CODE]You're using the simple button class. Just because you
instantiate an object of this class doesn't mean you've added
anything to the button.
What I'm trying to tell you is that addChild has nothing to
do with it. Simple Button just happens to be dependent on what is
defined inside the button states themselves.
For instance, comment out your hitStates leaving your width
call after the addChild and you should notice the same behavior as
before. By defining the button states, you are actually adding
content to the container that will be drawn to the display when
addChild is called.
You can define your height and width anytime after you have
defined the states for the button. At this point, Flash will then
have content to manipulate. Until you have drawable content to push
to the display list, nothing will happen when width and height are
called. -
How to set width/height of iPad app in ipa file
Hello,
I am developing an app for iPad in Flash Builder 4 and Packager for Iphone.
I set the width and height node values in the descriptor XML and compile the application. When I run the same in iPad, I am not able to see any effect on the app's width and height.
Also, in default load, app opens in dimensions as per the iphone view and not specifically for iPad.
Any help?
Tanuhi,
How does your application descriptor file look like? I also had the same problem, when I realised that I had a few things missing in my app desc. file. My file looks like this
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/2.0">
<id>IPadApp</id>
<filename>IPadApp</filename>
<name>IPadApp</name>
<version>v1</version>
<initialWindow>
<content>IPadApp.swf</content>
<fullScreen>true</fullScreen>
<autoOrients>true</autoOrients>
<title>IPadApp</title>
<aspectRatio>portrait</aspectRatio>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<!-- Portrait -->
<width>768</width>
<height>1024</height>
<!-- Landscape -->
<!--
<width>1024</width>
<height>768</height>
-->
<!--<x>100</x>
<y>100</y>-->
</initialWindow>
<supportedProfiles>desktop mobileDevice</supportedProfiles>
<iPhone>
<InfoAdditions>
<![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>2</string>
</array>
]]>
</InfoAdditions>
</iPhone>
</application>
Check your desc. file.
-Vrushali -
How can I set the height of ui:pageSeparator to less than 24px?
I've tried setting the height style but that appears to be ignored.
I have tried setting the height property of the page separator, but still the height in the IDE & in the browser is more then 7px. Is there a solution?
This is the style property value of the page separator.
border-width: 0px; margin: 0px; padding: 0px; height: 7px -
HT4623 iTunes showing Thank you for downloading but can't set up or download my PC
How can i download and set up iunes for my phone
http://support.apple.com/kb/VI67?viewlocale=en_US
-
Backend Operation for OK button of Data Set tab of Data Definition
Hello everyone,
Please let me know what happens at backend when we click on OK button Data Set tab of Data Definition in Unifier !
Cheers,
GaganTo only select the first 100 records is rather easy. Use the addition on your select statement "UP TO X ROWS". This will only select the first X number of entries for your condition or if you simply say SELECT from any table. To keep selecting the next 100 could be a bit of a pain, I honestly do not have an exact idea of how to accomplish that.<br><br>However, I would suggest looking into keeping an internal counter, but for purposes of efficiency you would have to start your selection of rows at the last record of the 100. Perhaps it is best to look into ways of buffering this table before you start doing your selections out of it. This would be useful if the application will be used a lot.
-
I'm not always able to 'catch' the update notification popup when it happens, and I do not wish to allow automatic updates without my approval. I have a rather 'sensitive' internet situation. Would it be possible to add a button under the updates tab to allow us to manually check for updates please? This would greatly help my situation.
Thank you for your time
BasemanMaybe what you called AppMenu is labeled differently as I cannot find that. And yes, the menu bar is visible. And the help menu only lists Help Contents, Troubleshooting Information, What's New, Release Notes, Restart With Add-ons disables, & About Thunderbird.
If I click Tools, then Options, then Advanced I see the Update tab. In this tab is where one should find a button labeled 'check for updates'. I do not see that. My only options are:
- Automatically Check For Updates
---Thunderbird
---Installed Add-ons
-When Updates To Thunderbird Are Found
---Ask Me What I Want To Do
---Automatically Download And Install The Update
-----Warn Me If This Will Disable Any Of My Add-ons
"Show Update History" button
-Use Background Service To Install Updates
I've attached a screen shot of this menu -
Middle-of-the-night text alerts for data usage - can I set alerts to email only?
Can't seem to find how to turn OFF text alerts for data overage, but leave email alerts in effect. OR, is there a way to specify WHEN text alerts are sent? Seems every one I've received comes in between 1 and 3 AM EST.
i'm also having major CPU problems w/ FF 29.0.1. when i restart the app it calms down again but after loading tabs it steadily climbs up to 100% after not too long. i have checked out the 2 CPU links/articles above and do all the basic troubleshooting and tips, but with all the FF tools & add-ons isn't there some sort of CPU monitor that has the ability to display which extensions/scripts are hogging the CPU? Activity Monitor on Mac just shows the total used by the app. it's impossible in my case to efficiently disable dozens of add-ons & scripts, restart, and test each one by one b/c it can take several hrs before the CPU starts to spike high again. i have no time for this.
thanks -
Microsoft Office for MAC, how does the sender select a notification that an email has been opened and read in Outlook? Thanks
Since this question is about a Microsoft product, you might have more luck getting suggestions if you ask in Microsoft's own forums.
Regards. -
help please, tearing my hair out!
What do you intend to do?
On desktop, on a new Mac, usually there's only the menu bar on top, an alias to your HDD (may not be displayed as default on recent systems), and your dock at bottom screen.
If you want to find system settings, it's called System Preferences, and you'll find it by clicking on the apple in menu bar. -
Action performs % scale instead of setting width & height
Hi
I'm trying to create an action to scale an object to an width of 1024 pixel and then save if for web.
But the actions saves the percents, making it useless when applied to another object.
Can someone tell me what I'm doing wrong?
Noties in pictures, that I set the width to 1024 pixel, but in the Action it performs an Scaling of 1233,73%Record setting the width or height in the Transform palette (or Control Panel) instead of in the Scale dialog.
JET -
How can I bind width- /-height-properties with the center area of a BorderP
An ImageView appears in the .center of an BorderPane. When sizing to fullscreen I want this Background stretch to this .center-area.
.center(
UIComps.createBackground("images/background.jpg")
.build()Make sure that the node you place in the center of the BorderPane is resizable with an unclamped max size (e.g. a control or layout pane) and it should automatically resize to fill the available area of the BorderPane center - no need for binding.
Also, you can apply a css style to the region (control or layout pane) in the center of your borderpane.
See the background image settings for -fx-background-image and -fx-background-size
http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html -
I have two AppleID's. Both use known email addresses. I need absolute security for documents. Can I set up a new Apple ID just for document syncing in iCloud? How?
Sorry, I did not mean to imply that security was non-existant or horrible, just it is online, so no absolutes.
iCloud is really not useful, IMO, for collaborating as only you or your AppleID enabled devices can access the files.
I have multiple online storage accounts with the common free services, but my most used is www.box.net. Many document apps will readily support it, and even if one does not, you can use the box.net app itself to access files, then open them in the app usually. And you can share your online folders, with reasonable controls on access to keep control of who can see (and upload or download) what.
A lot of people I know use dropbox as well, but they are usually using paid accounts (often their company sets one up for them to use to exchange files with clients) and I don't know how much better is the security on a paid dropbox account versus a free one. I suspect the free ones are on a par with box.net.
You could also use add security by using some sort of PGP or other encryption tools to encrypt files put up on the shared folder(s). You'd exchange public keys with your colleagues so they could decrypt those files once they download them. That may be overkill for many peoples needs though.
Another option, if you have an online hosting account, is to get one that offers SFTP access and use that for sharing files (the downside of that is having to distribute the password to colleagues, so you could loose control of it if one of them is careless or thoughtless with it). It seems more and more document-type apps for iOS are supporting generic FTP and SFTP as well as the popular free online storage solutions.
Maybe you are looking for
-
I have chosen to fil migrate from old ibook to new MacBook Pro using Time Machine after establishing admin account. I now have two admin. accounts and wish to delete the later one and transfer files manually. I am worried I will loose both accounts.
-
Settings application is missing, how do I get it back?
I went to add another wifi network and find that the settings application is nowhere to be found. I understand I need this to create another network connection. How do I recover it? Curt
-
Hi all, I want to know to whether supplier is merged ? if merged to which supplier and who merged..??? Can anyone help me.... Thanks and Regards Reju
-
Hi All, Can Anyone please tell how to compare clob type in select query with where condition ? Ex: field: Desc_ short(Clob ) field ean_code(number,pk) And i want to see those ean_code list matching to particullar clob pattern matching in the record i
-
Applications won't start, no menu bar...
Hello all, and thank you your time. I own a 2008 Macbook running on OSX 1.5.(whatever the last version of 1.5 is) My problem started this morning. I had just started my computer up in the morning, and i found that safari was barely working (i.e., not