青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

An HP TouchSmart Application Development Guidelines Primer (Page 1 of 3)

LINK: http://www.touchsmartcommunity.com/article/95/An-HP-TouchSmart-Application-Development-Guidelines-Primer/

An introduction to building HP TouchSmart-hosted applications and a step-by-step tutorial for a “Hello World”

Building Your First TouchSmart Application
A developers guide to the TouchSmart Platform

Introduction

The Hewlett-Packard TouchSmart PC is an innovative new PC form-factor which affords users the unique ability to control interactions using only their hands. Through the use of a very stylish “10 foot” style user interface, the user can simply touch the integrated screen and perform most essential functions – viewing photos, listening to music, and surfing the web – all without using a keyboard or mouse.

The TouchSmart interface can be considered an entirely new user-interface platform – and now HP has opened up this platform to the entire developer community. With the release of the TouchSmart Application Developer Guidelines you can now build applications which run on this unique platform – and cater to its expanding user-base.

This article walks you through building your first TouchSmart application, with the goal of creating a basic application template which you can use for all your TouchSmart projects.

Getting Started

In order to follow the steps in this document, you will need to be familiar with Windows Presentation Foundation (WPF) and .NET development with C#. This article assumes a basic knowledge of these technologies. Please visit the Microsoft Developer Network (MSDN) at http://msdn.microsoft.com for more information.

In addition, the following is required:

  • TouchSmart PC (model IQ504 or IQ506, current at the time of this writing)
  • Latest TouchSmart software (available from http://support.hp.com)
  • Microsoft Visual Studio 2008, Express (free) or Professional Edition
  • HP TouchSmart Application Development Guidelines (available from here).
  • .NET Framework 3.5 (although the same techniques can be used to build an application using Visual Studio 2005 and .NET 3.0)

It is recommended you install Visual Studio 2008 on the TouchSmart PC for ease of development, however it is not required. Since the TouchSmart application we are building is simply a Windows Presentation Foundation application it will run on any Vista or Windows XP PC with .NET 3.5.

Important Background Information

Before getting started you should know some important background information about a typical TouchSmart application:

  • To best integrate with the TouchSmart look-and-feel you should develop your application using the Windows Presentation Foundation (WPF)
  • The application runs as a separate process with a window that has the frame removed, it is not running within the TouchSmart shell process.
  • The TouchSmart shell is responsible for launching your application. Additionally, the TouchSmart shell will control the position and sizing of your window.
  • You must create three separate UI layouts for your application. This is not as difficult as it sounds; only one layout is interactive with controls – the other two layouts are for display only.
  • Design your application for a “10 foot” viewing experience. Plan to increase font and control sizes if you are converting an existing application.
  • Do not use pop-up windows in your application. This is perhaps the most unique requirement in building a TouchSmart application. The Windows “MessageBox” and other pop-up windows are not supported and should not be used. The best model to follow is to build your application like it was going to run in a web browser.
  • Your application must support 64-bit Vista, as this is the operating system used on the TouchSmart PC.

Building the HelloTouchSmart Application

The rest of this article describes how to build a basic TouchSmart enabled application. Over the next few sections, you will build a basic TouchSmart application which you can use as a template for all your TouchSmart projects.

Start by launching Visual Studio 2008 and create a new project. If you have User Account Control (UAC) enabled make sure to launch Visual Studio with Administrator privileges.

  • On the File menu, select New Project
  • Select WPF Application
  • Name your project “HelloTouchSmart” and click OK
  • For Visual Studio 2008 Professional Users, select the path to save your project. Choose “C:\TouchSmart”
  • For Visual Studio 2008 Express users, you will be prompted to save when you close your project. Choose “C:\TouchSmart” as the path to save your project to.

1. After the project is created, double-click the Window1.xaml file to open it. You are now going to make some important changes to this file which make it a TouchSmart application:

  • Edit the Window definition to match the XAML below. The most important aspect of this is making your application appear without a Window frame (using the combination of ShowInTaskbar, WindowStyle, and ResizeMode attributes). Additionally, it is important to position your window off screen (using the Top and Left attributes), since the TouchSmart shell will move it into the correct position as needed.

    <Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Name="HelloTouchSmart"
        Top="{Binding Source={x:Static SystemParameters.VirtualScreenHeight}}"
        Left="{Binding Source={x:Static SystemParameters.VirtualScreenWidth}}"
        Background="Black"
        ShowInTaskbar="False"
        WindowStyle="None"
        ResizeMode="NoResize">
        
  • Now add some basic text to the window by inserting the following between the elements in the XAML file. Keep in mind text on a TouchSmart UI should be large (at least 18 point), and match the font family used by the TouchSmart shell.

    <TextBlock Text="My first TouchSmart App!" Foreground="White" FontFamily="Segoe UI" FontSize="24"/>
        

2. Select Build, then Build Solution to create the HelloTouchSmart application.

  • Depending on the edition of Visual Studio you are using, the “HelloTouchSmart.exe” will be created in either the bin\Debug (Visual Studio Professional) or bin\Release (Visual Studio Express) folders
  • It is important to know where the output file is located since we will be registering the application with the TouchSmart shell in the next step.

3. Create a new XML file which contains information to register the application with the TouchSmart shell

  • Select Project then Add New Item
  • Select XML File
  • Create a file called Register.xml

4. The registration XML file needs specific attributes including the full-path to your application. Replace the contents of the file you created in the previous step with the contents below. If you have created your project in a different path make sure you correct the AppPath element below.

<AppManagementSetting>
<UserEditable>true</UserEditable>
<RunAtStartup>true</RunAtStartup>
<RemoveFromTaskbar>false</RemoveFromTaskbar>   <AppPath>C:\TouchSmart\HelloTouchSmart\HelloTouchSmart\bin\Release\HelloTouchSmart.exe
</AppPath>
<AppParameters>chromeless</AppParameters>
<AllowAttach>true</AllowAttach>
<Section>Top</Section>
<Type>InfoView</Type>
<DisplayName>HelloTouchSmart</DisplayName>
<IsVisible>true</IsVisible>
<UserDeleted>false</UserDeleted>
<InDefaultSet>false</InDefaultSet>
<IconName />
</AppManagementSetting>

 

5. Save the XML file. Now it will need to be registered with the TouchSmart shell for your application to start appear in the TouchSmart shell.

  • Make sure the TouchSmart shell is completely closed (click Close from the TouchSmart shell main screen)
  • Start a command window with Admin rights (if UAC is enabled)
  • Change the working directory to C:\Program Files(x86)\Hewlett-Packard\TouchSmart\SmartCenter 2.0
  • Type the following command line to register your application RegisterSmartCenterApp.exe updateconfig “C:\TouchSmart\HelloTouchSmart\HelloTouchSmart\Register.xml”
  • You should receive a successful message upon installation. Note you only need to register your application once.

6. After finishing these steps you should be greeted with your first TouchSmart application. Congratulations!

 

Enhancing the HelloTouchSmart Application

Now that you have a basic idea of how to build a TouchSmart application, the next step is to enhance it take advantage of the three layouts in the TouchSmart shell.

Each TouchSmart application needs to support three different UI views: small, medium, and large. If the user drags an application from the bottom area to the top area, it should switch from a small layout to a medium layout. If the user then clicks on the application in the medium layout it should switch to a large layout.

The small layout typically is an image that represents your application. The artwork should be a high-quality image that blends into the TouchSmart shell as best as possible.

The medium layout typically represents a non-interactive status view of your application. If your application is designed to display content from the web, for instance, this could be recent information your application has downloaded (e.g. most recent photos).

Finally, the large view represents your application. This is where you should expose all functions and features you intend to provide to the user. In the steps below we will enhance our sample to display an icon in the small layout and two different layouts for the medium and large views.

1. Start by closing the TouchSmart shell completely (clicking the Close button in the lower right-hand corner). Currently you will also need to manually “end task” the “HelloTouchSmart.exe” from the Windows task manager, as it doesn’t get closed by the TouchSmart shell when you close it. If you don’t close the application Visual Studio will be unable to build your project.

2. Open the HelloTouchSmart project

  • Double-click on the Window1.xaml file to open it. First we are going to define the 3 UI layouts.
  • We will also need an image in the project. Copy your favorite image (here we copied img35.jpg from the \Windows\Web\Wallpaper folder which is present on every installation of Windows Vista) into the project folder.
  • Add the image to your project by selecting Project->Add Existing Item. Change the file filter to “Image Files” then select the image file from your project folder.

3. You can define your layout using any of the WPF container elements; however for this example we are going to use the DockPanel.

  • Remove the TextBlock we defined in the section above.
  • Define three new sections between the as follows:

    <DockPanel Name="SmallUI" Background="Black">
        <Image Stretch="UniformToFill" Source="img35.jpg"/>
        </DockPanel>
        <DockPanel Name="MediumUI" Background="Black">
        <TextBlock Text="Medium UI" Foreground="White" FontFamily="Segoe UI"
        FontSize="24"/>
        </DockPanel>
        <DockPanel Name="LargeUI" Background="Black">
        <TextBlock Text="Large UI" Foreground="White" FontFamily="Segoe UI"
        FontSize="96"/>
        </DockPanel>
        

4. Compile the application then launch the TouchSmart shell.

  • There may be cases where the TouchSmart shell won’t re-launch your application properly.
  • If your application doesn’t appear for any reason (or appears without a UI), click Personalize, find the HelloTouchSmart tile, de-activate it and click OK.
  • Click Personalize again, find the HelloTouchSmart tile, activate it and click OK.
  • The TouchSmart shell should now launch your application.

5. As you can see our application appears but is only showing the large view. Close the TouchSmart shell and switch back to Visual Studio – we’ll fix this issue now.

  • Remember to “end task” HelloTouchSmart.exe from the Windows task manager

6. We are now going to add some code to Window1.xaml.cs to handle the resizing and show the appropriate controls.

  • Double-click on the Window1.xaml.cs file to open it. We will add code to show and hide our three DockPanels based on the size of the UI.
  • The size ratios below were derived from the HP TouchSmart Application Development Guidelines.

    public Window1()
        {
        InitializeComponent();
        SizeChanged += new SizeChangedEventHandler(Window1_SizeChanged);
        }
        void Window1_SizeChanged(object sender, SizeChangedEventArgs e)
        {
        double ratio = Math.Max(this.ActualWidth, this.ActualHeight) /
        Math.Max(SystemParameters.PrimaryScreenWidth,
        SystemParameters.PrimaryScreenHeight);
        if (ratio >= 0.68295) //Large
        {
        SmallUI.Visibility = Visibility.Collapsed;
        MediumUI.Visibility = Visibility.Collapsed;
        LargeUI.Visibility = Visibility.Visible;
        }
        else if (ratio <= 0.18) //Small
        {
        SmallUI.Visibility = Visibility.Visible;
        MediumUI.Visibility = Visibility.Collapsed;
        LargeUI.Visibility = Visibility.Collapsed;
        }
        else //Medium
        {
        SmallUI.Visibility = Visibility.Collapsed;
        MediumUI.Visibility = Visibility.Visible;
        LargeUI.Visibility = Visibility.Collapsed;
        }
        }
        
  • Seasoned WPF developers might see a better way to hide/show the panels but for the sake of being clear and concise we are keeping this code fairly simple. Feel free to create your own mechanism that suits your particular need.
  • Since the TouchSmart shell simply resizes and positions your window according to its needs you can use any WPF standard event handling and perform necessary adjustments to your user interface.

7. One final change is to prevent the application from being accidentally launched by a user. Since the application’s window appears initially off-screen it is important we only allow the application to be started by the TouchSmart shell.

  • Change the Window1 constructor to the following:

    public Window1()
        {
        bool okToRun = false;
        foreach (string str in Environment.GetCommandLineArgs())
        {
        if (str.CompareTo("chromeless") == 0)
        {
        okToRun = true;
        }
        }
        if (!okToRun)
        {
        Application.Current.Shutdown();
        }
        else
        {
        InitializeComponent();
        SizeChanged += new SizeChangedEventHandler(Window1_SizeChanged);
        }
        }
        
  • The parameter being checked (chromeless) was actually provided in the registration XML file created in the first part of this article. The TouchSmart shell will pass this parameter to your application on launch.

8. Compile and run your application as done in step four. You should now see your application display three distinct user interfaces depending on its placement in the TouchSmart shell.

You might have noticed the application at this point does not have an icon in the shell. To fix this issue create a compressed “Windows Vista style”256x256 PNG icon and embed it in the application executable by selecting Project->Properties and select your icon from the Application tab. There are several 3rd party tools for creating this specialized type of icon available since the standard version of Visual Studio does not support compressed PNG icons.

Tips for Debugging

If you would like to debug your application with the Visual Studio debugger we recommend you attach to the running process by selecting Debug->Attach to Process. This only works for the Professional Edition of Visual Studio.

To debug with the Express edition, you must change your window style to run as a normal Windows application and remove the check for “chromeless” above.

Summary

You should now be familiar with how a basic TouchSmart application is put together and have a good starting point for your future projects. Some other important items not covered (but are outlined in the HP TouchSmart Application Development Guidelines) include application skinning and UI notifications. These advanced topics will be covered in a follow-up article, however for now please refer to the HP developer document for more detailed information.

 

posted on 2009-05-25 15:26 zmj 閱讀(1116) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美黄色免费| 国产精品成人观看视频免费| 亚洲经典在线看| 亚洲女女女同性video| 亚洲国产一成人久久精品| 在线观看国产日韩| 亚洲精品美女久久久久| 一本色道久久综合亚洲精品高清| 日韩视频精品| 亚洲伊人网站| 久久久久久久综合狠狠综合| 久久久久久欧美| 欧美寡妇偷汉性猛交| 亚洲人成久久| 午夜在线视频观看日韩17c| 久久国产精品99国产精| 欧美福利电影网| 国产麻豆日韩| 亚洲欧洲精品一区二区三区 | 国产精品激情电影| 精品51国产黑色丝袜高跟鞋| 日韩视频免费看| 欧美一区永久视频免费观看| 欧美不卡视频一区| 亚洲视频精选| 久久久亚洲综合| 国产精品久久久久久久久借妻 | 免费视频亚洲| 亚洲一区二区三区激情| 久久大逼视频| 欧美日韩一区在线观看| 狠狠色丁香久久婷婷综合丁香| av成人黄色| 欧美本精品男人aⅴ天堂| 在线中文字幕不卡| 老鸭窝91久久精品色噜噜导演| 国产精品美女久久| 亚洲开发第一视频在线播放| 久久久久久久综合色一本| 在线视频亚洲一区| 欧美成人伊人久久综合网| 国产美女诱惑一区二区| 在线亚洲免费| 亚洲国产日韩欧美综合久久| 久久精品成人欧美大片古装| 欧美日韩国产免费| 亚洲三级视频| 99riav久久精品riav| 欧美中文在线观看| 国产精品日韩欧美| 亚洲一区二区三区高清| 亚洲国产精品一区二区www在线| 亚洲欧美国内爽妇网| 欧美性猛交xxxx乱大交退制版| 日韩视频不卡| 亚洲卡通欧美制服中文| 女女同性精品视频| 亚洲激情六月丁香| 亚洲国产精品久久久| 欧美a一区二区| 在线观看日韩av先锋影音电影院| 久久精品国产77777蜜臀| 一本色道久久精品| 欧美视频成人| 亚洲欧美一区在线| 中文精品视频| 国产欧美日韩视频一区二区| 欧美一区二区三区免费视频| 亚洲一区综合| 国产一区二区三区网站| 久久久久一区| 久久精品国产免费观看| 在线看日韩av| 亚洲国产精品高清久久久| 欧美日韩国产色站一区二区三区| 中国av一区| 亚洲一区二区在线免费观看| 国产欧美一区二区白浆黑人| 久久久噜噜噜久久久| 久久综合亚州| 一区二区三区视频在线| 亚洲淫片在线视频| 樱花yy私人影院亚洲| 亚洲欧洲精品一区二区三区不卡 | 国内精品久久久久影院薰衣草| 卡一卡二国产精品| 欧美激情aaaa| 亚洲欧美中文另类| 久久久久亚洲综合| 在线视频你懂得一区二区三区| 亚洲综合第一| 黑人巨大精品欧美一区二区| 亚洲成人自拍视频| 欧美亚州一区二区三区| 久久偷看各类wc女厕嘘嘘偷窃| 免费亚洲视频| 欧美一级日韩一级| 免费成人你懂的| 午夜精品短视频| 蜜臀久久99精品久久久画质超高清| 99热精品在线| 久久精品国产2020观看福利| 99视频在线精品国自产拍免费观看| 在线一区免费观看| 亚洲精品美女在线观看| 欧美一二三视频| 美日韩精品视频| 夜夜夜精品看看| 影音先锋另类| 一区二区三区.www| 亚洲国产精品女人久久久| 亚洲婷婷综合久久一本伊一区| 黄色成人在线免费| 99综合在线| 91久久线看在观草草青青| 亚洲欧美日韩直播| 亚洲图色在线| 欧美激情五月| 欧美高清在线| 红桃视频一区| 欧美在线www| 香蕉久久国产| 欧美日韩一区在线播放| 亚洲国产第一页| 国内精品伊人久久久久av影院| 亚洲图片在区色| 亚洲无人区一区| 欧美精品在线免费| 亚洲国产精品va在线看黑人动漫| 国语自产偷拍精品视频偷| 亚洲在线视频免费观看| 亚洲亚洲精品三区日韩精品在线视频| 免费看的黄色欧美网站| 欧美黄色片免费观看| 在线精品一区| 欧美成人一区二区三区| 亚洲国产精品一区二区第四页av| 亚洲国产mv| 久久女同精品一区二区| 久久久人成影片一区二区三区 | 亚洲综合色噜噜狠狠| 欧美日韩在线综合| 日韩午夜av在线| 亚洲一区999| 国产精品久久久999| 亚洲一区二区三区在线观看视频| 99精品欧美一区二区蜜桃免费| 欧美日韩一二三区| 亚洲视频欧洲视频| 亚洲欧美日韩综合aⅴ视频| 欧美视频免费看| 亚洲午夜激情网站| 久久精品国产69国产精品亚洲| 精品成人国产| 欧美国产精品专区| 一本色道久久88亚洲综合88| 午夜性色一区二区三区免费视频| 国产欧美日韩在线视频| 午夜在线a亚洲v天堂网2018| 久久综合久久久| 亚洲精品婷婷| 国产精品高潮在线| 欧美中文字幕不卡| 亚洲激情第一区| 亚洲欧美视频一区| 在线成人中文字幕| 欧美三级乱人伦电影| 西西裸体人体做爰大胆久久久| 能在线观看的日韩av| 亚洲天堂成人在线视频| 国产精品一二三视频| 欧美jizzhd精品欧美巨大免费| 国产精品久久久久国产a级| 亚洲高清视频一区二区| 日韩一区二区高清| 国产精品一区二区你懂得| 美女精品视频一区| av成人免费在线| 美女日韩在线中文字幕| 亚洲免费一级电影| 亚洲国产二区| 国产日韩一区二区三区| 欧美精品入口| 久久青草久久| 亚洲欧美电影院| 亚洲日本一区二区| 快射av在线播放一区| 亚洲欧美日韩另类| 日韩午夜在线视频| 亚洲国产精品一区二区久| 国产欧美日韩视频一区二区三区 | 午夜精品福利视频| 亚洲精品乱码久久久久久久久| 国产亚洲精品7777| 国产精品成人aaaaa网站| 欧美激情第三页| 你懂的国产精品| 噜噜噜在线观看免费视频日韩| 性欧美大战久久久久久久免费观看| 亚洲精品美女在线观看播放|