Skip to content

Add GUI widget library and enhance button functionality#2

Merged
rozensoftware merged 1 commit into
masterfrom
windows
Jun 20, 2026
Merged

Add GUI widget library and enhance button functionality#2
rozensoftware merged 1 commit into
masterfrom
windows

Conversation

@rozensoftware

Copy link
Copy Markdown
Owner
  • Introduced lib/gui.s and lib/gui.i for a lightweight widget toolkit.
  • Added DrawButton, GuiPollMouse, GuiHitTestRect, GuiHitTest, GetGuiMouseX, and GetGuiMouseY functions.
  • Updated CHANGELOG.md with new features and changes in button rendering.
  • New documentation for the GUI library with usage instructions and API reference.

- Introduced `lib/gui.s` and `lib/gui.i` for a lightweight widget toolkit.
- Added `DrawButton`, `GuiPollMouse`, `GuiHitTestRect`, `GuiHitTest`, `GetGuiMouseX`, and `GetGuiMouseY` functions.
- Updated `CHANGELOG.md` with new features and changes in button rendering.
- New documentation for the GUI library with usage instructions and API reference.
Copilot AI review requested due to automatic review settings June 20, 2026 19:09
@rozensoftware rozensoftware merged commit d8cef44 into master Jun 20, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the public-facing interface and documentation for the HAS GUI widget library by extending the lib/gui.i include header with additional external references / HAS templates, and by adding a full GUI library API reference plus corresponding changelog entries.

Changes:

  • Extend lib/gui.i to expose additional GUI mouse accessor entry points (GetGuiMouseX, GetGuiMouseY) and provide HAS extern func templates for the GUI API.
  • Add new end-user documentation (docs/GUI_LIBRARY.md) describing the GUI drawing and input APIs, struct layout, and integration patterns.
  • Update docs/CHANGELOG.md to describe the new GUI library functionality and recent button-rendering behavior changes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
lib/gui.i Adds XREFs and HAS extern func comment templates for newly documented GUI entry points.
docs/GUI_LIBRARY.md New GUI library documentation (API reference + usage/integration guidance).
docs/CHANGELOG.md Documents new GUI features and behavior changes under Unreleased.

Comment thread docs/CHANGELOG.md
Comment on lines +31 to +35
### Changed
- **`DrawButton` rendering** changed from a uniform `DrawBox` border to a **3D raised gadget** style (bright top/left highlight, black bottom/right shadow). Visual appearance now clearly distinguishes buttons from message-box windows.
- **`DrawButton` vertical centering** formula changed from `(y/8) + (h/8−1)/2` to `(y + h/2) / 8`, which rounds to the nearest character row rather than the topmost. For `h = 16`, text is now placed in the lower half of the button face instead of starting at the top border pixel.
- **`examples/msgbox_demo.has`** button dimensions updated from `(120, 240, 80, 16)` to `(100, 232, 120, 24)` to achieve perfect 7 px inner gap centering and give the button a standard Amiga gadget proportion. Window 4 height reduced from 48 to 40 px to accommodate the taller button within the 256-line screen.
- **`lib/gui.i`** updated with `XREF` declarations and HAS `extern func` comment templates for `DrawButton`, `GuiPollMouse`, `GuiHitTest`, `GuiHitTestRect`, `GetGuiMouseX`, and `GetGuiMouseY`.
Comment thread docs/GUI_LIBRARY.md
Comment on lines +20 to +24
4. [Mouse event manager](#mouse-event-manager)
- [GuiPollMouse](#guipollmouse)
- [GuiHitTestRect](#guihittestRect)
- [GuiHitTest](#guihittest) ← struct-based
- [GetGuiMouseX / GetGuiMouseY](#getguimousex--getguimousey)
Comment thread docs/GUI_LIBRARY.md
Comment on lines +60 to +67
| Argument | Meaning |
|----------|---------|
| `x` | Left pixel |
| `y` | Top pixel |
| `w` | Width in pixels |
| `h` | Height in pixels |
| `color` | Palette index 0–31 |

@rozensoftware rozensoftware deleted the windows branch June 21, 2026 18:20
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.

2 participants