Files
Aerofoil/PortabilityLayer/PLControlDefinitions.cpp

106 lines
2.1 KiB
C++
Raw Normal View History

2019-12-21 18:40:17 -05:00
#include "PLControlDefinitions.h"
2020-02-18 20:53:54 -05:00
#include "PLArrayView.h"
#include "PLArrayViewIterator.h"
#include "PLWidgets.h"
2019-11-11 00:11:59 -05:00
int FindControl(Point point, WindowPtr window, ControlHandle *outControl)
{
PL_NotYetImplemented();
return 0;
}
2020-01-05 02:33:03 -05:00
int FindControl(Point point, WindowPtr window, PortabilityLayer::Widget **outControl)
{
2020-02-18 20:53:54 -05:00
// Returns clicked part
ArrayView<PortabilityLayer::Widget*> widgets = window->GetWidgets();
for (ArrayViewIterator<PortabilityLayer::Widget*const> it = widgets.begin(), itEnd = widgets.end(); it != itEnd; ++it)
{
PortabilityLayer::Widget *widget = *it;
const Rect widgetRect = widget->GetRect();
if (widgetRect.Contains(point))
{
*outControl = widget;
return kControlButtonPart;
}
}
*outControl = nullptr;
2020-01-05 02:33:03 -05:00
return 0;
}
2019-11-11 00:11:59 -05:00
void SetControlValue(ControlHandle control, int value)
{
PL_NotYetImplemented();
}
void SetControlMaximum(ControlHandle control, int value)
{
PL_NotYetImplemented();
}
void MoveControl(ControlHandle control, int x, int y)
{
PL_NotYetImplemented();
}
void SizeControl(ControlHandle control, int width, int height)
{
PL_NotYetImplemented();
}
int GetControlValue(ControlHandle control)
{
PL_NotYetImplemented();
return 0;
}
ControlHandle NewControl(WindowPtr window, const Rect *rect, const PLPasStr &label, Boolean visible, int value, int minValue, int maxValue, int cdef, long userdata)
{
PL_NotYetImplemented();
return nullptr;
}
ControlActionUPP NewControlActionUPP(ControlActionProc proc)
{
return proc;
}
void DisposeControlActionUPP(ControlActionUPP upp)
{
}
Boolean TrackControl(ControlHandle control, Point point, ControlActionUPP proc)
{
PL_NotYetImplemented();
return false;
}
2020-01-05 02:33:03 -05:00
Boolean TrackControl(PortabilityLayer::Widget *widget, Point point, ControlActionUPP proc)
{
PL_NotYetImplemented();
return false;
}
2019-11-11 00:11:59 -05:00
long GetControlReference(ControlHandle control)
{
PL_NotYetImplemented();
return 0;
}
ControlHandle GetNewControl(int resID, WindowPtr window)
{
PL_NotYetImplemented();
return nullptr;
}
void HiliteControl(ControlHandle control, int unknown)
{
PL_NotYetImplemented();
}
2020-01-05 02:33:03 -05:00
void HiliteControl(PortabilityLayer::Widget *widget, int unknown)
{
PL_NotYetImplemented();
2020-01-05 02:33:03 -05:00
}