4D v16

ウィンドウとナビゲーション

ホーム

 
4D v16
ウィンドウとナビゲーション

ウィンドウとナビゲーション    


 

 

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

簡単にメッセージを表示するためにALERTコマンドを使用することができます。

しかしメッセージに情報を追加して、随時更新する必要が出てくるかもしれません。

ALERTコマンドに代わる、カスタマイズされたフォームを作ることができます。

カスタムフォームを使用すれば以下のような機能を持たせることができます:

  • 複数ページ
  • タブによる切り替え
  • ボタン
  • 配列
  • その他必要なものすべて

ヘルプ部門に以下の情報を含むメールを自動で送信するようプログラムすることもできます:

  • ユーザー
  • マシン
  • 日付
  • 時刻
  • エラーメッセージ
  • その他
またはこれらの情報をログとして記録し、後から参照することもできます。

またフォームを使用して以下の設定を行うことも可能です:

  • 特定のボタンを状況に応じて表示/非表示にする
  • オンラインヘルプを表示するためのURLリンクを追加する
  • 表示言語を選択する
  • など

In this video, we're going to learn how to use the automatic sizing properties of objects and to understand the possible interaction between programming and interface management.

After touching up the interventions form and the table a little by adding descriptive text, comments, the % completed, an ID, and so on, we now want to include a button for sending e-mails in the detail form of the Interventions table.

This e-mail will be sent to the technician in charge of the intervention.

To do this, we need to add this button and the e-mail input interface.

We have created a MAIL project form as well as a DETAIL_FUNCTIONS method that we will call to Cancel or Validate a dialog.
From the start, we plan to use this form in other circumstances.

So all the form areas will be variables that we can fill with the contents of the fields from one table or another.

Let’s make the areas auto-adjustable:

  • by setting the horizontal sizing to "Grow"
  • and by setting the vertical sizing to "Grow", only for the Content

We now need to indicate the type for these variables.

Place these lines of code in the form method:

 $evt:=Form event
 Case of
    :($evt=On Load//Initialization of variables used in the e-mail
       C_TEXT(vSender;vRecipient;vCC;vBCC;vSubject;vContent)
 End case

This lets us initialize the variables we're going to use.

We check that the On Load event of the form is the only one checked.

The button for sending an e-mail which we'll program later come from the picture library; it's the "Mail" button that is found in the PNG files provided with the example database.
The dialog box is ready. We can create, at the bottom of the Intervention DETAIL form, the button to call this dialog box.
The method associated with this button is as follows:

  //set a value for the variable to make input easier les variables pour faciliter la saisie
 vSender:="prof@4d.fr"
 vRecipient:=[Technicians]e-mail
 vCC:=""
 vBCC:=""
 vSubject:="Intervention for the "+String([Interventions]Date_Intervention)+" at "+String([Interventions]Time_Intervention)
 vContent:=[Interventions]Subject+(Char(13)*2)+[Interventions]Description
 
  //create the window (container) on which we display the dialog (content)
 $Window:=Open form window("MAIL";Plain window;Horizontally centered;Vertically centered)
  //display the dialog
 DIALOG("MAIL")
  //once the dialog is shut, close the window
 CLOSE WINDOW($Window)

  • We assign values to the variables with concatenations if necessary
  • Then we ask to create a container, in other words, a window
  • Where we will display the e-mail dialog box
  • And then we'll close the window.

Now let's see whether this dialog box works.

We see that the Technician button is in the middle of the comment since the comment is auto-adjustable but not the button.

So we're going to fix this by indicating in the button properties that it must move vertically when the form size is modified.

Let's check again: the button now moves according to the window size.

We're going to trace the method of this button:

  • Check that the variables have been assigned values
  • Create the container
  • And display the dialog box.

We find:

  • the intervention information.
  • the button for sending an e-mail that we'll program later on
  • and, if the window is reduced or enlarged, the objects are resized directly.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: ウィンドウとナビゲーション

 
履歴 

 
ARTICLE USAGE

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