Chapter 7 Programming a User Interface

第七章 ユーザー・インターフェースをプログラムする

The user interface for your application is often one of its most important features. In Chapter 4 we looked at how you build a user interface using Revolution’s tools and development environment. In this chapter we look at how you can edit, or even build a user interface programmatically. Everything you can do using the built in tools you can also do programmatically. You can even create and modify a user interface at run time in a standalone application, or provide interactive methods for your users to modify specific aspects of your application. This set of capabilities allow you to produce applications that construct their interface using XML files or a custom data structure, programmatically construct aspects of complex interfaces, modify their look using user specified parameters, create themed or skinned interface options, build our own interface editing tools that plug-in to Revolution’s IDE and much more. You can also create custom objects and attach your own virtual behaviors and custom properties to them. We recommend you spend a little time becoming familiar with building an interface using the tools in the development environment before creating or editing an interface programmatically.

アプリケーションのユーザー・インターフェースは、多くの場合アプリケーションの使い勝手を決定する重要な要素となります。第四章ではレヴォルーションの開発環境とツール群を使ってユーザー・インターフェースを作り上げる方法を紹介してきました。この章では、ユーザー・インターフェースの編集方法とプログラムによってユーザー・インターフェースを作る方法を扱っていきます。レヴォルーション開発環境に備え付けられたツール群を使ってできることは全てプログラムによって行うことが可能です。例えば、スタンドアローン・アプリケーションの実行中にユーザー・インターフェースを作成したり変更したり、或いはユーザーにアプリケーションの特定の機能を変更させるようなインターラクティブな方法の提供すら可能なのです。こうした一連の機能によって、XMLファイルやアプリケーション固有のデータ構造を使ったインターフェースを備えたアプリケーションを作り上げたり、複雑なインターフェースをプログラムによって作り上げたり、ユーザーの指定したパラメータを使って外見を変更したり、テーマやスキン等のオプションを追加したり、独自のインターフェースを持った編集ツールをレヴォルーションの開発環境用プラグインに仕立てたり、等々が可能となるのです。また同時に、独自のオブジェクトを作り上げ、それらに独自の仮想的な機能を付加し、独自のプロパティを付け加える等といったことまで可能です。インターフェースをプログラムにより作り上げたり編集したりする前に、ほんの少しの時間で良いので開発環境にあるツール群を使ったインターフェース作成に慣れていただくことをお薦めします。