Skip to content

Add editable combobox support and enhance textbox selection#117

Draft
hugou74130 wants to merge 1 commit into
mupen64:mainfrom
hugou74130:fix/label-interactive-flag
Draft

Add editable combobox support and enhance textbox selection#117
hugou74130 wants to merge 1 commit into
mupen64:mainfrom
hugou74130:fix/label-interactive-flag

Conversation

@hugou74130
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and new features to the ugui and BreitbandGraphics libraries, focusing on enhanced input handling, more flexible control properties, and improved image drawing APIs. The most significant changes are the introduction of instance-level and registry-level property resolution for controls (notably hittestable), a major refactor of the ListBox and ComboBox controls for better keyboard and mouse interaction, and the addition of a new, more flexible image drawing API.

Input Handling and Control Properties:

  • Added per-instance and registry-level support for the hittestable property on controls, allowing fine-grained control over which UI elements participate in hit-testing (e.g., labels are now non-hittestable by default). This is achieved via a new compute_prop function and related logic in input processing. [1] [2] [3] [4] [5]
  • The shift modifier key is now tracked in the static environment for use in controls.

ListBox and ComboBox Improvements:

  • Refactored ListBox control logic to separate mouse and keyboard selection, introduce smooth scrolling, and ensure the selected item is always visible. Added support for page up/down, home/end, and copy-to-clipboard keyboard shortcuts. [1] [2]
  • Enhanced ComboBox to support an optional editable mode for user text input and filtering, and improved its setup logic. [1] [2] [3]

Image Drawing API Enhancements:

  • Introduced a new draw_image2 API with a flexible DrawImageParams parameter object, supporting explicit source/destination rectangles, tinting, and interpolation. The old draw_image is now deprecated and implemented in terms of the new API. [1] [2] [3] [4]

Other Notable Changes:

  • The begin_frame function now tracks frame delta time for use in smooth animations and interactions. [1] [2]
  • Documentation and minor corrections for control properties (e.g., clarifying selected_index semantics).

Summary of Most Important Changes:

Control Properties and Input Handling:

  • Added support for per-instance and registry-level hittestable property, with a new compute_prop function to resolve effective values, and updated input processing to respect this property. Labels are now non-hittestable by default. [1] [2] [3] [4] [5]
  • Added shift key tracking to the static environment for modifier-aware controls.

ListBox and ComboBox Improvements:

  • Refactored ListBox logic for better mouse and keyboard interaction, smooth scrolling, and keyboard shortcuts (page up/down, home/end, copy). [1] [2]
  • Added editable property and related logic to ComboBox, improving setup and toggling behavior. [1] [2] [3]

Image Drawing API:

  • Introduced draw_image2 and DrawImageParams for more flexible image drawing; deprecated the old draw_image API. [1] [2] [3] [4]

Timing and Animation Support:

  • Added frame delta time tracking to enable time-based animations and smoother interactions. [1] [2]

Documentation and Minor Fixes:

  • Clarified documentation for control properties such as selected_index in ListBox.

@hugou74130 hugou74130 marked this pull request as draft May 4, 2026 16:41
@hugou74130 hugou74130 marked this pull request as ready for review May 4, 2026 17:03
@hugou74130 hugou74130 marked this pull request as draft May 4, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant