DragonNest/Server/ServiceMonitorEx/Source/CustomItem.h
2024-12-20 16:56:44 +08:00

32 lines
1.9 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "PropertyGrid.h"
class ICustomItem
{
public:
// basic required stuff
virtual CPropertyGrid::EEditMode GetEditMode() = 0;
virtual void DrawItem(CDC& dc, CRect rc, bool focused) = 0;
// validation
virtual void ValidateChanges() {}
// mouse stuff
virtual bool OnLButtonDown(CRect rc, CPoint pt) { UNUSED_ALWAYS(rc); UNUSED_ALWAYS(pt); return false; }
virtual void OnMouseMove(CRect rc, CPoint pt) { UNUSED_ALWAYS(rc); UNUSED_ALWAYS(pt); }
virtual void OnLButtonUp(CRect rc, CPoint pt) { UNUSED_ALWAYS(rc); UNUSED_ALWAYS(pt); }
// in-place edit
virtual _tstring GetStringForInPlaceEdit() { return _T(""); }
virtual bool OnItemEdited(_tstring strNewValue) { return false; }
// dropdown edit
virtual void ShowDropDown(CRect rc) { UNUSED_ALWAYS(rc); }
// modal edit
virtual bool OnEditItem() { return false; }
protected:
friend class CPropertyGrid;
CPropertyGrid* m_pGrid;
};