Go Full Screen For a Better View

By Jennifer Neighbors, Senior Consultant

1/6/2021

Have you checked out how your forms appear when viewed in “full screen” mode? Full screens are both wider and taller than usual – a welcome enhancement. Your users with small screens may especially appreciate Ninox’s full screen mode, but all users will like having the option. There are a couple of ways to do it. Let’s explore.

If you are going to open a screen for the user with the click of a button and you know the Id number of the table record you want to open, then you’ll want to use this bit of code in the button’s On Click function:

							
					let xID := number(Id);
openFullscreen(record(Events,xID))				
			

This code will open the Events table in form view and automatically go to full screen mode when it does. The specific record opened is the record with the matching Id number. Wonderful, right? Be cautious, however, because full screen mode hides the database menu. I like to make sure the user retains a sense of direction and control so I give them a way to close my form and go back to where they were or a way to exit full screen mode so they can see the database menu, or both.

							
					closeFullscreen()				
			

This function takes the form out of full screen mode, exposes the menu again, and returns the screen to the usual size. If you have any navigation buttons on your form, they can still be used while in full screen mode, but you MUST add this line to the top of the code block to take the form out of full screen mode first. Otherwise, the rest of the code will not execute.

What if you want to take the user to full screen mode for the form they are already viewing? In this situation, you will need to use this for your button’s On Click function:

							
					openFullscreen(this)				
			
Now you are indicating you want to take the current screen into full screen mode. You can then exit full screen mode in the usual manner.
I like to use two buttons in this way to enter and exit full screen mode on a form so that each button has its own name. That way the user knows what the button will do: either invoke or revoke full screen mode. When done right, the buttons will appear in exactly the same space so as to replace one another rather than sit next to each other. To do this, you will need a way to toggle the buttons, and their functions, on and off.
To toggle you will first need to create a hidden yes/no field. Create a new yes/no field and name it something like “Full Screen”, make it a checkbox, set the default value to “No” and set required to “Yes”. Save your work. Then toggle the new field back and forth a couple of times between “Yes” and “No”. Now, make your new field invisible by setting the Visible Only If function to “null” or “false” and save your new field again.

Next, open each of your buttons and paste the following code under the existing code:

							
					if 'Full Screen' then
    'Full Screen' := “No”
else
    'Full Screen' := “Yes"
end				
			

To make your buttons appear on top of one another at the proper times, in the Visible Only If function of your buttons, enter these commands:

In the button that invokes full screen mode, enter not ‘Full Screen’

In the button that revokes full screen mode, enter ‘Full Screen’

There you have it! Your two buttons should now toggle full screen mode on and off and appear in the exact same space on your form. If the two buttons are the same size and color, it will appear to the user as if only the name of the button changed.

An entirely different option is to have a single image, button or other formula toggle full screen mode on and off. This is a great alternative, but the downside is that the image, button or other formula will not change appearance as full screen mode is invoked and revoked. You will have to convey to the user that clicking once sends the form into full screen mode and clicking again reverts the form back to normal. To do this, select any field that has an On Click function and enter this code there:

							
					if 'Full Screen' then
    'Full Screen' := "No";
    closeFullscreen()
else
    'Full Screen' := "Yes";
    openFullscreen(this)
end				
			

Having the option of including full screen mode in your user interface design is something you’ll be glad to have in your set of skills, especially when users’ screens are various sizes and you’ve crowded a lot of fields into the available space. A recent client of mine says it’s “awesome” and I think it’s pretty awesome as well.

en_USEN