Files

66 lines
32 KiB
Python

DATA = {}
def D(name, desc, notes, setup, callback):
DATA[name] = (desc, notes, setup, callback)
D('GtkAboutDialog', 'An about box for an application. It draws a title bar reading About followed by the program name, then the program name and version, copyright, comments, license and website lines, and author and artist lists under Written by and Artwork by headings, with Back, Credits and Close buttons.', 'The Credits button toggles a credits view. The response constants defined here are RESPONSE_NONE, RESPONSE_DELETE_EVENT, RESPONSE_CANCEL and RESPONSE_CLOSE; there is no RESPONSE_OK in this header.', ['widget.set_program_name("DemoApp");', 'widget.set_version("1.0");'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkAppChooserDialog', 'A dialog for picking an application to open a file with. It shows the heading Select an application to open followed by the content type, one row per added application with its description, a Show other applications checkbox, and Cancel and Select buttons.', 'The application list holds only what add_application() adds; it does not scan installed applications. get_selected_app() returns the name of the highlighted row.', ['widget.set_content_type("text/plain");', 'widget.add_application("TextEdit", "Plain text editor");'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkApplicationWindow', 'A top level application window with a title bar, minimise, maximise and close buttons, an optional menu bar row and a status bar. The title bar can be dragged to move the window, and maximise grows it to fill the host window.', 'on_menu(std::string) fires with the name of the clicked menu. content_x(), content_y(), content_width() and content_height() give the client area below the title bar and above the status bar.', ['widget.add_menu("File");', 'widget.set_status_text("Ready");'], 'widget.on_menu = [](std::string m) { std::printf("menu %s\\n", m.c_str()); };')
D('GtkAspectFrame', 'A frame that keeps a fixed width to height ratio. It draws a rounded outline and a label showing the ratio as a number followed by : 1.', 'set_ratio() sets the frame ratio; set_child_ratio() and set_obey_child() control the ratio of the child area; set_alignment() takes horizontal and vertical alignment from 0.0 to 1.0. child_rect() returns the inner rectangle via out parameters.', ['widget.set_ratio(1.5);', 'widget.set_alignment(0.5, 0.5);'], '')
D('GtkAssistant', 'A multi page setup wizard. It draws a header bar with the title and a Step N of M indicator, a sidebar listing the page titles, the current page content, and Back, Next, Apply and Close buttons.', 'Pages carry a type (PAGE_CONTENT, PAGE_INTRO, PAGE_CONFIRM, PAGE_SUMMARY, PAGE_PROGRESS). set_page_complete() gates the Next button. next_page() and previous_page() move without a click.', ['widget.append_page("Welcome", "Welcome to the setup.", GtkAssistant::PAGE_INTRO);', 'widget.append_page("Done", "Setup complete.", GtkAssistant::PAGE_SUMMARY);'], 'widget.on_page_changed = [](int p) { std::printf("page %d\\n", p); };')
D('GtkBox', 'A linear container that lays out a row or column of child slots with spacing between them. Each slot is drawn as a labelled sample box reading Child N.', 'The children are drawn sample slots, not real widgets; set_sample_count() controls how many are drawn and get_selected_slot() reports the clicked slot. set_orientation() takes ORIENTATION_HORIZONTAL (0) or ORIENTATION_VERTICAL (1). child_rect(i, count) returns the slot rectangle as a Rect.', ['widget.set_orientation(GtkBox::ORIENTATION_VERTICAL);', 'widget.set_spacing(8);', 'widget.set_sample_count(3);'], '')
D('GtkButtonBox', 'A box holding a row of labelled buttons at a uniform size, laid out with a layout style and spacing.', 'set_labels() replaces the whole button list. on_button_clicked(int) fires with the index of the clicked button. The layout style is a plain int; its values are unclear from the header.', ['widget.set_labels({"OK", "Cancel", "Help"});', 'widget.set_spacing(6);'], 'widget.on_button_clicked = [](int i) { std::printf("button %d\\n", i); };')
D('GtkCenterBox', 'A three zone box that draws Start, Center and End areas side by side, each as a labelled zone.', 'draw_zone() and zone_contains() are public helpers that draw and hit test one zone given a Rect, a label, a tint and an active flag; they are used by draw() and can be called directly. The meaning of the baseline position int is unclear from the header.', ['widget.set_baseline_position(0);'], '')
D('GtkColorChooserDialog', 'A colour picker dialog. It draws a 32 by 20 palette grid, the current colour with R, G and B values and a hex readout, and Cancel and OK buttons.', 'set_color() takes an Srgb value; get_hex() returns the colour as a #RRGGBB string. on_color_changed() fires when the picked colour changes.', ['widget.set_color(Srgb{200, 60, 60});'], 'widget.on_color_changed = [] { std::printf("colour changed\\n"); };')
D('GtkDialog', 'A generic dialog shell: a title bar, a wrapped message area, and a row of buttons. Buttons are added with add_button() and each carries a response id.', 'run() only sets the running and visible flags; it does not block, the host event loop still drives the dialog. respond() records the response, clears the running flag and fires on_response(int). content_x() and friends give the area inside the frame.', ['widget.set_message("Hello from GtkDialog.");', 'widget.add_button("OK", GtkDialog::RESPONSE_OK);', 'widget.add_button("Cancel", GtkDialog::RESPONSE_CANCEL);', 'widget.run();'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkExpander', 'A collapsible section: a header row with a triangle and a label, and a body area that is shown only while the expander is expanded.', 'toggle() flips the state; on_toggled(bool) fires with the new state. body_rect() returns the body rectangle via out parameters.', ['widget.set_label("Details");', 'widget.set_expanded(true);'], 'widget.on_toggled = [](bool e) { std::printf("expanded %d\\n", (int)e); };')
D('GtkFileChooserDialog', 'A file picker dialog with a places sidebar, a file list with Name and Size columns, an Up button and a filename field, plus Cancel and Open style buttons.', 'The places sidebar lists four hard coded locations under /home/user (Home, Documents, Downloads, Pictures). set_action() takes ACTION_OPEN, ACTION_SAVE, ACTION_SELECT_FOLDER or ACTION_CREATE_FOLDER. get_selected_name() returns the clicked entry.', ['widget.set_action(GtkFileChooserDialog::ACTION_OPEN);', 'widget.set_current_folder("/tmp");'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkFixed', 'A fixed position container: children are named rectangles placed at absolute x and y coordinates with a width and height.', 'The children are named rectangles, not real widgets. put() adds or moves a child, move() repositions one, remove() deletes one, find_child() returns its index and get_selected_name() returns the clicked child.', ['widget.put("Child A", 20, 30, 120, 40);', 'widget.put("Child B", 180, 30, 120, 40);'], '')
D('GtkFlowBox', 'A flowing grid of labelled items that wraps onto the next row when the row is full. Clicking an item selects it.', 'set_min_child_size() and set_spacing() (column, row) control the layout; columns() and rows() report the computed grid. on_child_activated(int) fires with the index of the activated item.', ['widget.add_item("One");', 'widget.add_item("Two");', 'widget.add_item("Three");', 'widget.set_spacing(6, 6);'], 'widget.on_child_activated = [](int i) { std::printf("activated %d\\n", i); };')
D('GtkFontChooserDialog', 'A font picker dialog with a Search field, Font, Style and Size lists, a preview line and Cancel and OK buttons.', 'The family list is a hard coded set of 11 families (Cantarell, DejaVu Sans, DejaVu Sans Mono, DejaVu Serif, Liberation Mono, Liberation Sans, Liberation Serif, Noto Sans, Noto Serif, Ubuntu, Ubuntu Mono), not a scan of installed fonts. get_font_name() returns the family plus style and size as one string.', ['widget.set_font_name("DejaVu Sans");', 'widget.set_preview_text("AaBbYyZz 123");'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkFrame', 'A bordered frame with a label embedded in the top edge. The label position along the edge is set with set_label_xalign().', 'content_rect() returns the rectangle inside the frame via out parameters.', ['widget.set_label("Options");', 'widget.set_label_xalign(0.0);'], '')
D('GtkGrid', 'A grid container that draws a fixed 3 by 3 sample of labelled cells with column and row spacing. Arrow keys move the selected cell.', 'The grid is a fixed 3 by 3 sample (sample_columns_ and sample_rows_ are 3); there is no API to add real children or change the cell count. cell_rect(col, row, 3, 3) returns one cell rectangle as a Rect.', ['widget.set_column_spacing(8);', 'widget.set_row_spacing(8);'], '')
D('GtkLayout', 'A canvas container with a virtual size larger than the visible area. It draws the visible portion, an Offset x, y of W x H readout and its own scrollbars.', 'scroll_to() and scroll_by() move the view; get_hadjust() and get_vadjust() report the offsets. draw_scrollbars() is public. visible_rect() returns the visible rectangle as a Rect.', ['widget.set_virtual_size(1200, 900);', 'widget.scroll_to(100, 50);'], '')
D('GtkMessageDialog', 'A message box with a coloured icon glyph, a wrapped message line, optional secondary text and a row of buttons.', 'set_message_type() takes MESSAGE_INFO (0), MESSAGE_WARNING (1), MESSAGE_QUESTION (2) or MESSAGE_ERROR (3); set_buttons_type() takes BUTTONS_NONE (0), BUTTONS_OK (1), BUTTONS_CLOSE (2), BUTTONS_CANCEL (3), BUTTONS_YES_NO (4) or BUTTONS_OK_CANCEL (5). The icon is drawn, not an image.', ['widget.set_message_text("File saved.");', 'widget.set_message_type(GtkMessageDialog::MESSAGE_INFO);', 'widget.set_buttons_type(GtkMessageDialog::BUTTONS_OK);'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkNotebook', 'A tabbed notebook: a tab strip across the top and a page area below it showing the current page.', 'append_page() and remove_page() manage pages by label; set_current_page() selects one and on_page_changed(int) fires with the new index. With no pages it draws (no pages). tab_rect(index) and page_rect() return Rect values.', ['widget.append_page("First");', 'widget.append_page("Second");', 'widget.set_current_page(1);'], 'widget.on_page_changed = [](int p) { std::printf("page %d\\n", p); };')
D('GtkOverlay', 'A container with a main area and overlay children pinned to it by horizontal and vertical alignment.', 'add_overlay() has an overload that also takes an explicit width and height. Alignment values are plain ints; their exact meaning is unclear from the header (clamp_align() clamps them). on_overlay_click(std::string) fires with the name of the clicked overlay. main_rect() and overlay_rect(i) return Rect values.', ['widget.add_overlay("Badge", 2, 0);', 'widget.add_overlay("Tag", 0, 2);'], 'widget.on_overlay_click = [](std::string n) { std::printf("overlay %s\\n", n.c_str()); };')
D('GtkPaned', 'A split pane with First and Second panes divided by a draggable handle with grip dots.', 'set_position() sets the divider position in pixels. set_orientation() takes 0 for horizontal (panes side by side) or 1 for vertical (panes stacked); is_horizontal() reports the same. on_position_changed(int) fires while dragging; near_handle() hit tests the handle.', ['widget.set_position(300);', 'widget.set_orientation(0);'], 'widget.on_position_changed = [](int p) { std::printf("position %d\\n", p); };')
D('GtkPrintUnixDialog', 'A print dialog with a printer list, copies field, collate checkbox, page range controls and a landscape toggle.', 'Printers appear only if added with add_printer(); there is no printer discovery. set_pages_mode() takes PAGES_ALL (0), PAGES_CURRENT (1) or PAGES_RANGES (2); the range text is used only in ranges mode.', ['widget.add_printer("OfficeJet", "Ready");', 'widget.set_copies(2);'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkRevealer', 'A container that hides its child until revealed, animating the reveal. While hidden it draws Hidden - click to reveal; once revealed it shows the child label.', 'The animation is manual: set_reveal_child() sets the target and step() advances the progress by 0.2 per call until it reaches 0.0 or 1.0; is_animating() reports whether it is still moving and get_progress() returns the current progress. on_reveal_changed(bool) fires when the reveal state changes. The transition type is a plain int; its values are unclear from the header.', ['widget.set_child_label("Hidden content");', 'widget.set_reveal_child(true);'], 'widget.on_reveal_changed = [](bool r) { std::printf("revealed %d\\n", (int)r); };')
D('GtkScrollbar', 'A scrollbar with a track and a thumb, drawn vertically or horizontally.', 'set_range(upper, page) sets the range and page size together; the value, upper and page size are doubles. set_orientation_vertical(true) makes it vertical. on_value_changed() fires when the value changes; scroll_by(delta) moves it.', ['widget.set_range(100.0, 20.0);', 'widget.set_value(10.0);'], 'widget.on_value_changed = [] { std::printf("value changed\\n"); };')
D('GtkScrolledWindow', 'A scrollable viewport onto content larger than the window. It draws the visible part of the content, a content W x H @ x,y readout and scrollbars.', 'Policies are plain ints: 0 hides the bar, 2 always shows it, 1 (the default) is automatic. set_content_size() sets the virtual content size; set_hscroll() and set_vscroll() set the offsets. viewport_rect() returns the visible rectangle via out parameters.', ['widget.set_content_size(1200, 900);', 'widget.set_hscroll(100);'], '')
D('GtkSeparator', 'A single straight divider line, horizontal or vertical.', 'set_orientation() takes 0 for horizontal or 1 for vertical, the same convention as GtkBox. It has no other widget specific API.', ['widget.set_orientation(1);'], '')
D('GtkShortcutsWindow', 'A reference window listing keyboard shortcuts grouped into sections. Each shortcut row draws its keys as key caps followed by a description.', 'Sections and shortcuts are added with add_section() and add_shortcut(); there is no search or filtering. scroll_by() scrolls by a number of lines.', ['widget.add_section("General");', 'widget.add_shortcut("General", "Ctrl+S", "Save the file");'], 'widget.on_response = [](int r) { std::printf("response %d\\n", r); };')
D('GtkStack', 'A stack of named pages that shows one page at a time, labelled page N of M.', 'add_named() adds a page by name; set_visible_child_name() switches pages and on_visible_child_changed(std::string) fires with the new name. cycle(delta) steps forward or back through the pages. The transition type is a plain int and the duration is in milliseconds (default 250); the transition type values are unclear from the header.', ['widget.add_named("Home");', 'widget.add_named("Settings");', 'widget.set_visible_child_name("Settings");'], 'widget.on_visible_child_changed = [](std::string n) { std::printf("page %s\\n", n.c_str()); };')
D('GtkStackSidebar', 'A sidebar list of page names; clicking a row selects that page and highlights it.', 'set_page_names() replaces the list. set_row_height() controls the row height. index_at() hit tests a point. on_page_selected(int) fires with the selected index. row_rect(index) returns a row rectangle as a Rect.', ['widget.set_page_names({"Home", "Settings", "About"});', 'widget.set_selected_index(1);'], 'widget.on_page_selected = [](int i) { std::printf("selected %d\\n", i); };')
D('GtkStackSwitcher', 'A row of toggle style buttons, one per page name, for switching the visible page of a stack.', 'Like GtkStackSidebar but with a horizontal button row instead of a list. on_page_selected(int) fires with the selected index. button_rect(index) returns a button rectangle as a Rect.', ['widget.set_page_names({"Home", "Settings"});', 'widget.set_selected_index(0);'], 'widget.on_page_selected = [](int i) { std::printf("selected %d\\n", i); };')
D('GtkViewport', 'A viewport onto larger content, showing an offset x, y readout for the current scroll position.', 'set_hadjust() and set_vadjust() set the horizontal and vertical offsets in pixels. content_rect() returns the content rectangle via out parameters.', ['widget.set_hadjust(40);', 'widget.set_vadjust(20);'], '')
D('GtkWindow', 'A plain top level window with a title bar, minimise, maximise and close buttons and a client area. The title bar can be dragged to move it.', 'Pressing F4 while the window has focus closes it. maximise() fills the host window and remembers the old bounds for unmaximize(). set_decorated(false) hides the title bar; the window is then moved only by set_bounds().', ['widget.set_title("Demo Window");'], 'widget.on_close = [] { std::printf("closed\\n"); };')
D('TCalculatorDialog', 'A calculator keypad dialog with a display line, digit and operator keys, a Clear key and an equals key.', 'The keypad works with the mouse and the keyboard: digits and operators come through on_key(), Return or = evaluates, Escape clears and BackSpace deletes the last digit. get_display() returns the display text and get_value() the numeric value. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_value(42.0);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TCalendarDialog', 'A month calendar picker with a month and year title, previous and next month steppers, a weekday header, a day grid, a Selected date line and OK and Cancel buttons.', 'set_date() takes year, month and day as integers. get_date() returns the selected date as YYYY-MM-DD. Clicking a day selects it; the steppers move by one month. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_date(2026, 11, 26);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TColorDialog', 'A colour picker dialog with a Basic colors swatch grid, a Custom colors row, Red, Green and Blue fields, a hex readout and OK and Cancel buttons.', 'There are 16 custom colour slots, initially white. set_color() and get_color() use Srgb values; the hex readout is formatted #RRGGBB. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_color(Srgb{0, 128, 255});'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TControlBar', 'A dockable bar of horizontal bands, each with a grip and a caption, that can be dragged to reorder.', 'add_band(caption, width) appends a band. band_rect() and draw_band() are public helpers for hit testing and drawing one band. on_band_move() fires when a band is dragged; get_dragging_band() reports the band being dragged.', ['widget.add_band("Tools", 160);', 'widget.add_band("View", 120);'], 'widget.on_band_move = [] { std::printf("band moved\\n"); };')
D('TCoolBar', 'A cool bar: a row of bands with grips that can be dragged to reorder, like a toolbar dock.', 'add_band(caption, height) appends a band. on_reorder() fires after a drag reorder. get_drag_band() reports the band being dragged.', ['widget.add_band("Standard", 28);', 'widget.add_band("Formatting", 28);'], 'widget.on_reorder = [] { std::printf("reordered\\n"); };')
D('TFindDialog', 'A modeless find box with a Find what edit, Match case and Whole words only checkboxes, Up and Down direction radios, Find Next and Close buttons and a Searches run counter.', 'match_case(), whole_words() and search_up() are readers only; there are no setters, so the state changes only by clicking the controls. on_find() fires when Find Next is pressed; on_click() is the generic click signal. Result codes are private constants in the header (mrNone 0, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_find_text("hello");'], 'widget.on_find = [] { std::printf("find\\n"); };')
D('TFlowPanel', 'A flow layout panel that arranges numbered Tile N tiles left to right, wrapping onto the next row.', 'set_control_count() sets how many tiles are drawn and set_tile_size() their size; set_spacing() takes horizontal and vertical spacing. set_flow_style() takes a TFlowStyle value (fsLeftRightTopBottom, fsRightLeftTopBottom, fsLeftRightBottomTop, fsRightLeftBottomTop, fsTopBottomLeftRight and further values in the header). get_tile_rect() returns a tile rectangle via out parameters.', ['widget.set_control_count(6);', 'widget.set_tile_size(90, 60);', 'widget.set_flow_style(fsLeftRightTopBottom);'], '')
D('TFontDialog', 'A font picker dialog with Font, Style and Size lists, Strikeout and Underline checkboxes, a preview line reading AaBbYyZz 123 and OK and Cancel buttons.', 'This dialog exposes getters only (get_font_name(), get_style_name(), get_size(), get_strikeout(), get_underline()); there are no setters, so the font is chosen by clicking in the lists. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', [], 'widget.on_click = [&] { std::printf("font %s\\n", widget.get_font_name().c_str()); };')
D('TForm', 'A Lazarus style form window: a title bar with close, minimise and maximise buttons and a client area below it.', 'client_x(), client_y(), client_width() and client_height() give the area below the title bar. get_closed() reports whether the form was closed; set_closed() sets that flag directly.', ['widget.set_title_height(28);'], 'widget.on_close = [] { std::printf("closed\\n"); };')
D('TFrame', 'A bordered frame with an optional caption and a configurable border width.', 'set_show_caption() toggles the caption text (the common set_text()). client_rect() returns the inner rectangle as a Rect; contains_client() hit tests it.', ['widget.set_border_width(2);', 'widget.set_show_caption(true);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TGroupBox', 'A group box: a rounded outline with a caption that breaks the top edge, used to group related controls.', 'set_caption() sets the caption. client_left(), client_top(), client_right(), client_bottom(), client_width() and client_height() (and client_rect()) give the area inside the border; in_client() hit tests it.', ['widget.set_caption("Settings");'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TNotebook', 'A notebook with a tab strip and a page area, labelled Page N of M.', 'add_page() and delete_page() manage pages by name; set_page_index() selects one and on_change_page() fires. get_page_name(index) returns a page name.', ['widget.add_page("General");', 'widget.add_page("Advanced");', 'widget.set_page_index(1);'], 'widget.on_change_page = [] { std::printf("page changed\\n"); };')
D('TOpenDialog', 'A file open dialog with a Look in directory field and steppers, a file list, a File name edit, a Files of type filter and Open and Cancel buttons.', 'set_directory(), set_filter() and set_filename() preset the dialog. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_directory("/tmp");', 'widget.set_filter("*.txt");', 'widget.set_filename("notes.txt");'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TOpenPictureDialog', 'A picture open dialog like TOpenDialog, with an added preview area that draws a picture glyph for the selected file.', 'This dialog exposes getters only; there is no set_directory() or set_filter() setter. The preview is a drawn glyph, not a loaded image. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', [], 'widget.on_click = [&] { std::printf("file %s\\n", widget.get_filename().c_str()); };')
D('TPageControl', 'A tabbed page control with a tab strip on top, a page area below and optional close buttons on the tabs.', 'add_page() and remove_page() manage pages by caption; set_active_page() selects one and on_change() fires. set_show_close_buttons() toggles the per tab close buttons. page_bounds() returns the page area via out parameters.', ['widget.add_page("Editor");', 'widget.add_page("Preview");', 'widget.set_active_page(0);', 'widget.set_show_close_buttons(true);'], 'widget.on_change = [] { std::printf("page changed\\n"); };')
D('TPageSetupDialog', 'A page setup dialog with paper size and orientation radios, margin fields and a paper preview with draggable blue margin guides.', 'Margins are in millimetres; set_margins() takes left, top, right and bottom. get_paper_size() and get_orientation() return the chosen paper size and orientation as strings. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_margins(20, 20, 20, 20);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TPairSplitter', 'A splitter with two panes divided by a draggable divider, each pane showing a caption.', 'set_position() sets the divider position in pixels and set_vertical() chooses the divider direction. set_pane_text(side, text) sets a pane caption: side 0 is the common text, side 1 is text2, so set_text2() is the same as set_pane_text(1, ...). side_rect() and draw_pane() are public helpers. on_moved() fires after a drag.', ['widget.set_position(300);', 'widget.set_pane_text(0, "Left");', 'widget.set_pane_text(1, "Right");'], 'widget.on_moved = [] { std::printf("moved\\n"); };')
D('TPanel', 'A bevelled panel with a caption. The outer and inner bevels and the bevel width are configurable, and the caption alignment is settable.', 'Bevel values are the nested BevelKind enum: TPanel::bvNone (0), TPanel::bvLowered (1), TPanel::bvRaised (2). Alignment values are the nested AlignmentKind enum: TPanel::taLeftJustify (0), TPanel::taCenter (1), TPanel::taRightJustify (2). client_rect() returns the inner rectangle as x, y, width and height via out parameters.', ['widget.set_bevel_outer(TPanel::bvRaised);', 'widget.set_bevel_inner(TPanel::bvLowered);', 'widget.set_alignment(TPanel::taCenter);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TPrintDialog', 'A print dialog with a printer name, a copies stepper, a Status: Ready line, page range radios (All, Pages, Selection) with from and to fields, and Print and Cancel buttons.', 'get_range_mode() reports which range radio is selected; get_page_from() and get_page_to() give the range. Only set_copies() has a setter; the printer name is read only. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_copies(3);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TPrinterSetupDialog', 'A printer setup dialog with a printer list, paper size, a Properties button, orientation radios, a duplex checkbox and a quality line (Normal, 600 dpi).', 'All properties are getters; there are no setters. get_properties_open() reports whether the properties pane is showing. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', [], 'widget.on_click = [&] { std::printf("printer %s\\n", widget.get_printer().c_str()); };')
D('TReplaceDialog', 'A find and replace dialog with Find what and Replace with edits, match case and whole words checkboxes, Up and Down radios, Find Next, Replace, Replace All and Close buttons and Find / Replaced counters.', 'Three separate signals fire: on_find_next(), on_replace() and on_replace_all(). Like TFindDialog, match_case(), whole_words() and search_up() are readers only. Result codes are private constants in the header (mrNone 0, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_find_text("foo");', 'widget.set_replace_text("bar");'], 'widget.on_replace = [] { std::printf("replace\\n"); };')
D('TSaveDialog', 'A save dialog like TOpenDialog, with Save in, File name and Save as type fields and Save and Cancel buttons, plus an overwrite confirmation prompt.', 'When the filename already exists the dialog shows an overwrite prompt (already exists. Overwrite it?) with Yes and No buttons. get_overwrite_confirmed() reports the answer and get_confirm_showing() reports whether the prompt is showing. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2, mrYes 6, mrNo 7), so get_result() values must be compared against the raw numbers.', ['widget.set_directory("/tmp");', 'widget.set_filename("output.txt");'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TSavePictureDialog', 'A picture save dialog like TSaveDialog, with an added preview area that draws a picture glyph.', 'Unlike TOpenPictureDialog, this one has set_filename(). The filter is read only (get_filter() only). Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_filename("picture.png");'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TScrollBar', 'A Windows style scrollbar with arrow buttons at both ends and a draggable thumb.', 'set_kind() takes 0 for vertical or 1 for horizontal (from draw(); there are no named constants). set_range(lo, hi) sets the limits; set_small_change() and set_large_change() set the arrow and page step sizes. on_change() fires when the position changes; is_dragging() reports an in progress thumb drag.', ['widget.set_range(0, 100);', 'widget.set_position(25);', 'widget.set_page_size(10);'], 'widget.on_change = [] { std::printf("changed\\n"); };')
D('TScrollBox', 'A scrollable box showing sample content (Box A, Box B, Box C) larger than the viewport, with scrollbars.', 'set_content_size() sets the virtual size and scroll_to() the offsets; get_scroll_x() and get_scroll_y() report them. horz_visible() and vert_visible() report whether each scrollbar is showing. set_auto_scroll() toggles automatic scrolling.', ['widget.set_content_size(1000, 800);', 'widget.scroll_to(50, 50);'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TSelectDirectoryDialog', 'A directory picker showing a folder tree with expand triangles, plus Select and Cancel buttons.', 'set_directory() presets the selected folder; get_directory() returns the chosen path. Result codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2), so get_result() values must be compared against the raw numbers.', ['widget.set_directory("/tmp");'], 'widget.on_click = [] { std::printf("clicked\\n"); };')
D('TSplitter', 'A thin draggable splitter bar that sits between two panes and resizes them.', 'set_aligned() takes a nested EAligned value: TSplitter::alLeft, alRight, alTop or alBottom, which sets which edge the splitter docks to. set_position() sets the split position in pixels and set_min_size() the minimum pane size. The resize style is a plain int; its values are unclear from the header. on_moved(int) fires with the new position.', ['widget.set_aligned(TSplitter::alLeft);', 'widget.set_position(250);'], 'widget.on_moved = [](int p) { std::printf("moved %d\\n", p); };')
D('TTabControl', 'A tab strip with a display area below it. Tabs are added by caption; clicking a tab (or the arrow keys) selects it.', 'add_tab() appends a tab; set_tab_index() selects one and on_change() fires. set_tab_position() sets the tab strip position as a plain int; its values are unclear from the header. display_bounds() returns the display area via out parameters.', ['widget.add_tab("One");', 'widget.add_tab("Two");', 'widget.set_tab_index(1);'], 'widget.on_change = [] { std::printf("tab changed\\n"); };')
D('TTaskDialog', 'A task dialog with an icon, a bold instruction line, content text, a list of custom buttons and a list of radio buttons.', 'set_icon() takes an icon code: tdiNone 0, tdiInformation 1, tdiWarning 2, tdiError 3, tdiQuestion 4. Buttons are added by caption only with add_button(); get_button_index() and get_radio_index() report the clicked button and the selected radio. The result and icon codes are private constants in the header (mrNone 0, mrOk 1, mrCancel 2, mrAbort 3, mrRetry 4, mrIgnore 5, mrYes 6, mrNo 7), so callers pass and compare raw numbers.', ['widget.set_instruction("Delete the file?");', 'widget.set_content("This cannot be undone.");', 'widget.add_button("Delete");', 'widget.add_button("Cancel");', 'widget.set_icon(2); // tdiWarning'], 'widget.on_click = [] { std::printf("clicked\\n"); };')