Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom controls to define their own client rect #24517

Open
parduz opened this issue May 3, 2024 · 1 comment
Open

Allow custom controls to define their own client rect #24517

parduz opened this issue May 3, 2024 · 1 comment

Comments

@parduz
Copy link

parduz commented May 3, 2024

Request

Add a way (using a virtual overridable function?) to change the client origin and size passed to child sizers from a custom container control

Description

I've built a custom control derived from the wxPanel, call it FancyPanel.
It draws and animate a border on mouseover and mouse down/up (technically i draw a rounded rectangle as big as the FancyPanel itself, with variable penwidth and radius of the rounded corners).

Other wxControls will be added at runtime as children of the FancyPanels, but i have no way to tell that the client size is smaller than the control size, so they end up being placed over the animated border.

According to Doublemax on the forum, there's no way to customize the client rect which will be passed to the sizers, and i think this is important for control customization.

-edit- sorry for typo in the title :(

@parduz parduz added the feature label May 3, 2024
@vadz
Copy link
Contributor

vadz commented May 3, 2024

We have wxWindow::GetClientAreaOrigin() but it might only actually be taken into account for top-level windows. The simplest way to do the same thing for a wxPanel is to just put a nested wxPanel inside it and I'm not sure it's really worth doing anything else.

But maybe GetClientAreaOrigin() does work. And if it doesn't, I guess we could accept patches making it work for arbitrary windows. However I don't have any plans to work on this myself.

@vadz vadz changed the title Allows custom control derived from "container" to control hiw own ClientRect Allow custom controls to define their own client rect May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants