FileChooser(3I)

πŸŽ€ FileChooser(3I) πŸŽ€

okay so hi bestie, welcome to the InterViews Reference Manual πŸ’– today's main character is FileChooser, and she is literally the dialog box for choosing a file name. no cap. she's giving utility, she's giving pop-up, she's giving iconic. 🫢


🌸 NAME 🌸

FileChooser β€” a dialog box for choosing a file name. that's it, that's the whole girl. πŸ‘‘


✨ SYNOPSIS ✨

#include <InterViews/filechooser.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So FileChooser is a StringChooser, and what she does is provide a complete dialog box interface to selecting a file name. periodt. πŸ’…

and like, what's in the box? let me list it because the lineup is stacked:

  • two lines of descriptive text, serving as the title and subtitle
  • a StringEditor, for when you wanna enter the file name explicitly (yes, by hand, old school, love that for you)
  • a FileBrowser
  • two PushButtons β€” one for accepting and one for canceling. the duality of woman, honestly 😭

πŸ’… PUBLIC OPERATIONS πŸ’…

  • FileChooser(const char* title, const char* subtitle, const char* dir, int rows, int cols, const char* acceptLabel, Alignment)
  • FileChooser(const char* name, const char*, const char*, const char*, int, int, const char* accept, Alignment)

Construct a new FileChooser with the given title and subtitle, search directory dir, FileBrowser size specification rows and cols, label for the accept PushButton acceptLabel, and pop-up alignment. These constructors create all the elements of the dialog box and compose them into a default layout. she comes pre-assembled, bestie ✨

  • void SetTitle(const char*)
  • void SetSubtitle(const char*)

Change the text in the title or the subtitle. and the way that the new text will appear immediately in the dialog when either function is called?? obsessed. instant glow-up, no refresh needed. πŸ”₯

  • void SelectFile() β€” Highlight the text in the StringEditor. that's the whole thing, she just highlights it πŸ’«
  • void Update() β€” FileChooser's Update simply calls Update on the FileBrowser instance, so it rescans the current directory and updates its appearance. keeping it fresh, keeping it accurate 🌈

πŸŽ€ PROTECTED OPERATIONS πŸŽ€

okay so this is the "subclassing only" section. if you're not making a subclass, this is not your moment, iykyk πŸ™ˆ
  • FileChooser(ButtonState*, Alignment = Center) β€” Construct a new FileChooser with the given button state and pop-up alignment, and without creating FileBrowser, StringEditor, title, subtitle, or PushButton instances. This constructor should be called in subclasses requiring a specialized StringEditor or FileBrowser. you're building the pieces yourself, bestie, and honestly? respect. 🧚
  • FileChooser(ButtonState*, const char* dir, int rows, int cols, Alignment) β€” Construct a new FileChooser (along with its StringEditor and its FileBrowser) with the given button state, search directory, FileBrowser size specification, and pop-up alignment, without composing them into the default layout and without creating the title, subtitle, or PushButtons. This constructor should be used by FileChooser subclasses that define a specialized look and feel. custom layout, custom energy, main character behavior πŸ‘‘

🌈 SEE ALSO 🌈

  • Button(3I)
  • Dialog(3I)
  • FileBrowser(3I)
  • StringChooser(3I)
  • StringEditor(3I)

go read these too, they're all part of the friend group fr fr πŸ’œ


and that's the page!! πŸ“ this was InterViews, dated 30 November 1989 β€” yes she's vintage, yes she still slays, and yes you should absolutely screenshot this for later. bye bestie, go pick a file πŸ’–βœ¨πŸŽ€