BasicDialog(3U)
β¨ NAME β¨
AcknowledgeDialog, BasicDialog, ConfirmDialog, GridDialog, PrintDialog, UChooser β an assortment of useful dialog boxes
okay so bestie, this is BasicDialog(3U) from the InterViews Reference Manual and it's literally a whole girl squad of dialog boxes π
like not just one diva, a whole friend group, and they all live in <Unidraw/dialogs.h> and they're all here to make your app pop off. let's get into it π«Ά
πΈ SYNOPSIS πΈ
#include <Unidraw/dialogs.h>
π DESCRIPTION π
BasicDialog is the base class for subclasses that implement simple but common dialog boxes, and honestly? mother behavior. β¨
Here's the whole crew, one by one:
AcknowledgeDialogβ simply displays a one or two line message with aPushButtonfor dismissing the dialog. short, sweet, "okay noted, bye" energy πConfirmDialogβ displays one or two lines of descriptive text with three pushbuttons marked "Yes," "No," and "Cancel", and all of them dismiss the dialog. it also provides an interface for retrieving the button pushed, so you actually find out what they picked πGridDialogβ lets the user specify the resolution of a cartesian grid. math but make it cute πPrintDialogβ is aFileChooserfor specifying the name of a file or a printer.UChooserβ finally! extends theStringChooserprotocol to provide additional useful features, including support for alphabetizing itsStringBrowser's contents and for embellishing the dialog with descriptive text. it's giving organized AND aesthetic π
π BASICDIALOG PUBLIC OPERATIONS π
void SetTitle(const char*)void SetSubtitle(const char*)
BasicDialogs can display one or two lines of descriptive text. These functions change the text appearing in these lines. The change appears immediately if the dialog is visible. no refresh needed, it's that girl β
π¦ BASICDIALOG PROTECTED OPERATIONS π¦
BasicDialog(
ButtonState*, const char* title = "",
const char* subtitle = "", Alignment = Center
)
BasicDialog(
const char*, ButtonState*, const char* title = "",
const char* subtitle = "", Alignment = Center
)
Instantiate a BasicDialog, supplying an optional instance name, a button state, title and subtitle strings, and the dialog's alignment β which is used by its Popup operation. These operations will initialize two protected MarginFrame member variables, _title and _subtitle, which will contain either a Message instance with the specified string or a piece of glue if the string is null. These MarginFrames will be composed vertically at the top of the dialog, and no vertical space will be taken up by a null title or subtitle string. so if you pass nothing, you get zero wasted space β efficient queen π
virtual void Forward(Event&)boolean IsAChild(Interactor*)
These functions are useful for rejecting spurious events while the dialog is visible, effectively locking out the rest of the application. (main character energy: the dialog is the only thing that matters right now, sorry to everyone else π)
If Forward's event argument has x and y coordinates that fall within the dialog's canvas, then Forward calls Handle on the event's target. Otherwise the BasicDialog's Handle is called. IsAChild returns true if the given interactor is a child of the dialog.
π ACKNOWLEDGEDIALOG PUBLIC OPERATIONS π
AcknowledgeDialog(const char* title, const char* subtitle)β Construct anAcknowledgeDialoginstance with the given title and subtitle.virtual void Acknowledge()β Call this function when the application should wait for the user to acknowledge the dialog. It returns when the user has pressed and released the dialog's push button. This function does not pop up the dialog. (so like, it waits, but you gotta do the popping yourself, bestie π)
π CONFIRMDIALOG PUBLIC OPERATIONS π
ConfirmDialog(const char* title, const char* subtitle)β Construct aConfirmDialoginstance with the given title and subtitle.virtual char Confirm()β Call this function when the application should wait for the user to confirm the dialog. It returns'y','n', or'^G'('\007'), depending whether the "Yes," "No," or "Cancel" push button was pressed, respectively. This function does not pop up the dialog.
ngl that '^G' for Cancel is giving chaotic but it's literally in the spec so we respect it π
π GRIDDIALOG PUBLIC OPERATIONS π
GridDialog()β Construct aGridDialoginstance. TheGridDialogcontains aMatchEditorinstance for specifying the size of the grid's graduations in the x and y axes. The user can specify these values in pixels, points, centimeters, or inches by clicking on the appropriate radio button. pick your unit, slay β¨virtual void GetValues(float& xincr, float& yincr)β Return the user-specified values for the size of the grid's graduations, in pixel units.void SelectMessage()β Highlight the values in the dialog'sMatchEditor.
π¨οΈ PRINTDIALOG PUBLIC OPERATIONS π¨οΈ
PrintDialog(boolean to_printer = true)β Construct aPrintDialoginstance, optionally specifying whether the dialog should prompt for a printer name or a file name.void ToPrinter(boolean)boolean ToPrinter()
Specify and Return whether or not the string specified in the PrintDialog refers to a printer name. one getter, one setter, same name, iconic behavior fr fr π
π§ UCHOOSER PUBLIC OPERATIONS π§
UChooser(
const char* title, const char* subtitle,
const char* acceptLabel, const char* sample
)
Construct a UChooser instance. The title and subtitle parameters specify the descriptive text at the top of the dialog box. This constructor initializes two protected MarginFrame member variables _title and _subtitle that are analogous to the corresponding BasicDialog members described above. π
void Clear()β Removes all strings from theUChooser's string browser. clean slate, new era π¦void Include(const char*)void Exclude(const char*)
Include inserts a string into the string browser at a position defined by the UChooser's Position function, described below. Exclude removes the given string from the string browser. If the string browser contains more than one copy of the string, then Exclude removes the one with the smallest index.
void SetTitle(const char*)void SetSubtitle(const char*)
These functions change the text appearing in UChooser's title or subtitle. The change appears immediately if the dialog is visible. β¨
π UCHOOSER PROTECTED OPERATIONS π
UChooser(ButtonState*, int rows, int cols, Alignment)β Direct theUChooserto initialize itself with a string browser of the given size without initializing theMarginFramemembers. Subclasses that require a different look-and-feel can use this constructor to avoid creatingMarginFrames orMessages they don't need. TheInit,Interior, andAddScrollerfunctions (described below) factor out different parts of the default look and feel, allowing subclasses to use parts of it. modular, we love to see it πvoid Init(const char* title, const char* subtitle)β Explicitly initialize theMarginFramemembers to display the given title and/or subtitle strings.Interactor* Interior(const char* acceptLabel)β Return an interactor that composes theUChooser's default look and feel.Interactor* AddScroller(Interactor*)β Return a composition containing the given interactor with a vertical scroll bar and adjusters along its right side, initializing them to scroll the interactor. TheInteriorfunction uses this operation to provide the string browser's scrolling interface.virtual int Position(const char*)β Return an appropriate string browser index for the given string. By default, this function returns the index that will place the string in alphabetical order among those in the string browser. sorting is self-care, periodt π
π₯ SEE ALSO π₯
Button(3I), Dialog(3I), Event(3I), FileChooser(3I), Frame(3I), MatchEditor(3I), Message(3I), StringBrowser(3I), StringChooser(3I), StringEditor(3I)
and that's the whole page bestie!! this one came from Unidraw, dated 23 July 1990 β vintage but still serving looks π go forth and pop up some dialogs, you got this π«Άβ¨
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms