Button — version history
A command button drawn in the application theme — text and icon, three styles, counter badge, keyboard shortcut, default and cancel button. Introduced in 1.0; deprecated in 3.0 in favor of the button bar (u_pbt_buttonbar), but still shipped and maintained.
4.0 — October 2026 #
New #
- The
&mnemonic ofis_text(&Save) now works: Alt + the letter triggers the button wherever the focus is in the window, after the application's explicit shortcuts. A disabled button does not respond. is_shortcutis shown in the tooltip ("Save (Ctrl+S)"), as the title of a rich tooltip.- A shortcut registered with
of_register_shortcut("F5") andis_shortcutboth respond: changingib_default,ib_canceloris_shortcutno longer clears the other, andof_clear_shortcuts()no longer clears a button'sis_shortcut. - Two default (or cancel) buttons in the same window, for example in two MDI sheets: Enter or Esc goes to the one closest to the focus.
- The chords
Ctrl++,Ctrl+-,Ctrl+,,Alt+Left,Ctrl+Space,Ctrl+TabandCtrl+Backspaceare accepted, and a digit chord (Ctrl+Shift+1) fires on any keyboard layout, AZERTY included. [symbol=name]tag in rich text: eighteen monochrome glyphs that follow the text colour (clock,location,person,calendar,phone,mail,warning…); an unknown name stays as text.
Fixed #
- A disabled button (
ib_enabled = false) markedib_defaultorib_cancel, or carrying anis_shortcut, no longer captures Enter, Esc or its shortcut: the key goes back to the window (a defaultCommandButtonor an edit field receives it); once re-enabled, the button takes it back. - A disabled button is skipped by the Tab key and announced as disabled to screen readers.
- Holding Enter or Space on the focused button no longer fires a burst of
ue_clicked: one click only, and Space fires on release, as in Windows. - After
of_reset(),is_text,is_image,is_style,ii_badge,il_badge_color,ii_badge_sizeandii_image_sizeread back their default value, matching the screen. - A label made of a single image (
[picture=…],[symbol=…]) is displayed instead of disappearing; a&inside a tag no longer breaks the tag. - The keyboard focus is visible on a
STYLE_PRIMARYbutton in all ten themes. - Rich text: a closing tag closes its own tag only (
[b]A[i]B[/b]CleavesCin italics only), a]escaped byof_escape_markupright after a tag no longer breaks the formatting around it, and[picture=…]accepts a data URI and a file name containing a comma. - Enter on a focused PowerBuilder
CommandButtonpresses that button, not the default button. - Enter or Esc pressed in the component, when it does not use them, goes back to the window: the PowerBuilder
DefaultorCancelCommandButtonfires (the key was lost). - With no language chosen by the application, the component announces English to screen readers (it announced French).
is_theme_style,is_theme_modeandil_theme_accentread back the style and mode shown and the component's own accent (-1when it has none); an unknown or badly written value is ignored instead of leaving the component without a theme, and an axis left empty follows the application's theme.- The application accent (
PBT_SetDefaultThemeAccent) survives a change of theme, is followed as long as the component has no accent of its own, and repaints everything derived from it (hover, pressed, selections); Windows high contrast is supported. - Typing a character with AltGr in a PowerBuilder field (the euro of a French keyboard, AltGr+E) no longer fires a
Ctrl+Altshortcut of that key. - A disabled component (
ib_enabled = false) leaves the Tab order; enabled again (or afterof_reset), it takes its place back.
Behavior changes #
See the "Migrating from 3.0 to 4.0" guide, sections 11.3 and 11.14.
il_badge_colorfollows the rule shared by all colors:-1= theme color (and reads back-1when nothing is set),0is black. Replaceil_badge_color = 0with-1.- An
is_shortcutthe window cannot trigger ("Win+S", or a key name in another language such as"Ctrl+Entrée") is rejected and reads back""; key names are written in English (Enter,Esc,Del). - An
&letter of the button takes precedence over a PowerBuilder menu bar that uses the same letter. - Rich text: a markup image on a network share (
[picture=\\server\share\x.png]) is no longer shown: go throughof_icon(), which embeds it.
3.0 — September 2026 #
New #
of_set_property,of_get_propertyandof_component_name: drive a property by its name (settings screen, saved configuration).
Fixed #
- The text of a pressed button stays readable on the pressed background of the Office 2007 theme, light and dark.
- Rich text: a
[word]that is not a tag is shown as typed (report[final].pdf) instead of disappearing with the rest of the text.
Behavior changes #
- The component is deprecated in favor of the button bar (
u_pbt_buttonbar): a button bar is a single component where ten buttons are ten. It remains shipped and supported, and your code compiles unchanged. - Other colors now read back
-1when not set;il_badge_colorkeeps its original convention (0= theme color, reads back0).
2.0 — September 2026 #
New #
ue_script_error: a script error in the page reaches PowerBuilder with its message instead of being lost.
Fixed #
- The text of a hovered button is readable in every theme, dark mode included.
- The label of a disabled button is readable in every theme (contrast of at least 3:1).
1.0 — August 2026 #
New #
- Replaces a
CommandButtonwith a button drawn in the application theme: rich-text label with&mnemonic (is_text), icon (is_image,ii_image_size), three styles (STYLE_STANDARD,STYLE_PRIMARY,STYLE_FLAT). - Corner counter badge (
ii_badge,il_badge_color,ii_badge_size). - Default button (
ib_default, Enter) and cancel button (ib_cancel, Esc), keyboard shortcut (is_shortcut), enabled or disabled state (ib_enabled). - Simple or rich tooltip; events
ue_clicked,ue_rclicked, andue_mouse_enter/ue_mouse_leaveon request (ib_track_mouse).