/////////////////////////////////////////////////////////////////////////////
// Name:        wxdlg3dViewer.h.cpp
// Purpose:     
// Author:      
// Modified by: 
// Created:     12/12/2009 15:45:31
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#include "types.h"

#ifdef HAVE_WX

// Generated by DialogBlocks (unregistered), 12/12/2009 15:45:31

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
#include "wx/imaglist.h"
////@end includes

#include "wxdlg3dViewer.h"

////@begin XPM images
////@end XPM images


/*
 * wxdlg3dViewer type definition
 */

IMPLEMENT_DYNAMIC_CLASS( wxdlg3dViewer, wxDialog )


/*
 * wxdlg3dViewer event table definition
 */

BEGIN_EVENT_TABLE( wxdlg3dViewer, wxDialog )

////@begin wxdlg3dViewer event table entries
    EVT_CLOSE( wxdlg3dViewer::OnCloseWindow )

    EVT_CHECKBOX( ID_CheckMaterialInterpolate, wxdlg3dViewer::OnMaterialInterpolateClick )

    EVT_LIST_ITEM_SELECTED( ID_ListPolys, wxdlg3dViewer::OnListPolysSelected )

////@end wxdlg3dViewer event table entries

END_EVENT_TABLE()


/*
 * wxdlg3dViewer constructors
 */

wxdlg3dViewer::wxdlg3dViewer()
{
    Init();
}

wxdlg3dViewer::wxdlg3dViewer( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(parent, id, caption, pos, size, style);
	listPolys->callbacks = this;
	listPolys->InsertColumn(0,wxT("polys"));
}


/*
 * x creator
 */

bool wxdlg3dViewer::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin wxdlg3dViewer creation
    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end wxdlg3dViewer creation
    return true;
}


/*
 * wxdlg3dViewer destructor
 */

wxdlg3dViewer::~wxdlg3dViewer()
{
////@begin wxdlg3dViewer destruction
////@end wxdlg3dViewer destruction
}


/*
 * Member initialisation
 */

void wxdlg3dViewer::Init()
{
////@begin wxdlg3dViewer member initialisation
    checkMaterialInterpolate = NULL;
    panelTexture = NULL;
    panelViewport = NULL;
    labelFrameCounter = NULL;
    labelUserPolycount = NULL;
    labelFinalPolycount = NULL;
    listPolys = NULL;
    tree = NULL;
////@end wxdlg3dViewer member initialisation
}


/*
 * Control creation for x
 */

