Diol can save your theme preference in this browser using local storage.
EsWindow *EsWindowCreate(ES_INSTANCE_TYPE *instance, EsWindowStyle style);
Creates a window with the given style. instance may be ES_NULL for internal windows.
Returns the new window, or ES_NULL on failure. Must run on the message thread.
EsRectangle EsWindowGetBounds(EsWindow *window);
Returns the screen bounds of the window.
EsElement *EsWindowGetToolbar(EsWindow *window, bool createNew = false);
Returns the window's toolbar. With createNew true, always creates a new one.
Returns ES_NULL if creation fails. The toolbar belongs to the window.
void EsWindowSwitchToolbar(EsWindow *window, EsElement *toolbar, EsTransitionType transitionType);
Replaces the displayed toolbar with the given toolbar, using the given transition.
void EsWindowSetIcon(EsWindow *window, uint32_t iconID);
Sets the window's icon from the icon database. Must run on the message thread.
void EsWindowSetTitle(EsWindow *window, STRING title = BLANK_STRING);
Sets the window title. With an empty title, uses the instance's application name.
If both are empty, nothing changes. Must run on the message thread.
void EsWindowAddSizeAlternative(EsWindow *window, EsElement *small, EsElement *big, int widthThreshold, int heightThreshold);
Switch between elements when the window size goes below a threshold.
EsMenu *EsMenuCreate(EsElement *source, EsMenuFlags flags = ES_FLAGS_DEFAULT);
Creates a menu bound to the source element. Returns ES_NULL on failure.
EsElement *EsMenuGetSource(EsMenu *menu);
Returns the source element the menu was created from. The caller does not own it.
void EsMenuAddItem(EsMenu *menu, EsMenuItemFlags flags, STRING label = BLANK_STRING, EsMenuCallback callback = ES_NULL, EsGeneric context = ES_NULL);
Adds a menu item with the given label. The callback runs with the context when the item is activated.
void EsMenuAddCommand(EsMenu *menu, EsMenuItemFlags flags, STRING label, EsCommand *command);
Adds a menu item that activates the given command.
The item mirrors the command's enabled state, check state and callback.
void EsMenuAddSeparator(EsMenu *menu);
Adds a horizontal separator line to the menu.
void EsMenuNextColumn(EsMenu *menu, EsElementFlags flags = ES_FLAGS_DEFAULT);
Starts a new column in the menu. Later items are added to that column.
void EsMenuShow(EsMenu *menu, int fixedWidth = 0, int fixedHeight = 0);
Shows the menu near its source element, or at the cursor with ES_MENU_AT_CURSOR.
fixedWidth and fixedHeight force the menu size; with ES_MENU_MAXIMUM_HEIGHT, fixedHeight is a maximum.
void EsMenuClose(EsMenu *menu);
Closes the menu with an exit transition.
void EsMenuCloseAll();
Closes every open menu.
void EsMenuAddCommandsFromToolbar(EsMenu *menu, EsElement *element);
Adds a menu item for each toolbar button that has a command.
Recurses into child elements and skips non-client elements.
EsDialog *EsDialogShow(EsWindow *window, STRING title, STRING content, uint32_t iconID, EsDialogShowFlags flags = ES_FLAGS_DEFAULT);
Shows a modal dialog on the given window. Blocks interaction with the window content until it closes.
Returns the dialog, or ES_NULL on allocation failure. Only valid on normal windows.
EsButton *EsDialogAddButton(EsDialog *dialog, EsButtonFlags flags = ES_FLAGS_DEFAULT, EsStyleID style = 0, STRING label = BLANK_STRING, EsCommandCallback callback = ES_NULL);
Adds a button to the dialog. Returns the button, or ES_NULL on failure.
The callback runs when the button is activated. ES_BUTTON_CANCEL makes it the cancel button.
void EsDialogClose(EsDialog *dialog);
Closes the dialog with an exit transition and re-enables the content behind it.
EsElement *EsDialogGetContentArea(EsDialog *dialog);
Returns the dialog's content area element. Add custom content there. It belongs to the dialog.
void EsFileMenuAddToToolbar(EsElement *toolbar, const EsFileMenuSettings *settings = ES_NULL);
Adds a File button to the toolbar. The button opens the file menu for the instance.
settings is optional.
void EsFileMenuCreate(ES_INSTANCE_TYPE *instance, EsElement *parent, EsMenuFlags flags = ES_FLAGS_DEFAULT);
Creates and shows the file menu on the given parent element. Only for editor instances.