Decided to use uiControlSetParent() to signal that parent handles need to be changed on Windows. Now we can start implementing this model and taking it for a spin.

This commit is contained in:
Pietro Gagliardi 2022-07-29 00:38:36 -04:00
parent f3820ac4b0
commit 7c0113f220
2 changed files with 3 additions and 1 deletions

View File

@ -127,6 +127,8 @@ The child will receive a call to its `ParentChanging()` method before the actual
TODO do things this way to avoid needing to check if reparenting from a container implementation, or do that manually each time? we used to have uiControlVerifySetParent()...
TODO I forgot what this meant
Container implementations are free to un-parent and then immediately re-parent a child should some platform-specific need to recreate any existing OS-level relations arise. For example, on Windows, this would be how to signal that a new parent handle is available, and the child would respond by destroying its current window handles and creating new ones. Refer to each individual platform documentation for details. In particular, this means that implemenations of `ParentChanging()` and `ParentChanged()` should not make any assumptions as to why the parent is changing.
## `uiControlImplData()`
```c

View File

@ -58,7 +58,7 @@ uiprivExtern HWND uiWindowsControlParentHandle(uiControl *c);
This is the parent from the point of view of the Windows API. When creating the window handle for a uiControl, this is the handle to use as the `hwndParent`.
The value returned by this function TODO should not be stored TODO refer to the top of this page for the control model
The value returned by this function is valid until the control's parent changes for any reason. TODO should not be stored anyway TODO use `ParentChanging()`/`ParentChanged()` to destroy/create (respectively) window handles TODO refer to the top of this page for the control model
It is a programmer error to pass `NULL` for `c`. TODO a non-`uiControl`?