Search Results

Search found 17464 results on 699 pages for 'radio button'.

Page 20/699 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How to make buttons in python/pygame?

    - by user1334014
    I'm making a game in pygame and on the first screen I want there to be buttons that you can press to (i) start the game, (ii) load a new screen with instructions, and (iii) exit the program. I've found this code online for button making, but I don't really understand it (I'm not that good at object oriented programming). If I could get some explanation as to what it's doing that would be great. Also, when I use it and try to open a file on my computer using the file path, I get the error sh: filepath :Permission denied, which I don't know how to solve. #load_image is used in most pygame programs for loading images def load_image(name, colorkey=None): fullname = os.path.join('data', name) try: image = pygame.image.load(fullname) except pygame.error, message: print 'Cannot load image:', fullname raise SystemExit, message image = image.convert() if colorkey is not None: if colorkey is -1: colorkey = image.get_at((0,0)) image.set_colorkey(colorkey, RLEACCEL) return image, image.get_rect() class Button(pygame.sprite.Sprite): """Class used to create a button, use setCords to set position of topleft corner. Method pressed() returns a boolean and should be called inside the input loop.""" def __init__(self): pygame.sprite.Sprite.__init__(self) self.image, self.rect = load_image('button.png', -1) def setCords(self,x,y): self.rect.topleft = x,y def pressed(self,mouse): if mouse[0] > self.rect.topleft[0]: if mouse[1] > self.rect.topleft[1]: if mouse[0] < self.rect.bottomright[0]: if mouse[1] < self.rect.bottomright[1]: return True else: return False else: return False else: return False else: return False def main(): button = Button() #Button class is created button.setCords(200,200) #Button is displayed at 200,200 while 1: for event in pygame.event.get(): if event.type == MOUSEBUTTONDOWN: mouse = pygame.mouse.get_pos() if button.pressed(mouse): #Button's pressed method is called print ('button hit') if __name__ == '__main__': main() Thank you to anyone who can help me.

    Read the article

  • Why does WPF toggle button pulse once unchecked

    - by randyc
    Wihtin a Desktop app I have a toggle button: For the Checked event I am setting a value and then executing a method FilterView(); //ommitting code Unchecked state is just the opposite. resets a variable and executed the method again The question I have is I noticed when I uncheck the toggle button the button continues to pulse or flash ( going from blue to chrome) as if it still has focus. The button will stay like this until another button is clicked. Is there a way to remove this focus so that when the button is unchecked the button goes back to a unchecked state without the flashing / pulsing color. As you can see from above this is a standard toggle button no styles or custom I tested this on just a regular button and I found the same occured when clicked the button will continue to pulse / flash until another button is clicked. How do you work around this or prevent this effect from happening. Thank you

    Read the article

  • How do I make a simple image-based button with visual states in Silverlight 3?

    - by Jacob
    At my previous company, we created our RIAs using Flex with graphical assets created in Flash. In Flash, you could simply lay out your graphics for different states, i.e. rollover, disabled. Now, I'm working on a Silverlight 3 project. I've been given a bunch of images that need to serve as the graphics for buttons that have a rollover, pressed, and normal state. I cannot figure out how to simply create buttons with different images for different visual states in Visual Studio 2008 or Expression Blend 3. Here's where I am currently. My button is defined like this in the XAML: <Button Style="{StaticResource MyButton}"/> The MyButton style appears as follows: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"/> <VisualState x:Name="Pressed"/> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> I cannot figure out how to assign a different template to different states, nor how to change the image's source based on which state I'm in. How do I do this? Also, if you know of any good documentation that describes how styles work in Silverlight, that would be great. All of the search results I can come up with are frustratingly unhelpful. Edit: I found a way to change the image via storyboards like this: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24" x:Name="Image"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_over.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_active.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> However, this seems like a strange way of doing things to me. Is there a more standard way of accomplishing this?

    Read the article

  • WPF problem modify style of images in multiple Button Templates

    - by user556415
    I'm trying to create a control panel for a video camera, the panel has buttons for up, down, left and right etc. Each camera function up, down, left and right is represented by three images (see code below) for the left side, middle and right side. The control panel is circular so the corner images kind of overlap (its complicated to explain this without a visual). When I click on up for example I have to hide the initial three images (leftside, middle and right side) and display another three images for left , middle and right that indicate that the button is pressed. I am achieving this by having a grid inside a button template. The problem I have is that for the corner images for the control there are really four images that represent this. For example for the top left corner the four images would be represent 1. Top not clicked. 2. Top Clicked and 3. Left Not clicked and 4. Left Clicked. My problem is if I need to make the images contained within the Top button have precedence when the top control is clicked or the images in the left button have precedence when the left button is clicked. So it's like I want to modify the left button's image visible property when the top button is clicked and vise versa. This is really difficult to explain so I apologize if it makes little sense but I can email the source code on request if anyone is interested in my predicament. <Grid> <Canvas> <!--<StackPanel>--> <Button Name="TopSide" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="102" Canvas.Left="97" Canvas.Top="60" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid Width="100"> <Canvas> <Image Name="TopRightNormal" Source="Resources/topright_off.jpg" Height="34" Width="34" Canvas.Left="66"></Image> <Image Name="TopRightDown" Source="Resources/topright_down.jpg" Height="34" Width="34" Canvas.Left="66" Visibility="Hidden" ></Image> <Image Name="TopNormal" Source="Resources/topcenter_off.jpg" Height="34" Width="34" Canvas.Left="34" /> <Image Name="TopPressed" Source="Resources/topcenter_down.jpg" Height="34" Width="34" Canvas.Left="34" Visibility="Hidden" /> <Image Name="TopDisabled" Source="Resources/topcenter_off.jpg" Height="34" Width="34" Canvas.Left="34" Visibility="Hidden" /> <Image Name="TopLeftNormal" Source="Resources/topleft_off.jpg" Height="34" Width="34" Canvas.Left="2" ></Image> <Image Name="TopLeftDown" Opacity="0" Source="Resources/topleft_down.jpg" Height="34" Width="34" Canvas.Left="2" Visibility="Hidden" ></Image> </Canvas> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="TopNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopPressed" Property="Visibility" Value="Visible" /> <Setter TargetName="TopRightNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopRightDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopLeftDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftDown" Property="Opacity" Value="100" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="TopNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopDisabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button Name="LeftSide" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Canvas.Left="100" Canvas.Top="60" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MouseDown="Button_MouseDown_1"> <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid Width="34" Height="100"> <Canvas> <Image Name="TopLeftNormal" Source="Resources/topleft_off.jpg" Height="34" Width="34" Canvas.Left="0"></Image> <Image Name="TopLeftDown" Opacity="0" Source="Resources/topleft_leftdown.jpg" Height="34" Width="34" Canvas.Left="0" Visibility="Hidden" ></Image> <Image Name="Normal" Source="Resources/leftcenter_off.jpg" Height="34" Width="34" Canvas.Top="32" Canvas.Left="0"/> <Image Name="Pressed" Source="Resources/leftcenter_down.jpg" Visibility="Hidden" Canvas.Top="32" Height="34" Width="34" /> <Image Name="Disabled" Source="Resources/leftcenter_off.jpg" Visibility="Hidden" Height="34" Width="34" Canvas.Top="32" /> </Canvas> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Pressed" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="TopLeftNormal" Property="Opacity" Value="0" /> <Setter TargetName="TopLeftDown" Property="Visibility" Value="Visible" /> <Setter TargetName="TopLeftDown" Property="Opacity" Value="100" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Disabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="34" Canvas.Left="165" Canvas.Top="92" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MouseDown="Button_MouseDown_2" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Image Name="Normal" Source="Resources/rightcenter_off.jpg" /> <Image Name="Pressed" Source="Resources/rightcenter_down.jpg" Visibility="Hidden" /> <Image Name="Disabled" Source="Resources/rightcenter_off.jpg" Visibility="Hidden" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Pressed" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Normal" Property="Visibility" Value="Hidden" /> <Setter TargetName="Disabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <!--<StackPanel>--> <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Height="34" Width="34" Canvas.Left="133" Canvas.Top="124" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Button.Template> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Image Name="BottomNormal" Source="Resources/bottomcenter_off.jpg" /> <Image Name="BottomPressed" Source="Resources/bottomcenter_down.jpg" Visibility="Hidden" /> <Image Name="BottomDisabled" Source="Resources/bottomcenter_off.jpg" Visibility="Hidden" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="BottomNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="BottomPressed" Property="Visibility" Value="Visible" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="BottomNormal" Property="Visibility" Value="Hidden" /> <Setter TargetName="BottomDisabled" Property="Visibility" Value="Visible" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!--</StackPanel>--> <Image Source="Resources/bottomright_off.jpg" Height="34" Width="34" Canvas.Left="165" Canvas.Top="124"></Image> <Image Source="Resources/bottomleft_off.jpg" Height="34" Width="34" Canvas.Left="100" Canvas.Top="124"></Image> <!--<ToggleButton Style="{StaticResource MyToggleButtonStyle}" Height="34" Width="34" Margin="150,100"/>--> </Canvas> </Grid>

    Read the article

  • how to place a button within a table in Java ?

    - by trinity
    Hi all , In the properties windows , we come across buttons in a table cell < as in font property's row , a button can be clicked on to set font properties . Is there a way to insert a button in a Jtable 's second column < which i've created using netbeans .. how to do that , if it is possible ?

    Read the article

  • Setting a WPF ContextMenu's PlacementTarget property in XAML?

    - by qntmfred
    <Button Name="btnFoo" Content="Foo" > <Button.ContextMenu Placement="Bottom" PlacementTarget="btnFoo"> <MenuItem Header="Bar" /> </Button.ContextMenu> </Button> gives me a runtime error 'UIElement' type does not have a public TypeConverter class I also tried <Button Name="btnFoo" Content="Foo" > <Button.ContextMenu Placement="Bottom" PlacementTarget="{Binding ElementName=btnFoo}"> <MenuItem Header="Bar" /> </Button.ContextMenu> </Button> and that put the ContextMenu in the top left corner of my screen, rather than at the Button

    Read the article

  • Computer speakers receive radio station signal

    - by squircle
    I have a set of Logitech 5.1 speakers where each speaker and the source plug into the subwoofer. I'm using a Griffin Firewave with output from my MacBook Pro, and output from my custom-built desktop with a switch in the middle (built it myself out of an old Belkin A/B parallel switch). Recently, I've noticed that I can hear a local Punjabi radio station being picked up by my speakers, and the volume of this interference increases as I increase the volume of the speakers. I'm fairly sure that this radio station is at the low-end of the FM spectrum, below 90MHz (or it may be at the high end, above 105MHz, my memory isn't infallible). It gets quite annoying as I can't put my audio very loud without the interference. I've tried to put a ferrite core on the input cable just before the 3.5mm jacks plug into the subwoofer. I don't know if putting the same core around all three of the cables (green, black, orange) would negate the effects, but I'm assuming not. There has been no change. Is there any reason why this would be happening? I'm assuming the interference is coming somewhere between the FireWave and the subwoofer, because the noise gets amplified with volume increases. If anybody has any suggestions, I'd be grateful!

    Read the article

  • Get a selected radio button value after POST to set other fields enabled/disabled

    - by Redeemed1
    I have an MVC application with a simple control to all selection of All Dates or selecting a Date Range. The radio buttons have an onclick handler to enable/disable the dat pickers. All work well so far. When I try to set the correct context state for the datepickers after doing a POST I cannot get the jQuery selector to return the radio buttons checked value. The code is as follows: <%= Html.RadioButton("DateSelection.AllDates", "AllDates", Model.AllDates == "AllDates", new { onclick = "setReadOnly(this);" })%>ALL Dates&nbsp; <%= Html.RadioButton("DateSelection.AllDates", "Selection", Model.AllDates == "Selection", new { onclick = "setReadOnly(this);" })%>Selection <%= Html.DatePicker("DateSelection.startdate", Model.StartDate, "", "") %> &nbsp;To&nbsp;<%= Html.DatePicker("DateSelection.enddate", Model.EndDate, "", "") %><br /> The javascript is as follows: <script type="text/jscript" > function setReadOnly(obj) { if (obj.value == "Selection") { $('#DateSelection_startdate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); $('#DateSelection_enddate').css('backgroundColor', '#ffffff') .removeAttr('readonly') .datepicker('enable'); } else { $('#DateSelection_startdate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); $('#DateSelection_enddate').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val('') .datepicker('disable'); } } <script type="text/jscript"> $(document).ready(function() { $('#DateSelection_startdate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); $('#DateSelection_enddate').datepicker('disable').css('backgroundColor', '#eeeeee') .attr('readonly', 'readonly') .val(''); var selected = $('#DateSelection_AllDates:checked'); setReadOnly(selected); }); The javascript line that is causing the problem is var selected = $('#DateSelection_AllDates:checked'); which will NOT return the checked radio button. Using var selected = $('#DateSelection_AllDates'); will return the first radio button value as expected i.e. applying the ':checked' filter ALWAYS returns undefined. Can anyone see anything wrong here?

    Read the article

  • Checking if radio buttons are checked in Firefox

    - by Andrew Song
    On my site, I have two checkboxes created in my ASP.NET MVC view like so: Html.RadioButton("check", "true", "true" == (string) ViewData["someKey"], new { id = "check1"}); Html.RadioButton("check", "false", "false" == (string) ViewData["someKey"], new { id = "check2"}); I am positive that ViewData["someKey"] has the value "true" in it. In my JS init function, I perform the following check: alert($('#check1').is(':checked') + " " + $('#check2').is(':checked')); In Firefox (and only Firefox), my alert dialog will show the following (it works as expected in every other browser): Initial page load: true false Normal refresh via Ctrl + R: false false Refresh skipping cache via Ctrl + Shift + R: true false I have tried many different methods of looking at the checkbox value, including $('#check1').attr('checked') without success. If I examine the HTML in Firebug, I can see that the first radio button has the property checked="checked" in it. Why is the checkbox value changing in FF when I refresh, and how can I mitigate this? Since this seems to be a FF-only bug, how can I change my code to make it work? This SO question seemed to ask something similar, but none of the proposed solutions seem to work in this case. Edit: I should also point out that when the radio button is rendered after the refresh in FF, it's not actually being displayed as checked either, despite what the HTML is telling me. Edit2: Adding raw HTML as per request <input id="check1" type="radio" value="True" name="check" checked="checked"/> <input id="check2" type="radio" value="False" name="check"/>

    Read the article

  • radio input replacement using jquery

    - by altvali
    It may seem a bit odd to ask this since there are several solutions out there but the fact is that all of them look pretty and none of what i've seem save the input value for form submission the right way. I'm looking for something that will replace all radio inputs with divs that get special classes when they are hovered or clicked, and an input type hidden for every group of radio inputs with the same name, hidden input that will be updated with the value corresponding to the div the user clicks on. Long sentence, i know. Here's what i've come up with: $('input:radio').each(function(){ if (this.style.display!='none') { var inputName = $(this).attr('name'); var inputValue = $(this).attr('value'); var isChecked = $(this).attr('checked'); if (!$('input:hidden[name='+inputName+']').length) // if the hidden input wasn't already created $(this).replaceWith('<div class="inputRadioButton" id="'+inputName+'X'+inputValue+'"></div><input type="hidden" name="'+inputName+'" value="'+inputValue+'" />'); else{ $(this).replaceWith('<div class="inputRadioButton" id="'+inputName+'X'+inputValue+'"></div>'); if (isChecked) $('input:hidden[name='+inputName+']').attr({'value':inputValue}); } //this bind doesn't work $("#"+inputName+"X"+inputValue).click(function(){ if($('input:hidden[name='+inputName+']').val()!=inputValue){ $('input:hidden[name='+inputName+']').attr({'value':inputValue}); $('div[id*='+inputName+'].inputRadioButton').removeClass('inputRadioButtonSelected'); } if (!$("#"+inputName+"X"+inputValue).hasClass('inputRadioButtonSelected')) $("#"+inputName+"X"+inputValue).addClass('inputRadioButtonSelected'); }); } }); Please tell me how to fix it. Thank you. Edit I've found the reason. It should normally work but some of my radio inputs generated by an e-commerce software had brackets in them (e.g. id[12] ) and jQuery was parsing that. The fix is adding var inputButton = document.getElementById(inputName+"X"+inputValue); before the bind and replacing $("#"+inputName+"X"+inputValue) with $(inputButton).

    Read the article

  • On checkbox checked show radio button

    - by aDameToKillFor
    Hello, I would like to ask for a little help here, since I haven't got any big knowledge in Javascript, nor in jQuery. I need to show 5 radio buttons when a checkbox is checked, the checkboxes represent languages that the user speaks, so for each of the selected, there should appear 5 separate radio buttons for how good they speak it(1 to 5). I tried to do it with jQuery, but I did not manage to get very far away... This is where my checkboxes are created(dynamically): <% for(int i = 0; i < Model.Languages.Count; i++) { %> <input id="applang" name="applang" type="checkbox" value="<%: Model.Languages[i].languageID%>" /> <%: Model.Languages[i].name.ToString() %><br /> <%} %> So, I tried to add this script, but it's not working: <script type="text/javascript"> $("input[@name='applang']").click(function () { $("input[type='radio']").show(); }); I also tried this way - to use this javascript: <script type="text/javascript"> function toggle_visibility(id) { var e = document.getElementById(id); if (e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } And it works, but it works on already present controls, and I guess I need to create mine dynamically, or maybe not? And I tried to hide a present control with CSS, but then when the script shows it, it is there, only invisible :) Also, I would want to get the name and value of the radio buttons from my database, i.e. Model(this is ASP.NET MVC).. Can someone help me a little bit, please?

    Read the article

  • IE and replaceWith not preserving radio button state

    - by copelco
    Hello, I've run into an issue regarding replaceWith not maintaining the state of a moved radio button input. I've prepared a simple example illustrating this issue. This works in FF and Chrome, but not IE. Is there a way around this? Thanks! jsbin: http://jsbin.com/unola4/2 code: <html> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <title>IE replaceWith issue</title> <script type='text/javascript'> $(function(){ $('a').click(function(e) { e.preventDefault(); $('#temp').replaceWith($('#window').children()); }); }); </script> </head> <body> <a href='#'>run replaceWith</a> <p>Select a radio button and then click "run replaceWith". The value persists in FF, but not IE.</p> <div id='window' style='background-color: #DDD; height: 100px;'> <input id="id_received_date-days_0" type="radio" name="received_date-days" value="30" /> <input id="id_received_date-days_1" type="radio" name="received_date-days" value="50" /> <input type='text' name='test-test' /> </div> <br /> <form id='foo' style='background-color: #EEE'> <div id='temp'></div> </form> </body> </html>

    Read the article

  • IE8 Compatibility View issues

    - by 08Hawkeye
    I have the IE7 emulater tag in a jsp layout. But when I bring up the page, it defaults to the IE8 view until the user clicks the Compatibility View button. I don't want the user to have to click the button to launch compatibility mode. Is there a way to force IE7 Emulation on pageLoad? I'd even like to disable the button (or any potential to toggle between IE8 standard mode/IE7 view). Thanks! //sw Update: Now the button seems to have disappeared entirely, but still defaults to IE8 standards. Where did it go?! The toolbar context menu has it as selected, but the tools dropdown menu has it grayed out. For my purposes, it is unacceptable for the user to have to use the developer tools or even click the button to trigger emulation, but I don't know why the button disappeared anyway...

    Read the article

  • What is a good lightweight webradio program

    - by Robert Vukovic
    I am currently using Screamer Radio but it is a little bit buggy. It freezes a lot if internet connection is bad and can not continue if there are interruptions in the internet connection. I am not interested in some full sized MP3/media player, just a simple (with low memory footprint) application that can play streaming internet radio stations.

    Read the article

  • Creating ADF Faces Comamnd Button at Runtime

    - by Frank Nimphius
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} In ADF Faces, the command button is an instance of RichCommandButton and can be created at runtime. While creating the button is not difficult at all, adding behavior to it requires knowing about how to dynamically create and add an action listener reference. The example code below shows two methods: The first method, handleButtonPress is a public method exposed on a managed bean. public void handleButtonPress(ActionEvent event){   System.out.println("Event handled");   //optional: partially refresh changed components if command   //issued as a partial submit } The second method is called in response to a user interaction or on page load and dynamically creates and adds a command button. When the button is pressed, the managed bean method – the action handler – defined above is called. The action handler is referenced using EL in the created MethodExpression instance. If the managed bean is in viewScope, backingBeanScope or pageFlowsScope, then you need to add these scopes as a prefix to the EL (as you would when configuring the managed bean reference at design time) //Create command button and add it as a child to the parent component that is passed as an //argument to this method private void reateCommandButton(UIComponent parent){   RichCommandButton edit = new RichCommandButton();   //make the request partial   edit.setPartialSubmit(true);   edit.setText("Edit");                             //compose the method expression to invoke the event handler   FacesContext fctx = FacesContext.getCurrentInstance();   Application application = fctx.getApplication();   ExpressionFactory elFactory = application.getExpressionFactory();   ELContext elContext = facesCtx.getELContext();   MethodExpression methodExpressio = null;   //Make sure the EL expression references a valid managed bean method. Ensure   //the bean scope is properly addressed    methodExpression =  elFactory.createMethodExpression(                              elContext,"#{myRequestScopeBean.handleButtonPress}",                             Object.class,new Class[] {ActionEvent.class});   //Create the command buttonaction listener reference   MethodExpressionActionListener al = null;          al= new MethodExpressionActionListener(methodExpression);    edit.addActionListener(al);     //add new command button to parent component and PPR the component for     //the button to show    parent.getChildren().add(edit);    AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();     adfFacesContext.addPartialTarget(parent);  }

    Read the article

  • fitting buttons for multiple screens

    - by user3360327
    I want to develop my own keyboard and when I put first line button as you see the buttons are not fitting with any screens size. these are my questions: 1) how can I fit them? 2) is <TableLayout> is correct view layout? if it's not, which one is correct? this is XML code: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content"> <TableRow> <Button android:id="@+id/btnQ" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strQ" /> <Button android:id="@+id/btnW" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strW" /> <Button android:id="@+id/btnE" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strE" /> <Button android:id="@+id/btnR" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strR" /> <Button android:id="@+id/btnT" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strT" /> <Button android:id="@+id/btnY" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strY" /> <Button android:id="@+id/btnU" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strU" /> <Button android:id="@+id/btnI" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strI" /> <Button android:id="@+id/btnO" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strO" /> <Button android:id="@+id/btnP" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strP" /> </TableLayout>

    Read the article

  • GLOBAL loading inside each single button with Jquery in ajax calls of asp.net mvc

    - by Ricky
    I have the following scenario: I have a button\link with a image inside like this: <button type="submit" id="myButton" class="button"><img src="../../Content/images/check.png" id="defaultImage" /> SaveData!!!</button> We are OK here! Now what I need to do is: I want on the click that the image change for a loading element that is previously loaded in the page like this: <img id="loadingImage" src="../../Content/images/loader.gif" style="display: none;" alt="loading"/> And then when the load complete turn back the old button image, I ended with this code: function loader() { var $button = $('#myButton'); if (btnState == '1') { $button.find('img').hide(); $button.prepend($('#loadingImage')); $('#loadingImage').css({ 'display': 'inherit' }); btnState = '0'; } else { $button.find('img').hide(); $button.prepend($('#defaultImage')); $('#defaultImage').show(); btnState = '1'; } } This does the trick for ONE SINGLE button(since I pass its ID in the function) but, when I have for example a grid with a button on each line, I found inviable when managing a screen with many buttons do this for each of then. The main question is: How can I make this method general for all buttons/links on one specific class in the page? The goal is: Click a button, get the image and change it and stop(can be manual). I just don't wanna have to Hook ALL buttons.

    Read the article

  • How can I know when a Button in a Flex DataGrid itemRenderer is clicked?

    - by Eric Belair
    I have a DataGrid component that displays a few columns of data. It has one additional column that displays a Button that allows the user to take an action with regard to the record. <mx:DataGrid dataProvider="{myData}"> <mx:columns> <mx:DataGridColumn dataField="firstName" headerText="First Name" width="75" /> <mx:DataGridColumn dataField="LastName" headerText=" Last Name" width="150" /> <mx:DataGridColumn dataField="phone" headerText="Phone" width="120" /> <mx:DataGridColumn headerText="" width="110"> <mx:itemRenderer> <mx:Component> <mx:Box horizontalAlign="center" width="100%"> <mx:Button label="Take Action" /> </mx:Box> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns> </mx:DataGrid> I need to perform an action in the parent component, using other data that is available there, but unrelated to the data in the DataGrid. What is the best way to catch the Button click in the parent component, and know what record it corresponds to? Should I use a Custom Event, or an itemEditor, or something else completely?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >