user interface

intro slide[3]

One of the tricky things about helping developers build for a platform that has yet to be released is that it’s a tabula rasa. There’s no history, which is both blessing and curse: we developers get to make that history, but at the same time, we’re working in the dark. There are no examples to emulate and no best practices to follow – it’s just us and whatever user interface guidelines there happen to be (which, in the case of Windows Phone 7, is the Windows Phone UI Design and Interaction Guide).

That’s why I’m glad that Microsoft is building WP7 apps like USGA Shot Tracker, a gorgeous golf scorekeeping app that practically announces to developers: “This is how you do it. This is how you write a usable, beautiful, truly Windows Phone 7 app.” Here’s a video of USGA Shot Tracker in action:

Give the app a look, and also make sure you check out the article on Long Zheng’s blog, istartedsomething, which includes images of USGA Shot Tracker’s screens.

Keep an eye on this blog, because I’m a couple of days away from starting an ongoing series on well-designed WP7 apps and how you implement them. I’ll take a closer look at USGA Shot Tracker and other apps, going through them with a fine-toothed comb in attempt to learn as much as possible from them, and share that knowledge with you.

This article also appears in Canadian Developer Connection.

{ 0 comments }

A Touchy Subject

by Joey deVilla on August 1, 2010

win phone latitude xt2 surface

I think that we – and by we, I mean we developers and developer evangelist types at Microsoft – get touch and tablets, or slates, or pads, or whatever you’d like to call them, better than the Ars Technica article Ballmer (and Microsoft) still doesn’t get the iPad (written by Peter Bright and posted in the One Microsoft Way section) implies. I believe that over the next few months, you’ll see some interesting touch-related stuff coming from Microsoft, and that we have a responsibility to help developers understand the differences between mouse/keyboard computing and touch computing.

In anticipation of this, I’ve been make my move towards touch- (and other sensor-based) computing over the past little while, by migrating to the following devices:

The idea behind this purposeful move towards touch-equipped devices is to truly understand touch-based interfaces, which UI elements work and which ones don’t, and then to pass the lessons learned to my audience – developers and designers, whether you build for the Microsoft platform or the platforms of the Esteemed Competition.

My own move towards touch-based devices is a microcosmic example of the larger changes taking place at The Empire. The move to touch interfaces is taking place on Microsoft computing platforms of all sizes:

windows phone

As the Ars Technica article points out, one of the signs that we do get touch is the new interface design of Windows Phone 7. The design philosophy is build around touch (and other sensors), and the WP7 “design bible”, the Windows Phone User Interface Design and Interaction Guide [12 MB PDF], explains this philosophy beyond the mere technical details. Here’s the introduction to its section WP7’s touch interface (any emphasis in the quote below is mine):

Touch input is a core experience of Windows Phone 7 and has inherent differences from traditional keyboard and mouse input systems. Designed for natural and intuitive user interaction, touch input in Windows Phone 7 enables users to interact with application content such as a photo or a web page. Touch input enables simple and consistent user touch gestures that imitate real life behavior, such as panning on a photo to move it. Single-touch gestures make interaction easier with one hand, but multi-touch gestures are also available to provide more advanced gesture functionality.

Application developers should strive to create unique and exciting experiences that encourage the discovery of content through the use of touch gestures. Users should enjoy the experience of navigating through the steps of a task as well as the completion of the task itself. Touch gestures should provide a delightful, more colorful, intuitive experience within applications

Touch delights the senses as the user gets to see the interaction match the performance. The touch UI should always have aware and responsive performance, just like how real world objects respond to touch immediately, and applications on Windows Phone 7 should as well, by performing the action in real time and by providing immediate feedback that an event or process is occurring. Users should not have to wait as it breaks their immersion, flow, and concentration, especially as their gestures transition from one to the other. For example, a pan may turn into a flick or a tap can become a double tap, and the user should not be aware that the UI is switching gesture support.

There’s a great amount of understanding behind the nuances of touch-based interfaces in the Windows Phone User Interface Design and Interaction Guide, and over the next few months, we’ll be covering them in great detail in this blog.

big-ass table

When the Surface, a.k.a. the “Big-Ass Table”, came out, a number of people asked why such a big, expensive thing was built and what practical purpose such a beast would serve.

For starters, there are a number of customers who use it, from casinos in Vegas to bible study classes in megacurches to places closer to home (by which I mean Canada), from the company that did the security for President Obama’s visit to Ottawa to super-sexy Toronto design firm Teehan+Lax to Ontario College of Art and Design to Infusion, who’ve built applications such as Noront Resources’s GSI Surface tool to the security app Falcon Eye.

Equally important are lessons to be learned about input from touch and other sensors from a “concept” machine like the Surface, whose built-in camera systems allow for way more touch points than a resistive or capacitive touch screen will allow, as well as the ability to “see” objects on the tabletop. By being empirical and building such a computer, developing software for it and watching people interact with it, we learn more about touch and sensor-based computing way more than we could from mere theorizing.

I think Des Traynor captured our intent quite nicely in his article about Surface and other Microsoft efforts in the field of user interface:

When the Surface was released two years ago it was chastised by the public. The joke at the time was: “Apple and Microsoft both invest in multi-touch technology, Apple release the iPhone, Microsoft release a $15,000 coffee table!”.

But Surface wasn’t about “re-inventing the coffee table”, so much as it was prototyping a vision of the future of computing. There will come a time when “gathering around a laptop” will seem as ridiculous as connecting an ethernet cable; a time when everyone gathers around a multi-user computer to have a meeting or debate a design. With something like surface, Microsoft are preparing for that day.

standard computers

A lot of the knowledge from Surface applications have been injected into Windows 7 in the form of the Windows 7 Touch Pack. This pack gives Windows 7 a touch-based API and a set of apps originally designed for the Surface, so that they can run on touch-enabled computers, such as HP’s TouchSmart series, touch-enabled laptops like my own Dell Latitude XT2 as well as any computer connected to one of the new touch-enabled monitors (our manager John Oxley has one in his office).

The Ars Technica article goes on and on about Windows 7’s standard interface controls being too tiny for touch, but a quick look at the Touch Pack apps reveals that they don’t use the standard controls; rather, they use controls better-suited to touch. Here’s a screenshot of Surface Collage, the photo-collage application, running on my XT2:

surface collage

No standard Windows controls here! You manipulate the photos directly using gestures, and the strip along the bottom is a photo list, which you also manipulate through gestures. The closest thing to a standard Windows control is the “close” button near the upper-right hand corner of the screen, which is larger than the typical “close” button – small enough to be out of the way, yet large enough to click with a finger.

Here’s another app from the Touch Pack, Surface Globe, also running on my XT2:

surface globe

Once again, no standard Windows 7 controls here, but a map that you directly manipulate, augmented by finger-friendly controls.

The Touch Pack apps all follow this philosophy: when going touch, eschew the standard Windows 7 UI controls in favour of touch-friendly ones, and then back to bog-standard Windows 7 when exiting them. These apps show not just that we understand that touch computing is a different beast from mouse-and-keyboard computing, but that we also understand where they intersect.

future
We’re working on what I like to call “the touch continuum”, which spans pocket devices such as the Zune HD and Windows Phone, to portable computing with netbooks, laptops and soon, tablets, to desktop and tabletop and wall-sized units. And yes, we get that new types of user input call for new user interfaces and give rise to new usage patterns. We’re aware of the challenges of touch (and other sensor) input and over the next little while, you’ll see our answers to those challenges. And better still, we’ll share what we’ve learned in order to make you better developers and designers of software that use these new interfaces.

This article also appears in Canadian Developer Connection.

{ 1 comment }

If You Speak Database, Science Needs Your Brain!

by Joey deVilla on May 4, 2010

 database brain

If you’re in the Greater Toronto Area, have basic knowledge of database queries and want to help a grad student with a research project, Zuzel Vera Pacheco, one of Greg Wilson’s students at University of Toronto, needs to borrow your brain! In exchange, you’ll get a chance to win a $100 Best Buy gift card.

Here’s her description of the project:

Want to win a $100 Best Buy gift card? Do you have basic knowledge about database queries? If so, I need you!

Subjects are needed to take part in a study concerning the visualization of database queries. Participants will be asked to draw diagrams that represent the execution of database queries or to determine what queries are represented by a set of diagrams. This study will help design a tool intended to help expert and novice programmers to design and debug such queries. The time needed for the study will range from 30 minutes to an hour, and can take place in the Bahen Centre at the University of Toronto or elsewhere in the Greater Toronto Area.

A basic understanding of relational databases and database queries is required. The examples will contain queries in SQL and other programming languages like Ruby or Python. The participants should be fluent/conversant in English.

Participants who complete the study will be entered into a random draw for a $100 Best Buy gift card. The odds of winning this prize are 1 in 30.

If you think you can help Zuzel with her project, drop her a line!

This article also appears in Canadian Developer Connection.

{ 1 comment }

So You Need a Typeface…

by Joey deVilla on April 26, 2010

so you need a typeface flowchart

Got a project and can’t decide on a typeface? This chart is by no means complete, but it might help steer you in the right direction. Click it to see it at full size.

This article also appears in Canadian Developer Connection.

{ 1 comment }

Replica Spanish galleon on fire

Sometimes, you have to do more than just start from scratch. Sometimes, you have to burn the boats.

“Burning the boats” is an expression that comes from a story – some say legend — about Cortes, the Spanish Conquistador (and yes, the subject of Neil Young’s Cortez the Killer). Wishing to guarantee that his men would stay in Veracruz (which he’d just taken over from the Governor of Cuba) and only move forward into terra incognita without retreat, he ordered them to burn the ships that brought them to the New World. It was an extreme measure, but without the distraction of a way home, they committed themselves completely to business of exploring and conquering.

The Original Mac: No Arrow Keys

Bruce “Tog” Tognazzini, former user interface guy at Apple and the company formerly known as Sun, and now member of the Nielsen/Norman Group, wrote about how Apple burned the boats back when they released the original Macintosh in his 1992 book Tog on Interface and more recently in an article on his blog, AskTog.

Original IBM PC and Apple // computers

In 1984, the Macintosh represented a break from the dominant paradigm at the time: the command-line interface. Back then, you’d issue commands to a program these ways:

  • Typing them in
  • Using control-key combinations
  • Using function keys
  • Using the arrow keys to navigate

Software developers at the time had little experience developing for GUIs, which meant that there would be great temptation for them to simply develop apps for the Mac the way they did for other platforms. The software they’d end up writing would be a command-line app that just happened to run on the Mac.

Steve Jobs and Apple’s Macintosh team, an unconventional bunch who were said to have nary a classical computer science degree among them, thought that existing software sucked. I was 16 at the time, and I’d have to agree. In order to prevent straight ports of existing software to the Mac, they decided to “burn the boats” and make it difficult for developers to “go home” and simply rely on the UI techniques from the Old World. The first Mac keyboards didn’t just omit the function keys, they also left out the arrow keys:

Original 128K Macintosh. "See? No arrow, function or control keys."

Tog writes:

That was a big deal. Almost every application then in existence depended on the arrow keys (then called cursor keys) for navigation. With that one stroke, Steve reduced the number of apps that could be easily ported to the Mac from tens of thousands to zero, ensuring that this new computer would have a long and painful childhood.

It’s counterintuitive to want to have your creation go through a long and painful childhood, but there was a method to their madness. In “burning the boats” by getting rid of the function and arrow keys on which developers relied and taking away their “way home”, they forced developers to redesign and rewrite their applications to fit a mouse-driven graphical interface rather than a keyboard-driven command-line interface.

They eventually brought back the arrow keys about a year and a half later. By that point, developers had grown used to developing GUI apps that took advantage of the UI controls and mouse that we’ve come to know and love. The return of the arrow keys at that point would now be a welcome addition and convenience, rather than a dangerous temptation to return to “the old ways”.

It was a bold move, but when you’re making radical changes to the way things are done, bold moves are often required.

Windows Phone 7: No Copy and Paste

Copy and Paste icons

There’s been some talk about Windows Phone 7’s lack of copy and paste. It’s similar to the hue and cry about the original iPhone’s lack of copy and paste, and having been reminded by Tog’s article about the design decisions made for the original Mac, I can see the method to Microsoft’s madness.

“Copy and paste already exists in Windows,” people have said, “why not Windows Phone 7?”

The answer is simple: because Windows Phone 7 apps aren’t supposed to be like Windows apps. For non-enterprise, non-industrial use, the “Windows, but scaled down” approach of previous versions of Windows for phones, which goes under the name Windows Mobile, didn’t catch on (Windows Mobile still rules the roost for compact devices used in enterprises and industries, and will be supported for years to come). Hence Albert Shum’s completely different-from-the-desktop, and even different-from-other-phones Windows Phone 7 interface, which went by the codename “Metro”.

Windows Phone 7 hubs: music+video, people, pictures, office, games

The use of copy and paste implies a keyboard-centric user interface, which isn’t what Windows Phone 7 is about. People often use their smartphones one-handed, with only their thumb to access the touchscreen. Windows Phone 7’s interface takes this usage into account, which is why it’s sensor-centric, and applications, should get their information from touch, gestures, accelerometers, location and other sensors where possible. By not including copy and paste in the first release, the Windows Phone team is “burning the boats” and asking developers “How do you write apps so that they don’t need intricate more-suited-to-the-desktop operations like copy and paste?”

(And yes, copy and paste will eventually find its way into Windows Phone 7, just as the arrow keys, function keys and even right-clicking found their way into the Mac.)

The same could be said for many other things that were purposely excluded from Windows Phone 7, such as the compact edition of SQL Server that was part of Windows Mobile. If you think about it, this design decision forces you to build apps so they store and retrieve data from the network, which makes sense, since phones are devices that network with both cellular and wifi.

Windows Phone 7 represents a radical shift in the way Microsoft stuff works, from a very minimalistic look to its task-centric organization. In order to make sure that people built apps that fit it, the Windows Phone 7 team had to burn the boats. It’s a bold move, but it’s the right one.

{ 19 comments }

MIX10 Thoughts: Design, Windows Phone and Bill Buxton

by Joey deVilla on March 23, 2010

Joey deVilla and Bill Buxton posing on the dance floor at LAX nightclub in Las VegasMe and Bill Buxton at the MIX10 Attendee Party last Tuesday night.

There’s one reason I’m particularly excited about Windows Phone 7 Series. The radically reworked look and feel is the surest sign that the company is really beginning to understand design and is willing to start from scratch (a risky and pricey proposition) to get it right. It would appear from Microsoft’s Principal Researcher Bill Buxton’s interview in The Register that I’m not the only one who thinks this:

"We kinda changed the water that we drink, in the sense that all through the design community within the company we talk, and we have a common goal in terms of trying to bring a certain change of sensibility," he said.

"For me it’s not even about the phone, but what’s interesting is that it’s the first product in the company with critical mass that’s embraced this … it will have an impact on other parts of the company."

If (or better still, when) you start building Windows Phone applications – or hey, any kind of application — I hope that you’ll follow the spirit of “Metro” (the codename for the design philosophy behind Windows Phone 7) and keep it in mind. Yes, it’s absolutely important to know the Silverlight and XNA APIs as well as how to read the touch sensors, GPS, accelerometers and so on, but it’s just as important to design your applications around the people who’ll use them. That means understanding your users, how they’ll use what you’re making, knowing how to give them what they need as quickly and unobtrusively as possible and delighting them. Yes, “a pretty interface” is included in all that – and there’s research to suggest that beautiful interfaces work better –but looks are merely part of the design equation.

