mirror of
https://github.com/dbalsom/x86_microcode.git
synced 2026-06-09 13:04:17 +03:00
67 lines
2.0 KiB
Plaintext
67 lines
2.0 KiB
Plaintext
Window is a lightweight class that represents an element in the layout hierarchy. Examples:
|
|
Image
|
|
Button
|
|
|
|
Some windows can contain other windows - these are ContainerWindow objects
|
|
|
|
WindowsWindow is a ContainerWindow that has an HWND
|
|
|
|
|
|
|
|
ImageWindow inherits from Window rather than WindowsWindow but you can get around this by putting an ImageWindow inside a WindowsWindow
|
|
|
|
|
|
|
|
|
|
|
|
Consider the case of calibrate4:
|
|
We want to have some customizations (caption, size) on the WindowsWindow
|
|
Therefore the WindowsWindow should be the one that is specified in the template argument of WindowProgram
|
|
The CalibrateWindow class should be responsible for adding any child windows that it needs
|
|
|
|
|
|
|
|
|
|
|
|
When a window is clicked, give it focus and pass the click on to the child
|
|
Handle capture
|
|
Fix focus when child window with focus is removed
|
|
Have a null focus?
|
|
Null focus means that the focus is on the container window itself
|
|
Pass focus onto the next child?
|
|
Still need a null focus if there are no children remaining
|
|
If a child has focus then the parent has focus as well
|
|
|
|
|
|
|
|
|
|
|
|
How does invalidation work?
|
|
A window calls invalidate() to request that it be repainted
|
|
If it is a WindowsWindow this calls InvalidateRect
|
|
If it is a child window then it calls invalidate() on the parent window with the region
|
|
|
|
|
|
|
|
How does resize work for a BitmapWindow
|
|
|
|
|
|
|
|
Figure out animation
|
|
Assume a WM_TIMER message does an invalidate and a timer reset
|
|
i.e. just include the functionality in WindowsWindow
|
|
Or, should we allow any Window to be animated?
|
|
In that case, we might want to use thread rather than windows timer messages
|
|
thread is not interruptable (unless we do a WaitForObject kind of thing)
|
|
This kind of animation is one that automatically pauses if the window is covered - i.e. not synchronous with a simulation
|
|
|
|
|
|
|
|
|
|
We would like to be able to write programs in an OS-native style or a portable style (and even mix styles)
|
|
OS-native style puts OS-native controls directly into a WindowsWindow
|
|
Portable style uses a BitmapWindow and draws controls on the bitmap
|
|
|
|
|
|
|