def build_form_widgets(self):
        """Build widgets to hold settings for edition."""
        ### create special list to hold widgets
        widgets = self.widgets = List2D()

        ### define an initial topleft relative to the
        ### topleft corner of the form 'rect'
        topleft = self.rect.move(5, 5).topleft

        ### instantiate a caption for the form

        caption_label = Object2D.from_surface(
            surface=(
                render_text(
                    text="Set and start session recording",
                    border_thickness=2,
                    border_color=(TEXT_SETTINGS["foreground_color"]),
                    **TEXT_SETTINGS,
                )
            ),
            coordinates_name="topleft",
            coordinates_value=topleft,
        )

        widgets.append(caption_label)

        ### update the topleft to a value a bit below
        ### the bottomleft corner of the widgets already
        ### in the versatile list
        topleft = widgets.rect.move(0, 20).bottomleft

        ### instantiate widgets for recording title

        ## label

        recording_title_label = Object2D.from_surface(
            surface=render_text(
                text="Recording session title:", **TEXT_SETTINGS
            ),
            coordinates_name="topleft",
            coordinates_value=topleft,
        )

        widgets.append(recording_title_label)

        ## entry

        topleft = recording_title_label.rect.move(0, 5).bottomleft

        self.recording_title_entry = StringEntry(
            loop_holder=self,
            value="Type title of recording here",
            width=500,
            name="recording_title",
            coordinates_name='topleft',
            coordinates_value=topleft,
        )

        widgets.append(self.recording_title_entry)


        ### update the topleft to a value a bit below
        ### the bottomleft corner of the widgets already
        ### in the versatile list
        topleft = widgets.rect.move(0, 20).bottomleft

        ### instantiate widgets for recording filepath

        ## filepath label

        new_file_label = Object2D.from_surface(
            surface=render_text(
                text="Path wherein to save recorded data:", **TEXT_SETTINGS
            ),
            coordinates_name="topleft",
            coordinates_value=topleft,
        )

        widgets.append(new_file_label)

        ## filepath change button

        topleft = new_file_label.rect.move(0, 5).bottomleft

        change_filepath_button = Button.from_text(
            text="Change path",
            command=self.change_recording_filepath,
            coordinates_name="topleft",
            coordinates_value=topleft,
            **BUTTON_SETTINGS,
        )

        draw_depth_finish(change_filepath_button.image)

        widgets.append(change_filepath_button)

        ## chosen filepath label

        midleft = change_filepath_button.rect.move(5, 0).midright

        initial_text = str(Path.home() / DEFAULT_RECORDING_FILENAME)

        self.recording_filepath_label = Label(
            text=initial_text,
            name="recording_path",
            max_width=485,
            ellipsis_at_end=False,
            coordinates_name="midleft",
            coordinates_value=midleft,
            **TEXT_SETTINGS,
        )

        widgets.append(self.recording_filepath_label)

        ### update the topleft to a value a bit below
        ### the bottomleft corner of the widgets already
        ### in the versatile list
        topleft = widgets.rect.move(0, 20).bottomleft

        ### instantiate widgets for filepath to load

        ## label

        load_file_label = Object2D.from_surface(
            render_text(
                f"Should load {NATIVE_FILE_EXTENSION} file?:",
                **TEXT_SETTINGS,
            ),
            coordinates_name="topleft",
            coordinates_value=topleft,
        )

        widgets.append(load_file_label)

        ## checkbutton

        midleft = load_file_label.rect.move(5, 0).midright

        self.load_file_checkbutton = CheckButton(
            value=False,
            name="set_file_to_load",
            command=self.toggle_extra_file_widgets,
            coordinates_name="midleft",
            coordinates_value=midleft,
        )

        widgets.append(self.load_file_checkbutton)

        ### instantiate and store extra widgets for filepath to load

        ## create a special list to hold the references
        self.file_to_load_widgets = file_to_load_widgets = List2D()

        ## "use current" button

        midleft = self.load_file_checkbutton.rect.move(10, 0).midright

        use_current_button = Button.from_text(
            text="Use currently loaded",
            command=self.set_loaded,
            coordinates_name="midleft",
            coordinates_value=midleft,
            **BUTTON_SETTINGS,
        )

        draw_depth_finish(use_current_button.image)

        file_to_load_widgets.append(use_current_button)

        ## filepath change button

        topleft = load_file_label.rect.move(0, 5).bottomleft

        change_filepath_to_load_button = Button.from_text(
            text="Change file to load",
            command=self.change_filepath_to_load,
            coordinates_name="topleft",
            coordinates_value=topleft,
            **BUTTON_SETTINGS,
        )

        draw_depth_finish(change_filepath_to_load_button.image)

        file_to_load_widgets.append(change_filepath_to_load_button)

        ## chosen filepath label

        midleft = change_filepath_to_load_button.rect.move(5, 0).midright

        initial_text = str(Path.home() / DEFAULT_FILENAME_TO_LOAD)

        self.filepath_to_load_label = Label(
            text=initial_text,
            name="path_to_load",
            max_width=445,
            ellipsis_at_end=False,
            coordinates_name="midleft",
            coordinates_value=midleft,
            **TEXT_SETTINGS,
        )

        file_to_load_widgets.append(self.filepath_to_load_label)


        ### update the topleft to a value a bit below
        ### the bottomleft corner of the "file to load widgets"
        topleft = file_to_load_widgets.rect.move(0, 20).bottomleft

        ### instantiate widgets for window size

        window_size_label = Object2D.from_surface(
            render_text("Window size:", **TEXT_SETTINGS),
            coordinates_name="topleft",
            coordinates_value=topleft,
        )

        widgets.append(window_size_label)

        ## extra label for displaying full window size

        midleft = window_size_label.rect.move(5, 0).midright

        self.window_size_label_full = Label(
            text="1280x720",
            name="full_window_size",
            max_width=None,
            ellipsis_at_end=False,
            coordinates_name="midleft",
            coordinates_value=midleft,
            **TEXT_SETTINGS,
        )

        widgets.append(self.window_size_label_full)

        ## option tray for window size

        midleft = self.window_size_label_full.rect.move(20, 0).midright

        value = next(key for key in TEXT_TO_WINDOW_SIZE if '1080p' in key)

        self.window_size_tray = OptionTray(
            value=value,
            options=tuple(TEXT_TO_WINDOW_SIZE.keys()),
            max_width=0,
            name="window_size",
            command=self.update_window_size,
            coordinates_name="midleft",
            coordinates_value=midleft,
        )

        widgets.append(self.window_size_tray)

        ### update the topleft to a value a bit below
        ### the bottomleft corner of the widgets already
        ### in the versatile list
        topleft = widgets.rect.move(0, 20).bottomleft

        ### create and store behaviour for exiting the form
        ### (equivalent to setting the 'running' flag to False)
        self.cancel = partial(setattr, self, "running", False)

        ### create, position and store form related buttons

        ## start button

        self.start_button = Button.from_text(
            text="Start recording session",
            command=self.trigger_recording,
            **BUTTON_SETTINGS,
        )

        draw_depth_finish(self.start_button.image)

        self.start_button.rect.bottomright = self.rect.move(-10, -10).bottomright

        ## cancel button

        self.cancel_button = Button.from_text(
            text="Cancel",
            command=self.cancel,
            **BUTTON_SETTINGS,
        )

        draw_depth_finish(self.cancel_button.image)

        self.cancel_button.rect.midright = self.start_button.rect.move(-5, 0).midleft

        ## store
        widgets.extend((self.cancel_button, self.start_button))
Build widgets to hold settings for edition.
nodezator/editing/playback/record.py