4D v16

オブジェクトプロパティ

ホーム

 
4D v16
オブジェクトプロパティ

オブジェクトプロパティ    


 

 

このビデオ中で説明されている操作に加え、以下の点にも留意してください:

フォームも独自のプロパティやメソッドを持っています。

オブジェクトの動作を記述するために、オブジェクトメソッドとフォームメソッドいずれを使用することもできます。ではどちらを使用すべきなのでしょうか。

知っておくべきことは、必要になればコードが実行されるということです。なのでいずれのメソッドを使用しても、必要な仕事を行うことができます。最初のうちはすべての詳細についてあまり最適化のために時間をかけない方がよいでしょう。

しかし、イベントが発生したときにどのような順番でメソッドが実行されるかは覚えておくべきです:

  1. まずオブジェクトメソッドが実行されます (イベントに対応するオブジェクトのみ、レイヤーレベル順 (入力順) に)
  2. そのあとにフォームメソッドが実行されます。

(最適化とあと後のメンテナンスのしやすさのため)、使用しないイベントはオブジェクト/フォームともすべて選択を解除しておくことをお勧めします。そしてコードを実行する必要のあるイベントのみを選択するようにしてください。

コードを実行する際に、現在のイベントコンテキストをテストするようコードを構造化していたとしても、もし不必要なイベントが選択されていれば、そのようなイベントが発生するたびにメソッドがロードされ実行されてしまします。つまり不必要に何度も繰り返しメソッドが実行されてしまうのです。

Now we're going to learn how to manage object properties.

Each object has a certain number of properties. Some are specific to the object itself and other are shared for all objects in general.
When you select more than one object, only their shared properties appear:

  • the type
  • the name
  • the coordinates
  • resizing
  • and so on.

Changing any of these properties will affect all the selected objects.

When no particular object is selected, the form properties are displayed.

Properties are grouped by themes and can be displayed as a whole or theme by theme.

To open and close all the types, hold down the Ctrl key and click a type.

When the list of events is displayed, holding down Ctrl (or Command on Mac) when you click on a box in the list will select or deselect them all at once.

To get started right away:
When you create a form, let's take the Interventions Input form as an example, all the Field type objects, by default, have a certain number of events selected.

Since we know that we're not planning on programming these objects, we can start off by deselecting all of the events.

This simple operation is very useful when you are converting former databases (from earlier versions of 4D).

Now we're going to test a few object properties (for details about each object and their properties, refer to the 4D documentation).

Let's take an object where we set the vertical resizing property to "Grow" and duplicate it, with this one having only vertical movement and no horizontal movement.

Now let's execute the form. We see that both the objects move according to the constraints that were set:

  • No lateral movement for the small rectangle: vertical movement only.
  • And the bigger one grows larger.

As far as properties are concerned, we've also set certain properties on the navigation form. There we set up picture buttons where the picture changes whenever you move the mouse over it or click it.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: オブジェクトプロパティ

 
履歴 

 
ARTICLE USAGE

セルフトレーニング ( 4D v16)