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

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) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   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>
            激情综合自拍| 翔田千里一区二区| 欧美日本二区| 欧美精品日韩一区| 欧美人妖在线观看| 欧美精品激情在线| 国产伦精品一区二区三区四区免费| 欧美久久久久久蜜桃| 欧美性片在线观看| 国产偷久久久精品专区| 在线看日韩欧美| 日韩视频一区二区三区在线播放| 日韩天堂av| 久久精品在线播放| 亚洲国产毛片完整版| 日韩一级在线| 国产欧美91| 国产精品极品美女粉嫩高清在线| 欧美 日韩 国产精品免费观看| 亚洲午夜视频在线| 你懂的视频一区二区| 亚洲国产成人在线| 亚洲综合大片69999| 久久综合给合| 久久精品视频播放| 久久久久亚洲综合| 亚洲国产裸拍裸体视频在线观看乱了 | 国内精品久久久久久久影视麻豆 | 亚洲男人的天堂在线观看| 欧美主播一区二区三区| 亚洲高清视频一区二区| 国产精品99久久久久久宅男| 久久天天综合| 在线观看的日韩av| 久久免费高清| 久久另类ts人妖一区二区| 国产乱码精品一区二区三区av| 亚洲黄色天堂| 亚洲国产精品一区二区www在线| 欧美一区二区三区视频免费播放 | 亚洲欧美激情一区| 一区二区三区欧美成人| 欧美日韩情趣电影| 99国产精品久久久久久久久久| 蜜臀va亚洲va欧美va天堂 | 亚洲裸体俱乐部裸体舞表演av| 久久嫩草精品久久久精品一| 伊人精品成人久久综合软件| 久久精品视频免费| 久久综合中文色婷婷| 日韩午夜激情电影| 免费在线观看精品| 欧美gay视频| 榴莲视频成人在线观看| 欧美在线视频a| 国产精品国产三级国产专播精品人| 亚洲国产高潮在线观看| 亚洲夜晚福利在线观看| 久久综合给合久久狠狠色| 亚洲福利视频网站| 午夜久久资源| 欧美精品情趣视频| 亚洲国产精品一区二区久 | 99一区二区| 亚洲第一色中文字幕| 在线不卡中文字幕| 免费在线看一区| 久久亚洲精品一区二区| 1024成人| 亚洲电影第1页| 欧美精品一区二区三区高清aⅴ| 亚洲日本精品国产第一区| 亚洲国产99| 欧美日韩另类一区| 香蕉乱码成人久久天堂爱免费| 亚洲欧美国产高清va在线播| 国产欧美日本一区二区三区| 久久理论片午夜琪琪电影网| 久久久久久香蕉网| 亚洲人永久免费| 一区二区三区久久网| 国产精品一区二区久久精品| 久热精品视频在线观看| 欧美成人精品激情在线观看| 一本色道久久综合狠狠躁篇怎么玩 | 伊人久久综合97精品| 免费成人性网站| 欧美精品一区二区三区四区 | 欧美国产精品中文字幕| 欧美日韩高清在线播放| 欧美一区午夜视频在线观看| 久久婷婷国产麻豆91天堂| 日韩视频中文字幕| 亚洲欧美色婷婷| 亚洲国产视频a| 亚洲一区二区免费| 亚洲激情影视| 午夜亚洲精品| 一本大道久久a久久精品综合| 亚洲一区精品电影| 欧美刺激午夜性久久久久久久| 欧美国产精品专区| 午夜在线观看欧美| 免费欧美在线| 久久国产精品一区二区| 欧美电影免费观看高清完整版| 午夜精品久久| 欧美成人自拍| 久久亚洲国产精品日日av夜夜| 欧美激情一区在线观看| 久久免费观看视频| 国产精品国产馆在线真实露脸| 久久综合国产精品台湾中文娱乐网| 欧美巨乳在线| 欧美α欧美αv大片| 国产精品入口麻豆原神| 亚洲国产成人tv| 国产亚洲精品bv在线观看| 亚洲国产精品久久久久秋霞蜜臀 | 欧美日韩在线视频首页| 欧美成人首页| 国内精品久久久久久久影视蜜臀 | 久久本道综合色狠狠五月| 欧美日韩国产成人在线观看| 欧美成人一区二区三区| 国内精品视频在线观看| 亚洲无线视频| 亚洲在线一区| 国产精品av一区二区| 亚洲肉体裸体xxxx137| 亚洲国产欧美一区二区三区丁香婷| 午夜久久久久久久久久一区二区| 亚洲欧美日韩一区二区| 国产精品久久久久久久app| 99热精品在线| 亚洲欧美电影在线观看| 欧美四级剧情无删版影片| 亚洲精品专区| 亚洲午夜电影在线观看| 国产精品豆花视频| 亚洲专区免费| 久久久久久亚洲精品中文字幕 | 妖精视频成人观看www| 日韩亚洲欧美综合| 麻豆亚洲精品| 亚洲国产精品欧美一二99| 亚洲人成绝费网站色www| 你懂的网址国产 欧美| 欧美激情一区二区三区在线 | 久久精品一区二区国产| 国产一区二区久久精品| 久久福利毛片| 欧美高清在线视频| 一本色道久久综合狠狠躁篇的优点| 欧美精品在线观看一区二区| 亚洲欧洲午夜| 亚洲一区二区在线免费观看视频| 国产精品h在线观看| 麻豆精品传媒视频| 欧美成人国产va精品日本一级| 欧美电影免费观看网站| 99精品国产在热久久下载| 欧美日韩少妇| 午夜欧美不卡精品aaaaa| 麻豆国产精品777777在线| 亚洲人成在线播放| 国产精品r级在线| 久久xxxx精品视频| 欧美激情一区二区三区不卡| 亚洲一区二区成人在线观看| 国产裸体写真av一区二区| 美女久久网站| 亚洲一区二区三区免费观看| 另类av导航| 亚洲欧美久久久| 亚洲国产女人aaa毛片在线| 欧美日韩另类在线| 久久精品国产成人| 亚洲国产欧洲综合997久久| 性伦欧美刺激片在线观看| 亚洲国产高清在线观看视频| 欧美日韩在线亚洲一区蜜芽| 欧美中文字幕第一页| 亚洲精品在线观| 美国成人毛片| 性欧美xxxx视频在线观看| 亚洲级视频在线观看免费1级| 国产精品入口福利| 欧美日韩国产精品专区| 久久久久五月天| 亚洲一区三区视频在线观看| 欧美激情自拍| 久久综合伊人77777| 午夜国产精品视频| 夜夜嗨一区二区| 亚洲国产精品ⅴa在线观看| 国产欧美一区二区三区久久 | 国内伊人久久久久久网站视频| 欧美日韩系列| 欧美精品九九|