style

style in binding a reference to object-or-dummy

What is the best way to bind an rvalue reference to either a given object or a temporary copy of it? A &&var_or_dummy = modify? static_cast<A&&>( my_A ) : static_cast<A&&>( static_cast<A>( my_A ) ); (This code doesn't work on my recent GCC 4.6… I recall it working before, but now it always returns a copy.) On...

If-Then-Else Return Style

Possible Duplicate: Should a function have only one return statement? While reading the section on refactoring in Code Complete by Steve McConnell, I noticed a suggestion that ran contrary to what I personally believed. McConnell suggests that during a nested if-else-then block you should return immediately after calculating t...

Question about Data Template or Style in WPF xaml

Hi, I have a textbox that has the following simple XAML (not necessary to read it - just have it for reference): <TextBox Name="m_ctrlUserDeviceType" Style="{StaticResource textStyleTextBox}" Text="{Binding Source={x:Static api:MySettings.Instance}, Path=UserDeviceType, ValidatesOnExceptions=true, NotifyOnValidationError=true}" Validati...

WPF - ListView Item on Selected change Font size

this is my code: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ListBox ItemsSource="{Binding Persons}"> <ListBox.ItemContainerStyle> ...

Event to Command in a style

Can someone tell me how to code an event to command in a style for a tabitem? I have no problems using it elsewhere but I can not figure it out for a style. I am trying to do this in Xaml for WPF using MVVM-Light toolkit. Here is an example of what I am trying to do: <DataTemplate x:Key="WorkspacesTemplate"> <igWindows:XamTab...

How to remove a style?

Let's say we define button style in .Resource tags. The style is apply to all button (TargetTye=Button, x:Key is not set). In some parts of my application, I want to turn this style off. I seek for a solution where a "style undo" feature can happen. Like typing in MS Word, when you try some formation (bold/underline) - should read as a...

How to remove 3D border in IE8 with DOCTYPE XHTML?

The problem: Here is what I do body { border: 0; } as was suggested here: Removing border from WebBrowser control But this only works when we use the following doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> When doctype is changed to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> ...

WPF Style with no target type?

Hi, How can I have a WPF style that has no target type ( one that can be applied to all objects) ? <Style x:Key="Basic" TargetType="???"> <Setter Property="FontFamily" Value="Tahoma"/> <Setter Property="FontSize" Value="12"/> </Style> I want to base all other styles on this "basic" style. Regards, MadSeb ...

Log message style guide

Can anyone recommend a best practice style guide for log messages? For example: What & when Conventions Style & Formatting Readability i.e. what makes a good / bad log message string EDIT: I'm particularly interested in what make a good log string - beyond including the TIME, SEVERITY and COMPONENT, as I tend to use log4j anyway ...

WPF TabItem Background color when selected?

Hi, Any clue on why the code bellow does not work ? I'm trying to set the background color of a tab item when selected to red. <Style x:Key="TabItemStyle" TargetType="{x:Type TabItem}"> <Setter Property="Background" Value="White"/> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> ...

Android: GUI: Using styles for various image.

I am studying how to use styles and create theme in android. Please help to implement following. I have listview displaying fixed image and variable text. I want to change the image based on theme selection. Is it possible to do that? How? I can change background and text color using following code. Styles.xml <style name="BlueLabel...

WPF ComboBox: how to set focus on it's togglebutton

I'm trying to get a combobox to match a visual design, so its togglebutton has a blue border when the combobox has focus. I can't figure out how to do this and can't find an example. When the combobox gets focus, the textbox inside gets the dashed focus visual. How do I pass the combobox focus state down to the togglebutton, so that it'...

style and script tag sequence

Normally HTML page contains following tags <script> <link> <style> I found number of times that changing the sequence of those tags, mess up with page layout. So what would be the reason and what are the points to avoid this situation? EDIT After looking the answer of @Anurag, I'm actually assuming that we don't have a case where ...

Add border to image in PHP

I want to improve one of my Facebook apps by allowing the users to apply border styles to their images. I am not exactly sure how this can be done, but hopefully someone here will be able to help. The application is written in PHP. I originally thought that I would be able to create an image with just the border, a few pixels wider and t...

Style a button to match the current theme for the expand/collapse button on a TreeView

As you know, the built-in themes all define styles for the standard controls such as the TreeView control. We're trying to create something that looks an awful lot like a TreeView but isn't actually one, nor is it a subclass of one. It just has parts that we want to look like one for consistency. For instance, our control too has a se...

how to reference current control in grid?

I want to creat my own control: public class DataGrid : System.Windows.Controls.DataGrid In the style definition, I want to add a button above the grid, so I wrote: <Style TargetType="local:DataGrid"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:DataGrid"> ...

overriding a style in android.

Let's say i have a layout with style: <LinearLAyout ... > <TextView ... style=someStyle /> <ImageView ... style=someImageStyle ... /> </LinearLayout> the style will be defined in an xml in my project. How can i override that style with an external xml ? (i'm asking because i've noticed the View does not have applyStyle\setStyl...

Offline CSS compressor

I am looking for a css compressor that can run on our build server that can be executed on a number of css files. Does anyone know of any good ones that work offline? ...

is wrapper DIV a violation of content-style separation?

It's been said that the goal of CSS is to provide visual presentation and the goal of HTML is to provide structure of the document. Well, thank goodness. It has gotten so much easier, especially with font tags! But in practice, it seems that way many of us still rely on HTML to use CSS when it shouldn't be there. For example, it's comm...

How to set multiple css style properties in Javascript

I have the following dynamic variables: var fontsize = "12px" var left= "200px" var top= "100px" The variables may differ, it may be also others like color, line-height... I know that I can set them to my element like this: document.getElementById("myElement").style.top=top document.getElementById("myElement").style.left=left ...bu...