Content


NTL
Core
CLockRepaint

CLockRepaint


Helper class allowing to do repaint locking in one line. By default you do repaint locking from control code in the following way.

if (getForm())
    getForm()->LockRepaint();
...
if (getForm())
{
    getForm()->UpdateHoveredControl();
    getForm()->UnlockRepaint();
}

The CLockRepaint class allow to simplify it just to single CLockRepaint lock{ this }; line instead of the first "if" and omit last "if" at all.

You can find more information in comments below.

class CLockRepaint
{
public:
    CLockRepaint(IControl *control); // Created based on the control 
    CLockRepaint(IForm *form); // Create based on the form 
    ~CLockRepaint();
};
Namespace: nitisa
Include: Nitisa/Core/LockRepaint.h