4D v16

起動時にダイアログを表示

ホーム

 
4D v16
起動時にダイアログを表示

起動時にダイアログを表示    


 

 

Today, we're going to display this form automatically when the database starts up.

We'll create a first method using the Explorer. This will be a "Project Method".

  • Click on Methods
  • Then Project Methods
  • And then the "+" button
  • We'll call this method "Navigation"

We're going to create a container that will let us display this form, which will also be called "Navigation".

Then we'll request the display of the form itself.
Of course, we could just use copy-paste and most of the commands are available with the type-ahead mechanism.

When we close the navigation form, we'll also close the container at the same time. So if you hold down the CTRL key (or ALT on Mac) while dragging and dropping selected text, this lets you copy and paste this text elsewhere.

 $WindowNum:=Open form window("Navigation")

 DIALOG("Navigation")

 CLOSE WINDOW($WindowNum)

To check that this method works correctly, click on the Execute button at the top left of the method window. The form appears in a "custom-made" window. The buttons are still active.

Automatic display on start-up is nearly finished. Now we just have to "call" this method wen 4D is launched.
Close the method and then we'll look for the "On Startup" database method in the list of methods.

This method is run automatically when 4D starts up.
We'll call the navigation method that we just created in the "On Startup" method. That way it calls the navigation method that we just set up each time 4D is started.

To test this, choose "Close Database" in the "File" menu, then choose "Open Recent Databases" > "My First 4D Database" and we see that the navigation method is automatically called when our database starts.

When we close this dialog, we return to the dialog in the Design environment.

This first step is now complete. We have set up the automatic opening of our working window. Now we're going to continue improving the interface of our main form.

 
 

 
プロパティ 

プロダクト: 4D
テーマ: 起動時にダイアログを表示

 
履歴 

 
ARTICLE USAGE

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