Mark Miller
  • Minority Report Meets Visual Studio

    One of the cool things I get to do here at DevExpress is explore new technologies to interface humans with machines, and more specifically, developers with their code. In the past you’ve seen us write code with chopsticks, super models, guitars, and our minds. With the release of Microsoft’s Kinect, we knew it wouldn’t be long before we’d be working on an interface for Visual Studio to let you write code with your hands, Minority Report style.

    SelectPreview

    Navigating, coding, declaring, refactoring, testing – you’ll do it all with your hands. As with everything else we build here at DevExpress, our intention is to craft a great user interface around this technology. An experience that's as efficient at writing code as using the keyboard and mouse. And we expect to make the source code available so you’ll be able to play with it yourself.

    Don't be surprised if you see this at a major developer conference in the very near future. Stay tuned.

  • Science of Great UI & Windows Phone 7

    The Windows Phone 7 release is imminent. Here are screenshots of two versions of the start page tiles:

    Originals

    When I first saw this screenshot I noticed a few variances from the guidelines presented in my Science of Great UI talk.

    One of the things I mention in my talk is that everything presented onscreen is information (everything – data, background, borders, etc.), and not all information has the same relevance. Since our eyes are attracted to great contrast, relevant information should be rendered in a higher contrast than less important information.

    When I look at the screenshots above, my eyes are primarily attracted to the large black “+” sign formed by the proximity of the top four tiles (in bright amber or blue) over the black background. The sharp edges of the borders attract my eyes. After that the bright tiles themselves attract my eyes. However the data that varies inside the tiles (presumably the important information), is rendered in a much lower contrast – white on a highly saturated light background.

    Here’s my redesign of the front page, using the guidelines from the Science of Great UI session:

    Redesign

    Here you can see I’m placing a higher emphasis on the actual data inside the tiles, and a lower emphasis on the tile background itself. Also, I’ve softened the edges of the tiles with a subtle gradient to lower their contrast against the black background. I’ve increased the size of the time – an important piece of information that is now easier to see. And since we’re showing the time, I added the day and date as well near the top. The final change was a redesign of the high-contrast button (the arrow pointing to the right).

    Here are the original (on the left) and the redesign (on the right):

    SideBySide

    What do you think?

  • CodeRush Screenshot of the Week – Rotate 90 Degrees

    You may have noticed this entry showing up in the Code menu and wondered “What does Rotate 90 Degrees do?”. This code provider is useful when you are working in a two-dimensional space, and you’ve written code to work in one dimension and you want to create similar code to work in the other dimension.

    Here I’ve taken the first method, CalculateHorizontalPosition that works on the x-axis, copied it, and now I’m converting it into a functionally similar method that works on the y-axis:

    Rotate90Degrees

    So DeltaX becomes DeltaY, _HorizontalPosition becomes _VerticalPosition, Left becomes Top, StrongRight becomes StrongBottom (hmmm… maybe I should rename that), etc..

    Seen something cool in CodeRush? Take a screenshot and send it to me (markm at the DevExpress domain). If we use your image we’ll send you one of these highly coveted CodeRush Nation t-shirts.

    CodeRush Nation t-shirt

  • CodeRush Template Deep Dive Wrap Up

    Here's the source code and an export of the templates folder Rory and I created today for the CodeRush Template Deep Dive. The session was indeed deep and intense. We hope you enjoyed it and found the information useful.

  • CodeRush Template Deep Dive - Thursday 10am PDT, 17:00 GMT

    This webinar will provide a brief overview of existing CodeRush template technology followed by a deep dive behind-the-scenes look at how CodeRush templates are built. Rory and I will show how to position the caret, select text, call templates from templates, create alternate expansions, and use fields, linked identifiers, context, dynamic lists, TextCommands, and StringProviders -- everything you need to know about exploiting the power of CodeRush templates.

    To register for this session, click here: https://www3.gotomeeting.com/register/582260542

    If you have a common code sample you would like to see us turn into a template, send it to me at markm at the DevExpress domain and we may discuss it in this session.

  • CodeRush Screenshot of the Week – Test Runner Goodness

    This week’s screenshot, submitted by CodeRush customer Casey Kramer, who likes the CodeRush Test Runner:

    Unit Test Window in Happy TDD Land_CaseyKramer

    Casey says: "I dig the unit test runner, and I do TDD whenever I can….here is a view in the “Red” stage of the Red-Green-Refactor cycle.  The graphic elements on the tests themselves are nice too."

    Congratulations, Casey. Your t-shirt is in the mail!

    Seen something cool in CodeRush? Take a screenshot and send it to me (markm at the DevExpress domain). If we use your image we’ll send you one of these highly coveted CodeRush Nation t-shirts.

    CodeRush Nation t-shirt

  • CodeRush Screenshot of the Week – Adding Contracts to Methods

    This week’s screenshot, submitted by CodeRush customer Jeff Forrett, who’s a big fan of adding method contracts quickly:

    Generating Null Exceptions in CodeRush

    Jeff says: "Saving time by generating null exceptions, I like it."

    Congratulations, Jeff. Your t-shirt is in the mail!

    Jeff’s screenshot has inspired us to reveal a sneak preview of more chunky goodness, support for .NET 4.0 contracts, coming in CodeRush 10.2:

    CodeRush_Add_Contract

    Seen something cool in CodeRush? Take a screenshot and send it to me (markm at the DevExpress domain). If we use your image we’ll send you one of these highly coveted CodeRush Nation t-shirts.

    CodeRush Nation t-shirt

  • CodeRush Screenshot of the Week

    One of the things I love about CodeRush is there’s so much depth that sometimes even I forget what we put in there. Here’s an example of a feature I discussed with the devs a while back, but didn’t need until moments ago: Create Event Trigger

    With the caret on an event declaration, press the CodeRush/Refactor! key (Ctrl+` by default).

    CreateEventTrigger

    I love it when a plan comes together. :-)

    Seen something amazing in CodeRush? Take a screenshot and send it to me (markm at the DevExpress domain). If we use your photo we’ll send you a killer CodeRush Nation t-shirt.

    CodeRush Nation t-shirt

  • Interesting CodeRush Blog Series

    CodeRush user Jason Follas has started an interesting blog series on CodeRush; interesting because Jason talks about essential and important CodeRush features from his perspective. So far in the series Jason discusses:

    Great work, Jason! Looking forward to see what else you have in store for us.

     

     

  • Working with Color in CodeRush

    Working with color in source code has never been as easy or intuitive as it should be. Looking at hex values or a color name like Bisque and then trying to imagine what that color looks like is a challenge. Finding the correct color to use in a new style in a CSS file is also challenging.

    Furthermore, going from color to code is rarely a picnic.

    Fortunately, CodeRush 10.1 brings developers much closer to the real colors with new Color features. In this post I’ll discuss CodeRush features for working with color, both new and old.

    Generating Color Declarations from HTML

    This Intelligent Paste feature has been around for years. Simply copy an HTML color declaration (e.g., “#4B70BC”) and paste that inside a C# or VB file inside a method, property accessor, or inside a type (but not in a member) on an empty line, and you’ll get something like this (C# example shown):

    ShowColorSmartPaste

    This intelligent paste will create a local variable or a field, depending upon where you paste. As with all Intelligent Paste operations, you can press Undo to get the literal contents of the clipboard if you don’t like the CodeRush version. All Intelligent Paste operations are defined on the Intelligent Paste options page. Follow these steps to get there if you want to see them all:

    1. From the DevExpress menu, select "Options...".
    2. In the tree view on the left, navigate to this folder: Editor\Clipboard
    3. Select the "Intelligent Paste" options page.

    Note: This page level is Advanced, and will only be visible if the Level combo on the lower-left of the Options dialog is set to Advanced or Expert.

    Working with Color Declarations from Templates

    When working with color from templates, the mnemonic to remember is “CL”.

    Normally (without CodeRush), if I want to bring up a list of named colors using Intellisense, I have to type in “Color.”. With CodeRush installed, I can now simply type “CL” (lower case is fine) followed by the space bar to expand the template, and this is important: the caret must be at a location where a Color expression is valid (so not on an empty line but instead as a parameter to a method or an assignment to a variable or a property. Also, the active project must have a reference to System.Drawing or System.Windows.Media (CodeRush will add the appropriate namespace reference to the source file if needed).

    If you need a color from the SystemColors class, expand the “SYC” template (again, lowercase is fine, but for clarity I like to specify templates using uppercase letters).

    Back to that CL mnemonic. You can combine this shortcut with other CodeRush code templates that work with types. For example, MCL will generate a method that returns a Color, VCL will create a variable declaration (local, parameter, or field) of type Color, and ACL will generate an auto-implemented property of type Color. There are also PCL (for properties of type Color with backing store) and NCL for newly-initialized variables of type Color.  And there is “CL.E” for Color.Empty.

    Try these in a project that references System.Drawing or System.Windows.Media.

    Color Swatches in the Code

    Remember that color declaration we generated at the top of this post when I pasted a color reference into the code? You probably noticed that bluish rectangle under the word Color. Here’s that screen shot again:

    ShowColorSmartPaste

    And here’s a variation with different values:

    ColorSwatch

    Those rectangles appearing below the Color type reference are color swatches. These are very cool. Now you no longer have to reverse engineer RGB color values in your head to figure out exactly what color you’re looking at in the code.

    NamedColorSwatches

    The CodeRush Color Dialog

    So what happens when you want to edit a color in the code? Good news: just click the color swatch with the mouse and up pops the CodeRush Color dialog, which looks like this:

    ColorPickerAppears

    The CodeRush Color dialog consists of several pages, which we’ll examine in a moment. At the bottom of the CodeRush Color dialog is a sample color swatch which reveals the selected color, and to the right of the sample is a Favorites button. FavoritesButton

    We’ll talk more about the cool things you can do with favorite colors in a moment. But first, let’s take a look at the pages.

    The Color Picker

    The “Picker” page, the one you see in the screen shot above, is perhaps the most weighty. If you need to pick a color based on hue, saturation, brightness, red, green, or blue, you can do it here. You can also set opacity, enter an HTML color (including shorthand for web-safe colors such as “369”), and change a selected color to it’s nearest web-safe neighbor. And you can select a color from an existing image or window appearing on your desktop by clicking the eye-dropper tool. EyeDropper

    When working with color, you can use one of two mechanisms: red, green, & blue or hue, saturation & brightness (RGB and HSB). You may prefer to work with HSB on the Picker page since these attributes make it easy to change the brightness or the saturation without modifying the hue, which can produce nice color variations like this:

    Variations

    or this:

    Variations2

    Keeping most of the UI colors in the same hue is useful for reducing visual noise in a user interface.

    Regardless of which of the two mechanisms you choose to work in, specifying a color on this page is always a convergence of three values. I like to visualize this as a cube which holds all colors. If I’m working in RGB, the dimensions of that cube are 256x256x256.

    Here’s an example of a three-dimensional arrangement of colors organized by saturation (width), brightness (height), and hue (depth):

    ColorCube

    So to specify a color in this three-dimensional space the Picker page gives you a two-dimensional grid, like this:

    TwoDimensionalGrid

    and a one-dimensional vertical gradient, like this:

    OneDimensionalGrid

    These two controls work together to let you specify any color in this three-dimensional space. The vertical gradient allows you to select any plane in this space, and two-dimensional grid lets you select a color on that plane.

    The vertical gradient is useful when you want to isolate one of the three attributes of the cube you’re working with onto a single dimension, allowing adjustments to only one value while keeping the other two attributes static.

    To isolate an attribute just click its corresponding radio button on this page.

    For example, to isolate the Saturation attribute, click the “Sat:” radio button.

     BySaturation

    Notice the labels on the two-dimensional grid have changed to show Brightness on the vertical axis and Hue on the horizontal axis.

    Isolating the Brightness attribute looks like this:

    ByBrightness

    Things get interesting when you isolate one of the RGB channels. For example, here’s Red:

    ByRed

    Here you can see where the color will go as you increase or decrease the RGB values.

    Here’s what it looks like when you isolate the Green channel:

    ByGreen

    And for completeness, here’s what it looks like when you isolate the Blue channel:

    ByBlue

    If you need a color from the desktop, click the Eyedropper button EyeDropper and then click on the color you want. A sample of the color under the eyedropper will appear below the button, and to the right you’ll see a magnified portion of the screen with a rectangle in the center representing the eyedropper position.

    PickColor

    If we’re working with a color that isn’t web safe, the “Make Web Safe” button will be enabled. Clicking it will to take the selected color to its nearest web-safe neighbor, like this:

     WebSafeNow

    Right above the Make Web Safe button is the hex edit control, useful for copying or pasting hex triplet representations of color (for example, “B6005A”). You can also use a three-digit shorthand when representing web safe colors, for example enter “369” in the hex edit control and you’ll get this:

    WebSafeShorthand

    Which is shorthand for #336699.

    Web Colors

    Speaking of web-safe colors, let’s switch to the Web page, where you can select from all 216 web-safe colors:

    WebSafeColors

    Named Colors

    Here’s the Named page for .NET colors based on the X11 color names:

    NamedColors

    System Colors

    SystemColors

    Document Colors

    The Document page shows all the colors defined in the active document (before taking this screen shot I opened a C# class which defined many colors):

    DocumentColors

    Favorite Colors

    And finally, we have the Favorites page, which might initially look like this:

    Favorites

    The favorites page holds favorite colors in groups called palettes.

    There are three interesting buttons on the top row of this page:

    DeleteSelectedColor Delete Selected Color
    DeleteActivePalette Delete Active Palette
    CreateNewPalette Create New Palette

    You can rename the active palette simply by typing in a new name in the combo box at the top of the dialog (press Enter to commit the change or Escape to cancel). For example, let’s rename this palette to “My Faves”, like this:

    MyFaves

    Press Enter to commit the change, or you can commit the rename by simply moving focus away to another control.

    At the bottom of the CodeRush Color dialog, to the right of the color sample, sits the Favorites button. FavoritesButton

    If you click the button, the sample color will be added to the active palette page.

    AddFavorite

    Let’s add another color to this page. Click on the Named color tab, select DarkOrange:

    DarkOrange

    Then click the Favorite button, and watch what happens under the mouse:

    ReturnButtonBig

    The Favorites button changes to a Return button, so a single click on this can get you right back to the page you started from. This makes it easy to add several favorite colors from anywhere in the CodeRush Color window.

    There’s one more cool thing you can do with favorite colors. To demonstrate, let’s create a new palette page. Click the Create New Palette button. CreateNewPalette

    Now let’s go to the Picker page and find a favorite color, like this:

    DevExpressBlue

    For this demo I’m grabbing the DevExpress blue from the web site using the Eyedropper.

    Now, right-click the Favorite button and select Add Color Distribution, then click the number of colors of varying lightness you want to add in the same hue as this color. I’ll select 21.

    AddColorDistribution

    Which generates 21 colors based on the selected color, like this:

    DevExpressColorDistribution

    Generating the Color Reference

    Once you have the color you want, just click the OK button and the active color reference will be replaced with a reference to the color selected. Here’s the DevExpress blue placed in a C# file after clicking OK:

    DevExpressColorInCode

    Oh, and if you’re still wondering what Bisque looks like, here it is:

      ColorBisque

    We hope you enjoy the CodeRush features that make working with color easier. As always, let us know what we can do to improve your development experience.

2 3 4 5 6
7
8 9 10 11
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners