Home About Me

A C++ Drug Management System Built from EasyX UI Components

The project is a C++ drug management system whose core is described as a C-language framework. It handles the usual inventory operations—adding, deleting, editing, searching, and statistics—on drug data, and it builds its interface from three reusable EasyX components rather than relying on a larger GUI toolkit.

Project image

Main modules

The application is split into six main modules and three auxiliary UI modules.

Login and registration. The entry point is a graphical login/registration screen with prompts that guide the user through authentication.

Adding drugs. Users type drug data directly into the relevant text boxes. Validation and error handling are built in so invalid drug records are rejected before they enter the system.

Deleting drugs. A data table is paired with delete buttons. When the pointer moves over a delete button, the table highlights; clicking the button deletes the corresponding record directly.

Editing drugs. This works much like deletion: the table and edit buttons are combined, and clicking the edit button lets the user change the selected content.

Searching drugs. The query interface is flexible. The user can supply only the fields they care about, and the program performs fuzzy matching across the whole table before returning the results.

Statistics. Several sorting views are available: by drug name, manufacturer, production date, shelf life, and stock level. Each is triggered by a button, and the program uses its quicksort routine to return the sorted result as quickly as possible.

EasyX-based UI components

The three auxiliary modules provide the interface pieces the main modules reuse.

  1. Buttons. A button is drawn from top-left and bottom-right coordinates. Hovering over it produces a highlight animation, and some visual details can be customized.
  2. Text boxes. Also drawn from corner coordinates, these respond to mouse clicks and show a blinking cursor. Some effects are configurable.
  3. Tables. A table is drawn from a top-left coordinate, row and column counts, and cell width/height. The component also exposes a table-highlighting function.

The code is on GitHub at luoy-oss/drugSystem (github.com). A Lanzou Cloud download is available at drluo.lanzoui.com.