Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mzying2001/sw
SimpleWindow GUI Framework
https://github.com/mzying2001/sw
cpp gui win32 windows
Last synced: 3 days ago
JSON representation
SimpleWindow GUI Framework
- Host: GitHub
- URL: https://github.com/mzying2001/sw
- Owner: Mzying2001
- License: mit
- Created: 2023-06-20T13:07:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-21T14:05:03.000Z (5 days ago)
- Last Synced: 2024-12-21T15:20:46.464Z (5 days ago)
- Topics: cpp, gui, win32, windows
- Language: C++
- Homepage: https://mzying2001.github.io/sw/
- Size: 6.1 MB
- Stars: 101
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.en.md
- License: LICENSE
Awesome Lists containing this project
README
# `sw`
[中文](./README.md) | **English**
`sw`, short for `SimpleWindow`, is a C++ GUI framework for building Windows desktop applications. It provides object-oriented encapsulation of Windows standard controls and is suitable for creating simple desktop applications.
## Features
+ **Based on Windows API**:
SimpleWindow is a framework based on the Windows API with no additional dependencies.
+ **Supports Properties**:
It implements property syntax similar to C#, allowing for intuitive access and modification of object properties.
+ **High DPI Support**:
Native support for high DPI using DIP (Device Independent Pixels) as the default unit of measurement.
+ **Flexible Layout**:
Implements a layout system similar to WPF, supporting various layouts such as `GridLayout`, `StackLayout`, `DockLayout`, and more.
+ **Routed Events**:
Adopts a routed event mechanism, where events can bubble up from the source control to propagate upwards. Event handlers can be registered on controls at different levels.## Quick Start
Here is a SimpleWindow HelloWorld program. For more examples, see [here](./examples).
```c++
#include "SimpleWindow.h"int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, INT nCmdShow)
{
// Window object
sw::Window mainWindow;// Button object
sw::Button button;// Modify the window layout to center the button
mainWindow.SetLayout();// Modify the button text by assigning a value to the Text property
button.Text = L"Click Me";// Register a button click event handler to show a message box when the button is clicked
button.RegisterRoutedEvent(sw::ButtonBase_Clicked,
[](sw::UIElement& sender, sw::RoutedEventArgs& e) {
sw::MsgBox::Show(L"Hello, SimpleWindow!");
});mainWindow.AddChild(button);
mainWindow.Show();// Start the message loop
return sw::App::MsgLoop();
}
```## Documentation
For detailed documentation on SimpleWindow, please visit [mzying2001.github.io/sw](https://mzying2001.github.io/sw).
## License
The SimpleWindow framework is released under the MIT license, allowing you to freely use and modify it in your own projects.
## Contribution
Contributors are welcome to participate in the development and improvement of SimpleWindow. If you find bugs or have suggestions for improvements, please raise an issue or submit a pull request.
## Stargazers over time
[![Stargazers over time](https://starchart.cc/Mzying2001/sw.svg)](https://starchart.cc/Mzying2001/sw)