Some Design Sessions from MIX10

Want some interesting lunchtime viewing on design? Look no farther than these two videos.

The first is Bill Buxton’s MIX10 session, simply titled An Hour with Bill Buxton, a conversation about design:

Get Microsoft Silverlight
Don’t have Silverlight? Get it here or download the video in
WMV, WMV (High) or MP4 format.

If you haven’t the time to watch the video of Buxton’s presentation, check out this hit list of metaphors complied by Sharon Chan at Microsoft Pri0.

If you’re planning on getting into Windows Phone 7 design, you’re going to want to learn the “design language” – not a programming language, but the guiding principles and philosophies behind the new user experience – behind it. Here’s the MIX10 presentation on that topic, Designing Windows Phone 7 Series with Albert Shum, Michael Smuga and Chad Roberts:

Get Microsoft Silverlight
Don’t have Silverlight? Get it here or download the video in
WMV, WMV (High) or MP4 format.

A World Without Design

Here’s a little something extra for those of you who like to think about design and user experience:

"A World Without Design": The same rock, described as a hammer, doorstop, paperweight and so on.

I whipped up this graphic, modelling it after a poster I remember seeing many years ago. I can’t remember what it was for – a museum, art gallery or exhibit, perhaps? – but I remember thinking that it was right on the money. If you remember the original poster and what it was for, please let me know, either via email or the comments!

This article also appears in Canadian Developer Connection.

{ 0 comments }

Windows Phone 7 Series: Now That’s More Like It!

by Joey deVilla on February 15, 2010

Windows Phone 7 Series generic phone

A New Windows for the Phone

Ever since joining The Empire, I’ve been saying that Windows Mobile needs to go back to the drawing board. While there was good technology lying in its innards – mobile versions of the .NET framework, SQL Server and Office – treating the mobile form factor as “the desktop, but much, much smaller”, was the wrong approach. In the meantime, the Esteemed Competition were doing the right thing: designing their phones’ OS features and interface from the ground up rather than attempting to force-fit the desktop UI into a pocket UI.

Today at Mobile World Congress in Barcelona, Microsoft previewed the latest in a series of steps forward – consider Xbox to Xbox 360, Windows Vista to Windows 7, Live Search to Bing – there’s now Windows Phone 7 Series.

(The name’s a bit long. Whoever does the naming at Microsoft corporate HQ must get paid by the syllable.)

A Quick Look at Windows Phone’s Experience

A good starting point is this video, which covers Windows Phone’s features in three minutes, thirty seconds:

You can take an interactive tour of the UI at the Windows Phone 7 Series site:

Screenshot of the Windows Phone 7 Series site's home page

A Closer Look at the Windows Phone Experience

Over at Channel 9, Laura Foy has posted her interview with Joe Belfiore, VP Windows Phone 7 Program Management, who gave her a walkthrough of the goodies in Windows Phone (the video is 22 minutes, 18 seconds):

Get Microsoft Silverlight

Some quick notes from the video:

  • There are three mandatory hardware buttons, which are context-sensitive:
    • Back
    • Windows (the “Start” button)
    • Search
  • The screen is a capacitive touch-screen, capable of supporting multi-touch
  • The Start menu is built up of tiles: little block representing the information and features that you care most about
    • You can add your own custom tiles; Joe shows a “me” tile linked to his Facebook profile
  • A browser with:
    • Snappy performance
    • Support for multitouch actions such as pinch zoom, double-tap to zoom and finger drag
    • Very readable text, that to sub-pixel positioning in HTML
    • Phone number recognition in HTML documents; touch them to dial them
    • Street address recognition in HTML documents; touch them to get a map
    • Multiple tabs
  • The “People Hub”
    • Aggregates Exchange, Hotmail, Gmail, Yahoo! Mail and other mail contacts
    • Provides a live feed of your contacts
  • Context-sensitive search:
    • Press the “Search” button while in the People Hub, and you search your people list
    • Press the “Search” button while in the Start menu, and it runs a web search
      • Based on your query, it knows whether to give you a web search result or a local search result
      • In the demo, Joe does a search for pizza and gets a map and results for pizzerias near him, and a quick pan over to adjacent pages yield directions and reviews
      • A tap on “nearby” yield the locations of useful things like parking, ATMs and so on near the selected pizzeria
      • In another demo search, Joe does a search for “Avatar” and it returns a list of nearby theatres and times for the movie Avatar; a quick pan to an adjacent page yields the results for local business and places with “Avatar” in the name
  • Email:
    • Easy pivoting between unread, flagged and urgent emails
    • A caching system prevents you from seeing the dreaded “loading” screen
    • Press “Search” within email and you perform a search of your email messages, by subject, text and so on
  • Rotation: you can operate the phone in “portrait” or “landscape” mode
  • Calendar:
    • Support for both work and personal calendars
  • ActiveSync works in the background and keeps the phone synced with email, contacts and calendar
  • User-customizable UI colour schemes
  • The “Pictures Hub”
    • Gallery: Lets you browse all the pictures on your phone
    • Mosaic: Recent and favourite pictures
    • What’s New: New photos from your social networks
    • Camera roll: A folder for photos taken with your phone
    • Support for photo albums from Facebook and Windows Live, which you browse as if they lived right on your phone
  • Music and Video
    • History: Most recently played music and videos
    • New: New music and videos added since the last sync
    • Zune HD-style marketplace searching and support for Zune subscriptions with unlimited music plays
  • The “Me” tile
    • Lets you update your status on places like Facebook
    • Nice little typing features like auto-spelling-correction and a special soft keyboard for emoticons
  • The UI concept: Windows Phone is task-centric, not app-centric, with a hub associated with each: people, photos, media
  • There’s also a games hub, which ties into Xbox Live
  • Third-party applications and games? Wait…

Wait a Minute…What About Third-Party Apps and Games?

"MIX10: The Next Web Now" logo buttonCan you wait a month?

Here’s the deal: the announcement at Mobile World Congress was about showing what Windows Phone can do. As for what’s possible on the developer front, it’ll all be announced at the MIX10 Conference, which takes place from March 15th through 17th in Las Vegas.

There will be a dozen sessions at MIX10 for Windows Phone, and they promise to be quite interesting. I’ll be at MIX10, and will blog what I learn from these sessions when they take place.

You can save $200 off the price of MIX10 registration if you register before February 21st, so if you want to get in on the ground floor with Windows Phone and save some money, register now!

What the Tech Press is Saying

Pretty good stuff, actually. Rather than bury you with links to a zillion blog entries filed from Mobile World Congress, I thought I’d pick two of the big tech blogs, Gizmodo and Engadget:

Here’s what Gizmodo has to say about the new Windows Phone:

It’s different. The face of Windows Phone 7 is not a rectangular grid of thumbnail-sized glossy-looking icons, arranged in a pattern of 4×4 or so, like basically every other phone. No, instead, an oversized set of bright, superflat squares fill the screen. The pop of the primary colors and exaggerated flatness produces a kind of cutting-edge crispness that feels both incredibly modern and playful. Text is big, and beautiful. The result is a feat no phone has performed before: Making the iPhone’s interface feel staid.

If you want to know what it feels like, the Zune HD provides a taste: Interface elements that run off the screen; beautiful, oversized text and graphics; flipping, panning, scrolling, zooming from screen to screen; broken hearts. Some people might think it’s gratuitous, but I think it feels natural and just…fun. There’s an incredible sense of joie de vivre that’s just not in any other phone. It makes you wish that this was aesthetic direction all of Microsoft was going in.

Here are Engadget’s impressions, after having some hands-on time with Windows Phone:

The design and layout of 7 Series’ UI (internally called Metro) is really quite original, utilizing what one of the designers (Albert Shum, formerly of Nike) calls an "authentically digital" and "chromeless" experience. What does that mean? Well we can tell you what it doesn’t mean — no shaded icons, no faux 3D or drop shadows, no busy backgrounds (no backgrounds at all), and very little visual flair besides clean typography and transition animations. The whole look is strangely reminiscent of a terminal display (maybe Microsoft is recalling its DOS roots here) — almost Tron-like in its primary color simplicity. To us, it’s rather exciting. This OS looks nothing like anything else on the market, and we think that’s to its advantage. Admittedly, we could stand for a little more information available within single views, and we have yet to see how the phone will handle things like notifications, but the design of the interface is definitely in a class of its own.

(In another article, Engadget simply summed it up with “Microsoft is playing to win”.)

Watch this Space!

"Counting Down to Seven" badgeWe’ll have more announcements about Windows Phone over the next few weeks, so keep an eye on this blog!

This article also appears in Canadian Developer Connection.

{ 4 comments }

Qixing’s Big Move

by Joey deVilla on January 4, 2010

Good Luck, Qixing!

QIxing Zheng in her TechDays 2009 orange speaker shirt

We may be losing a User Experience Evangelist, but I think we’ll get a great Windows 8 in return. Qixing Zheng, who’s been with Microsoft Canada’s Developer and Platform Evangelism team for the past three years, is leaving to join the Windows UX Team as a Program Manager. While I saw firsthand that she enjoyed her work as a UX Evangelist, talking to developers and designers about building usable, comprehensible and beautiful applications, joining the Windows UX Team is the opportunity of a lifetime. After all, how often are you given the chance to design something that will get used all the time by millions of people, all over the world, at work, play and in their day-to-day lives?

Qixing’s been the sole writer for the Canadian UX Connection blog during her tenure. She posted her farewell article, A New Year and a New Beginning, on January 1st, but don’t think that’s the last you’ve seen of her online. She promises that she’ll be blogging soon – she’ll let us know where, and I’ll let you know in turn. In the meantime, you can follow her on Twitter, where her handle is @hundredflavour.

What About User Experience?

Windows 3.1, as seen using the garish yellow and red "Hot Dog Stand" colour scheme

While I’m glad that Qixing is going to be applying her skills and knowledge to Windows’ user interfaces, there remains the need for someone to help developers, designers and people who play both roles build useful, usable and beautiful interfaces, applications and experiences. This is becoming even more important as mainstream software development extends beyond the desktop OS to the web, mobile phones, tablets and even big-ass tables.

I’m planning to pick up some of the slack in the tech blogs where I write, Canadian Developer Connection and Global Nerdy. In addition to articles on programming, industry trends and reports from the field, I’ll also be posting articles about usability, user interface and user experience, as seen from the developer’s point of view. I’ve had some experience in this area, and where my skills and knowledge fall short, I can always call on my “friends in UI places” and bring their opinions and know-how to you.

Once again, congratulations Qixing, you’ve been a great teammate — and yes, we’ll keep evangelizing user experience!

This article also appears in Canadian Developer Connection.

{ 0 comments }

One-Handed Computing

by Joey deVilla on October 30, 2009

Yes, you probably went here as soon as you saw the phrase “One-Handed Computing”:

"Successories" style poster featuring a woman gasping as a man shows her something on his computer: "Your Porn Collection. Probably best kept to yourself."

But in this case, I’m talking about what Jason Kottke is talking about — those times when you use mobile technology while your other hand isn’t free because you’re:

  • Eating
  • Drinking
  • Carrying or feeding a baby
  • Walking the dog
  • Carrying groceries
  • “Straphanging” on a train or bus
  • Getting by with a broken arm

In the cases above – and I’m sure you can think of many more – you’re accessing computing resources in a very undesktop-like way: with only one hand, and even then, a limited portion of that hand since most of your fingers are busy holding that phone. You’re likely using only your thumb, as shown below:

windows mobile 6.5 and thumb

There are lots of times when users are stuck in “one-thumb mode”. If you’re building mobile applications, you should keep that in mind and make sure you design your user interfaces accordingly. You might need to consider things like:

  • The size of touchscreen controls: make them too small and they’re not thumb-friendly.
  • The number of controls on the screen; the maximum number is dictated by their size.
  • Navigation in your app. Hierarchical arrangements make sense to developers, but lots of user experience people will tell you that ordinary people don’t get hierarchies.
  • Which functions will your users use most often? You should make those very easily accessible. Which functions will your users use less often? You might be able to put them on a secondary or tertiary screen.
  • Can you get information without making the user enter it? For example, can you infer information based on the user’s location, which you can grab from GPS instead of asking for him/her to enter it? Can your application remember your user’s most often-used data?
  • Can you get other kinds of one-handed input, such as from the camera, accelerometer, magnetometer or other sensors?

That’s a fair bit to think about, and I might have to present some ideas at the upcoming Toronto WinMoDevCamp (and yes, I’ll also blog them).

This article also appears in Canadian Developer Connection.

{ 0 comments }

Airport Signage and the Tab Control

by Joey deVilla on October 7, 2009

While flying home from TechDays Vancouver, something on the sign pointing the way to the gates caught my eye. Note the screen on the right:

Gate signs at Vancouver airport, featuring a multilingual LCD sign using a tab control

Here’s a closer look:

Close-up of the LCD sign featuring the multilingual tab control

LOLcat: "I see what you did there"

It’s an interesting use for a tab control. The content of each tab page is the same, but each one shows that content in a different language: Japanese, Korean and Hindi (I have no idea why there’s no Chinese; there are lots of Chinese visitors at Vancouver airport). The sign cycles through each tab page, displaying each one for about 10 seconds before switching to the next one.

Is it an appropriate use for a tab control? My guess is that user interface/user experience types (Qixing, if you’re reading this, feel free to chime in) would say “no”. I say “no”, myself. It’s based mostly on a gut feeling, but a little thinking provides me with some rationale, which includes:

  • There’s so little information on each tab. The purpose of a tab control is to break down a large or complex set of controls into more manageable groups, which in the world of  .NET controls are called ”tab pages”. The current tab page, which shows something in Hindi, has no more than a line of tex,t, and the same is true for the Japanese and Korean tabs. They could’ve shown all three languages on a single screen.
  • Tab controls imply interactivity. The tabs in a tab control are for all intents and purposes buttons. Buttons imply interactivity: you click them and something happens. The same is true for tabs: you click a tab and its tab page becomes the frontmost one. These tabs aren’t clickable at all; they’re just being used to show you what languages the sign uses. Using a tab control in this fashion seems like using a button as a label. It gets the job done, but it is the best way?

What do you think? Feel free to opine in the comments.

This article also appears in Canadian Developer Connection.

{ 1 comment }

Lessons from an Air Pump

by Joey deVilla on August 10, 2009

This article also appears in Canadian Developer Connection.

The Incident

I live in Toronto’s High Park neighbourhood, which puts me at that magical distance where biking downtown takes a half-hour, about as long as public transit. If weather isn’t downright terrible and I don’t have too much to carry – say, laptop, change of clothes and even an accordion — I tend to take my bike.

Cycling is much easier with a pair of properly-inflated tires, so I often make use of the air pump at the gas station near my house:

air_pump_1

Gas stations used to give you air for free, but these days, you have to pay to use an air pump – presumably to cover the cost of their upkeep. At the gas station near my house, a dollar gets you enough time to inflate all the tires on a car, which is plenty of time for a bike’s tires. You can use either a loonie (that’s “dollar coin” to you readers outside Canada) or four quarters.

Take a look at  the coin slots for the air pump at the gas station near my house:

air_pump_2

Although the left and right coin slots are identical in size and appearance, they are for different types of coins:

  • The left slot is marked “dollar coin” and is for loonies (that’s “dollar coins” to you non-Canadian readers) only.
  • The right slot is marked “4 quarters” and is for quarters only.

It’s the worst combination of usability factors: identical slots that serve different purposes.

I reached into my pocket and pulled out some quarters. Without thinking, I put quarter in the dollar coin slot, realizing my mistake a little too late. The machine accepted the coin and didn’t route it to the “coin return” compartment. In fact, the machine didn’t even have a coin return compartment.

I wondered what would happen if I put three more quarters in the dollar coin slot. After all, the sticker might be wrong.. It wasn’t – I put in the remaining quarters and the air pump remained off. Luckily, I had four more quarters. I put those in the quarter slot and the machine came to life, providing compressed air for my tires.

Out of principle, I went to the gas station attendant and asked for the dollar I’d lost to the air pump back. He was resistant at first, but as soon as I said “Geez, you guys are a rip-off. I should post that on Twitter,” he quickly capitulated and reimbursed me.

The Lessons

Because I am in the business of talking about software development and design, I was inspired to turn the experience into a blog article (eight years of blogging will do that). I took photos of the air pump and derived two lessons.

Lesson One: Interface Matters!

If two things expect different input, they should appear different. The coin slots on the air pump are the same size. Although the sticker on the machine has markings that say that the left slot is for loonies and the right slot is for quarters, those markings are almost identical. Possible solutions include:

  • Differently-sized coin slots: a larger slot for loonies, a smaller slot for quarters. Older coin-operated machines made use of these:

old_school_coin_slot

  • A new sticker, perhaps with some colour coding to make it very clear that each coin slot expects very different kinds of coins. 

    new_coin_slot_sticker

Be forgiving of user mistakes:

  • Both slots should accept either loonies or quarters. This solution is even better than differently-size coin slots or a new sticker. The constraint that one slot is for loonies and the other for quarters is a convenience for the manufacturer, not the user. Go the extra mile – after all, coin recognition technology isn’t anything new or hard to get.

    Most coin-operated machines that provide more than one coin slot, such as videogames and pinball machines at arcades, don’t “care” which one you use. Either coin slot will do, as long as you provide enough coins:

    arcade_coin_slot

  • There should be a coin return slot. The current design simply takes your money and doesn’t let you cancel the transaction.

Simplify! Once you put in a coin slot that accepts loonies and quarters, there’s no need for a second coin slot – a single one will do.

The lesson of “interface matters” doesn’t just apply to user interface; they’re just as applicable to application interfaces, from method signatures to whole APIs. It pays to be clear and comprehensible.

Lesson Two: Social Software Matters (at least to some people)

The second lesson? Never underestimate the power of social networking software. The gas station attendant wouldn’t budge, but I saw him constantly checking his smartphone and guessed that he might be into Twitter.

{ 5 comments }

Fast Food Apple Pies and Why Netbooks Suck

by Joey deVilla on May 26, 2009

If you’re pressed for time, the graphic below – which takes its inspiration from these articles by Kathy “Creating Passionate Users” Sierra — captures the spirit of this article rather nicely:

Kathy Sierra-esque graph showing  the relative positions of the smartphone (great for when you're on the go), the laptop (great for when you're sitting down) and in between, the netbook (zone of suck)

If you have a little more time to spare, I’m going to explain my belief that while netbooks have a nifty form factor, they’re not where the mobile computing action is.

A Tale of Two Pies

When I was Crazy Go Nuts University’s second most notorious perma-student (back in the late ‘80s/early ‘90s), I took a handful of business courses at the recommendation of my engineering and computer science professors. “You’re going to have to learn to speak the suits’ language,” they said. Crazy Go Nuts University has a renowned business school and I thought it would be a waste not to take at least a couple of business courses. I especially liked the Marketing couse, and one lecture stands out in my mind: a case study comparing the dessert offerings of two major fast food chains.

In the interest of not attracting the attention of their lawyers, I’m going to refer to the chains as:

  • Monarch Burger, whose mascot is a mute monarch with a glazed-over face, wearing a crown and associated paraphernalia, and
  • Jester Burger, whose mascot is a clown in facepaint and a brightly-coloured jumpsuit who loves to sing and dance.

Both Monarch Burger and Jester Burger offered a dessert that went by the name “apple pie”. Let’s examine them.

Monarch Burger’s Pie

Monarch Burger's apple pie: a slice of pie served in a wedge-shaped box Monarch Burger went to the trouble of making their apple pie look like a slice of homemade apple pie. While it seems appealing in its photo on the menu, it sets up a false expectation. It may look like a slice of homemade apple pie, but it certainly doesn’t taste like one. Naturally, it flopped. Fast-food restaurants are set up to be run not by trained chefs, but by a low-wage, low-skill, disinterested staff. As a result, their food preparation procedures are designed to run on little thinking and no passion. They’re not set up to create delicious homemade apple pies.

Jester Burger’s Pie

Jester Burger's apple pie: a tube of pastry, whose skin is pocked from deep-frying

Jester Burger’s approach was quite different. Their dessert is called “apple pie”, but it’s one in the loosest sense. It’s apple pie filling inside a pastry shell shaped like the photon torpedo casings from Star Trek. In the 70s and 80s, the pastry shell had bubbles all over it because it wasn’t baked, but deep-fried. After all, their kitchens already had deep fryers aplenty – why not use them?

Unlike Monarch Burger’s offering, Jester Burger’s sold well because it gave their customers a dessert reminiscent of an apple pie without setting up any expectations for real apple pie.

Jester Burger’s pie had an added bonus: unlike Monarch Burger’s pie, which was best eaten with a fork, Jester Burger’s pie was meant to be held in your hand, just like their burgers and fries.

At this point, I am obliged to remind you that this isn’t an article about 1980s-era desserts at fast food burger chains. It’s about netbooks and smartphones, but keep those pies in mind…

Netbooks are from Monarch Burger…

Netbooks remind me of Monarch Burger’s apple pie. Just as Monarch Burger tried to take the standard apple pie form and attempt to fit it into a fast food menu, the netbook approach tries to take the standard laptop form and attempt to fit it into mobile computing. The end result, to my mind, is a device that occupies an uncomfortable, middle ground between laptops and smartphones that tries to please everyone and pleases no one. Consider the factors:

  • Size: A bit too large to go into your pocket; a bit too small for regular day-to-day work.
  • Power: Slightly more capable than a smartphone; slightly less capable than a laptop.
  • Price: Slightly higher than a higher-end smartphone but lacking a phone’s capability and portability; slightly lower than a lower-end notebook but lacking a notebook’s speed and storage.

To summarize: Slightly bigger and pricier than a phone, but can’t phone. Slightly smaller and cheaper than a laptop, but not that much smaller or cheaper. To adapt a phrase I used in an article I wrote yesterday, netbooks are like laptops, but lamer.

Network Computers and Red Herrings

Sun's "JavaStation" network computer

The uncomfortable middle ground occupied by the netbook reminds me of another much-hyped device that flopped – the network computer, which also went by the name "thin client". In the late 90s, a number of people suggested that desktop computers, whose prices started at the mid-$1000 range in those days, would be replaced by inexpensive diskless workstations. These machines would essentially be the Java-era version of what used to be called "smart terminals", combining local processing power with network-accessed storage of programs and data.

A lot of the ideas behind the network computer ended up in today’s machines, even if the network computer itself didn’t. Part of the problem was the state of networking when the NC was introduced; back then, broadband internet access was generally the exception rather than the rule. Another major factor was price – desktop and even laptop computers prices fell to points even lower than those envisioned for NCs. Finally, there was the environment in which the applications would run. Everyone who was betting on the NC envisioned people running Java apps pushed across the network, but it turned out that the things they had dismissed as toys — the browser and JavaScript, combining to form the juggernaut known as Ajax — ended up being where applications "lived".

When I look at netbooks, I get network computer deja vu. I see a transitory category of technology that will eventually be eclipsed. I think that laptops will eventually do to netbooks what desktop machines did to network computers: evolve to fill their niche. Just as there are small-footprint desktop computers that offer all the functionality and price point of a network computer along with the benefits of local storage, I suspect that what we consider to be a netbook today will be just another category of laptop computer tomorrow.

A netbook displaying a picture of a red herring on its screen

I’m going to go a little farther, beyond stating that netbooks are merely the present-day version of the network computer. I’m going to go beyond saying that while their form factor is a little more convenient than that of a laptop, the attention they’re getting – there’s a lot of hoo-hah about who’s winning in the netbook space, Windows or Linux –  is out of proportion to their eventual negligible impact. I’m going to go out on a limb and declare them to be a dangerous red herring, a diversion from where the real mobile action is.  

…and Smartphones are from Jester Burger

Southern Chicken Place's apple pie, which looks a lot like Jester Burger's apple pie

A quick aside: The photo above is not of a Jester Burger fried apple pie. In response to their customers’ so-called health concerns (really, if those concerns were real, they’d stop eating there), they started phasing out the fried pies in 1992 in favour of the baked kind. There are still some branches of Jester Burger that carry the fried pies, but a more reliable source is a fast food chain that I’ll refer to as “Southern Chicken Place”, or SCP for short. Those pies in the photo above? They’re from SCP.

Jester Burger made no attempt to faithfully replicate a homemade apple pie when they made their dessert. Instead, they engineered something that was “just pie enough” and also matched the environment in which it would be prepared (a fast food kitchen, which didn’t have ovens but had deep fryers) and the environment in which it would be eaten (at a fast food restaurant table or in a car, where there isn’t any cutlery and everything is eaten with your hands). The Jester Burger pie fills a need without pretending to be something it’s not, and I think smartphones do the same thing.

Smartphones are truly portable. They really fit into your pocket or hang nicely off your belt, unlike netbooks:

Two Japanese models trying to stuff a Sony Vaio netbook into their pockets

And smartphones are meant to be used while you’re holding them:

Captain Kirk, his communicator and the iPhone

Just try that with a netbook. In order to really use one, you’ve got to set it down on a flat surface:

Guy using his netbook, perched on the roof of his car...with a stylus, no less!

The best smartphones make no attempt to faithfully replicate the laptop computer experience in a smaller form. Instead, they’re “just computer enough” to be useful, yet better fit the on-the-go situations in which they will be used. They also incorporate mobile phones and MP3s – useful, popular and familiar devices — and the best smartphones borrow tricks from their user interfaces.

Smartphones, not netbooks, are where the real advances in mobile computing will be made.

Smartphone vs. Netbook: The People Have Chosen

One again, the thesis of this article, in graphic form:

Same graph as the earlier Kathy Sierra-esque one at the start of the article.

In the late 80s and early 90s, the people chose the fast food apple pie they wanted: the convenient, if not exactly apple pie-ish Jester Burger pie over Monarch Burger’s more-like-the-real-thing version.

When people buy a smartphone, which they’ve been doing like mad, they’re buying their primary mobile phone. It’s the mobile phone and computing platform that they’re using day in and day out and the device that they’re pulling out of their pockets, often to the point of interrupting conversations and crashing the trolley they’re operating.

When people buy a netbook, they’re often not buying their primary machine. It’s a second computer, a backup device that people take when their real machine – which is often a laptop computer that isn’t much larger or more expensive – seems like too much to carry. It’s a luxury that people might ditch if the current economic situation continues or worsens and as the differences between laptops and netbooks vanish. Netbooks, as a blend of the worst of both mobile and laptop worlds, will be a transitional technology; at best, they’ll enjoy a brief heyday similar to that of the fax machine.

The people are going with smartphones, and as developers, you should be following them.

{ 49 comments }

Joel Spolsky: Learning from StackOverflow.com

by Joey deVilla on May 3, 2009

This article also appears in Canadian Developer Connection.

Just in case there’s nothing good on TV and you’re having a “lazy Sunday”, here’s a video of Joel Spolsky’s recent presentation at Google, Learning from StackOverflow.com, in which he talks about the design decisions that went into and the lessons learned from the Stack Overflow site. It runs for about 52 minutes, so you might want to get yourself a nice beverage before you watch it:

{ 0 comments }

 Mad Mobile: More Windows Mobile 6 example code from the guy who blogs at Global Nerdy

In my previous article in Upwardly Mobile, the ongoing article series in which I look as various aspects of Windows Mobile 6 development, I showed you a simple application that made use of a couple of user interface controls. In this article, we’ll take a closer look at some of the user interface controls by way of the steak-and-cocktails lifestyle of the characters on the TV series Mad Men.

(In case you’re not familiar with Mad Men, it’s a dramatic TV series set in the early 1960s whos emain characters are advertising executives working at an agency in New York. It was the age of three-martini steak lunches, which serves as the inspiration for the example application in this article.)

Introducing Beef ‘N’ Booze

The application that we’ll build is called Beef ‘N’ Booze. It has no real function other than to demonstrate the use of some of the controls that come with Windows Mobile 6, and do so in a more entertaining way that you’d normally find in a book.

Here’s what the app will look like on startup:

beef_screen_1

The app has a single form and that form is filled completely with a tab control with two tab pages: Beef and Booze. The Beef page lets you choose the “doneness” of your steak as well as a selection of side dishes. Once you’ve made your choices, you click the Place Order button to see a message box containing a summary of your order:

beef_screen_2

Clicking on the Booze tab takes you to the Booze page, where you can place an order from a selection of cocoktails. You can also specify the number of cocktails you want to order and how strong you want the bartender to make them:

booze_screen_1

When you’ve made your drink choices, you click on the Place Order button to see a message box summarizing your drink order:

booze_screen_2

That’s the app in a nutshell. Remember that the idea behind Beef ‘N’ Booze isn’t to make something useful; it’s to demonstrate Windows Mobile’s built-in user controls and give you a chance to explore them. With that knowledge and a little practice, you can eventually build apps that actually do something.

TabControl and TabPages

One of the tricks to compensate for the limited screen “real estate” on a mobile device is to break up an application into pages. The simplest “out of the box” way to do this with Windows Mobile is to use a TabControl, which is a container that holds one or more TabPage controls. Each TabPage is itself a container that can hold other controls.

In Beef ‘N’ Booze, I created a TabControl named tabMain, which holds two TabPages:

  • tpgBeef, whose Text property is set to Beef. It will contain the controls for placing and order for a steak and side dishes.
  • tpgBooze, whose Text property is set to Booze. It will contain the controls for ordering cocktails.

tabcontrol_tabpages

One convenient thing about using TabControls is that the tabbed pages work inside Visual Studio’s form editor. To view and edit a given TabPage, you click on its tab; it becomes the topmost page and you can add, move and remove controls from it.

Buttons

The Beef page has a single button, btnBeef, that when clicked, causes a message box to display the user’s order for steak and side dishes. The Booze page has a similar button, btnBooze, except that it causes a message box to display the user’s cocktail order.

buttons

We’ll draw btnBeef on the tpgBeef page and btnBooze on the tpgBooze page. The next step is to create event handlers for both buttons. The easiest way to do this is to select each button and then use the Events view in the Properties window, and double-clicking on the Click event for each button. Here’s a screenshot of me doing that for btnBeef – Visual Studio responds by auto-magically creating a handler named btnBeef_Click:

btnBeef

Creating event handlers for btnBeef and btnBooze creates these empty methods in the code for the form:

private void btnBeef_Click(object sender, EventArgs e)
{
}

private void btnBooze_Click(object sender, EventArgs e)
{
}

While I do like the “magic” provided by Visual Studio, I also feel that you should know what’s going on behind the scenes. How are the btnBeef_Click() and btnBoozeClick() methods attached to the btnBeef and btnBooze controls? It’s taken care of in the Designer code for the form, in which the layout and events for controls on the form is defined. Here’s the chunk of code that concerns with btnBeef’s properties and events:

this.btnBeef.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
this.btnBeef.Location = new System.Drawing.Point(165, 181);
this.btnBeef.Name = "btnBeef";
this.btnBeef.Size = new System.Drawing.Size(111, 28);
this.btnBeef.TabIndex = 8;
this.btnBeef.Text = "Place Order";
this.btnBeef.Click += new System.EventHandler(this.btnBeef_Click);

When I added a Click event to btnBeef through the Properties window, Visual Studio generated the name btnBeef_Click for the event handler, added a blank btnBeef_Click() method to the form’s code and connected the event to the handler in the form’s Designer code with this line:

this.btnBeef.Click += new System.EventHandler(this.btnBeef_Click);

When the user clicks btnBeef, we want to call a method named OrderBeef(), which will collect the data from the controls on tpgBeef, format it into something human-readable and then display the results in a message box. When the user clicks btnBooze, we want to call a method name OrderBooze(), which will do something similar, but for the user’s cocktail order. Here’s what the resulting event handler code should look like:

private void btnBeef_Click(object sender, EventArgs e)
{
    OrderBeef();
}

private void btnBooze_Click(object sender, EventArgs e)
{
    OrderBooze();
}

We’ll define OrderBeef() and OrderBooze() over the next couple of sections, as we explore the controls.

Radio Buttons

Radio buttons are controls you use when:

  • You want the user to choose one (and only one) item from a selection of items
  • You want the user to be able to see the complete selection of items immediately

The name “radio buttons” comes from the radio buttons from older radios, such as those in older cars, which let you choose from a number of pre-set radio stations. Selecting one button would change the tuning to the corresponding radio station and de-select the currently selected button:

car_radio_buttons

Radio buttons are grouped together by putting them inside the same container control, such as a panel, or in the case of this particular application, a TabPage. Selecting a radio button de-selects all the other radio buttons occupying the same container control.

The diagram below shows the radio buttons on tpgBeef and the names I assigned to them:

radio_buttons

Here’s my first iteration of OrderBeef(), which shows you how to determine which radio button is selected by checking each one’s Checked property. Once that’s done, it displays the resulting choice in a message box:

private void OrderBeef()
{
    StringBuilder order = new StringBuilder("Steak: ");

    if (rdoRare.Checked)
    {
        order.AppendLine("Rare");
    }
    else if (rdoMediumRare.Checked)
    {
        order.AppendLine("Medium Rare");
    }
    else if (rdoMedium.Checked)
    {
        order.AppendLine("Medium");
    }
    else if (rdoMediumWell.Checked)
    {
        order.AppendLine("Medium Well");
    }
    else if (rdoWellDone.Checked)
    {
        order.AppendLine("Well Done");
    }
    else
    {
        order.AppendLine("Chef's choice");
    }

    MessageBox.Show(order.ToString());
}

Checkboxes

Checkboxes are useful when:

  • You want the user to select zero, one or more items
  • You want the user to be able to see the complete selection of items immediately

The diagram below shows the checkboxes on tpgBeef and the names I assigned to them:

checkboxes

Here’s my second iteration of OrderBeef(), which adds some code to check to see which side dishes the user ordered. As with radio buttons, we’re using the Checked properties, but for the checkboxes:

private void OrderBeef()
{
    StringBuilder order = new StringBuilder("Steak: ");
    int numSides = 0;

    if (rdoRare.Checked)
    {
        order.AppendLine("Rare");
    }
    else if (rdoMediumRare.Checked)
    {
        order.AppendLine("Medium Rare");
    }
    else if (rdoMedium.Checked)
    {
        order.AppendLine("Medium");
    }
    else if (rdoMediumWell.Checked)
    {
        order.AppendLine("Medium Well");
    }
    else if (rdoWellDone.Checked)
    {
        order.AppendLine("Well Done");
    }
    else
    {
        order.AppendLine("Chef's choice");
    }

    order.AppendLine("Sides:");

    if (chkCreamedSpinach.Checked)
    {
        order.AppendLine("Creamed Spinach");
        ++numSides;
    }

    if (chkFrites.Checked)
    {
        order.AppendLine("Frites");
        ++numSides;
    }

    if (chkMushrooms.Checked)
    {
        order.AppendLine("Mushrooms");
        ++numSides;
    }

    if (numSides == 0)
    {
        order.AppendLine("None");
    }

    MessageBox.Show(order.ToString());
}

Comboboxes

comboboxes

For the Booze page, I thought I’d use a different way to let the user select one item from a selection of many: a Combobox with its DropDownStyle property set to DropDownList and containing a number of cocktail names. The method below does the following:

  • Sets the Combobox’s DropDownStyle property to DropDownList, which means that the user cannot just type in any value into the list’s text portion, but can only select from items in the list.
  • Adds a number of cocktail names to the list.
  • Sets the list so that the first item is selected.

public void InitializeCocktailControls()
{
    cboCocktail.DropDownStyle = ComboBoxStyle.DropDownList;
    cboCocktail.Items.Add("Bloody Caesar");
    cboCocktail.Items.Add("Bloody Mary");
    cboCocktail.Items.Add("Martini");
    cboCocktail.Items.Add("Rye and Ginger");
    cboCocktail.Items.Add("Vodka Tonic");
    cboCocktail.SelectedIndex = 0;
}

If I wanted to, I could’ve set the DropDownStyle and the collection of items in the ComboBox in the Properties window.

I placed a call to InitializeCocktailControls() inside the form’s constructor:

public frmMain()
{
    InitializeComponent();
    InitializeCocktailControls();
}

And here’s my first iteration of OrderBooze(), which displays a message box showing which cocktail the user ordered. It makes use of the ComboBox’s SelectedItem property:

private void OrderBooze()
{
    StringBuilder order = new StringBuilder("Cocktail: " +
                            cboCocktail.SelectedItem.ToString() +
                            "\n");

    MessageBox.Show(order.ToString());
}

Numeric Up/Downs

Numeric Up/Downs are useful when:

  • You want to restrict user input to numeric values only
  • You want to restrict those numeric values to a specific range

numeric_updowns

Here's the second iteration of InitializeCocktailControls(), which adds code to initialize the numeric up/down nudCocktail in the following ways:

  • Restricting the possible values to the range of 1 through 10
  • Setting the up/down increment to 1 – if the user clicks the “up” button, the value contained within goes up by 1, if the user clicks the “down” button, the value contained within goes down by 1.
  • Setting the initial value to 1

public void InitializeCocktailControls()
{
    cboCocktail.DropDownStyle = ComboBoxStyle.DropDownList;
    cboCocktail.Items.Add("Bloody Caesar");
    cboCocktail.Items.Add("Bloody Mary");
    cboCocktail.Items.Add("Martini");
    cboCocktail.Items.Add("Rye and Ginger");
    cboCocktail.Items.Add("Vodka Tonic");
    cboCocktail.SelectedIndex = 0;

    nudCocktail.Minimum = 1;
    nudCocktail.Maximum = 10;
    nudCocktail.Increment = 1;
    nudCocktail.Value = 1;
}

Here's the OrderBooze() method, featuring an additional line of code to display the number of drinks the user ordered. The value contained within nudCocktail is taken from its Value property:

private void OrderBooze()
{
    StringBuilder order = new StringBuilder("Cocktail: " +
                            cboCocktail.SelectedItem.ToString() +
                            "\n");
    order.AppendLine("Quantity: " + nudCocktail.Value.ToString());

    MessageBox.Show(order.ToString());
}

Trackbars

Another way to get numeric value input from the user is to use a Trackbar control. While Trackbars don’t display their corresponding numeric values like Numeric Up/Downs, they have a couple of advantages:

  • They’re larger and more “finger-friendly” than Numeric Up/Downs
  • They give the user a visual cue of where the current value is in relation to the minimum and maximum values

trackbars

In the screenshot above, you can see that I’ve augmented the Trackbar with by putting a couple of label controls just below it: Lame, Decent, and Hardcore.

Here’s another iteration of InitializeCocktailControls(), with code to initialize the Trackbar with the following properties:

  • The leftmost position on the Trackbar corresponds to the value 0
  • The rightmost position on the Trackbar corresponds to the value 10
  • The smallest step you can make in either direction, up or down, is 1
  • Large steps, which you get by clicking to the right or left of the current slider position, change the value in steps of 5
  • The initial value of the Trackbar is 5

public void InitializeCocktailControls()
{
    cboCocktail.DropDownStyle = ComboBoxStyle.d;
    cboCocktail.Items.Add("Bloody Caesar");
    cboCocktail.Items.Add("Bloody Mary");
    cboCocktail.Items.Add("Martini");
    cboCocktail.Items.Add("Rye and Ginger");
    cboCocktail.Items.Add("Vodka Tonic");
    cboCocktail.SelectedIndex = 0;

    nudCocktail.Minimum = 1;
    nudCocktail.Maximum = 10;
    nudCocktail.Increment = 1;
    nudCocktail.Value = 1;

    tbrCocktail.Minimum = 0;
    tbrCocktail.Maximum = 10;
    tbrCocktail.SmallChange = 1;
    tbrCocktail.LargeChange = 5;
    tbrCocktail.Value = 5;
}

Here’s OrderBooze(), with an additional line to display the user’s preferred drink strength, which is derived from the Trackbar’s Value property:

private void OrderBooze()
{
    StringBuilder order = new StringBuilder("Cocktail: " +
                            cboCocktail.SelectedItem.ToString() +
                            "\n");
    order.AppendLine("Quantity: " + nudCocktail.Value.ToString());
    order.AppendLine("Strength: " + tbrCocktail.Value.ToString());

    MessageBox.Show(order.ToString());
}

Putting It All Together

Here’s the complete code behind the single form in Beef ‘N’ Booze:

using System;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;

namespace BeefNBooze
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
            InitializeCocktailControls();
        }

        public void InitializeCocktailControls()
        {
            cboCocktail.DropDownStyle = ComboBoxStyle.DropDownList;
            cboCocktail.Items.Add("Bloody Caesar");
            cboCocktail.Items.Add("Bloody Mary");
            cboCocktail.Items.Add("Martini");
            cboCocktail.Items.Add("Rye and Ginger");
            cboCocktail.Items.Add("Vodka Tonic");
            cboCocktail.SelectedIndex = 0;

            nudCocktail.Minimum = 1;
            nudCocktail.Maximum = 10;
            nudCocktail.Increment = 1;
            nudCocktail.Value = 1;

            tbrCocktail.Minimum = 0;
            tbrCocktail.Maximum = 10;
            tbrCocktail.SmallChange = 1;
            tbrCocktail.LargeChange = 5;
            tbrCocktail.Value = 5;
        }

        private void btnBeef_Click(object sender, EventArgs e)
        {
            OrderBeef();
        }

        private void btnBooze_Click(object sender, EventArgs e)
        {
            OrderBooze();
        }

        private void OrderBeef()
        {
            StringBuilder order = new StringBuilder("Steak: ");
            int numSides = 0;

            if (rdoRare.Checked)
            {
                order.AppendLine("Rare");
            }
            else if (rdoMediumRare.Checked)
            {
                order.AppendLine("Medium Rare");
            }
            else if (rdoMedium.Checked)
            {
                order.AppendLine("Medium");
            }
            else if (rdoMediumWell.Checked)
            {
                order.AppendLine("Medium Well");
            }
            else if (rdoWellDone.Checked)
            {
                order.AppendLine("Well Done");
            }
            else
            {
                order.AppendLine("Chef's choice");
            }

            order.AppendLine("Sides:");

            if (chkCreamedSpinach.Checked)
            {
                order.AppendLine("Creamed Spinach");
                ++numSides;
            }

            if (chkFrites.Checked)
            {
                order.AppendLine("Frites");
                ++numSides;
            }

            if (chkMushrooms.Checked)
            {
                order.AppendLine("Mushrooms");
                ++numSides;
            }

            if (numSides == 0)
            {
                order.AppendLine("None");
            }

            MessageBox.Show(order.ToString());
        }

        private void OrderBooze()
        {
            StringBuilder order = new StringBuilder("Cocktail: " +
                                    cboCocktail.SelectedItem.ToString() +
                                    "\n");
            order.AppendLine("Quantity: " + nudCocktail.Value.ToString());
            order.AppendLine("Strength: " + tbrCocktail.Value.ToString());

            MessageBox.Show(order.ToString());
        }

    }
}

Download, Go Forth and Noodle!

It’s one thing to read about Windows Mobile 6’s built-in user interface controls, but something else entirely to make use of them. If you’re feeling ambitious, start a new project and rebuild Beef ‘N’ Booze (or a similar app that lets you explore the controls) yourself. Or, if you’d like, download my project files by clicking the link below, play with the app, make changes and learn. No matter which route you take, the best way to learn to is fire up Visual Studio and get coding!

Download icon Download the Beef ‘N’ Booze project (Visual Studio 2008 SP1, 15K .zip file)

{ 3 comments }

Sara Diamond and Mark Relph onstage at the Mesh Conference 2009

This morning at the Mesh 2009 Conference, Microsoft’s Mark Relph (my boss’ boss) and OCAD President Sara Diamond announced a Microsoft/OCAD partnership. Microsoft will provide OCAD with a Surface tabletop computer along with software and support (which includes training and courses by Infusion Development, who know a lot about developing software for the Surface).

sara_mark_surface_02

We’re providing OCAD with a Surface development unit along with Visual Studio and other developer tools related to building software for it. The Surface will be put in OCAD’s Digital Media Research + Innovation Institute, whose first phase is currently under construction. It’ll be used as a tool within the school’s -disciplinary Digital Futures Initiative (DFI) program, whose goals include establishing a research and innovation laboratory for interactive design, art and digital media.

Sara Diamond, Mark Relph and the Mesh 2009 audience

Mark Relph writes:

Microsoft Surface will help OCAD students, faculty and researchers to apply interactive technology to their work in digital media, art and design.  In conjunction with our partner Infusion Development, we will be directly engaged with teaching students how to harness the power of these new technologies.  This is only the start – in the years ahead we’ll be bringing in our technology and design experts to OCAD to help further strengthen this relationship. Our focus will not just be on the Surface technologies – as we move into a world where the interaction with software will depend on new user experiences like touch, speech and other capabilities it is critical that we prepare the next generation of software designers and experience experts.

sara_mark_surface_01

As programmers, engineers and techies, we at Microsoft can come up with all sorts of interesting uses and applications for Surface, but we can’t come up with all of them. We feel that the students at OCAD, who have a strong bent towards design, will come up with some interesting ideas and applications that would never occur to us whose bent is towards geekery. Having worked at a job where OCAD graduates were the majority, I can say from experience that there’s a certain “something” that you get from design-oriented minds that you don’t get from engineering-oriented minds. You can see that “something” in Apple’s products, and it’s something I’d like to see more of from The Empire.

{ 0 comments }