mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-22 01:55:25 -04:00
4ebe69e1fd
The current working directory is changed on the fly when loading/previewing a scene so that every filename in a project is relative to the project directory. Adapted to changes in GDL/GDCore. Added MillionthVector in Credits. git-svn-id: svn://localhost@745 8062f311-0dae-4547-b526-b8ab9ac864a5
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
/** \file
|
|
* Game Develop
|
|
* 2008-2012 Florian Rival (Florian.Rival@gmail.com)
|
|
*/
|
|
#include "RenderDialog.h"
|
|
#include "SceneCanvas.h"
|
|
|
|
//(*InternalHeaders(RenderDialog)
|
|
#include <wx/intl.h>
|
|
#include <wx/string.h>
|
|
//*)
|
|
|
|
const long RenderDialog::ID_CUSTOM1 = wxNewId();
|
|
//(*IdInit(RenderDialog)
|
|
//*)
|
|
|
|
BEGIN_EVENT_TABLE(RenderDialog,wxDialog)
|
|
//(*EventTable(RenderDialog)
|
|
//*)
|
|
END_EVENT_TABLE()
|
|
|
|
RenderDialog::RenderDialog(wxWindow* parent, SceneCanvas * sceneCanvasNotifiedOnClose_) :
|
|
toBeNotifiedOnClose(sceneCanvasNotifiedOnClose_)
|
|
{
|
|
//(*Initialize(RenderDialog)
|
|
Create(parent, wxID_ANY, _("Aperçu"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
|
|
renderCanvas = new wxSFMLCanvas(this,ID_CUSTOM1,wxDefaultPosition,wxSize(800,600),wxWANTS_CHARS | wxNO_BORDER);
|
|
|
|
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&RenderDialog::OnClose);
|
|
//*)
|
|
}
|
|
|
|
RenderDialog::~RenderDialog()
|
|
{
|
|
//(*Destroy(RenderDialog)
|
|
//*)
|
|
}
|
|
|
|
|
|
/**
|
|
* Resize manually the canvas to accord to windows size.
|
|
*/
|
|
void RenderDialog::SetSizeOfRenderingZone(unsigned int width, unsigned int height)
|
|
{
|
|
renderCanvas->sf::RenderWindow::SetSize(width, height);
|
|
|
|
renderCanvas->wxWindowBase::SetSize(wxSize(width, height));
|
|
SetClientSize(width, height);
|
|
|
|
Update();
|
|
Refresh();
|
|
}
|
|
|
|
void RenderDialog::OnClose(wxCloseEvent& event)
|
|
{
|
|
if ( toBeNotifiedOnClose != NULL ) toBeNotifiedOnClose->ExternalWindowClosed();
|
|
Hide();
|
|
}
|