KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Opening the Font picker through a button
PRODUCT: 4D | VERSION: 15 | PLATFORM: Mac & Win
Published On: September 23, 2015

The Font picker is a simple UI that allows users to choose the font they want for a selected text variable.
The 4D command OPEN FONT PICKER opens the font picker.



OPEN FONT PICKER takes in no parameters, and will only open the font picker if the focus is on a text variable. This means that the cursor must be over an enterable text variable, else the command does nothing. To use the command in a button, the following steps can be taken

  1. In the text variable, check the property "Allow Font/Font Picker" in the properties list.
  2. Uncheck the focusable property of the button.
  3. Set the focus to the text variable using GOTO OBJECT.
  4. Open the font picker using OPEN FONT PICKER.
The button may have the following code:
Case of
:(Form event=On Clicked)
  GOTO OBJECT(textVar)
  OPEN FONT PICKER
End case