Search Results

Search found 4648 results on 186 pages for 'voting buttons'.

Page 27/186 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Blackberry horizontal scroll in bottom menu bar

    - by Dachmt
    Hi, I have a MainScreen that has an overlay menu at the bottom of the screen, over a map. To do that, I have an MenuHoster (extends HorizontalFieldManager) that takes all width of the screen, 45px height and at the bottom of the screen. It overlays a map. In my MenuHoster, and add another HorizontalFieldManager that has a background image (my menu bar image) and focusable buttons. I have too many buttons to be all in my screen, so I want to an horizontal screen. When I create my second HorizontalFieldManager that hosts the buttons, I define the Manager.HORIZONTAL_SCROLL as style. My buttons are focusable, but nothing happens... The focus change to the next buttons but my HorizontalFieldManager does not scroll... I tried putting the same parameter in my MenuHoster HorizontalFieldManager, the scroll is working but all my screen goes right or left, and I want only the content of my menu bar... So there is my map and my menu going left, my buttons at the bottom and the rest of the screen white. Any idea why my second HorizontalFieldManager hosting the buttons does not scoll? Thank you!

    Read the article

  • Using the hardware keyboard to simulate button press on Android

    - by Bevor
    Hello, it is difficult to test a game with the mouse pointer on android buttons. I would like to control those buttons with the hardware keyboard. Actually I don't want to control the buttons itself but I want to control the behaviour the buttons would also do. For example I have 4 buttons in the android application with "arrow up, down, left, right". I'd like to use the arrow buttons of my hardware keyboard to control the same. How can I do that? Actually the question is, where can I set the Listener? I tried something in my activity. I set this listener to the application button: button.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) //scroll down return true; } }); The behaviour is the following: I can't scroll down with my hardware keyboard but with the hardware keyboard I can select the android buttons (they will be highlighted when I move on any button). After I selected the button with the Listener I can't select any other button anymore but then the Listener comes into force. Now I can scroll down with the hardware keyboard arrow down button. I would like to achieve this behaviour without selecting any button. So I thought about setting the listener to the layout container or any other layout but this has no effect. Is there any other approach to achieve this?

    Read the article

  • Does XAML work with file links in Visual Studio?

    - by Tim
    I'm adding a new WPF project to an existing Visual Studio solution and would like to reuse a bunch of code (C# and xaml) from an existing project within the solution. I've created the new project and added existing files as follows: Right click project Add - Add Existing Item Find the file to reuse, use the arrow next to "Add" and "Add as Link" I now have a nice project set up with all the proper links. However, XAML chokes on these links. For example: <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Resources\Elements\Buttons\Buttons.xaml" /> <ResourceDictionary Source="Resources\Elements\TextBox\TextBox.xaml" /> </ResourceDictionary.MergedDictionaries> The files "Buttons.xaml" and "TextBox.xaml" exist as links in my new project. The project builds, but when I run, I get the following XamlParseException: 'Resources\Elements\Buttons\Buttons.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot locate resource 'resources/elements/buttons/buttons.xaml'. It seems like the XAML parser is requiring an actual copy of these XAML files to exist in my new project, instead of links. This is exactly what I'm trying to avoid. I want my project to share these files so that any changes get transferred to the other project without hunting and copying. Any insight is appreciated!

    Read the article

  • JavaScript: Very strange behavior with assigning methods in a loop

    - by Andrey
    Consider this code below: <a href="javascript:void(-1)" id="a1">a1</a> <a href="javascript:void(-1)" id="a2">a2</a> <script type="text/javascript"> var buttons = [] buttons.push("a1") buttons.push("a2") var actions = [] for (var i in buttons) { actions[buttons[i]] = function() { alert(i) } } var elements = document.getElementsByTagName("a") for (var k = 0; k < elements.length; k++) { elements[k].onclick = actions[elements[k].id] } </script> Basically, it shows two anchors, a1 and a2, and I expect to see "1" and "2" popping up in an alert when clicking on corresponding anchor. It doesn't happen, I get "2" when clicking on either. After spending an hour meditating on the code, I decided that it probably happens because dynamic onclick methods for both anchors keep the last value of "i". So I change that loop to for (var i in buttons) { var local_i = i.toString() actions[buttons[i]] = function() { alert(local_i) } } hoping that each dynamic function will get its own copy of "i" with immediate value. But after this change I get "1" popping up when I click on either link. What am I doing wrong? It's a huge show stopper for me.

    Read the article

  • ActionScript / AIR - One Button Limit (Exclusive Touch) For Mobile Devices?

    - by TheDarkIn1978
    two years ago, when i was developing an application for the iPhone, i used the following built-in system method on all of my buttons: [button setExclusiveTouch:YES]; essentially, if you had many buttons on screen, this method insured that the application wouldn't be permitted do crazy things when several button events firing at the same time as any new button press would cancel all others. problematic: ButtonA and ButtonB are available. each button has a mouse up event which fire a specific animated (tweened) reorganization/layout of the UI. if both button's events are fired at the same time, their events will likely conflict, causing a strange new layout, perhaps a runtime error. solution: application buttons cancel any current pending mouse up events when said button enters mouse down. private function mouseDownEventHandler(evt:MouseEvent):void { //if other buttons are currently in a mouse down state ready to fire //a mouse up event, cancel them all here. } of course it's simple to manually handle this if there are only a few buttons on stage, but managing buttons becomes more and more complicated / bug-prone if there are several / many buttons available. is there a convenience method available in AIR specifically for this functionality?

    Read the article

  • How can I set the Jbuttons in a preferred order?

    - by Umzz Mo
    I have a grid of 30 buttons, and I want to have it from left to right then goes down, right to left, down again left to right. Basically the numbering would be as follow: 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 21 22 23 24 25 26 27 28 29 30 So if I have a piece on the button 10 and I instruct it to move up 2 bits it would land on 12 not 19. Below is my Code: //Creates the button using the loop, adds it into the panel and frame. JPanel panel = new JPanel(); panel.setLayout(new GridLayout(3,10)); JButton [] buttons = new JButton[30]; for(int i=0;i<30;i++){ buttons[i] = new JButton("label" + i); buttons[i].setBackground(Color.white); //Puts the player 1 piece on button 1,3,5,7,9 and player 2 piece on button 2,4,6,8,10 if (i < 10) { if (i%2 == 0) { buttons[i].setIcon(piece1); } else { buttons[i].setIcon(piece2); } } panel.add(buttons[i]); } frame.add(panel, BorderLayout.CENTER);

    Read the article

  • NSMutableArray accessing issue.

    - by Danegraphics
    I've searched and have no answer. I've created an NSMutableArray and am getting an EXC_BAD_ACCESS error in one place of access. Here. This is declaring in the .h file: NSMutableArray *buttons; ... @property (nonatomic, retain)NSMutableArray *buttons; And this is the synthesizing and implimenting: @synthesize buttons; ... - (id)init { self = [super init]; if(self != nil) { buttons = [[NSMutableArray alloc] init]; } return self; } ... -(void)addButtonWithImage:(Image*)image { Image *button = image; [buttons addObject:button]; [button release]; } ... -(void)replaceButtonAt:(int)num with:(Image*)image { Image *button = image; [buttons replaceObjectAtIndex:num withObject:button]; <<===EXC_BAD_ACCESS [button release]; } But when I use this: -(void)renderButton:(int)num atPoint:(CGPoint)point center:(BOOL)center{ Image *button = [buttons objectAtIndex:num]; [button renderAtPoint:point centerOfImage:center]; } It works

    Read the article

  • Get to Know a Candidate (1 of 25): Tom Hoefling&ndash;America&rsquo;s Party

    - by Brian Lanham
    DISCLAIMER: This is not a post about “Romney” or “Obama”. This is not a post for whom I am voting.  Information sourced for Wikipedia. If you recall, on Sunday I blogged about not voting against a candidate and, instead, voting for a candidate.  As promised, this is the first post of 25. Meet Tom Hoefling of America’s Party In addition to being America’s Party nominee, he’s also the national chairman of the party.  Mr. Hoefling also served as the political director for Alan Keyes’ political group America’s Revival.  He is a representative for the American Conservative Coalition.  Mr. Hoefling is on the ballot in:  CA, CO, FL and is a qualified write-in candidate in IN. America’s Party This party was originally known as “America’s Independent Party” and considers itself conservative. The following describes their standing on specific issues. * Tax Reform – The party seeks to reform the tax structure by advocating the repeal of the 16th Amendment, and despite the fact that many members support the FairTax, the platform remains open on what to replace the Federal income tax with. * Other - The party supports the Federal Marriage Amendment being added to the U.S. Constitution. It is also pro-life on abortion. Learn more about Tom Hoefling and America’s Party on Wikipedia.

    Read the article

  • Basic Scolling Question

    - by localgamer
    Hey guys, im pretty new to android platform and have a really simple question. Im putting buttons as layouts with text boxes, but im running out of room. How would i make it possible for the user to scroll down to view more buttons and stuff. For example, if i have 6 buttons, and 3 are in the field of view, i wanna be able to scroll with my finger and be able to see those buttons as I scroll. Thanks for the help guys -Localgamer

    Read the article

  • How to fix button size?

    - by rob
    I am using three buttons along with the list view.These three buttons are added to the layout using the TableRow.The first button takes more space on content, so the other two becomes smaller in size than first one. When the application runs, it doesn't even show the two other buttons. How can I make the size of three buttons equal and display all of them when application runs?

    Read the article

  • Android device guidelines/requirements

    - by Ravi Vyas
    Are there any requirements/guidelines for an Android device? like numbers of buttons or minimum buttons required. Also are there any android devices which do not have the menu and back buttons? ( I am aware that no menu/back buttons will kill most of the apps in terms of usability , I just wanted to know more on the topic :-) )

    Read the article

  • Allowing interaction with a UIView under another UIView

    - by delany
    Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, at the moment I have a UIView (A) with an object at the top and an object at the bottom of the screen and nothing in the middle. This sits on top of another UIView that has buttons in the middle (B). However, I cannot seem to interact with the buttons in the middle of B. I can see the buttons in B - I've set the background of A to clearColor - but the buttons in B do not seem to receive touches despite the fact that there are no objects from A actually on top of those buttons. EDIT - I still want to be able to interact with the objects in the top UIView Surely there is a simple way of doing this? Many thanks, D

    Read the article

  • iphone - button outside MPMoviePlayerController window not responding

    - by Mike
    I have created a MPMoviePlayerController to play a movie. As the movie likes to play landscape in full screen, when the movie is about to play, I grab its window and resize it to be smaller. At the same time, I add a view to the movie's window and this view contains several buttons, that are supposed to be around the movie. As the movie's window is reduced in size, I have to scale the buttons' view up, so the buttons do not reduce in size. I ended with this What you can see here is this: four buttons (green rectangles), the reduced movie's window and the application's window, that now is visible because the movie's window was reduced. The problem is that the buttons just work if you click on their regions inside the movie's window (A). If you click them on the region outside (B) they don't work. WHen you click on B, TouchesMoved on the main view controller receives the touch and the button doesn't do its action. How can this be solved? thanks for any help

    Read the article

  • How can I control the action of onbeforeunload in IE?

    - by SpawnCxy
    Hi all I've got a problem about onbeforeunload recently that I need to pop up a voting page if the user try closes their IE browser.And I did it by using <body onbeforeunload="makevote()"> And the main structure of makevote() in javascript as follows: function makevote() { comet.distruct(); if(csid != null && isvote == null) { window.event.returnValue = false window.event.returnValue='press “cancel” to vote please!' showComDiv(popvote,"popiframe",400,120,'your vote here','dovote()'); } } For last three months this voting function performed so ugly that I got only less than 8,000 votes from more than 4,50,000 vistors.I think the problem is, when the users try to close their browsers,the onbeforeunload property pops up a comfirm box which covered my voting box while most users click the OK button,which means close comfirming is done,as a habit.So my question is how can I control the comfirming box made by onbeforeunload myself? So far I can only define the message it shows.For example if I click the "OK" ,I'll go to the voting box instead of closing my IE.And if there's any other better way to do this?Help would be greatly appreciated! Regards

    Read the article

  • What is the correct way to set size of elements of GUI?

    - by Roman
    I am using swing to create my GUI. J have a JFrame containing one main JPanel which, in its turn contain several JPanels which, in their turn, contain buttons. I would like to set certain sizes to mu buttons and JPanels. How does it work? Should I set sizes of my buttons and then the size of the JPanel and the JFrame will be set according to the buttons sizes? Or it works in the opposite direction? I set size for the JPanel and the size of the buttons will be set automatically?

    Read the article

  • Silverlight Cream for April 16, 2010 -- #838

    - by Dave Campbell
    In this Issue: Alan Beasley(-2-, -3-, -4-, -5-), Brian, Rishi, Pete Brown, Yavor Georgiev, and David Anson. Shoutouts: As usual, Tim Heuer has all the scoop on all the hot-off-the-presses releases: Silverlight 4 released. Availability of tools announcement. He covers all the main parts of interest. Tim Heuer also discusses Backward Compatibility with Silverlight 4 applications And before you ask, Tim Heuer announced the Silverlight Client for Facebook updated for Silverlight 4 release If you're having trouble with the install, Peter Bromberg has a post up to help bail you out: Get Silverlight 4 Installed: Tips and Tricks Christian Schormann has a link to probably the fastest intro to SketchFlow I've seen: Video: SketchFlow in 90 seconds, with Jon Harris Chris Rouw has a Summary of Silverlight at DevConnections on his site. I had the opportunity to spend some time with Chris and we had some good discussions. Rene Schulte describes how to get started with the new final Silverlight 4 RTW build and announces that he updated his samples and open source projects. He also shares what he wishes for the next Silverlight version: Silverlight 4 Up and Running From SilverlightCream.com: Building Better Buttons in Expression Blend and Silverlight I generally end up missing articles embedded at CodeProject, so Alan Beasley emailed me a link to these, they were new to me. In this first one, he's got a very nice tutorial up on making some awesome buttons in Expression Blend Arcade Button in Expression Blend and Silverlight Alan Beasley's second Expression Blend Button tutorial is the classic 'arcade button' ... this is great stuff.. check it out. Picture Frame Control in Expression Blend and Silverlight I wasn't going to do the full list Alan Beasley had sent me in one post, but they're all so good! This third takes an excursion away from buttons to do a Picture Frame control. Styled to the max, and another great Blend tutorial! The last building buttons article (Part1), in Expression Blend and Silverlight Alan Beasley finishes what may be a definitive work on buttons in Blend... even if you don't want to follow the tutorials (and why wouldn't you??) ... he's got 10 buttons you can download! ListBox Styling (Part1-ScrollBars) in Expression Blend & Silverlight In Alan Beasley's 5th post at Code Project, He has a great long tutorial on Styling Listbox Scrollbars in Expression Blend ... the ScrollBars are Part 1 of a series. Some Notes on DRM in Silverlight 4 Brian at Silverlight SDK has a post up on DRM ... WMDRM and PlayReady. If you're planning on utilizing this, Brian's post looks like a good starting point. nRoute: Now, More Wholesome Rishi has a detailed post up explaining the latest nRoute release now supporting Silverlight 4, WP7, and WPF. What a piece of work! Scanning an Image from Silverlight 4 using WIA Automation Pete Brown demonstrates using VS2010 and SL4 to lash up to his scanner. Lots of code and external links... all good stuff, Pete! Dealing with those pesky WCF CommunicationException “NotFound” errors in Silverlight Yavor Georgiev has a quick post up discussing WCF CommunicationException errors in Silverlight with a couple external links to explain the solution. New Silverlight 4 Toolkit released with today's Silverlight 4 RTW! David Anson blogged about the new Toolkit release that is live right now along with the Silverlight 4 Release, and has some release notes up on the Toolkit. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • MS Office Excel Ribbon - Cannot change/hide Editing group in Home tab

    - by A9S6
    I have a .net addin for Excel. The addin creates the Ribbon UI for Excel 2007 and re-purposes some existing commands such as Cut, Copy, Paste, Sort etc. For Cut, Copy and Paste I am just overriding their OnAction value to call my own procedure when the buttons are clicked. But for Sort, Sort Asc and Sort Desc commands the case is a little different. When either of the Sort, Sort Asc or Sort Desc buttons are clicked, I want to get notified and then call the default functionality. This was possible in Excel 2003 commandsbars by calling the Execute() method on the CommandBarControl. In Excel 2007, there is a ExecuteMso() method to programmatically click a ribbon element but when the OnAction is overridden, this ExecuteMso() method just executes my own procedure and not the default functionality of that button. So I thought that I will HIDE the Sort buttons in the "Editing" group in Home tab and add my own Sort, Sort Asc and Sort Desc buttons to it. The buttons will call into my procedure first from where I will call the default behavior. Now the problem is that I am unable to change/hide the Editing group (idMso="GroupEditing"). Is this built-in group not editable? I can however HIDE the Clipboard and other groups(but can't add buttons to them). <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon> <tabs> <tab idMso="TabHome"> <group idMso="GroupEditing" visible="false" /> </tab> </tabs> </ribbon> </customUI>

    Read the article

  • Strange Bug in iPhone SDK

    - by Crazer
    Hi all, I found a strange bug in iphone sdk. I try to explain it: I have a number of uibuttons in a view. They are all just images. Every buttons has a title but that is not displayed so you just see the images (all 80x80). I made it all in IB. In my code I position those buttons. Here's a snippet of that code: for(NSString *iconObject in iconArray){ //retrieve UIButtons from dictionary iconButton = [allIconsDictionary objectForKey:iconObject]; iconButton.hidden = NO; //position and resize icon Buttons iconButton.frame = CGRectMake((79 * col) + 28, (70 * row) + 70, 80 ,80); col++; //five buttons in a row if(col%5 == 0){ row++; col = 0; } } That works like it should. But for all buttons that title starts with a 't' the title displays in the simulator (also on the device). The title of the other buttons are not shown just those where the title starts with a 't'. I have no clue what this could be?! I hope I could describe the problem.

    Read the article

  • Adding fields until screen is full

    - by Eric
    For the sake of this question, let us suppose that I want a row of buttons. I want to put as many buttons in that row as I can fit on the screen, but no more. In other words, as long as a prospective button will not be cut off or have its text shortened, add it. It seems that I should be able to do something like: HorizontalFieldManager hfm = new HorizontalFieldManager(); int remainingWidth = Display.getWidth(); int i =0; while(true) { ButtonField bf = new ButtonField("B " + i); remainingWidth -= bf.getWidth(); if(remainingWidth<0) break; hfm.add(bf); i++; } add(hfm); But this doesn't work. bf.getWidth() is always 0. I suspect that this is because the button has not yet been laid out when I query for the width. So, perhaps I could just make sure the buttons are always the same size. But this won't work for a few reasons: Different BB platforms have different looks for buttons and text that will fit on a button on a Curve won't fit on a button on a Storm. 3rd party themes may change the look of buttons, so I can't even count on buttons being a certain size on a certain platform. Is there no way for me to actually check the remaining space before adding a button? It feels like a fairly useful feature; am I just missing something?

    Read the article

  • validating creation by post_id and ip_address - Ruby on Rails

    - by bgadoci
    I have created a blog application using Ruby on Rails which includes the ability to vote on posts. A user can click vote and a record is created in the vote table. I am now trying to limit that same person from voting for a post multiple times. class Post has_many :votes end class Vote belongs_to :post end When a vote record is created I am using the VotesController to pass the :post_id and using a hidden field in the view to pass the ip_address (both to the vote table). I am wondering if there is a way to add a validation to the Vote Model that searches to see if a post_id has an ip_address that matches the person requesting to vote. I have tried simply using the validates_uniqueness_of :ip_address but that restricts the user from voting on any post. I just want to restrict the user from voting on a particular post that they have already voted on. Is there a way to do this through validation?

    Read the article

  • Winform radiobutton data binding

    - by Rajarshi
    I am following the "Presentation Model" design pattern suggested by Martin Fowler for my GUI architecture in a Windows Forms project. "The essence of a Presentation Model is of a fully self-contained class that represents all the data and behavior of the UI window, but without any of the controls used to render that UI on the screen. A view then simply projects the state of the presentation model onto the glass...." - Martin Fowler Read more about this pattern at www.martinfowler.com/eaaDev/PresentationModel.html I am finding the concept very fluid and easy to understand except this one issue of data binding RadioButtons to properties on the Data/Domain object. Suposing I have a Windows Form with 3 radio buttons to depict some "Mode" options as - Auto Manual Import How can I use boolean properties on Data/Domain Objects to DataBind to these buttons? I have tried many ways but to no avail. For example I would like to code like - rbtnAutoMode.DataBindings.Add("Text", myBusinessObject, "IsAutoMode"); rbtnManualMode.DataBindings.Add("Text", myBusinessObject, "IsManualMode"); rbtnImportMode.DataBindings.Add("Text", myBusinessObject, "IsImportMode"); There should be a fourth property like "SelectedMode" on the data/domain object which at the end should depict a single value like "SelectedMode = Auto". I am trying to update this property when any of the "IsAutoMode", "IsManualMode" or "IsImportMode" is changed, e.g. through the property setters. I have INotifyPropertyChanged implemented on my data/domain object so, updating any data/domain object property automatically updates my UI controls, that's not an issue. There is a good example of binding 2 radio buttons here - http://stackoverflow.com/questions/344964/how-do-i-use-databinding-with-windows-forms-radio-buttons but I am missing the link while implementing the same with 3 buttons. I am having very erratic behaviors for the Radio Buttons. I hope I was able to explain reasonably. I am actually in a hurry and could not put a detailed code on post, but any help in this regard is appreciated. There is a simple solution to this issue by exposing a method like - public void SetMode(Modes mode) { this._selectedMode = mode; } which could be called from the "CheckedChanged" event of the Radio Buttons from the UI and would perfectly set the "SelectedMode" on the business object, but I need to stretch the limits to verify whether this can be done by DataBinding.

    Read the article

  • UIButton does not respond to touch events after changing its position using setFrame

    - by Pranathi
    I have a view controller class (child) which extends from view controller class (parent). In the parent class's loadView() method I create a sub-view (named myButtonView) with two buttons (buttons are horizontally laid out in the subview) and add it to the main view. In the subclass I need to shift these two buttons up by 50pixels. So, I am shifting the buttonView by calling the setFrame method. This makes the buttons shift and render properly but they do not respond to touch events after this. Buttons work properly in the views of Parent class type. In the child class type view also, if I comment out the setFrame() call the buttons work properly. How can I shift the buttons and still make them respond to touch events? Any help is appreciated. Following is snippets of the code. In the parent class: - (void)loadView { // Some code... CGRect buttonFrameRect = CGRectMake(0,yOffset+1,screenRect.size.width,KButtonViewHeight); myButtonView = [[UIView alloc]initWithFrame:buttonFrameRect]; myButtonView.backgroundColor = [UIColor clearColor]; [self.view addSubview:myButtonView]; // some code... CGRect nxtButtonRect = CGRectMake(screenRect.size.width - 110, 5, 100, 40); myNxtButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myNxtButton setTitle:@"Submit" forState:UIControlStateNormal]; myNxtButton.frame = nxtButtonRect; myNxtButton.backgroundColor = [UIColor clearColor]; [myNxtButton addTarget:self action:@selector(nextButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myNxtButton]; CGRect backButtonRect = CGRectMake(10, 5, 100, 40); myBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; [myBackButton setTitle:@"Back" forState:UIControlStateNormal]; myBackButton.frame = backButtonRect; myBackButton.backgroundColor = [UIColor clearColor]; [myBackButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [myButtonView addSubview:myBackButton]; // Some code... } In the child class: - (void)loadView { [super loadView]; //Some code .. CGRect buttonViewRect = myButtonView.frame; buttonViewRect.origin.y = yOffset; // This is basically original yOffset + 50 [myButtonView setFrame:buttonViewRect]; yOffset += KButtonViewHeight; // Add some other view below myButtonView .. }

    Read the article

  • Why does obj.getBounds().height give a larger height than obj.height?

    - by TC
    I'm new to Flash and ActionScript, but managing quite nicely. One thing that is continuously getting in my way are the width and height properties of DisplayObject(Container)s. I'm finally starting to get my head around them and learned that the width and height of a Sprite are determined solely by their contents for example. I do not understand the following though: I've got a Sprite that I add a bunch of Buttons to. The buttons all have a height of 30 and an y of 0. As such, I'd expect the height of the containing Sprite to be 30. Surprisingly, the height is 100. The Adobe documentation of the height property of a DisplayObject states: Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. Apparently, the 'bounds' of the object are important. So I went ahead and wrote this little test in the Sprite that contains the Buttons: for (var i:int = 0; i < numChildren; ++i) { trace("Y: " + getChildAt(i).y + " H: " + getChildAt(i).height); trace("BOUNDS H: " + getChildAt(i).getBounds(this).height); } trace("SCALEY: " + scaleY + " TOTAL HEIGHT: " + height); This code iterates through all the objects that are added to its display list and shows their y, height and getBounds().height values. Surprisingly, the output is: Y: 0 H: 30 BOUNDS H: 100 ... (5x) SCALEY: 1 TOTAL HEIGHT: 100 This shows that the bounds of the buttons are actually larger than their height (and the height that they appear to be, visually). I have no clue why this is the case however. So my questions are: Why are the bounds of my buttons larger than their height? How can I set the bounds of my buttons so that my Sprite isn't larger than I'd expect it to be based on the position and size of the objects it contains? By the way, the buttons are created as follows: var control:Button = new Button(); control.setSize(90, 30); addChild(control);

    Read the article

  • using Intellimouse in Parallels 5

    - by nobody
    I'm running Win7 in Parallels 5 and have a five button USB mouse (Microsoft Intellimouse). I have my mouse's side buttons mapped to the Forward and Back (browser) commands. However, Parallel's Mouse Synchronization Service seems to be intercepting the mouse keypress event for these two buttons, and remapping them to the Windows Start Menu command. Any way to undo this? i.e. get my Back/Forward buttons working again?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >