Search Results

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

Page 42/186 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • jQuery menu active link

    - by antosha
    Hello, I am trying to make a jquery menu that when I click on one of the links (without reloading the page), it changes its class to "active" and removes this class when I click on another link. here is my code : <script type="text/javascript"> $(document).ready(function() { $(".buttons").children().("a").click(function() { $(".buttons").children().toggleClass("selected").siblings().removeClass("selected"); }); }); </script> <ul class="buttons"> <li><a class="button" href="#">Link1</a></li> <li><a class="button" href="#">Link2</a></li> <li><a class="button" href="#">Link3</a></li> <li><a class="button" href="#">Link4</a></li> </ul> Can someone tell me why my code is not working and how to fix it? Thanks :)

    Read the article

  • Android - Linear Layout arrangement, not positioning as expected

    - by Arun
    The following is my code. I want an interface where I have a single line textbox, a multiline textbox with 2 buttons below. I want the multiline textbox to occupy all the space available after rendering the buttons and textbox. For this I created two LinearLayouts inside the main layout. The first one has vertical orientation with layout_width set to fill_parent. The second one is horizontal with fill_parent again. The first one has a textbox for which I have set the layout_height to fill parent. The second one has two textboxes OK and Cancel. When I run this application I get the UI, but the Buttons are very small (about 5px in height). I have to set the button height manually. What am I doing wrong here. I don't want to hard code the button height. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Contents"></TextView> <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" /> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <Button android:id="@+id/okbutt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="OK" android:layout_weight="1" /> <Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Cancel" android:layout_weight="1" /> </LinearLayout> Thanks, Arun

    Read the article

  • YUI button onclick get value

    - by Simon
    I have a a set of yui buttons generated using the standard yui html. <span class="yui-button yui-checkbox-button" id="analystbutton1"> <span class="first-child"> <button type="button" class="facetbutton" tabindex="0" id="analystbutton1-button"> Joe Bloggs </button> </span> </span> I create the buttons like so, and I then have some javascript to create the button and the listener. var analystCButton1 = new YAHOO.widget.Button("analystbutton1", { type:"checkbox", value:"BLOGGS", checked:false }); analystCButton1.on("click", onFacetClick); Finally I have the onFacetClick function var onFacetClick = function (e) { // e is the event var target = YAHOO.util.Event.getTarget(e); var button = new YAHOO.widget.Button(target); alert(button.get('type')); alert(button.get('id')); alert(button.get('value')); }; When I click on any of my buttons the first two alerts display the type and id (although not what I would expect). I cannot get the value, the alert doesn't fire, but I see no error in FireBug or the error console. alert(button.get('type')); returns push - I would expect checkbox alert(button.get('id')); returns analystbutton1-button

    Read the article

  • Flex: embedded fonts not being applied correctly in Label and DataGrid

    - by lje
    Folks, I am observing a problem with how an embedded font is applied to certain Flex components, namely mx:Label and mx:DataGrid. I have a CSS that declares three variations on an embedded font as follows: @font-face { src:url("buttons.swf"); font-family: "Arial"; } @font-face { src:url("buttons.swf"); font-family: "Arial"; font-weight: bold; } @font-face { src:url("buttons.swf"); font-family: "Arial"; font-style: italic; } And in the style declaration for Label and DataGrid, I have: Label { fontFamily: "Arial"; fontSize: 11; fontFamily: LucidaSans; } and DataGrid { fontFamily: "Arial"; height: 16; } (I've snipped some stuff from both style rules, so if you think there's something that may be causing a conflict I can certainly post the entire definition. It's mostly color, line and padding stuff for the DataGrid.) The problem that is for both Label and cells in the DataGrid the text is being rendered as sort of a times new roman font. The headers in the DataGrid are fine, just the text in the cells is wonky. All other components use the correct font as defined in the CSS/SWF. Any ideas why this is happening?

    Read the article

  • Button style in AlertDialogs

    - by Steve H
    Does anyone know how to override the default style for AlertDialog buttons? I've looked through the Android source for themes and styles and experimented with different things but I haven't been able to find a way that works. What I've got below works for changing the backgrounds, but doesn't do anything with the buttons. myTheme is applied to the whole <application> via the manifest. (Some other items were deleted for clarity, but they only relate to the title bar.) <style name="myTheme" parent="android:Theme"> <item name="android:buttonStyle">@style/customButtonStyle</item> <item name="android:alertDialogStyle">@style/dialogAlertTheme</item> </style> <style name="dialogAlertTheme" parent="@android:style/Theme.Dialog.Alert"> <item name="android:fullDark">@drawable/dialog_loading_background</item> <item name="android:topDark">@drawable/dialog_alert_top</item> <item name="android:centerDark">@drawable/dialog_alert_center</item> <item name="android:bottomDark">@drawable/dialog_alert_bottom</item> <!-- this last line makes no difference to the buttons --> <item name="android:buttonStyle">@style/customButtonStyle</item> </style> Any ideas?

    Read the article

  • ASP.Net MVC vs ASP.Net for Complex workflows

    - by Grant Sutcliffe
    I have just become involved in migrating a series of complex workflows with InfoPath UIs to Web-based UIs. I am new to ASP.Net MVC but have started to evaluate it as the technology versus classic ASP.Net for the job. As is typical of most workflows, in each state there are a number of business rules that determine (a) who can view what content; (2) who can edit what content; (3) what the user action options might be (Edit; Reject; Approve), etc. In essence, there is a lot of logic that needs to be applied to each request before presenting the appropriate view. Being more experienced in ASP.Net, I know that presenting the form(s) as required can be easily achieved through code behind pages (enable / disable / hide fields). I have not seen how this can be achieved with ASP.Net MVC (but am realising that new thinking is required of me when working with MVC - ‘Give only the content on a particular View + limited user action options’). Therefore, if using ASP.Net MVC, it looks like I would need to create a lot of views. Much of the content in each view would be the same. Only field enabled status or buttons would differ in most instances for these views in each state. For example: Step01Initiate (‘Has Save’ button); Step01OriginatorView (has ‘Edit’ Button) ; Step01OriginatorEdit (has ‘Save’ button); Step01Review (has ‘Accept’ / ‘Reject’ buttons); Step01ReviewReject (for reviewer notes; has ‘Save’ / ‘Cancel’ buttons). With workflows of up to six states, this would result in a lot of views. I can see the advantages of choosing ASP.MVC (1) ‘thin’ Views in terms of content; and (2) with logic consolidation in Controllers and different Models. Am I thinking along the right lines in terms of applying the MVC – ‘plenty of views’; or is there a better way to achieve my goal (using ASP.Net MVC or classic ASP.Net)?

    Read the article

  • How to float a <div> echoed in the footer over a <div> located elsewhere (PHP/jQuery/HTML/CSS)

    - by PlasmaFlux
    Hello All! I'm embarking on a major project, but am stuck on a tiny issue at the very start. I'll try to be as concise as possible. I have a PHP script that will be echoing into the footer of the page (the last stuff before a bunch of s containing visible buttons and s containing hidden dialog boxes. The plan is to have the buttons float in the upper-right corner of corresponding s in the main content area of the page. i.e. - button-1 echoed into the footer will float in the corner of content-box-1, and will be tied to the hidden 'dialog-1'. I'll be using jQuery and jQuery UI Dialog throughout the page(s). I'm not sure if that's particularly relevant to this question, but thought it worth mentioning just in case. So my question, put simply, is how do I echo a Button 1 into the footer with PHP, but have it float in the upper-right corner (with maybe 5px margin) of Content 1 is full of content? A picture says a thousand words: As shown above, I want the little blue gear button things in the corner of content pieces, locked and loaded with hidden s containing dialog boxes. Again, the catch is that all buttons and hidden divs will be the very last items echoed into the page footer. I've found plenty of info on how to float divs on top of divs, but all the examples I saw showed the s in close proximity to each other in the page source; not with a hundred lines of source code between the two s I'm not sure if the solution is pure CSS, pure jQuery/jQueryUI or a combination of the two. Any advice will be much appreciated. Thanks!

    Read the article

  • Several xml errors using Facebook JS SDK with xhtml strict

    - by Landitus
    I'm trying to set up some like buttons to a project. These buttons live inside a jquery slideshow with Aino's Galleria and let you "Like" each different slide. I'm using an xHTML strict document and while in Firefox (and Firebug) everything seems ok, but in webkit inspector I get this: XML self-closing tag syntax used on <fb:like>. The tag will not be closed. [The HTML that caused this error was generated by a script.] XML self-closing tag syntax used on <fb:like>. The tag will not be closed. I get one of these every slide, so there are 28 errors. Looking into it, found some seem to enclose the fb:like into something like this: <script type="text/javascript"> //<![CDATA[ document.write('<fb:like href="<?php echo "http://www.site/image-".$image_id ;?>" width="260" height="80" show_faces="false" />'); //]]> </script> The above, still works in Firefox, but not in Safari. The inspector says: 26 XFBML tags failed to render in 30000ms. Moreover, for the Facebook like buttons to work with the Galleria Jquery plugin, I have a custom function that reloads only the facebook like button concerning the actual slide which appears briefly upon loading the slide: [...] extend: function(options) { // listen to when an image is shown this.bind(Galleria.IMAGE, function(e) { number = e.index + 1; tag = $('.galleria-info-description .info-box-'+number).find('.btn_fb'); $(tag).each(function() { FB.XFBML.parse( this ); }); }); } This thing is getting more complex and really don't know who is causing the problem! Hope somebody can help or ask the right questions!

    Read the article

  • Does Android XML Layout's 'include' Tag Really Work?

    - by Eric Burke
    I am unable to override attributes when using <include> in my Android layout files. When I searched for bugs, I found Declined Issue 2863: "include tag is broken (overriding layout params never works)" Since Romain indicates this works in the test suites and his examples, I must be doing something wrong. My project is organized like this: res/layout buttons.xml res/layout-land receipt.xml res/layout-port receipt.xml The buttons.xml contains something like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <Button .../> <Button .../> </LinearLayout> And the portrait and landscape receipt.xml files look something like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> ... <!-- Overridden attributes never work. Nor do attributes like the red background, which is specified here. --> <include android:id="@+id/buttons_override" android:background="#ff0000" android:layout_width="fill_parent" layout="@layout/buttons"/> </LinearLayout> What am I missing?

    Read the article

  • Confusion about WPF binding...

    - by Vladislav
    I am trying to bind a 2D array of buttons arranged in stackpanels to a 2D ObservableCollection... Yet, I'm afraid I don't understand something very elementary about binding. My XAML: <Window.Resources> <DataTemplate x:Key="ItemsAsButtons"> <Button Content="{Binding}" Height="100" Width="100"/> </DataTemplate> <DataTemplate x:Key="PanelOfPanels"> <ItemsControl ItemsSource="{Binding Path=DayNumbers}" ItemTemplate=" {DynamicResource ItemsAsButtons}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> </DataTemplate> </Window.Resources> ... <ItemsControl x:Name="DaysPanel" Grid.ColumnSpan="7" Grid.Row="2" ItemTemplate="{DynamicResource PanelOfPanels}"/> My C# code: The backend: /// <summary> /// Window BE for Calendar.xaml /// </summary> public partial class Calendar : Window { private CalendarViewModel _vm; public Calendar() { InitializeComponent(); _vm = new CalendarViewModel(); this.DataContext = _vm; } } The ViewModel: class CalendarViewModel { CalendarMonth _displayedMonth; EventCalendar _calendar; public CalendarViewModel() { _displayedMonth = new CalendarMonth(); } public ObservableCollection<ObservableCollection<int>> DayNumbers { get { return _displayedMonth.DayNumbers; } } } I'm trying to populate the buttons with values from CalendarViewModel.DayNumbers - yet the buttons do not appear. I'm clearly doing something wrong with my binding.

    Read the article

  • Is it possible to accept a button tag to be in some range iphone sdk

    - by neha
    Hi all, In my application I'm doing dynamic resizing of cells and label in it depending upon the text in it. I'm adding button to cells in uitableview. I'm taking the label instance and button instance in a new label and button variable respectively and setting their frames to arrange them properly after resizing. if(cel==nil) { //some code original_label=[[UILabel alloc]init]; original_label.tag=111; //SOME MORE CODE GOES HERE original_button=[[UIButton alloc]init]; original_button.tag=222; //SOME MORE CODE GOES HERE } new_label=(UILabel *) [cell viewWithTag:111]; //This' how I'm taking the label instance on cell and below button instance on cell in new variables new_button = (UIButton * ) [cell viewWithTag:222]; Earlier I kept the tags of all the buttons on cells same, so it was easier to get button instances on cells properly and were being arranged properly. But now I want to recognize these buttons separately as I'm adding some functionality on button_click. I'm giving the buttons that are added to the cells incremental tags[1,2,3...9 and so on]. Now, how can I take these button tags in some range like[suppose 1-9]? Can anybody help? Thanks in advance.

    Read the article

  • trackroll does not works as i want or expect to do,blackberry

    - by SWATI
    i am working on blackberry curve 8300 i have added some components in the main screen,now i want to move the focus vertically when the trackball moves up or down and move the focus horizontally when track-Wheel moves left or right. ================================================================================== --Title area that contains a focusable field(BACK)-- --Non focusable Label field that indicates the name of the user-- --A horizontal field manager1 that contains 4 buttons-- --A horizontal field manager2 that contains 4 buttons-- --A horizontal field manager2 that contains 4 buttons-- ================================================================================== now suppose currently focus is on BACK button and i scroll the track-wheel downwards then, focus should come on 1st button of manager1 Again when i scroll downwards,then focus should come on the 1st button of manager2 and not the 2nd button of manager1(as its happening on device) my code is ::: protected boolean trackwheelRoll(int amount, int status, int time) { focusIndex = this.getFieldWithFocusIndex(); System.out.println("focus index ::::::::::::::::"+focusIndex); Field f; if(focusIndex!=0) { if(amount==-1) { //move up if(focusIndex>=0) { focusIndex = focusIndex-1; f = getField(focusIndex); f.setFocus(); } } if(amount==1) { //moving down if(focusIndex<=3) { f = getField(++focusIndex); f.setFocus(); } } } return super.trackwheelRoll(amount, status, time); } even after this control moves abruptly on simulator but on device no change took place

    Read the article

  • Session Variable Not Being Updated? ASP.NET

    - by davemackey
    I have a three step wizard. On the first step I use a repeater to create a series of buttons that an individual can select from. When the user selects one of the buttons the value of the button is saved to session state. They are taken to the next step and shown a similar list of buttons that are based on what they previously selected. Thus, if you choose "Hamburger" you might receive the options of "onion", "lettuce", "tomato" while if you choose "Hot Dog" you might receive "sauerkraut" and "ketchup". Lets say an individual chooses Hamburger. This is saved into session state like so: Public Sub Button_ItemCommand(ByVal Sender As Object, ByVal e As RepeaterCommandEventArgs) ' ******** Lets pass on the results of our query in LinqDataSource1_Selecting. Session("food_select") = RTrim(e.CommandName) Wizard1.ActiveStepIndex = 1 End Sub Now, this works fine and dandy. But lets say I select hamburger and then realize I'm really hankering for a hot dog. I go back to the first wizard step and click on the hot dog button - but when the wizard progresses to the next step I still see the options for hamburgers! The session variable has not been updated. Why? Thanks!

    Read the article

  • Controller with unknown number of parameters?

    - by StackPointer
    Greetings! I'm doing a Form on ASP.NET MVC 2, in my view I have a TextBox for the name, and two buttons. One of the buttons is for submit, and the other one have a function in JS, that add's another textbox, and a drop down list. In the post controller action method, how do I get all the parameters? Here is the View Code: <body> <div> <%using (Html.BeginForm()) { %> New Insurance Type Name: <%=Html.TextBox("InsuranceName") %> <div id="InsuranceDetails"/> </div> <div id="Buttons"> <input type="button" onclick="AddFieldForm()" value="Add Field" /> <p /> <input type="submit" value="Submit" /> <%} %> </div> </body>

    Read the article

  • Having a different action for each button dynamically created in a loop

    - by Oliver
    Hi, use this website a lot but first time posting. My program creates a number of buttons depending on the number of records in a file. E.g. 5 records, 5 buttons. The buttons are being created but i'm having a problem with the action listener. If add the action listener in the loop every button does the same thing; but if I add the action listener outside the loop it just adds the action listener to last button. Any ideas? Here is what I have code-wise (I've just added the for loop to save space): int j=0; for(int i=0; i<namesA.size(); i++) { b = new JButton(""+namesA.get(i)+""); conPanel.add(b); conFrame.add(conPanel); b.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae2){ System.out.println(namesA.get(j)); } }}); j++; } Much Appreciated

    Read the article

  • Loading page all content and scripts inside another

    - by Robin I Knight
    If you go to this page on our website: http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/dahab-divemaster-training.html The buttons at the bottom that say 'Beginner' 'Open Water Diver' etc.... They take you to another page where you have a series of options and can book. We would like it so that rather than have to navigate to another page it loaded those options and all the scripts that make the calculations in a div on the first page. Depending on which button you press depends on which page it would load inside the div. IFrame does not work as it does not dynamically resize when the collapsible panels are opened. AJAX script at dynamic drive. http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm does not work as none of the collapsible panels work, nor does the calculation script. How can this be done. To sum it up it would be like turning the buttons at the bottom of the page into tabs that would display the content from the pages those buttons currently link through to. Is this possible.

    Read the article

  • multiple ajax requests with jquery

    - by Emil
    I got problems with the async nature of Javascript / JQuery. Lets say the following (no latency is counted for, in order to not make it so troublesome); I got three buttons (A, B, C) on a page, each of the buttons adds an item into a shopping cart with one ajax-request each. If I put an intentional delay of 5 seconds in the serverside script (PHP) and pushes the buttons with 1 second apart, I want the result to be the following: Request A, 5 seconds Request B, 6 seconds Request C, 7 seconds However, the result is like this Request A, 5 seconds Request B, 10 seconds Request C, 15 seconds This have to mean that the requests are queued and not run simultaneously, right? Isnt this opposite to what async is? I also tried to add a random get-parameter to the url in order to force some uniqueness to the request, no luck though. I did read a little about this. If you avoid using the same "request object (?)" this problem wont occure. Is it possible to force this behaviour in JQuery? This is the code that I am using $.ajax( { url : strAjaxUrl + '?random=' + Math.floor(Math.random()*9999999999), data : 'ajax=add-to-cart&product=' + product, type : 'GET', success : function(responseData) { // update ui }, error : function(responseData) { // show error } }); I also tried both GET and POST, no difference. I want the requests to be sent right when the button is clicked, not when the previous request is finnished. I want the requests to be run simultaneously, not in a queue.

    Read the article

  • Change title of UINavigationBar

    - by Lemmy
    I've created a view-based application. I've placed a Navigation Bar on the view and two buttons. I'd like to change the title of the nav bar after pressing the buttons. In IB I've connected the buttons with the corresponding actions. Debugging shows that the actions are getting called but the title of the nav bar is not changed. Kindly help! // // NavBarViewController.h #import <UIKit/UIKit.h> @interface NavBarViewController : UIViewController { } -(IBAction) clickedOne: (id)sender; -(IBAction) clickedTwo: (id)sender; @end // // NavBarViewController.m #import "NavBarViewController.h" @implementation NavBarViewController -(IBAction) clickedOne: (id)sender { self.navigationItem.title = @"1"; } -(IBAction) clickedTwo: (id)sender { self.navigationItem.title = @"2"; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • How to disable other touch gestures after adding another tap gesture to the view?

    - by Hudson Duan
    I have a view with some tables and buttons on it, and then I want to add a tap gesture to the entire view, but I only want that gesture recognizer to recognize taps. Ideally, I want to do something when the added gesture recognizer is tapped, then remove that gesture recognizer after so the other buttons and tables can be accessed. Basically a tap to dismiss functionality that replicates something like the facebook notifications window, tap outside to dismiss, but not interfere with the buttons outside of the notifications view. Can anybody help? My current code is: NotificationsWindow *customView = [[[NSBundle mainBundle]loadNibNamed:@"NotificationsWindow" owner:self options:nil]objectAtIndex:0]; customView.frame= CGRectMake(12, 12, customView.frame.size.width, customView.frame.size.height); UITapGestureRecognizer *recognizerForSubView = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapBehindAgain:)]; [recognizerForSubView setNumberOfTapsRequired:1]; recognizerForSubView.cancelsTouchesInView = NO; //So the user can still interact with controls in the modal view [customView addGestureRecognizer:recognizerForSubView]; [self.view addSubview:customView]; UITapGestureRecognizer *recognizerForSuperView = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapBehind:)]; [recognizerForSuperView setNumberOfTapsRequired:1]; recognizerForSuperView.cancelsTouchesInView = NO; //So the user can still interact with controls in the modal view [customView.superview addGestureRecognizer:recognizerForSuperView]; (void)handleTapBehind:(UITapGestureRecognizer *)sender { NSLog(@"tapped"); [[self.view.subviews lastObject] removeFromSuperview]; [self.view removeGestureRecognizer:sender]; } I want to make it so that the recognizer for the super view dismisses the subview, but not to interfere with the other taps on the super view.

    Read the article

  • No resource type specified (at 'id' with value '@+id\st')

    - by Refaat
    I'm new at android programming, I'm now trying to make some buttons, I configured these buttons using the following code: The MainActivity class : public class MainActivity extends Activity { /** Called when the activity is first created. */ Button st,nd,center; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); st = (Button)findViewById(R.id.st); st = (Button)findViewById(R.id.center); st = (Button)findViewById(R.id.nd); } } and the XML Layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello from animation!!" /> <button android:layout_width="100dp" android:layout_height="50dp" android:text="1st half" android:id="@+id\st" /> // and the other two points defined the same way </LinearLayout> And i got that syntax error: error: Error: No resource type specified (at 'id' with value '@+id\st'). // and the same error with the other two buttons HINT: The R class is imported and accessible from the MainActivity class but it can't read R.id.

    Read the article

  • How to set padding to columns in table layout dynamically

    - by Praveenb
    Hi all, I am trying to create a table layout with buttons dynamically. I am able to get the table layout with buttons. bt i need padding between buttons. How i can get programatically. I tried following code bt private void showCowsTblField() { for (int row = 0; row < numberOfRowsInField-1; row++) { TableRow tableRow = new TableRow(this); tableRow.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT )); for (int column = 0; column < numberOfColumnsInField -1; column++) { blocks[row][column].setLayoutParams(new LayoutParams( LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); blocks[row][column].setPadding(blockPadding, blockPadding, blockPadding, blockPadding); tableRow.addView(blocks[row][column]); tableRow.setPadding(blockPadding, blockPadding, blockPadding, blockPadding); } tblCows.addView(tableRow,new TableLayout.LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); } } Please let me know.... Thanks.

    Read the article

  • Who to access a UIButton using tag and button change image?

    - by ste
    I need to change the images on a matrix of UIButtons, and the only thing I know of to address the buttons, is the tag. But I can not find a way to actually us this identifier. The buttons are created programmatically during viewDidLoad. Here is the code for creating the buttons: #define N_ROWS 4 #define N_COLS 3 int N_IMG = 0; for (int a = 0; a < N_COLS; a++) { for (int j = 0; j < N_ROWS; j++) { UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom]; aButton.frame = CGRectMake(a * 65.0 + 25, j * 65.0 + 15, 10.0, 10.0); aButton.tag = j + a * N_ROWS + 1; [aButton setBackgroundColor:[UIColor redColor]]; N_IMG = N_IMG++; [self.view addSubview:aButton]; number_sorted = 1; } } Here is the code for setting the image: - (IBAction)set_image:(id)sender { #define N_ROWS 4 #define N_COLS 3 int N_IMG = 0; for (int a = 0; a < N_COLS; a++) { for (int j = 0; j < N_ROWS; j++) { uibutton aButton.tag == (j + a * N_ROWS + 1) setImage:[UIImage imageNamed:[puzzles objectAtIndex:N_IMG]] forState:UIControlStateNormal]; N_IMG = N_IMG++; } } } This is the code where the truble starts: uibutton aButton.tag == (j + a * N_ROWS + 1) Who can I set this up to work?

    Read the article

  • WPF RadioButton selected in UI, but seen by code as IsChecked == false

    - by Mike
    I have some radio buttons in a group box. I select the buttons randomly, and all works perfectly from a visual standpoint and also the event handler is called each time a new button is selected. Now I have a dependency property with a callback when the value changes. When in this callback procedure I read the IsChecked value of any button, the value is False, in spite the button is visually selected (they are all false at the same time, strange). The debugger also displays all buttons unchecked. Hu hu, I'm lacking ideas about the reason, after the basic verifications... <GroupBox> <StackPanel> <RadioButton x:Name="btNone" Content="Disconnected" IsChecked="True" Checked="OnSelChecked"/> <RadioButton x:Name="btManual" Content="Manual" Checked="OnSelChecked"/> </StackPanel> </GroupBox> Event handler: private void OnSelChecked(object sender, RoutedEventArgs e) { if (btManual.IsChecked == true) { // is called } } Dependency property: public static readonly DependencyProperty ManualProperty = DependencyProperty.Register("Manual", typeof(Position), typeof(SwitchBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(OnManualChanged))); Dependency property callback: private static void OnManualChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { SwitchBox box = sender as SwitchBox; if (box.btManual.IsChecked == true) { // never true, why?? } }

    Read the article

  • RectangleGeometry with relative dimensions... how?

    - by Padu Merloti
    I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating. The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent rectangle with a rectanglegeometry. The problem is that I don't know how to define a relative rectangle geometry. I kind of worked around width by defining a large value (1000), but height is a problem. For example, it works good for buttons that have a 200 height, but doesn't do anything for smaller buttons. Any ideas? <Rectangle RadiusX="5" RadiusY="5" StrokeThickness="1" Stroke="Transparent"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.55"> <GradientStop Color="#66ffffff" Offset="0.0" /> <GradientStop Color="Transparent" Offset="1.0" /> </LinearGradientBrush> </Rectangle.Fill> <Rectangle.Clip> <RectangleGeometry Rect="0,0,1000,60" /> </Rectangle.Clip> </Rectangle>

    Read the article

  • Flex 4 Button state in a HGroup

    - by chchrist
    Hi all, I have a HGroup with some buttons inside which is my application's menu. <s:HGroup id="nav"> <s:Button id="homeButton" label="Home" /> <s:Button id="showroomButton" label="Showroom" /> <s:Button label="Catalogue" /> <s:Button label="Offers" /> <s:Button label="My Account" /> <s:Button label="My Orders" /> </s:HGroup> What I want is when I click for example the #homeButton to change it's state to "over", become disabled and reset all other buttons to the "up" state. I've written this function private function resetNavState():void { for(var i:int = 0,ii:int = nav.numChildren-1;i<ii;i++) { Button(nav.getChildAt(i)).mouseEnabled = true; Button(nav.getChildAt(i)).skin.setCurrentState("up",true); } } And then on the homeButton click handler for example i use protected function homeButton_clickHandler(event:MouseEvent):void { resetNavState(); currentState = "home"; homeButton.skin.setCurrentState("over",true); homeButton.mouseEnabled = false; } I resets the states of the #nav buttons but it doesn't change the state of the pressed button. Any ideas? Thanx in advance

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >