Navigation

Search

Categories

On this page

Color Tab - Tab Stop for Smartphone

Archive

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 12
This Year: 0
This Month: 0
This Week: 0
Comments: 0

Sign In

 Thursday, November 01, 2007
Thursday, November 01, 2007 7:59:58 AM UTC ( )
Due to the limited nature of the Smartphone interface, here are some notes on how we have organised tab stops for the Smartphone interface.

Within the ColorTab control, it is the tab pages that hold focus. With this in mind, when a tab page has focus, the left and right keys are used to switch between tabs.

All but the Smartphone OS have some way of the user entering the tab page contents (either by mouse, or stylus), we have therefore made the enter key on the Smartphone the trigger for the first control within the currently selected tab page to gain focus. After the tab control pages loose control of focus, it is up to the developer to nagivate between existing controls within the tab pages and to give focus back to the tab control when the user is done.

If there are brighter ideas than this out there, we would be gratefull to hear them.

Here is the code used within the KeyUp event on the tab page for reference:

protected override void OnKeyUp(KeyEventArgs e)
{
  base.OnKeyUp(e);

  if (Parent.Equals(null))
   return;

  switch (e.KeyData)
  {
   case Keys.Right:
    ((ColorTab)Parent).SelectedIndex++;
    break;

   case Keys.Left:
    ((ColorTab)Parent).SelectedIndex--;
    break;
#if Smartphone
   // enter into the tab page
   // the developer is going to have to set focus from here on in
   // due to the limitations of the Smartphone
   case Keys.Enter:
    if (base.Controls.Count > 0 && base.Focused)
     SelectNextControl(this, true, true, true, true);

   break;
#endif
  }
}