Add callbacks, make library locations part of project now

This commit is contained in:
Vulpovile
2025-04-07 19:44:51 -07:00
parent d06251ce7f
commit d854ddfdd4
5 changed files with 25 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ using namespace B3D;
BaseButtonInstance::BaseButtonInstance(void) : Instance()
{
actionCode = 0;
callback = NULL;
}
void BaseButtonInstance::render(RenderDevice* rd)
@@ -29,12 +30,20 @@ bool BaseButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice*
void BaseButtonInstance::onMouseClick()
{
if(callback != NULL)
{
callback(this->getParentDataModel(), this, NULL, NULL);
}
// if(listener != NULL)
// {
// listener->onButton1MouseClick(this);
// }
}
void BaseButtonInstance::setCallback(void (*callback)(DataModelInstance * theDatamodel, BaseButtonInstance * theCaller, WPARAM wParam, LPARAM lParam))
{
this->callback = callback;
}
bool BaseButtonInstance::mouseInArea(float point1x, float point1y, float point2x, float point2y, float mousex, float mousey)
{