HComponentLibrary

screenshot of HComponentLibrary

Lightweight Java like Windows GUI library for C++

Overview

HComponentLibrary is a lightweight UI component library for C++ that is inspired by Java Swing's syntax. It uses the Win32 API, resulting in minimal dependencies and maximum performance. The library can be used to convert Java Swing projects to native Windows applications. It consists of various classes, including HButton, HCheckBox, HComboBox, HFrame, HLabel, HPanel, HRadioButton, HTextArea, and HTextField. HComponentLibrary is LGPL licensed, allowing it to be used in dynamically linked proprietary applications.

Features

  • Minimal Dependencies: HComponentLibrary directly uses Win32 API, resulting in minimal dependencies and maximum performance.
  • Easy to Learn: The library's syntax is similar to Java Swing, making it easy for Java Swing developers to learn and use.
  • Conversion of Java Swing Projects: HComponentLibrary can be used to convert Java Swing projects into native Windows applications.
  • Small File Size: The size of the DLL file is very small, around 230KiB.
  • Variety of UI Components: The library consists of various UI components such as buttons, checkboxes, dropdown lists, windows, labels, panels, radio buttons, text areas, and text fields.
  • Action Events: HComponentLibrary includes an action event class for action listeners.
  • Radio Button Grouping: The library provides a class for grouping radio buttons, ensuring that only one button can be selected simultaneously.
  • Cross-Platform Compatibility: HComponentLibrary can be cross-compiled and run on Linux with MinGW and Wine projects.

Building from Source

Windows

  • Open the HCl.sln file with Visual Studio.
  • Make any necessary changes to the source code.
  • Compile the project.

Linux

  • HComponentLibrary cannot be natively compiled on Linux distros due to its use of the Windows API.
  • However, it can be cross-compiled and run with MinGW and Wine projects.
  • Install necessary packages by using the package manager for your Linux distribution.
  • Use CMake to compile the project.
  • For RHEL-based distros, the following steps can be applied to other Linux-based operating systems as well.
  • To compile for 32-bit architecture, use the following command:
cmake -DCMAKE_CXX_FLAGS="-m32" .
  • Navigate to the project root directory and build the project with the following command:
make
  • The resulting libHCL.dll and libHCL.dll.a files can be found in the build/HCL directory. Rename libHCL.dll.a to HCL.lib.

Testing with Wine

  • Make sure Wine64 is properly installed.
  • Copy any of the provided examples and paste it into a file named Test.cpp.
  • Place the libHCL.dll and HCl.h files in the same directory as Test.cpp.
  • Copy HCL.lib to /home/$USER/HCl (any directory can be used).
  • Compile the application with the following command:
g++ Test.cpp -o Test -lHCL
  • Before running the compiled application, ensure that all necessary DLL files of MinGW are copied.

Summary

HComponentLibrary is a lightweight UI component library for C++ that is heavily inspired by Java Swing's syntax. It offers minimal dependencies, maximum performance, and easy integration with existing Java Swing projects. With a variety of UI components available, developers can create native Windows applications with ease. The library's small file size and cross-platform compatibility make it a convenient choice for C++ developers.

ui-kit
UI Kits & Components

A UI kit provides developers with a set of reusable components that can be easily integrated into a website or application. These components are pre-designed with consistent styling and functionality, allowing developers to save time and effort in the design and development process. UI kits can be either custom-built or third-party, and often include components for buttons, forms, typography, icons, and more.