void wxdlg3dViewer::CreateControls()
{    
////@begin wxdlg3dViewer content construction
    wxdlg3dViewer* itemDialog1 = this;

    wxFlexGridSizer* itemFlexGridSizer2 = new wxFlexGridSizer(1, 0, 0, 0);
    itemFlexGridSizer2->AddGrowableCol(0);
    itemFlexGridSizer2->AddGrowableCol(1);
    itemFlexGridSizer2->AddGrowableCol(2);
    itemFlexGridSizer2->AddGrowableCol(3);
    itemFlexGridSizer2->AddGrowableCol(4);
    itemDialog1->SetSizer(itemFlexGridSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemFlexGridSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALIGN_TOP|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Display optionsss"));
    wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL);
    itemBoxSizer3->Add(itemStaticBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    checkMaterialInterpolate = new wxCheckBox( itemDialog1, ID_CheckMaterialInterpolate, _("Material clip interpolation"), wxDefaultPosition, wxDefaultSize, 0 );
    checkMaterialInterpolate->SetValue(false);
    itemStaticBoxSizer4->Add(checkMaterialInterpolate, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxCheckBox* itemCheckBox6 = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Something else"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox6->SetValue(false);
    itemStaticBoxSizer4->Add(itemCheckBox6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer8 = new wxFlexGridSizer(0, 2, 0, 0);
    itemBoxSizer3->Add(itemFlexGridSizer8, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    panelTexture = new wxWindow( itemDialog1, ID_PanelTexture, wxDefaultPosition, wxSize(64, 64), wxSIMPLE_BORDER );
    itemFlexGridSizer8->Add(panelTexture, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText10 = new wxStaticText( itemDialog1, wxID_STATIC, _("3dviewer is unstable.\ndont use it."), wxDefaultPosition, wxDefaultSize, 0 );
    itemFlexGridSizer8->Add(itemStaticText10, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    panelViewport = new wxWindow( itemDialog1, ID_PanelViewport, wxDefaultPosition, wxSize(256, 192), wxSIMPLE_BORDER );
    itemFlexGridSizer2->Add(panelViewport, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer12 = new wxFlexGridSizer(3, 1, 0, 0);
    itemFlexGridSizer12->AddGrowableRow(1);
    itemFlexGridSizer2->Add(itemFlexGridSizer12, 1, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer13Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Choose One"));
    wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(itemStaticBoxSizer13Static, wxVERTICAL);
    itemFlexGridSizer12->Add(itemStaticBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM|wxALL, 5);

    wxRadioButton* itemRadioButton14 = new wxRadioButton( itemDialog1, ID_RADIOBUTTON, _("Final Polylist"), wxDefaultPosition, wxDefaultSize, 0 );
    itemRadioButton14->SetValue(true);
    itemStaticBoxSizer13->Add(itemRadioButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxRadioButton* itemRadioButton15 = new wxRadioButton( itemDialog1, ID_RADIOBUTTON1, _("User Polylist"), wxDefaultPosition, wxDefaultSize, 0 );
    itemRadioButton15->SetValue(false);
    itemRadioButton15->Enable(false);
    itemStaticBoxSizer13->Add(itemRadioButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    wxRadioButton* itemRadioButton16 = new wxRadioButton( itemDialog1, ID_RADIOBUTTON2, _("Display List"), wxDefaultPosition, wxDefaultSize, 0 );
    itemRadioButton16->SetValue(false);
    itemRadioButton16->Enable(false);
    itemStaticBoxSizer13->Add(itemRadioButton16, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

    itemFlexGridSizer12->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Statistics"));
    wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
    itemFlexGridSizer12->Add(itemStaticBoxSizer18, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    labelFrameCounter = new wxStaticText( itemDialog1, wxID_STATIC, _("Frame: 9999999"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer18->Add(labelFrameCounter, 0, wxALIGN_LEFT|wxALL, 1);

    labelUserPolycount = new wxStaticText( itemDialog1, wxID_STATIC, _("User Polys: 999999"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer18->Add(labelUserPolycount, 0, wxALIGN_LEFT|wxALL, 1);

    labelFinalPolycount = new wxStaticText( itemDialog1, wxID_STATIC, _("Final Polys: "), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticBoxSizer18->Add(labelFinalPolycount, 0, wxALIGN_LEFT|wxALL, 1);

    wxStaticLine* itemStaticLine22 = new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    itemFlexGridSizer2->Add(itemStaticLine22, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);

    listPolys = new wxDesmumeListCtrl( itemDialog1, ID_ListPolys, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_VIRTUAL );
    itemFlexGridSizer2->Add(listPolys, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);

    tree = new wxTreeCtrl( itemDialog1, ID_Tree, wxDefaultPosition, wxSize(99, 99), wxTR_HAS_BUTTONS |wxTR_HIDE_ROOT|wxTR_ROW_LINES|wxTR_SINGLE );
    itemFlexGridSizer2->Add(tree, 0, wxALIGN_CENTER_HORIZONTAL|wxGROW|wxALL, 5);

    // Connect events and objects
    panelTexture->Connect(ID_PanelTexture, wxEVT_PAINT, wxPaintEventHandler(wxdlg3dViewer::OnPaintPanelTexture), NULL, this);
    panelTexture->Connect(ID_PanelTexture, wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxdlg3dViewer::OnDoNotEraseBackground), NULL, this);
    panelViewport->Connect(ID_PanelViewport, wxEVT_PAINT, wxPaintEventHandler(wxdlg3dViewer::OnPanelPaint), NULL, this);
    panelViewport->Connect(ID_PanelViewport, wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(wxdlg3dViewer::OnDoNotEraseBackground), NULL, this);
////@end wxdlg3dViewer content construction
}


/*
 * Should we show tooltips?
 */

bool wxdlg3dViewer::ShowToolTips()
{
    return true;
}

/*
 * Get bitmap resources
 */

wxBitmap wxdlg3dViewer::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin wxdlg3dViewer bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end wxdlg3dViewer bitmap retrieval
}

/*
 * Get icon resources
 */

wxIcon wxdlg3dViewer::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin wxdlg3dViewer icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end wxdlg3dViewer icon retrieval
}


/*
 * wxEVT_CLOSE_WINDOW event handler for ID_X
 */

void wxdlg3dViewer::OnCloseWindow( wxCloseEvent& event )
{

    event.Skip();
    Destroy();
}


/*
 * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_MATERIALINTERPOLATE
 */

void wxdlg3dViewer::OnMaterialInterpolateClick( wxCommandEvent& event )
{
	RepaintPanel();
}


/*
 * wxEVT_PAINT event handler for ID_PANEL
 */

void wxdlg3dViewer::OnPanelPaint( wxPaintEvent& event )
{
	_OnPaintPanel(event);
}




/*
 * wxEVT_ERASE_BACKGROUND event handler for ID_PANEL
 */

void wxdlg3dViewer::OnDoNotEraseBackground( wxEraseEvent& event )
{
	//blank to block background clearing
}



/*
 * wxDesmumeListCtrl type definition
 */

IMPLEMENT_DYNAMIC_CLASS( wxDesmumeListCtrl, wxListCtrl )


/*
 * wxDesmumeListCtrl event table definition
 */

BEGIN_EVENT_TABLE( wxDesmumeListCtrl, wxListCtrl )

////@begin wxDesmumeListCtrl event table entries
////@end wxDesmumeListCtrl event table entries

END_EVENT_TABLE()


/*
 * wxDesmumeListCtrl constructors
 */

wxDesmumeListCtrl::wxDesmumeListCtrl()
{
    Init();
}

wxDesmumeListCtrl::wxDesmumeListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator)
{
    Init();
    Create(parent, id, pos, size, style, validator);
}


/*
 * wxDesmumeListCtrl creator
 */

bool wxDesmumeListCtrl::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator)
{
////@begin wxDesmumeListCtrl creation
    wxListCtrl::Create(parent, id, pos, size, style, validator);
    CreateControls();
////@end wxDesmumeListCtrl creation
    return true;
}


/*
 * wxDesmumeListCtrl destructor
 */

wxDesmumeListCtrl::~wxDesmumeListCtrl()
{
////@begin wxDesmumeListCtrl destruction
////@end wxDesmumeListCtrl destruction
}


/*
 * Member initialisation
 */

void wxDesmumeListCtrl::Init()
{
////@begin wxDesmumeListCtrl member initialisation
////@end wxDesmumeListCtrl member initialisation
}


/*
 * Control creation for wxDesmumeListCtrl
 */

void wxDesmumeListCtrl::CreateControls()
{    
////@begin wxDesmumeListCtrl content construction
////@end wxDesmumeListCtrl content construction
}


/*
 * wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_LISTPOLYS
 */

void wxdlg3dViewer::OnListPolysSelected( wxListEvent& event )
{
////@begin wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_LISTPOLYS in wxdlg3dViewer.
    // Before editing this code, remove the block markers.
    event.Skip();
////@end wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_LISTPOLYS in wxdlg3dViewer. 
}


/*
 * wxEVT_PAINT event handler for ID_PanelTexture
 */

void wxdlg3dViewer::OnPaintPanelTexture( wxPaintEvent& event )
{
////@begin wxEVT_PAINT event handler for ID_PanelTexture in wxdlg3dViewer.
    // Before editing this code, remove the block markers.
    wxPaintDC dc(wxDynamicCast(event.GetEventObject(), wxWindow));
////@end wxEVT_PAINT event handler for ID_PanelTexture in wxdlg3dViewer. 
}

#endif //HAVE_WX
