Class Documentation: TControl

The TControl class is a fundamental class in the FiveWin library, which is used for creating and managing GUI controls in Windows applications. It inherits from the TWindow class and provides a wide range of functionalities for handling user interactions, resizing, dragging, and other control-related operations.

This class is designed to be the base class for various GUI controls like buttons, checkboxes, textboxes, etc. It includes methods and data members that allow for customization, event handling, and control manipulation.


Key Features


Data Members

Control State and Behavior

Class Variables


Methods

Control Positioning and Sizing

Event Handling

Focus and Validation

Drag and Drop

Rendering and Appearance

Utility Methods

System Commands


Additional Notes

The class supports grid-based resizing and dragging of controls, which is useful in design mode.

It provides transparency and 3D look options for controls.

The class is designed to work seamlessly with FiveWin's event-driven architecture, making it easy to handle user interactions.


Example Usage

// Create a new TControl instance
oControl := TControl():New()

// Set the control's position and size
oControl:Move(100, 100, 200, 50)

// Enable dragging
oControl:lDrag := .T.

// Handle the click event
oControl:bLClicked := { || MsgInfo("Control Clicked!") }

// Add the control to a window
oWnd:AddControl(oControl)

This class is a cornerstone of the FiveWin library, providing the foundation for creating interactive and customizable GUI controls in Windows applications.