Most remaining level editor work

This commit is contained in:
elasota
2020-03-01 17:01:35 -05:00
parent abd4f1a978
commit 7b27d6c6b5
48 changed files with 1211 additions and 945 deletions

View File

@@ -136,11 +136,6 @@ void HiliteWindow(WindowPtr window, bool highlighted)
PL_NotYetImplemented();
}
void DisposeWindow(WindowPtr window)
{
PL_NotYetImplemented();
}
void GetWindowBounds(WindowPtr window, WindowRegionType windowRegion, Rect *rect)
{
if (windowRegion == kWindowContentRgn)
@@ -204,11 +199,6 @@ void ShowWindow(WindowPtr window)
PortabilityLayer::WindowManager::GetInstance()->ShowWindow(window);
}
void SetWTitle(WindowPtr window, const PLPasStr &title)
{
PL_NotYetImplemented_TODO("Editor");
}
long MenuSelect(Point point)
{
int16_t menuID = 0;
@@ -760,6 +750,29 @@ PortabilityLayer::Widget* Window::GetWidgetById() const
return nullptr;
}
bool Window::ReplaceWidget(PortabilityLayer::Widget *oldWidget, PortabilityLayer::Widget *newWidget)
{
for (size_t i = 0; i < m_numWidgets; i++)
{
if (m_widgets[i] == oldWidget)
{
assert(newWidget->GetWindow() == nullptr);
oldWidget->Destroy();
m_widgets[i] = newWidget;
newWidget->m_window = this;
newWidget->DrawControl(&m_surface);
m_surface.m_port.SetDirty(PortabilityLayer::QDPortDirtyFlag_Contents);
return true;
}
}
return false;
}
void Window::FocusWidget(PortabilityLayer::Widget *widget)
{
if (m_widgetWithFocus != widget)