4D v16

フォームとナビゲーションページ

ホーム

 
4D v16
フォームとナビゲーションページ

フォームとナビゲーションページ    


 

 

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

インターフェースの作成にはとても時間がかかります (開発プロジェクトによっては作業時間の70%を占めることもあります)。

そのため、すでに4Dが提供している自動的な動作を、開発者が再開発しなくても済むよう、どのような機能が提供されているのか知っておくことが重要です:

  • ウィンドウサイズ変更に伴うオブジェクトの振る舞い
  • オブジェクトのサイズ変更
  • クローズボックスの管理
  • など

In this video, we're going to learn how to create pages in the navigation form and program buttons to be able to access each of the pages.

We now have an aesthetically correct database.

We can delete two old buttons that are no longer useful.

In the previous video, we added "handling" buttons on page 0 at the top of the form (like Add, Select All, Query, etc.) that will work for each of the work lists. We also added function buttons that can be used to access records in each of the tables.

4D has several tools for navigating within forms, including tabs. In our example, we'll navigate by clicking function buttons on the left of the form.

We need to make the form functional by creating pages 2 through 5 and then positioning specific information on each page and making it possible to navigate between the different pages.

To create pages:

  • We open the "Navigation" project form
  • Then we can choose "Add Page" from the "Form" menu
  • Confirm the dialog
  • And repeat the process until we get 5 pages.

You can also use the right arrow to create additional pages.

To check the page changes, we'll add a different text or drawing on each page, at a different location, so that it's easy to notice each time the page changes.

Let's go back to page 1.

  • Here we're supposed to work on interventions
  • On page 2, on the list of technicians
  • On page 3, on locations
  • On page 4, preferences
  • And on page 5, parameters

Of course, we'll remove all this text later on.

Since the "Technicians" text was replaced, we now need to indicate for each button the right form page to display when the user clicks on it.

  • So let's go back to page 0
  • We'll open the method for the "Interventions" button by right-clicking on it and choosing "Object Method"
  • Then we enter the following:

 FORM GOTO PAGE(1)

We'll copy the text and do the same thing for each button, while changing the page number as needed.

  • page 2 for technicians
  • 3 for locations
  • 4 for preferences
  • and 5 for parameters.

You'll notice that we didn't use a right-click to create methods for each of the last 4 buttons.

Instead, we used the Alt+click shortcut directly on the object. This shortcut automatically creates an object method or opens the existing one.

Now we can test the form and its new navigation by clicking the green triangle at the top left of the form.

By default, page 1 is displayed. We can select another page by programming.

When we click on the other buttons, in principle, we'll change pages.
The form works properly and meets user expectations. Now we need to give them some data, which is covered in the next section.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: フォームとナビゲーションページ

 
履歴 

 
ARTICLE USAGE

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