Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# win32_smartdlg
Win32_smartdlg is a library for creating dynamic, pixel-less layouts in Win32 applications. It provides an abstraction layer over the traditional Win32 window API, allowing for more flexible and responsive UI designs.

## Features
- Dynamic Layouts: Automatically resizes and repositions controls.
- Easy Integration: Simple API for integrating into existing Win32 projects.
- No Pixel Positioning: Define layouts without worrying about pixel coordinates.

## Getting Started
### Prerequisites
- Windows XP or newer: This library is designed for Windows applications.
- ReactOS / Wine: For the purposes of this library, ReactOS and Wine are acceptable substitutes.
- C++ Compiler: Ensure you have a C++ compiler that supports the Win32 API.

### Dependencies
By default, this project depends on the win32_utf8 library. You can find it here: https://github.com/thpatch/win32_utf8

To include this dependency in your projects, replace `#include <windows.h>` with `#include <win32_utf8.h>` in your source files. If you do not wish to include Unicode support, simply reverse this change.

### Installation
1. Clone the Repository: `git clone https://github.com/thpatch/win32_smartdlg`
2. Include in Project: Add the source files to your C++ project.

### Usage
1. Include Header: `#include "SmartDlg.h"`
2. Initialize Layout Manager:
```
void InitDialog(HWND hDlg) {
SmartDlg dlg(hDlg);
dlg.addControl(IDC_BUTTON1, SMARTDLG_ANCHOR_LEFT | SMARTDLG_ANCHOR_TOP);
dlg.addControl(IDC_EDIT1, SMARTDLG_ANCHOR_LEFT | SMARTDLG_ANCHOR_RIGHT | SMARTDLG_ANCHOR_TOP);
// Add more controls as needed
}
```
3. Compile and Run: Build and run your application. The layout manager will handle dynamic resizing.

## Example
Here’s a basic example of setting up a dialog with dynamic layouts:
```
#include "SmartDlg.h"

void InitDialog(HWND hDlg) {
SmartDlg dlg(hDlg);
dlg.addControl(IDC_BUTTON1, SMARTDLG_ANCHOR_LEFT | SMARTDLG_ANCHOR_TOP);
dlg.addControl(IDC_EDIT1, SMARTDLG_ANCHOR_LEFT | SMARTDLG_ANCHOR_RIGHT | SMARTDLG_ANCHOR_TOP);
// More control initializations
}
```
## Contributing
Contributions are welcome! Please fork the repository and submit pull requests.

## Disclaimer
This README was produced using ChatGPT and may contain errors, both in its content and its formatting. Please verify the information and refer to the source code for the most accurate details.

## License
This project is licensed under the MIT License.