User Tools

Site Tools


k12:k12.4:start

12.4.0 Dialogues

Gambas provides you with two dialogue classes from two different components with which you can call dialogue boxes and further use their return values in the program.

B1
Figure 12.4.0.1: Dialogue box 'Open file' (gb.qt4)

12.4.0.1 Dialogue (gb.qt4)

The class has these properties:

  • Color,
  • Filter,
  • Font,
  • Path,
  • Paths,
  • ShowHidden,
  • Title.

The Dialog class (gb.qt4) contains static methods for calling standard dialogue boxes from the QT4 toolkit:

  • OpenFile,
  • SaveFile,
  • SelectColor,
  • SelectDirectory,
  • SelectFont.

A 'default dialogue box' is always the dialogue box specified by the toolkit currently in use.

12.4.0.2 Dialog (gb.form.dialog)

The extended standard dialogues class contains methods for calling the gambas-specific dialogue boxes. This class is static. The class extends the Dialog class in gb.qt4.

The Dialog class has the following properties:

  • Colour,
  • Filter,
  • Font,
  • Path,
  • Paths,
  • ShowHidden,
  • Title,
  • AutoExt,
  • Date,
  • FixedOnly.

The class has these methods:

  • OpenFile,
  • SaveFile,
  • SelectColor,
  • SelectDirectory,
  • SelectFont,
  • SelectDate.

12.4.0.3 Note

As long as the specification of the following two dialogue properties from the Dialogue class (gb.form.dialog) is dispensable in your projects and you call the 'DateChooser' control directly instead of the 'SelectDate' method and and you want the appearance of the standard dialogues to be specified by the toolkit, then you can dispense with the use of the gb.form.dialog component:

  1. Property AutoExt As Boolean (Use default file extension?).
  2. Property FixedOnly As Boolean (Show only non-proportional fonts?).

The dialogues in gb.form.dialog are written in Gambas. Thus their appearance is independent of the toolkit used.

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k12/k12.4/start.txt · Last modified: 01.02.2022 (external edit)

Page Tools