SimpleWindow GUI Framework
MIT License
sw
中文 | 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.
GridLayout
, StackLayout
, DockLayout
, and more.Here is a SimpleWindow HelloWorld program. For more examples, see here.
#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<sw::FillLayout>();
// 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();
}
For detailed documentation on SimpleWindow, please visit mzying2001.github.io/sw.
The SimpleWindow framework is released under the MIT license, allowing you to freely use and modify it in your own projects.
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.