4D v16

フォームの継承

ホーム

 
4D v16
フォームの継承

フォームの継承    


 

 

ビデオ中で説明した操作の他、以下の点にも留意してください:

  • 理論上、継承の階層数に制限はありません。あるフォームを継承するフォームが他のフォームから継承されるということも可能です。
  • 継承のフレームワークにおいて、継承元のフォームは複数のページを持つことができますが、継承先に表示されるのは0ページと1ページのみです。
特定のケースでは、継承されるフォームのオブジェクトを条件に応じて非表示にしたり、有効/無効を切り替えたりしたいケースがあります。
  • ボタンの場合、OBJECT SET ENABLEDコマンドを使用して有効/無効を切り替えることができます。
  • オブジェクトを非表示にするにはOBJECT SET VISIBLEコマンドを使用します。
  • OBJECT MOVEコマンドでオブジェクトを一時的に移動やサイズ変更することもできます。

In this video, well set up forms so that we can have a consistent interface, stored at a single place per form category.

We have already used page 0 in forms in order to centralize elements that are shared on every page of the same form.

Form inheritance consists of creating a form where we place objects that are shared between several forms (texts, buttons, etc.) that will inherit from this "parent" form.

In order, we need to:

  • create a "parent" form
  • place the objects on it
  • and indicate the "relationship" with the "child" forms that will inherit from it.

The parent form can be a project form or a form associated with a table.

Here we're gong to create this new form.

  • In the Explorer choose => "Project Forms"
  • Click on +
  • Call it HERIT_PAGE since we're going to create a form intended to be inherited on different pages.
    A blank form appears.
  • We add a button at the top left.
  • And Save the form.

Now that the parent exists, we can associate child forms with it:

  • Open the input form for interventions
  • and in the Property list of the form
  • we're going to choose "Inherited page" as the Inherited form.

We can see the contents of the parent form immediately appear in the background.

If we modify the location of the button on the parent form and save it (without closing it), we'll see the same modification carried out directly on the child form.
And of course it is also carried out on forms that are closed.

Since the goal is to keep the interface consistent, we're going to move the buttons of the child form to the parent form.

  • Cut
  • Paste
  • and Save

and the buttons appear again automatically in the child form.

Now, to apply this modification to other input forms, you just need to:

  • Open them (Technician => Input)
  • Remove the buttons already included in the form
  • Then set the Inherited Form Name to "HERIT_PAGE"

This means that now any changes made to the parent form, for instance if we move everything just a few pixels and then save it, will be automatically carried out on all the forms that inherit from this parent form.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: フォームの継承

 
履歴 

 
ARTICLE USAGE

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