|
From: <ob...@us...> - 2007-10-08 11:59:08
|
Revision: 343
http://iaeditor.svn.sourceforge.net/iaeditor/?rev=343&view=rev
Author: obi666
Date: 2007-10-08 04:59:12 -0700 (Mon, 08 Oct 2007)
Log Message:
-----------
Moved iaMainFrame and iaObjectsManager to widgets.
Modified Paths:
--------------
trunk/src/apps/editor/application.cpp
trunk/src/apps/editor/gui/widgets/iaObjectTree.h
trunk/src/apps/editor/iaCSApplication.cpp
Added Paths:
-----------
trunk/src/apps/editor/gui/widgets/iaMainFrame.cpp
trunk/src/apps/editor/gui/widgets/iaMainFrame.h
trunk/src/apps/editor/gui/widgets/iaObjectsManager.h
Removed Paths:
-------------
trunk/src/apps/editor/gui/iaMainFrame.cpp
trunk/src/apps/editor/gui/iaMainFrame.h
trunk/src/include/ia-tool/iaObjectsManager.h
Modified: trunk/src/apps/editor/application.cpp
===================================================================
--- trunk/src/apps/editor/application.cpp 2007-10-08 11:40:28 UTC (rev 342)
+++ trunk/src/apps/editor/application.cpp 2007-10-08 11:59:12 UTC (rev 343)
@@ -39,14 +39,8 @@
#include "windows.h"
#endif
-#include "iutil/vfs.h"
-#include "csutil/cscolor.h"
-#include "cstool/csview.h"
-#include "cstool/initapp.h"
-#include "csutil/syspath.h"
+#include "gui/widgets/iaMainFrame.h"
-#include "gui/iaMainFrame.h"
-
IMPLEMENT_APP(iaApplication)
iObjectRegistry * object_reg;
Deleted: trunk/src/apps/editor/gui/iaMainFrame.cpp
===================================================================
--- trunk/src/apps/editor/gui/iaMainFrame.cpp 2007-10-08 11:40:28 UTC (rev 342)
+++ trunk/src/apps/editor/gui/iaMainFrame.cpp 2007-10-08 11:59:12 UTC (rev 343)
@@ -1,521 +0,0 @@
-/*
-Copyright (C) 2005 - 2007 by Piotr Obrzut and Valentin Vit
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free
-Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "ia_mainframe.h"
-#endif
-
-// 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 <cssysdef.h>
-#include "../iaCSApplication.h"
-//#include "csutil/cscolor.h"
-//#include "cstool/csview.h"
-//#include "ivideo/graph3d.h"
-//#include "ivideo/graph2d.h"
-//#include "ivideo/wxwin.h"
-
-#include <wx/dc.h>
-#include <wx/filedlg.h>
-#include <wx/laywin.h>
-
-#include "widgets/iaObjectTree.h"
-#include "widgets/iaPropertyGrid.h"
-#include "widgets/iaPropertySheet.h"
-#include "widgets/iaSimulationPanel.h"
-#include <string>
-
-#include "editor.h"
-#include "iaMainFrame.h"
-
-IMPLEMENT_CLASS(iaMainFrame, wxFrame)
-/*!
-* iaMainFrame event table definition
-*/
-BEGIN_EVENT_TABLE(iaMainFrame, wxFrame)
-//EVT_LEFT_DOWN(iaMainFrame::OnMouse)
-//EVT_LEFT_DCLICK(iaMainFrame::OnMouse)
-
-EVT_SIZE(iaMainFrame::OnSize)
-
-EVT_MENU(IA_MENUITEM_ATTACH_BODY, iaMainFrame::OnAttachBodyMenuItem)
-EVT_MENU(IA_MENUITEM_ATTACH_SPHERE_COLLIDER, iaMainFrame::OnAttachSphereColliderMenuItem)
-EVT_MENU(IA_MENUITEM_ATTACH_BOX_COLLIDER, iaMainFrame::OnAttachBoxColliderMenuItem)
-EVT_MENU(IA_MENUITEM_ATTACH_CAPSULE_COLLIDER, iaMainFrame::OnAttachCapsuleColliderMenuItem)
-EVT_MENU(IA_MENUITEM_ATTACH_JOINT, iaMainFrame::OnAttachJointMenuItem)
-EVT_MENU(ID_MENUITEM_LOAD, iaMainFrame::OnLoadMenuItem)
-EVT_MENU(ID_MENUITEM_SAVE, iaMainFrame::OnSaveMenuItem)
-EVT_MENU(ID_MENUITEM_NEW_PROJECT, iaMainFrame::OnNewProjectMenuItem)
-EVT_MENU(ID_MENUITEM_LOAD_PROJECT, iaMainFrame::OnLoadProjectMenuItem)
-EVT_MENU(ID_MENUITEM_SAVE_AS, iaMainFrame::OnSaveAsMenuItem)
-EVT_MENU(ID_MENUITEM_EXIT, iaMainFrame::OnExitMenuItem)
-EVT_MENU(IA_MENUITEM_DELETE, iaMainFrame::OnDelete)
-EVT_MENU(IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, iaMainFrame::OnAttachScriptedControllerMenuItem)
-EVT_MENU(ID_MENUITEM_DRAW_WIREFRAME, iaMainFrame::OnDrawWireFrame)
-EVT_MENU(ID_MENUITEM_SHOW_COLLIDERS, iaMainFrame::OnShowColliders)
-EVT_MENU(ID_MENUITEM_SHOW_JOINTS, iaMainFrame::OnShowJoints)
-EVT_MENU(ID_MENUITEM_SHOW_BONES, iaMainFrame::OnShowBones)
-EVT_MENU(ID_MENUITEM_SHOW_BODIES, iaMainFrame::OnShowBodies)
-EVT_MENU(ID_MENUITEM_SHOW_CHARACTERS, iaMainFrame::OnShowCharacters)
-
-EVT_TOOL(ID_TOOL_ATTACH_CAPSULE_COLLIDER, iaMainFrame::OnAttachCapsuleColliderMenuItem)
-EVT_TOOL(ID_TOOL_ATTACH_BOX_COLLIDER, iaMainFrame::OnAttachBoxColliderMenuItem)
-EVT_TOOL(ID_TOOL_ATTACH_SPHERE_COLLIDER, iaMainFrame::OnAttachSphereColliderMenuItem)
-EVT_TOOL(ID_TOOL_CONTROLLER, iaMainFrame::OnAttachScriptedControllerMenuItem)
-EVT_TOOL(ID_TOOL_SAVE, iaMainFrame::OnSaveMenuItem)
-EVT_TOOL(ID_TOOL_IMPORT, iaMainFrame::OnLoadProjectMenuItem)
-
-END_EVENT_TABLE()
-
-iaMainFrame *m_mainfrm;
-
-iaMainFrame::~iaMainFrame()
-{
- central_info->Get3dView ()->ShutDown ();
- aui_mgr.UnInit();
-}
-
-iaMainFrame::iaMainFrame()
-{
- m_mainfrm = this;
-}
-
-iaMainFrame::iaMainFrame(iEditorCentralInfo* info, wxWindow* parent,
- const wxWindowID id, const wxString& title, const wxPoint& pos,
- const wxSize& size, const long style)
-{
- central_info = info;
- m_mainfrm = this;
- central_info->GetObjectsInfo ()->AddListener ((iaBaseObjectListener*)this);
- SetMinSize(wxSize(400,300));
-}
-
-bool iaMainFrame::Create(wxWindow* parent, wxWindowID id, const wxString& caption,
- const wxPoint& pos, const wxSize& size, long style)
-{
- pnl_3dview = NULL;
- wxFrame::Create (parent, id, caption, pos, size, style);
-
- if (!CreateControls ())
- return false;
-
- pnl_3dview->SetFocus ();
-
- Centre ();
-
- return true;
-}
-
-void iaMainFrame::ObjectSelected (iEditorObject *obj)
-{
- bool can_delete = true;
- for (size_t i = 0; i < central_info->GetObjectsInfo ()->GetSelectedObjectsCount (); i++)
- {
- if (!central_info->GetObjectsInfo ()->GetSelectedObject (i)->CanBeDeleted ())
- can_delete = false;
- }
- itemMenuEdit->Enable (IA_MENUITEM_DELETE, can_delete);
-
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, false);
-
- if (central_info->GetObjectsInfo ()->GetSelectedObjectsCount () == 1)
- {
- iEditorObject *obj = central_info->GetObjectsInfo ()->GetSelectedObject (0);
- if (obj->CanAttach (IA_OBJECT_TYPE_BODY))
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, true);
- if (obj->CanAttach (IA_OBJECT_TYPE_COLLIDER))
- {
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, true);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, true);
- }
- if (obj->CanAttach (IA_OBJECT_TYPE_CONTROLLER))
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, true);
-
- }else if(central_info->GetObjectsInfo ()->GetSelectedObjectsCount () == 2)
- {
- iEditorObject *obj1 = central_info->GetObjectsInfo ()->GetSelectedObject (0);
- iEditorObject *obj2 = central_info->GetObjectsInfo ()->GetSelectedObject (1);
- if (obj1->CanAttach (IA_OBJECT_TYPE_JOINT) && obj2->CanAttach (IA_OBJECT_TYPE_JOINT))
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, true);
- }
-
-}
-void iaMainFrame::ObjectRemoved (iEditorObject *obj)
-{
-}
-void iaMainFrame::UpdatePane (wxWindow *wnd)
-{
- aui_mgr.GetPane (wnd).BestSize (wnd->GetSize ());
- aui_mgr.InsertPane (wnd, aui_mgr.GetPane (wnd), wxAUI_INSERT_DOCK);
- aui_mgr.Update ();
-}
-void iaMainFrame::ObjectAdded (iEditorObject *obj)
-{
-}
-void iaMainFrame::ObjectChanged (iEditorObject *obj, iEditorObjectProperty* prop)
-{
-}
-
-/*!
-* Control creation for ia_MainFrame
-*/
-bool iaMainFrame::CreateControls()
-{
- aui_mgr.SetManagedWindow (this);
-
- wxString icons_path = wxString (central_info->GetIconsPath ().c_str (), wxConvUTF8);
- if (icons_path.Cmp (_T("")) == 0)
- return false;
-
- //menu and statusbar
- iaMainFrame* itemFrame1 = this;
-
- wxMenuBar* menuBar = new wxMenuBar;
- wxMenu* itemMenu5 = new wxMenu;
- itemMenu5->Append (ID_MENUITEM_NEW_PROJECT, _("New Project...\tCTRL+N"), _T(""), wxITEM_NORMAL);
- itemMenu5->Append (ID_MENUITEM_LOAD_PROJECT, _("Load Project...\tCTRL+L"), _T(""), wxITEM_NORMAL);
- //itemMenu5->Append (ID_MENUITEM_LOAD, _("Load..."), _T(""), wxITEM_NORMAL);
- itemMenu5->Append (ID_MENUITEM_SAVE, _("Save Project\tCTRL+S"), _T(""), wxITEM_NORMAL);
- //itemMenu5->Append (ID_MENUITEM_SAVE_AS, _("Save As..."), _T(""), wxITEM_NORMAL);
- itemMenu5->Append(ID_MENUITEM_EXIT, _("Exit\tCTRL+X"), _T(""), wxITEM_NORMAL);
- menuBar->Append(itemMenu5, _("File"));
- itemMenuEdit = new wxMenu;
- itemMenuEdit->Append (IA_MENUITEM_DELETE, _("Delete\tDel"), _T(""), wxITEM_NORMAL);
- menuBar->Append(itemMenuEdit, _("Edit"));
- wxMenu* itemMenuView = new wxMenu;
- menuBar->Append(itemMenuView, _("View"));
- itemMenuView->Append (ID_MENUITEM_DRAW_WIREFRAME, _("Draw wireframe"), _T(""), wxITEM_CHECK);
- itemMenuView->Append (ID_MENUITEM_SHOW_BONES, _("Show Bones"), _T(""), wxITEM_CHECK);
- itemMenuView->Check (ID_MENUITEM_SHOW_BONES, true);
- itemMenuView->Append (ID_MENUITEM_SHOW_COLLIDERS, _("Show Colliders"), _T(""), wxITEM_CHECK);
- itemMenuView->Check (ID_MENUITEM_SHOW_COLLIDERS, true);
- itemMenuView->Append (ID_MENUITEM_SHOW_JOINTS, _("Show Joints"), _T(""), wxITEM_CHECK);
- itemMenuView->Check (ID_MENUITEM_SHOW_JOINTS, true);
- itemMenuView->Append (ID_MENUITEM_SHOW_BODIES, _("Show Bodies"), _T(""), wxITEM_CHECK);
- itemMenuView->Check (ID_MENUITEM_SHOW_BODIES, true);
- itemMenuView->Append (ID_MENUITEM_SHOW_CHARACTERS, _("Show Characters"), _T(""), wxITEM_CHECK);
- itemMenuView->Check (ID_MENUITEM_SHOW_CHARACTERS, true);
-
- itemMenuAttach = new wxMenu;
- itemMenuAttach->Append (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, _("Attach Sphere Collider..."),
- _T(""),wxITEM_NORMAL);
- itemMenuAttach->Append (IA_MENUITEM_ATTACH_BOX_COLLIDER, _("Attach Box Collider..."),
- _T(""),wxITEM_NORMAL);
- itemMenuAttach->Append (IA_MENUITEM_ATTACH_BODY, _("Attach Body...\tCTRL+B"), _T(""), wxITEM_NORMAL);
- itemMenuAttach->Append (IA_MENUITEM_ATTACH_JOINT, _("Attach Joint...\tCTRL+J"), _T(""), wxITEM_NORMAL);
- itemMenuAttach->Append (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER,
- _("Attach Scripted Controler...\tCTRL+C"), _T(""), wxITEM_NORMAL);
- menuBar->Append (itemMenuAttach, _("Attach"));
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
-
- wxMenu* itemMenu13 = new wxMenu;
- itemMenu13->Append (ID_MENUITEM2, _("About"), _T(""), wxITEM_NORMAL);
- menuBar->Append (itemMenu13, _("Help"));
- itemFrame1->SetMenuBar (menuBar);
-
- wxStatusBar* itemStatusBar2 = new wxStatusBar (itemFrame1, ID_STATUSBAR,
- wxST_SIZEGRIP | wxNO_BORDER);
- itemStatusBar2->SetFieldsCount (2);
- itemFrame1->SetStatusBar (itemStatusBar2);
- //end menu and statusbar
-
- //toolbar
- wxInitAllImageHandlers ();
- wxToolBar* tb1 = CreateToolBar (wxTB_FLAT | wxTB_HORIZONTAL, ID_TOOLBAR);
- tb1->SetToolBitmapSize (wxSize(32, 32));
-
- tb1->AddSeparator();
-
- wxBitmap itemtool2Bitmap (icons_path + _T("Icon_save.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool2BitmapDisabled (icons_path + _T("Icon_save_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_SAVE, _T(""), itemtool2Bitmap, itemtool2BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Save project"));
-
- wxBitmap itemtool3Bitmap (icons_path + _T("Icon_import.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool3BitmapDisabled (icons_path + _T("Icon_import_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_IMPORT, _T(""), itemtool3Bitmap, itemtool3BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Load Project"));
-
-#if 0
- wxBitmap itemtool4Bitmap (icons_path + _T("Icon_export.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool4BitmapDisabled (icons_path + _T ("Icon_export_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_EXPORT, _T(""), itemtool4Bitmap, itemtool4BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Export physics (currently not avaible)"));
-#endif
-
- tb1->AddSeparator();
-#if 0
- wxBitmap itemtool5Bitmap (icons_path + _T("Icon_move.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool5BitmapDisabled (icons_path + _T ("Icon_move_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_MOVE, _T(""), itemtool5Bitmap, itemtool5BitmapDisabled, wxITEM_NORMAL, _T(""),
- wxT("Move Object (currently not avaible)"));
-
- wxBitmap itemtool6Bitmap (icons_path + _T("Icon_rotate.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool6BitmapDisabled (icons_path + _T("Icon_rotate_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_ROTATE, _T(""), itemtool6Bitmap, itemtool6BitmapDisabled, wxITEM_NORMAL, _T(""),
- wxT("Rotate Object (currently not avaible)"));
-
- tb1->AddSeparator();
-
- wxBitmap itemtool7Bitmap (icons_path + _T ("Icon_movebody.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool7BitmapDisabled (icons_path + _T("Icon_movebody_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_MOVE_BODY, _T(""), itemtool7Bitmap, itemtool7BitmapDisabled,
- wxITEM_NORMAL, _T(""), wxT("Move rigid body (currently not avaible)"));
-
- wxBitmap itemtool8Bitmap (icons_path + _T("Icon_rotatebody.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool8BitmapDisabled (icons_path + _T("Icon_rotatebody_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_ROTATE_BODY, _T(""), itemtool8Bitmap, itemtool8BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Rotate rigid body (currently not avaible)"));
-
- tb1->AddSeparator();
-
- wxBitmap itemtool9Bitmap (icons_path + _T("Icon_rag.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool9BitmapDisabled (icons_path + _T("Icon_rag_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_CREATE_CHAR, _T(""), itemtool9Bitmap, itemtool9BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Create character from given model"));
-#endif
-
- wxBitmap itemtool10Bitmap (icons_path + _T("Icon_cube.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool10BitmapDisabled (icons_path + _T("Icon_cube_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_ATTACH_BOX_COLLIDER, _T(""), itemtool10Bitmap, itemtool10BitmapDisabled,
- wxITEM_NORMAL, _T(""), wxT("Attach box collider"));
-
- wxBitmap itemtool11Bitmap (icons_path + _T ("Icon_cilinder.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool11BitmapDisabled(icons_path + _T ("Icon_cilinder_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool(ID_TOOL_ATTACH_CAPSULE_COLLIDER, _T(""), itemtool11Bitmap, itemtool11BitmapDisabled,
- wxITEM_NORMAL, _T(""), wxT("Attach cilinder collider"));
-
- wxBitmap itemtool12Bitmap (icons_path + _T ("Icon_sphere.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool12BitmapDisabled (icons_path + _T("Icon_sphere_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_ATTACH_SPHERE_COLLIDER, _T(""), itemtool12Bitmap, itemtool12BitmapDisabled,
- wxITEM_NORMAL, _T(""), wxT("Attach sphere collider"));
-
-#if 0
- wxBitmap itemtool16Bitmap (icons_path + _T("Icon_animation.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool16BitmapDisabled (icons_path + _T("Icon_animation_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_ANIMATION, _T(""), itemtool16Bitmap, itemtool16BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Animation tool (not avaible yet)"));
-
- wxBitmap itemtool17Bitmap (icons_path + _T("Icon_force.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool17BitmapDisabled (icons_path + _T("Icon_force_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_FORCE, _T(""), itemtool17Bitmap, itemtool17BitmapDisabled, wxITEM_NORMAL,
- _T(""), wxT("Create force (not avaible yet)"));
-#endif
-
- wxBitmap itemtool18Bitmap (icons_path + _T("Icon_controler.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool18BitmapDisabled (icons_path + _T("Icon_controler_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool (ID_TOOL_CONTROLLER, _T(""),
- itemtool18Bitmap, itemtool18BitmapDisabled, wxITEM_NORMAL, _T(""), wxT("Attach controller"));
-
- tb1->AddSeparator();
-
-#if 0
- wxBitmap itemtool19Bitmap(icons_path + _T("Icon_camera.png"), wxBITMAP_TYPE_PNG);
- wxBitmap itemtool19BitmapDisabled(icons_path + _T("Icon_camera_a.png"), wxBITMAP_TYPE_PNG);
- tb1->AddTool(ID_TOOL_CAMERA, _T(""), itemtool19Bitmap, itemtool19BitmapDisabled, wxITEM_NORMAL, _T(""),
- wxT("Record (not avaible yet)"));
-
- tb1->AddSeparator();
-#endif
-
- itemMenuEdit->Enable (IA_MENUITEM_DELETE, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, false);
- itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, false);
-
- tb1->Realize();
- itemFrame1->SetToolBar (tb1);
- //end toolbar
-
- sim_panel = new iaSimulationPanel (central_info, this, ID_SIMULATION_PANEL,
- wxDefaultPosition, wxSize(GetSize().x, 115), wxNO_BORDER | wxTAB_TRAVERSAL);
- sim_panel->SetBackgroundColour (wxColor (255, 255, 255));
- sim_panel->CreateControls ();
-
- //the tree
- objtree = new iaObjectTree (central_info, this, ID_OBJECTS_TREE_PANEL, wxDefaultPosition, wxSize(200, 63),
- wxNO_BORDER | wxTAB_TRAVERSAL, icons_path);
- objtree->SetBackgroundColour (wxColor (255, 255, 255));
-
- //3dview
- pnl_3dview = new wxPanel (this, ID_PANEL, wxDefaultPosition, wxSize(131, 63),
- wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
- pnl_3dview->SetBackgroundColour(wxColour(0, 0, 128));
-
- //pnl right ->propgrid
- iaPropertyGrid* propEditor = new iaPropertyGrid (central_info, this, -1, wxPoint(3, 3),
- wxSize(131, 63), wxPG_BOLD_MODIFIED | wxPG_SPLITTER_AUTO_CENTER | wxPG_AUTO_SORT | wxTOP |
- wxTAB_TRAVERSAL| wxPG_BOOL_USE_CHECKBOX);
- propEditor->SetMarginColour (wxColor (122, 110, 90));
- propEditor->SetLineColour (wxColor (0,0,0));
- propEditor->SetCaptionBackgroundColour (wxColor (122, 110, 90));
- propEditor->SetCaptionForegroundColour (wxColor (0,0,0));
- //propEditor->SetCellBackgroundColour (wxColor (122, 110, 90));
-
- aui_mgr.AddPane (sim_panel, wxAuiPaneInfo ().Name (
- wxT ("pnl_bottom")).Caption (wxT ("Simulation")).Bottom());
-
- aui_mgr.AddPane(objtree, wxAuiPaneInfo ().Name (wxT ("objtree")).Caption (
- wxT ("Objects Tree")).Left());
-
- aui_mgr.AddPane (propEditor, wxAuiPaneInfo ().Name (wxT ("properties")).Caption (
- wxT ("Properties")).Right());
-
- aui_mgr.AddPane (pnl_3dview, wxCENTER);
-
- aui_mgr.Update ();
-
- return true;
-}
-
-bool iaMainFrame::ShowToolTips()
-{
- return true;
-}
-
-wxBitmap iaMainFrame::GetBitmapResource(const wxString& name)
-{
- // Bitmap retrieval
- ////@begin iaMainFrame bitmap retrieval
- wxUnusedVar(name);
- return wxNullBitmap;
- ////@end iaMainFrame bitmap retrieval
-}
-void iaMainFrame::OnShowColliders (wxCommandEvent& event)
-{
- central_info->Get3dView ()->Show (IA_OBJECT_TYPE_COLLIDER, event.IsChecked ());
-}
-void iaMainFrame::OnShowJoints (wxCommandEvent& event)
-{
- central_info->Get3dView ()->Show (IA_OBJECT_TYPE_JOINT, event.IsChecked ());
-}
-void iaMainFrame::OnShowBones (wxCommandEvent& event)
-{
- central_info->Get3dView ()->Show (IA_OBJECT_TYPE_BONE, event.IsChecked ());
-}
-void iaMainFrame::OnDrawWireFrame (wxCommandEvent& event)
-{
- central_info->Get3dView ()->DisplayWireframe (event.IsChecked ());
-}
-void iaMainFrame::OnShowBodies (wxCommandEvent& event)
-{
- central_info->Get3dView ()->Show (IA_OBJECT_TYPE_BODY, event.IsChecked ());
-}
-void iaMainFrame::OnShowCharacters (wxCommandEvent& event)
-{
- central_info->Get3dView ()->Show (IA_OBJECT_TYPE_CHARACTER, event.IsChecked ());
-}
-wxIcon iaMainFrame::GetIconResource(const wxString& name)
-{
- // Icon retrieval
- ////@begin iaMainFrame icon retrieval
- wxUnusedVar(name);
- return wxNullIcon;
- ////@end iaMainFrame icon retrieval
-}
-void iaMainFrame::OnLoadMenuItem ( wxCommandEvent& event )
-{
- //wxFileDialog ofd (m_mainfrm, "Load file", central_info->GetProjectPath ().c_str (), "", "*.*", wxOPEN);
- //if (ofd.ShowModal () == wxID_OK)
- //{
- // central_info->LoadObject (ofd.GetFilename ().c_str (),ofd.GetDirectory ().c_str ());
- //}
-}
-void iaMainFrame::OnDelete (wxCommandEvent& event)
-{
- central_info->GetObjectsInfo ()->DeleteSelected ();
-}
-void iaMainFrame::OnSaveMenuItem ( wxCommandEvent& event )
-{
- central_info->SaveProject ();
-}
-void iaMainFrame::OnLoadProjectMenuItem (wxCommandEvent& event)
-{
- wxFileDialog pfd (m_mainfrm, _T("Choose project file"),
- wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T(""), _T("*.iaprj"), wxOPEN);
- if (pfd.ShowModal () == wxID_OK)
- {
- central_info->LoadProject (pfd.GetFilename ().mb_str (), pfd.GetDirectory ().mb_str ());
- }
-}
-void iaMainFrame::OnAttachScriptedControllerMenuItem (wxCommandEvent& event)
-{
- OnAttachScriptedController (this);
-}
-void iaMainFrame::OnAttachJointMenuItem (wxCommandEvent& event)
-{
- OnAttachJoint ();
-}
-void iaMainFrame::OnAttachBodyMenuItem (wxCommandEvent& event)
-{
- OnAttachBody ();
-}
-void iaMainFrame::OnAttachCapsuleColliderMenuItem (wxCommandEvent& event)
-{
- OnAttachCapsuleCollider ();
-}
-void iaMainFrame::OnAttachSphereColliderMenuItem (wxCommandEvent& event)
-{
- OnAttachSphereCollider ();
-}
-void iaMainFrame::OnAttachBoxColliderMenuItem (wxCommandEvent& event)
-{
- OnAttachBoxCollider ();
-}
-void iaMainFrame::OnNewProjectMenuItem (wxCommandEvent& event)
-{
- wxFileDialog wfd (m_mainfrm, _T("Choose world file"),
- wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T(""), _T("*.*"), wxOPEN);
- if (wfd.ShowModal () == wxID_OK)
- {
- central_info->NewProject (wfd.GetFilename ().mb_str (),wfd.GetDirectory ().mb_str ());
- }
-}
-void iaMainFrame::OnExitMenuItem (wxCommandEvent& event)
-{
- m_mainfrm->Close();
-}
-void iaMainFrame::OnSaveAsMenuItem ( wxCommandEvent& event )
-{
- event.Skip();
-}
-void iaMainFrame::OnSize(wxSizeEvent& event)
-{
- if (m_mainfrm->pnl_3dview)
- {
- central_info->Get3dView ()->SetSize (m_mainfrm->pnl_3dview->GetClientSize().x,
- m_mainfrm->pnl_3dview->GetClientSize().y);
- }
- event.Skip();
-}
-
Deleted: trunk/src/apps/editor/gui/iaMainFrame.h
===================================================================
--- trunk/src/apps/editor/gui/iaMainFrame.h 2007-10-08 11:40:28 UTC (rev 342)
+++ trunk/src/apps/editor/gui/iaMainFrame.h 2007-10-08 11:59:12 UTC (rev 343)
@@ -1,185 +0,0 @@
-/*
-Copyright (C) 2005 - 2007 by Piotr Obrzut and Valentin Vit
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public
-License as published by the Free Software Foundation; either
-version 2 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with this library; if not, write to the Free
-Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-
-#ifndef _IA_MAINFRAME_H_
-#define _IA_MAINFRAME_H_
-
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma interface "ia_mainframe.h"
-#endif
-
-
-#include <wx/statusbr.h>
-#include <wx/laywin.h>
-#include <wx/intl.h>
-
-#include "editor.h"
-#include "ia-tool/iaObjectsManager.h"
-#include "ia-tool/iaBaseObjectListener.h"
-#include <wx/aui/aui.h>
-
-
-
-////@begin control identifiers
-#define ID_FRAME 10000
-#define SYMBOL_IAMAINFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE | wxHSCROLL | wxVSCROLL
-#define SYMBOL_IAMAINFRAME_TITLE _("iaMainFrame")
-#define SYMBOL_IAMAINFRAME_IDNAME ID_FRAME
-#define SYMBOL_IAMAINFRAME_SIZE wxSize(300, 300)
-#define SYMBOL_IAMAINFRAME_POSITION wxPoint(10, 10)
-#define ID_STATUSBAR 10001
-#define ID_PANEL 10002
-#define ID_MENUITEM1 10008
-#define ID_MENU 10006
-#define ID_MENUITEM 10007
-#define ID_MENUITEM2 10009
-#define ID_MENUITEM_SAVE 10010
-#define ID_MENUITEM_SAVE_AS 10011
-#define ID_MENUITEM_LOAD 10012
-#define ID_TOOLBAR 10004
-#define ID_PANEL 10002
-#define ID_SIMULATION_PANEL 10019
-#define ID_OBJECTS_TREE_PANEL 10020
-#define ID_PANEL7 10024
-#define ID_TOOLBAR2 10025
-//#define ID_MENUITEM_CREATE_RAGDOLL 10023
-#define ID_MENUITEM_NEW_PROJECT 10027
-#define ID_MENUITEM_LOAD_PROJECT 10028
-#define ID_MENUITEM_EXIT 10029
-#define ID_TOOL_SAVE 10032
-#define ID_TOOL_IMPORT 10033
-#define ID_TOOL_EXPORT 10034
-#define ID_TOOL_MOVE 10035
-#define ID_TOOL_ROTATE 10036
-#define ID_TOOL_MOVE_BODY 10037
-#define ID_TOOL_ROTATE_BODY 10038
-#define ID_TOOL_CREATE_CHAR 10039
-#define ID_TOOL_ATTACH_BOX_COLLIDER 10040
-#define ID_TOOL_ATTACH_CILINDER_COLLIDER 10041
-#define ID_TOOL_ATTACH_SPHERE_COLLIDER 10042
-#define ID_TOOL_ANIMATION 10043
-#define ID_TOOL_FORCE 10044
-#define ID_TOOL_CONTROLLER 10045
-#define ID_TOOL_CAMERA 10045
-#define ID_MENUITEM_DRAW_WIREFRAME 10046
-#define ID_MENUITEM_SHOW_COLLIDERS 10047
-#define ID_MENUITEM_SHOW_BONES 10048
-#define ID_MENUITEM_SHOW_JOINTS 10049
-#define ID_MENUITEM_SHOW_BODIES 10050
-#define ID_MENUITEM_SHOW_CHARACTERS 10051
-#define ID_TOOL_ATTACH_CAPSULE_COLLIDER 10052
-////@end control identifiers
-
-/*!
-* Compatibility
-*/
-
-#ifndef wxCLOSE_BOX
-#define wxCLOSE_BOX 0x1000
-#endif
-
-
-struct iEditorObjectsInfo;
-class iaMainFrame;
-class iaObjectTree;
-class ObjectToolbarGUI;
-class iaSimulationPanel;
-
-/*!
-* iaMainFrame class declaration
-*/
-
-class iaMainFrame : public wxFrame, public iaObjectsManager, public iaBaseObjectListener
-{
- DECLARE_CLASS( iaMainFrame )
-
-public:
-
- wxAuiManager aui_mgr;
- wxPanel *pnl_3dview;
- wxBoxSizer *bxSz3Dview;
- iaObjectTree *objtree;
- iaSimulationPanel *sim_panel;
-
- wxMenu *itemMenuAttach;
- wxMenu *itemMenuEdit;
-
- wxPanel *pnl_controler;
- wxPanel *pnl_tlb;
- wxToolBar * tlb_bottom;
-
- iaMainFrame ();
- ~iaMainFrame ();
- //iaMainFrame(iaDataSubject *data,iaCSApplication *csApp,wxWindow* parent, wxWindowID id = SYMBOL_IAMAINFRAME_IDNAME, const wxString& caption = SYMBOL_IAMAINFRAME_TITLE, const wxPoint& pos = SYMBOL_IAMAINFRAME_POSITION, const wxSize& size = SYMBOL_IAMAINFRAME_SIZE, long style = SYMBOL_IAMAINFRAME_STYLE );
- iaMainFrame (iEditorCentralInfo* info,wxWindow *parent, const wxWindowID id,
- const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
-
- bool Create (wxWindow* parent, wxWindowID id = SYMBOL_IAMAINFRAME_IDNAME,
- const wxString& caption = SYMBOL_IAMAINFRAME_TITLE,
- const wxPoint& pos = SYMBOL_IAMAINFRAME_POSITION,
- const wxSize& size = SYMBOL_IAMAINFRAME_SIZE, long style = SYMBOL_IAMAINFRAME_STYLE );
-
- /// Creates the controls and sizers
- bool CreateControls();
- void UpdatePane (wxWindow *wnd);
-
- wxBitmap GetBitmapResource (const wxString& name );
- wxIcon GetIconResource (const wxString& name );
- /// Should we show tooltips?
- static bool ShowToolTips ();
-
- //events
- //void OnMouse ( wxMouseEvent& event );
- void OnAttachScriptedControllerMenuItem (wxCommandEvent& event);
- void OnAttachJointMenuItem (wxCommandEvent& event);
- void OnAttachBodyMenuItem (wxCommandEvent& event);
- void OnAttachSphereColliderMenuItem (wxCommandEvent& event);
- void OnAttachCapsuleColliderMenuItem (wxCommandEvent& event);
- void OnAttachBoxColliderMenuItem (wxCommandEvent& event);
-
- void OnSize (wxSizeEvent& event);
-
- void OnSaveAsMenuItem (wxCommandEvent& event);
- void OnSaveMenuItem (wxCommandEvent& event);
- void OnLoadMenuItem (wxCommandEvent& event);
- //void OnCreateRagdollMenuItem (wxCommandEvent& event);
- void OnNewProjectMenuItem (wxCommandEvent& event);
- void OnLoadProjectMenuItem (wxCommandEvent& event);
- void OnExitMenuItem (wxCommandEvent& event);
- void OnDelete (wxCommandEvent& event);
- void OnSortByType (wxCommandEvent& event);
- void OnDrawWireFrame (wxCommandEvent& event);
- void OnShowColliders (wxCommandEvent& event);
- void OnShowJoints (wxCommandEvent& event);
- void OnShowBones (wxCommandEvent& event);
- void OnShowBodies (wxCommandEvent& event);
- void OnShowCharacters (wxCommandEvent& event);
-
- void ObjectSelected (iEditorObject *obj);
- void ObjectRemoved (iEditorObject *obj);
- void ObjectAdded (iEditorObject *obj);
- void ObjectChanged (iEditorObject *obj, iEditorObjectProperty* prop);
-
- DECLARE_EVENT_TABLE()
-};
-
-
-#endif
-// _IA_MAINFRAME_H_
-
Added: trunk/src/apps/editor/gui/widgets/iaMainFrame.cpp
===================================================================
--- trunk/src/apps/editor/gui/widgets/iaMainFrame.cpp (rev 0)
+++ trunk/src/apps/editor/gui/widgets/iaMainFrame.cpp 2007-10-08 11:59:12 UTC (rev 343)
@@ -0,0 +1,516 @@
+/*
+Copyright (C) 2005 - 2007 by Piotr Obrzut and Valentin Vit
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free
+Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma implementation "ia_mainframe.h"
+#endif
+
+// 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 <cssysdef.h>
+#include "../iaCSApplication.h"
+
+#include <wx/dc.h>
+#include <wx/filedlg.h>
+#include <wx/laywin.h>
+
+#include "widgets/iaObjectTree.h"
+#include "widgets/iaPropertyGrid.h"
+#include "widgets/iaPropertySheet.h"
+#include "widgets/iaSimulationPanel.h"
+#include <string>
+
+#include "editor.h"
+#include "iaMainFrame.h"
+
+IMPLEMENT_CLASS(iaMainFrame, wxFrame)
+/*!
+* iaMainFrame event table definition
+*/
+BEGIN_EVENT_TABLE(iaMainFrame, wxFrame)
+//EVT_LEFT_DOWN(iaMainFrame::OnMouse)
+//EVT_LEFT_DCLICK(iaMainFrame::OnMouse)
+
+EVT_SIZE(iaMainFrame::OnSize)
+
+EVT_MENU(IA_MENUITEM_ATTACH_BODY, iaMainFrame::OnAttachBodyMenuItem)
+EVT_MENU(IA_MENUITEM_ATTACH_SPHERE_COLLIDER, iaMainFrame::OnAttachSphereColliderMenuItem)
+EVT_MENU(IA_MENUITEM_ATTACH_BOX_COLLIDER, iaMainFrame::OnAttachBoxColliderMenuItem)
+EVT_MENU(IA_MENUITEM_ATTACH_CAPSULE_COLLIDER, iaMainFrame::OnAttachCapsuleColliderMenuItem)
+EVT_MENU(IA_MENUITEM_ATTACH_JOINT, iaMainFrame::OnAttachJointMenuItem)
+EVT_MENU(ID_MENUITEM_LOAD, iaMainFrame::OnLoadMenuItem)
+EVT_MENU(ID_MENUITEM_SAVE, iaMainFrame::OnSaveMenuItem)
+EVT_MENU(ID_MENUITEM_NEW_PROJECT, iaMainFrame::OnNewProjectMenuItem)
+EVT_MENU(ID_MENUITEM_LOAD_PROJECT, iaMainFrame::OnLoadProjectMenuItem)
+EVT_MENU(ID_MENUITEM_SAVE_AS, iaMainFrame::OnSaveAsMenuItem)
+EVT_MENU(ID_MENUITEM_EXIT, iaMainFrame::OnExitMenuItem)
+EVT_MENU(IA_MENUITEM_DELETE, iaMainFrame::OnDelete)
+EVT_MENU(IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, iaMainFrame::OnAttachScriptedControllerMenuItem)
+EVT_MENU(ID_MENUITEM_DRAW_WIREFRAME, iaMainFrame::OnDrawWireFrame)
+EVT_MENU(ID_MENUITEM_SHOW_COLLIDERS, iaMainFrame::OnShowColliders)
+EVT_MENU(ID_MENUITEM_SHOW_JOINTS, iaMainFrame::OnShowJoints)
+EVT_MENU(ID_MENUITEM_SHOW_BONES, iaMainFrame::OnShowBones)
+EVT_MENU(ID_MENUITEM_SHOW_BODIES, iaMainFrame::OnShowBodies)
+EVT_MENU(ID_MENUITEM_SHOW_CHARACTERS, iaMainFrame::OnShowCharacters)
+
+EVT_TOOL(ID_TOOL_ATTACH_CAPSULE_COLLIDER, iaMainFrame::OnAttachCapsuleColliderMenuItem)
+EVT_TOOL(ID_TOOL_ATTACH_BOX_COLLIDER, iaMainFrame::OnAttachBoxColliderMenuItem)
+EVT_TOOL(ID_TOOL_ATTACH_SPHERE_COLLIDER, iaMainFrame::OnAttachSphereColliderMenuItem)
+EVT_TOOL(ID_TOOL_CONTROLLER, iaMainFrame::OnAttachScriptedControllerMenuItem)
+EVT_TOOL(ID_TOOL_SAVE, iaMainFrame::OnSaveMenuItem)
+EVT_TOOL(ID_TOOL_IMPORT, iaMainFrame::OnLoadProjectMenuItem)
+
+END_EVENT_TABLE()
+
+iaMainFrame *m_mainfrm;
+
+iaMainFrame::~iaMainFrame()
+{
+ central_info->Get3dView ()->ShutDown ();
+ aui_mgr.UnInit();
+}
+
+iaMainFrame::iaMainFrame()
+{
+ m_mainfrm = this;
+}
+
+iaMainFrame::iaMainFrame(iEditorCentralInfo* info, wxWindow* parent,
+ const wxWindowID id, const wxString& title, const wxPoint& pos,
+ const wxSize& size, const long style)
+{
+ central_info = info;
+ m_mainfrm = this;
+ central_info->GetObjectsInfo ()->AddListener ((iaBaseObjectListener*)this);
+ SetMinSize(wxSize(400,300));
+}
+
+bool iaMainFrame::Create(wxWindow* parent, wxWindowID id, const wxString& caption,
+ const wxPoint& pos, const wxSize& size, long style)
+{
+ pnl_3dview = NULL;
+ wxFrame::Create (parent, id, caption, pos, size, style);
+
+ if (!CreateControls ())
+ return false;
+
+ pnl_3dview->SetFocus ();
+
+ Centre ();
+
+ return true;
+}
+
+void iaMainFrame::ObjectSelected (iEditorObject *obj)
+{
+ bool can_delete = true;
+ for (size_t i = 0; i < central_info->GetObjectsInfo ()->GetSelectedObjectsCount (); i++)
+ {
+ if (!central_info->GetObjectsInfo ()->GetSelectedObject (i)->CanBeDeleted ())
+ can_delete = false;
+ }
+ itemMenuEdit->Enable (IA_MENUITEM_DELETE, can_delete);
+
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, false);
+
+ if (central_info->GetObjectsInfo ()->GetSelectedObjectsCount () == 1)
+ {
+ iEditorObject *obj = central_info->GetObjectsInfo ()->GetSelectedObject (0);
+ if (obj->CanAttach (IA_OBJECT_TYPE_BODY))
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, true);
+ if (obj->CanAttach (IA_OBJECT_TYPE_COLLIDER))
+ {
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, true);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, true);
+ }
+ if (obj->CanAttach (IA_OBJECT_TYPE_CONTROLLER))
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, true);
+
+ }else if(central_info->GetObjectsInfo ()->GetSelectedObjectsCount () == 2)
+ {
+ iEditorObject *obj1 = central_info->GetObjectsInfo ()->GetSelectedObject (0);
+ iEditorObject *obj2 = central_info->GetObjectsInfo ()->GetSelectedObject (1);
+ if (obj1->CanAttach (IA_OBJECT_TYPE_JOINT) && obj2->CanAttach (IA_OBJECT_TYPE_JOINT))
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, true);
+ }
+
+}
+void iaMainFrame::ObjectRemoved (iEditorObject *obj)
+{
+}
+void iaMainFrame::UpdatePane (wxWindow *wnd)
+{
+ aui_mgr.GetPane (wnd).BestSize (wnd->GetSize ());
+ aui_mgr.InsertPane (wnd, aui_mgr.GetPane (wnd), wxAUI_INSERT_DOCK);
+ aui_mgr.Update ();
+}
+void iaMainFrame::ObjectAdded (iEditorObject *obj)
+{
+}
+void iaMainFrame::ObjectChanged (iEditorObject *obj, iEditorObjectProperty* prop)
+{
+}
+
+/*!
+* Control creation for ia_MainFrame
+*/
+bool iaMainFrame::CreateControls()
+{
+ aui_mgr.SetManagedWindow (this);
+
+ wxString icons_path = wxString (central_info->GetIconsPath ().c_str (), wxConvUTF8);
+ if (icons_path.Cmp (_T("")) == 0)
+ return false;
+
+ //menu and statusbar
+ iaMainFrame* itemFrame1 = this;
+
+ wxMenuBar* menuBar = new wxMenuBar;
+ wxMenu* itemMenu5 = new wxMenu;
+ itemMenu5->Append (ID_MENUITEM_NEW_PROJECT, _("New Project...\tCTRL+N"), _T(""), wxITEM_NORMAL);
+ itemMenu5->Append (ID_MENUITEM_LOAD_PROJECT, _("Load Project...\tCTRL+L"), _T(""), wxITEM_NORMAL);
+ //itemMenu5->Append (ID_MENUITEM_LOAD, _("Load..."), _T(""), wxITEM_NORMAL);
+ itemMenu5->Append (ID_MENUITEM_SAVE, _("Save Project\tCTRL+S"), _T(""), wxITEM_NORMAL);
+ //itemMenu5->Append (ID_MENUITEM_SAVE_AS, _("Save As..."), _T(""), wxITEM_NORMAL);
+ itemMenu5->Append(ID_MENUITEM_EXIT, _("Exit\tCTRL+X"), _T(""), wxITEM_NORMAL);
+ menuBar->Append(itemMenu5, _("File"));
+ itemMenuEdit = new wxMenu;
+ itemMenuEdit->Append (IA_MENUITEM_DELETE, _("Delete\tDel"), _T(""), wxITEM_NORMAL);
+ menuBar->Append(itemMenuEdit, _("Edit"));
+ wxMenu* itemMenuView = new wxMenu;
+ menuBar->Append(itemMenuView, _("View"));
+ itemMenuView->Append (ID_MENUITEM_DRAW_WIREFRAME, _("Draw wireframe"), _T(""), wxITEM_CHECK);
+ itemMenuView->Append (ID_MENUITEM_SHOW_BONES, _("Show Bones"), _T(""), wxITEM_CHECK);
+ itemMenuView->Check (ID_MENUITEM_SHOW_BONES, true);
+ itemMenuView->Append (ID_MENUITEM_SHOW_COLLIDERS, _("Show Colliders"), _T(""), wxITEM_CHECK);
+ itemMenuView->Check (ID_MENUITEM_SHOW_COLLIDERS, true);
+ itemMenuView->Append (ID_MENUITEM_SHOW_JOINTS, _("Show Joints"), _T(""), wxITEM_CHECK);
+ itemMenuView->Check (ID_MENUITEM_SHOW_JOINTS, true);
+ itemMenuView->Append (ID_MENUITEM_SHOW_BODIES, _("Show Bodies"), _T(""), wxITEM_CHECK);
+ itemMenuView->Check (ID_MENUITEM_SHOW_BODIES, true);
+ itemMenuView->Append (ID_MENUITEM_SHOW_CHARACTERS, _("Show Characters"), _T(""), wxITEM_CHECK);
+ itemMenuView->Check (ID_MENUITEM_SHOW_CHARACTERS, true);
+
+ itemMenuAttach = new wxMenu;
+ itemMenuAttach->Append (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, _("Attach Sphere Collider..."),
+ _T(""),wxITEM_NORMAL);
+ itemMenuAttach->Append (IA_MENUITEM_ATTACH_BOX_COLLIDER, _("Attach Box Collider..."),
+ _T(""),wxITEM_NORMAL);
+ itemMenuAttach->Append (IA_MENUITEM_ATTACH_BODY, _("Attach Body...\tCTRL+B"), _T(""), wxITEM_NORMAL);
+ itemMenuAttach->Append (IA_MENUITEM_ATTACH_JOINT, _("Attach Joint...\tCTRL+J"), _T(""), wxITEM_NORMAL);
+ itemMenuAttach->Append (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER,
+ _("Attach Scripted Controler...\tCTRL+C"), _T(""), wxITEM_NORMAL);
+ menuBar->Append (itemMenuAttach, _("Attach"));
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
+
+ wxMenu* itemMenu13 = new wxMenu;
+ itemMenu13->Append (ID_MENUITEM2, _("About"), _T(""), wxITEM_NORMAL);
+ menuBar->Append (itemMenu13, _("Help"));
+ itemFrame1->SetMenuBar (menuBar);
+
+ wxStatusBar* itemStatusBar2 = new wxStatusBar (itemFrame1, ID_STATUSBAR,
+ wxST_SIZEGRIP | wxNO_BORDER);
+ itemStatusBar2->SetFieldsCount (2);
+ itemFrame1->SetStatusBar (itemStatusBar2);
+ //end menu and statusbar
+
+ //toolbar
+ wxInitAllImageHandlers ();
+ wxToolBar* tb1 = CreateToolBar (wxTB_FLAT | wxTB_HORIZONTAL, ID_TOOLBAR);
+ tb1->SetToolBitmapSize (wxSize(32, 32));
+
+ tb1->AddSeparator();
+
+ wxBitmap itemtool2Bitmap (icons_path + _T("Icon_save.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool2BitmapDisabled (icons_path + _T("Icon_save_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_SAVE, _T(""), itemtool2Bitmap, itemtool2BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Save project"));
+
+ wxBitmap itemtool3Bitmap (icons_path + _T("Icon_import.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool3BitmapDisabled (icons_path + _T("Icon_import_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_IMPORT, _T(""), itemtool3Bitmap, itemtool3BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Load Project"));
+
+#if 0
+ wxBitmap itemtool4Bitmap (icons_path + _T("Icon_export.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool4BitmapDisabled (icons_path + _T ("Icon_export_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_EXPORT, _T(""), itemtool4Bitmap, itemtool4BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Export physics (currently not avaible)"));
+#endif
+
+ tb1->AddSeparator();
+#if 0
+ wxBitmap itemtool5Bitmap (icons_path + _T("Icon_move.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool5BitmapDisabled (icons_path + _T ("Icon_move_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_MOVE, _T(""), itemtool5Bitmap, itemtool5BitmapDisabled, wxITEM_NORMAL, _T(""),
+ wxT("Move Object (currently not avaible)"));
+
+ wxBitmap itemtool6Bitmap (icons_path + _T("Icon_rotate.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool6BitmapDisabled (icons_path + _T("Icon_rotate_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_ROTATE, _T(""), itemtool6Bitmap, itemtool6BitmapDisabled, wxITEM_NORMAL, _T(""),
+ wxT("Rotate Object (currently not avaible)"));
+
+ tb1->AddSeparator();
+
+ wxBitmap itemtool7Bitmap (icons_path + _T ("Icon_movebody.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool7BitmapDisabled (icons_path + _T("Icon_movebody_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_MOVE_BODY, _T(""), itemtool7Bitmap, itemtool7BitmapDisabled,
+ wxITEM_NORMAL, _T(""), wxT("Move rigid body (currently not avaible)"));
+
+ wxBitmap itemtool8Bitmap (icons_path + _T("Icon_rotatebody.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool8BitmapDisabled (icons_path + _T("Icon_rotatebody_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_ROTATE_BODY, _T(""), itemtool8Bitmap, itemtool8BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Rotate rigid body (currently not avaible)"));
+
+ tb1->AddSeparator();
+
+ wxBitmap itemtool9Bitmap (icons_path + _T("Icon_rag.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool9BitmapDisabled (icons_path + _T("Icon_rag_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_CREATE_CHAR, _T(""), itemtool9Bitmap, itemtool9BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Create character from given model"));
+#endif
+
+ wxBitmap itemtool10Bitmap (icons_path + _T("Icon_cube.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool10BitmapDisabled (icons_path + _T("Icon_cube_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_ATTACH_BOX_COLLIDER, _T(""), itemtool10Bitmap, itemtool10BitmapDisabled,
+ wxITEM_NORMAL, _T(""), wxT("Attach box collider"));
+
+ wxBitmap itemtool11Bitmap (icons_path + _T ("Icon_cilinder.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool11BitmapDisabled(icons_path + _T ("Icon_cilinder_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool(ID_TOOL_ATTACH_CAPSULE_COLLIDER, _T(""), itemtool11Bitmap, itemtool11BitmapDisabled,
+ wxITEM_NORMAL, _T(""), wxT("Attach cilinder collider"));
+
+ wxBitmap itemtool12Bitmap (icons_path + _T ("Icon_sphere.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool12BitmapDisabled (icons_path + _T("Icon_sphere_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_ATTACH_SPHERE_COLLIDER, _T(""), itemtool12Bitmap, itemtool12BitmapDisabled,
+ wxITEM_NORMAL, _T(""), wxT("Attach sphere collider"));
+
+#if 0
+ wxBitmap itemtool16Bitmap (icons_path + _T("Icon_animation.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool16BitmapDisabled (icons_path + _T("Icon_animation_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_ANIMATION, _T(""), itemtool16Bitmap, itemtool16BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Animation tool (not avaible yet)"));
+
+ wxBitmap itemtool17Bitmap (icons_path + _T("Icon_force.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool17BitmapDisabled (icons_path + _T("Icon_force_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_FORCE, _T(""), itemtool17Bitmap, itemtool17BitmapDisabled, wxITEM_NORMAL,
+ _T(""), wxT("Create force (not avaible yet)"));
+#endif
+
+ wxBitmap itemtool18Bitmap (icons_path + _T("Icon_controler.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool18BitmapDisabled (icons_path + _T("Icon_controler_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool (ID_TOOL_CONTROLLER, _T(""),
+ itemtool18Bitmap, itemtool18BitmapDisabled, wxITEM_NORMAL, _T(""), wxT("Attach controller"));
+
+ tb1->AddSeparator();
+
+#if 0
+ wxBitmap itemtool19Bitmap(icons_path + _T("Icon_camera.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap itemtool19BitmapDisabled(icons_path + _T("Icon_camera_a.png"), wxBITMAP_TYPE_PNG);
+ tb1->AddTool(ID_TOOL_CAMERA, _T(""), itemtool19Bitmap, itemtool19BitmapDisabled, wxITEM_NORMAL, _T(""),
+ wxT("Record (not avaible yet)"));
+
+ tb1->AddSeparator();
+#endif
+
+ itemMenuEdit->Enable (IA_MENUITEM_DELETE, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BODY, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SPHERE_COLLIDER, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_BOX_COLLIDER, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_JOINT, false);
+ itemMenuAttach->Enable (IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER, false);
+
+ tb1->Realize();
+ itemFrame1->SetToolBar (tb1);
+ //end toolbar
+
+ sim_panel = new iaSimulationPanel (central_info, this, ID_SIMULATION_PANEL,
+ wxDefaultPosition, wxSize(GetSize().x, 115), wxNO_BORDER | wxTAB_TRAVERSAL);
+ sim_panel->SetBackgroundColour (wxColor (255, 255, 255));
+ sim_panel->CreateControls ();
+
+ //the tree
+ objtree = new iaObjectTree (central_info, this, ID_OBJECTS_TREE_PANEL, wxDefaultPosition, wxSize(200, 63),
+ wxNO_BORDER | wxTAB_TRAVERSAL, icons_path);
+ objtree->SetBackgroundColour (wxColor (255, 255, 255));
+
+ //3dview
+ pnl_3dview = new wxPanel (this, ID_PANEL, wxDefaultPosition, wxSize(131, 63),
+ wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
+ pnl_3dview->SetBackgroundColour(wxColour(0, 0, 128));
+
+ //pnl right ->propgrid
+ iaPropertyGrid* propEditor = new iaPropertyGrid (central_info, this, -1, wxPoint(3, 3),
+ wxSize(131, 63), wxPG_BOLD_MODIFIED | wxPG_SPLITTER_AUTO_CENTER | wxPG_AUTO_SORT | wxTOP |
+ wxTAB_TRAVERSAL| wxPG_BOOL_USE_CHECKBOX);
+ propEditor->SetMarginColour (wxColor (122, 110, 90));
+ propEditor->SetLineColour (wxColor (0,0,0));
+ propEditor->SetCaptionBackgroundColour (wxColor (122, 110, 90));
+ propEditor->SetCaptionForegroundColour (wxColor (0,0,0));
+ //propEditor->SetCellBackgroundColour (wxColor (122, 110, 90));
+
+ aui_mgr.AddPane (sim_panel, wxAuiPaneInfo ().Name (
+ wxT ("pnl_bottom")).Caption (wxT ("Simulation")).Bottom());
+
+ aui_mgr.AddPane(objtree, wxAuiPaneInfo ().Name (wxT ("objtree")).Caption (
+ wxT ("Objects Tree")).Left());
+
+ aui_mgr.AddPane (propEditor, wxAuiPaneInfo ().Name (wxT ("properties")).Caption (
+ wxT ("Properties")).Right());
+
+ aui_mgr.AddPane (pnl_3dview, wxCENTER);
+
+ aui_mgr.Update ();
+
+ return true;
+}
+
+bool iaMainFrame::ShowToolTips()
+{
+ return true;
+}
+
+wxBitmap iaMainFrame::GetBitmapResource(const wxString& name)
+{
+ // Bitmap retrieval
+ ////@begin iaMainFrame bitmap retrieval
+ wxUnusedVar(name);
+ return wxNullBitmap;
+ ////@end iaMainFrame bitmap retrieval
+}
+void iaMainFrame::OnShowColliders (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->Show (IA_OBJECT_TYPE_COLLIDER, event.IsChecked ());
+}
+void iaMainFrame::OnShowJoints (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->Show (IA_OBJECT_TYPE_JOINT, event.IsChecked ());
+}
+void iaMainFrame::OnShowBones (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->Show (IA_OBJECT_TYPE_BONE, event.IsChecked ());
+}
+void iaMainFrame::OnDrawWireFrame (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->DisplayWireframe (event.IsChecked ());
+}
+void iaMainFrame::OnShowBodies (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->Show (IA_OBJECT_TYPE_BODY, event.IsChecked ());
+}
+void iaMainFrame::OnShowCharacters (wxCommandEvent& event)
+{
+ central_info->Get3dView ()->Show (IA_OBJECT_TYPE_CHARACTER, event.IsChecked ());
+}
+wxIcon iaMainFrame::GetIconResource(const wxString& name)
+{
+ // Icon retrieval
+ ////@begin iaMainFrame icon retrieval
+ wxUnusedVar(name);
+ return wxNullIcon;
+ ////@end iaMainFrame icon retrieval
+}
+void iaMainFrame::OnLoadMenuItem ( wxCommandEvent& event )
+{
+ //wxFileDialog ofd (m_mainfrm, "Load file", central_info->GetProjectPath ().c_str (), "", "*.*", wxOPEN);
+ //if (ofd.ShowModal () == wxID_OK)
+ //{
+ // central_info->LoadObject (ofd.GetFilename ().c_str (),ofd.GetDirectory ().c_str ());
+ //}
+}
+void iaMainFrame::OnDelete (wxCommandEvent& event)
+{
+ central_info->GetObjectsInfo ()->DeleteSelected ();
+}
+void iaMainFrame::OnSaveMenuItem ( wxCommandEvent& event )
+{
+ central_info->SaveProject ();
+}
+void iaMainFrame::OnLoadProjectMenuItem (wxCommandEvent& event)
+{
+ wxFileDialog pfd (m_mainfrm, _T("Choose project file"),
+ wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T(""), _T("*.iaprj"), wxOPEN);
+ if (pfd.ShowModal () == wxID_OK)
+ {
+ central_info->LoadProject (pfd.GetFilename ().mb_str (), pfd.GetDirectory ().mb_str ());
+ }
+}
+void iaMainFrame::OnAttachScriptedControllerMenuItem (wxCommandEvent& event)
+{
+ OnAttachScriptedController (this);
+}
+void iaMainFrame::OnAttachJointMenuItem (wxCommandEvent& event)
+{
+ OnAttachJoint ();
+}
+void iaMainFrame::OnAttachBodyMenuItem (wxCommandEvent& event)
+{
+ OnAttachBody ();
+}
+void iaMainFrame::OnAttachCapsuleColliderMenuItem (wxCommandEvent& event)
+{
+ OnAttachCapsuleCollider ();
+}
+void iaMainFrame::OnAttachSphereColliderMenuItem (wxCommandEvent& event)
+{
+ OnAttachSphereCollider ();
+}
+void iaMainFrame::OnAttachBoxColliderMenuItem (wxCommandEvent& event)
+{
+ OnAttachBoxCollider ();
+}
+void iaMainFrame::OnNewProjectMenuItem (wxCommandEvent& event)
+{
+ wxFileDialog wfd (m_mainfrm, _T("Choose world file"),
+ wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T(""), _T("*.*"), wxOPEN);
+ if (wfd.ShowModal () == wxID_OK)
+ {
+ central_info->NewProject (wfd.GetFilename ().mb_str (),wfd.GetDirectory ().mb_str ());
+ }
+}
+void iaMainFrame::OnExitMenuItem (wxCommandEvent& event)
+{
+ m_mainfrm->Close();
+}
+void iaMainFrame::OnSaveAsMenuItem ( wxCommandEvent& event )
+{
+ event.Skip();
+}
+void iaMainFrame::OnSize(wxSizeEvent& event)
+{
+ if (m_mainfrm->pnl_3dview)
+ {
+ central_info->Get3dView ()->SetSize (m_mainfrm->pnl_3dview->GetClientSize().x,
+ m_mainfrm->pnl_3dview->GetClientSize().y);
+ }
+ event.Skip();
+}
+
Added: trunk/src/apps/editor/gui/widgets/iaMainFrame.h
===================================================================
--- trunk/src/apps/editor/gui/widgets/iaMainFrame.h (rev 0)
+++ trunk/src/apps/editor/gui/widgets/iaMainFrame.h 2007-10-08 11:59:12 UTC (rev 343)
@@ -0,0 +1,185 @@
+/*
+Copyright (C) 2005 - 2007 by Piotr Obrzut and Valentin Vit
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the Free
+Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+
+#ifndef _IA_MAINFRAME_H_
+#define _IA_MAINFRAME_H_
+
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+#pragma interface "ia_mainframe.h"
+#endif
+
+
+#include <wx/statusbr.h>
+#include <wx/laywin.h>
+#include <wx/intl.h>
+
+#include "editor.h"
+#include "iaObjectsManager.h"
+#include "ia-tool/iaBaseObjectListener.h"
+#include <wx/aui/aui.h>
+
+
+
+////@begin control identifiers
+#define ID_FRAME 10000
+#define SYMBOL_IAMAINFRAME_STYLE wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE | wxHSCROLL | wxVSCROLL
+#define SYMBOL_IAMAINFRAME_TITLE _("iaMainFrame")
+#define SYMBOL_IAMAINFRAME_IDNAME ID_FRAME
+#define SYMBOL_IAMAINFRAME_SIZE wxSize(300, 300)
+#define SYMBOL_IAMAINFRAME_POSITION wxPoint(10, 10)
+#define ID_STATUSBAR 10001
+#define ID_PANEL 10002
+#define ID_MENUITEM1 10008
+#define ID_MENU 10006
+#define ID_MENUITEM 10007
+#define ID_MENUITEM2 10009
+#define ID_MENUITEM_SAVE 10010
+#define ID_MENUITEM_SAVE_AS 10011
+#define ID_MENUITEM_LOAD 10012
+#define ID_TOOLBAR 10004
+#define ID_PANEL 10002
+#define ID_SIMULATION_PANEL 10019
+#define ID_OBJECTS_TREE_PANEL 10020
+#define ID_PANEL7 10024
+#define ID_TOOLBAR2 10025
+//#define ID_MENUITEM_CREATE_RAGDOLL 10023
+#define ID_MENUITEM_NEW_PROJECT 10027
+#define ID_MENUITEM_LOAD_PROJECT 10028
+#define ID_MENUITEM_EXIT 10029
+#define ID_TOOL_SAVE 10032
+#define ID_TOOL_IMPORT 10033
+#define ID_TOOL_EXPORT 10034
+#define ID_TOOL_MOVE 10035
+#define ID_TOOL_ROTATE 10036
+#define ID_TOOL_MOVE_BODY 10037
+#define ID_TOOL_ROTATE_BODY 10038
+#define ID_TOOL_CREATE_CHAR 10039
+#define ID_TOOL_ATTACH_BOX_COLLIDER 10040
+#define ID_TOOL_ATTACH_CILINDER_COLLIDER 10041
+#define ID_TOOL_ATTACH_SPHERE_COLLIDER 10042
+#define ID_TOOL_ANIMATION 10043
+#define ID_TOOL_FORCE 10044
+#define ID_TOOL_CONTROLLER 10045
+#define ID_TOOL_CAMERA 10045
+#define ID_MENUITEM_DRAW_WIREFRAME 10046
+#define ID_MENUITEM_SHOW_COLLIDERS 10047
+#define ID_MENUITEM_SHOW_BONES 10048
+#define ID_MENUITEM_SHOW_JOINTS 10049
+#define ID_MENUITEM_SHOW_BODIES 10050
+#define ID_MENUITEM_SHOW_CHARACTERS 10051
+#define ID_TOOL_ATTACH_CAPSULE_COLLIDER 10052
+////@end control identifiers
+
+/*!
+* Compatibility
+*/
+
+#ifndef wxCLOSE_BOX
+#define wxCLOSE_BOX 0x1000
+#endif
+
+
+struct iEditorObjectsInfo;
+class iaMainFrame;
+class iaObjectTree;
+class ObjectToolbarGUI;
+class iaSimulationPanel;
+
+/*!
+* iaMainFrame class declaration
+*/
+
+class iaMainFrame : public wxFrame, public iaObjectsManager, public iaBaseObjectListener
+{
+ DECLARE_CLASS( iaMainFrame )
+
+public:
+
+ wxAuiManager aui_mgr;
+ wxPanel *pnl_3dview;
+ wxBoxSizer *bxSz3Dview;
+ iaObjectTree *objtree;
+ iaSimulationPanel *sim_panel;
+
+ wxMenu *itemMenuAttach;
+ wxMenu *itemMenuEdit;
+
+ wxPanel *pnl_controler;
+ wxPanel *pnl_tlb;
+ wxToolBar * tlb_bottom;
+
+ iaMainFrame ();
+ ~iaMainFrame ();
+ //iaMainFrame(iaDataSubject *data,iaCSApplication *csApp,wxWindow* parent, wxWindowID id = SYMBOL_IAMAINFRAME_IDNAME, const wxString& caption = SYMBOL_IAMAINFRAME_TITLE, const wxPoint& pos = SYMBOL_IAMAINFRAME_POSITION, const wxSize& size = SYMBOL_IAMAINFRAME_SIZE, long style = SYMBOL_IAMAINFRAME_STYLE );
+ iaMainFrame (iEditorCentralInfo* info,wxWindow *parent, const wxWindowID id,
+ const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
+
+ bool Create (wxWindow* parent, wxWindowID id = SYMBOL_IAMAINFRAME_IDNAME,
+ const wxString& caption = SYMBOL_IAMAINFRAME_TITLE,
+ const wxPoint& pos = SYMBOL_IAMAINFRAME_POSITION,
+ const wxSize& size = SYMBOL_IAMAINFRAME_SIZE, long style = SYMBOL_IAMAINFRAME_STYLE );
+
+ /// Creates the controls and sizers
+ bool CreateControls();
+ void UpdatePane (wxWindow *wnd);
+
+ wxBitmap GetBitmapResource (const wxString& name );
+ wxIcon GetIconResource (const wxString& name );
+ /// Should we show tooltips?
+ static bool ShowToolTips ();
+
+ //events
+ //void OnMouse ( wxMouseEvent& event );
+ void OnAttachScriptedControllerMenuItem (wxCommandEvent& event);
+ void OnAttachJointMenuItem (wxCommandEvent& event);
+ void OnAttachBodyMenuItem (wxCommandEvent& event);
+ void OnAttachSphereColliderMenuItem (wxCommandEvent& event);
+ void OnAttachCapsuleColliderMenuItem (wxCommandEvent& event);
+ void OnAttachBoxColliderMenuItem (wxCommandEvent& event);
+
+ void OnSize (wxSizeEvent& event);
+
+ void OnSaveAsMenuItem (wxCommandEvent& event);
+ void OnSaveMenuItem (wxCommandEvent& event);
+ void OnLoadMenuItem (wxCommandEvent& event);
+ //void OnCreateRagdollMenuItem (wxCommandEvent& event);
+ void OnNewProjectMenuItem (wxCommandEvent& event);
+ void OnLoadProjectMenuItem (wxCommandEvent& event);
+ void OnExitMenuItem (wxCommandEvent& event);
+ void OnDelete (wxCommandEvent& event);
+ void OnSortByType (wxCommandEvent& event);
+ void OnDrawWireFrame (wxCommandEvent& event);
+ void OnShowColliders (wxCommandEvent& event);
+ void OnShowJoints (wxCommandEvent& event);
+ void OnShowBones (wxCommandEvent& event);
+ void OnShowBodies (wxCommandEvent& event);
+ void OnShowCharacters (wxCommandEvent& event);
+
+ void ObjectSelected (iEditorObject *obj);
+ void ObjectRemoved (iEditorObject *obj);
+ void ObjectAdded (iEditorObject *obj);
+ void ObjectChanged (iEditorObject *obj, iEditorObjectProperty* prop);
+
+ DECLARE_EVENT_TABLE()
+};
+
+
+#endif
+// _IA_MAINFRAME_H_
+
Modified: trunk/src/apps/editor/gui/widgets/iaObjectTree.h
===================================================================
--- trunk/src/apps/editor/gui/widgets/iaObjectTree.h 2007-10-08 11:40:28 UTC (rev 342)
+++ trunk/src/apps/editor/gui/widgets/iaObjectTree.h 2007-10-08 11:59:12 UTC (rev 343)
@@ -19,7 +19,7 @@
#include "wx/wx.h"
#include <wx/treectrl.h>
#include <csutil/hash.h>
-#include "ia-tool/iaObjectsManager.h"
+#include "iaObjectsManager.h"
#include "ia-tool/iaBaseObjectListener.h"
#include "editor.h"
Added: trunk/src/apps/editor/gui/widgets/iaObjectsManager.h
===================================================================
--- trunk/src/apps/editor/gui/widgets/iaObjectsManager.h (rev 0)
+++ trunk/src/apps/editor/gui/widgets/iaObjectsManager.h 2007-10-08 11:59:12 UTC (rev 343)
@@ -0,0 +1,144 @@
+/*
+Copyright (C) 2007 by Piotr Obrzut
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef _IA_OBJ_MANAGER_H_
+#define _IA_OBJ_MANAGER_H_
+
+
+#include <wx/statusbr.h>
+#include <wx/laywin.h>
+#include <wx/intl.h>
+
+#include "editor.h"
+
+////@begin control identifiers
+#define IA_MENUITEM_ATTACH_BODY 0
+#define IA_MENUITEM_ATTACH_JOINT 2
+#define IA_MENUITEM_ATTACH_SPHERE_COLLIDER 3
+#define IA_MENUITEM_ATTACH_BOX_COLLIDER 4
+#define IA_MENUITEM_DELETE 5
+#define ID_MENUITEM_SORT_BY_TYPE 6
+#define IA_MENUITEM_ATTACH_SCRIPTED_CONTROLLER 7
+#define IA_MENUITEM_ATTACH_CAPSULE_COLLIDER 8
+#define IA_MENUITEM_HIDE 9
+#define IA_MENUITEM_SHOW 10
+#define IA_MENUITEM_GROUP 11
+#define IA_MENUITEM_SAVE_ANIMATION 12
+////@end control identifiers
+
+/*!
+* Compatibility
+*/
+
+#ifndef wxCLOSE_BOX
+#define wxCLOSE_BOX 0x1000
+#endif
+
+
+struct iEditorObjectsInfo;
+class iaMainFrame;
+class iaObjectTree;
+class ObjectToolbarGUI;
+//class wxFrameManager;
+
+#include <wx/filedlg.h>
+#include <iScriptController.h>
+#include "iPcDynamicsSystem.h"
+#include "iPcCharacter.h"
+
+class iaObjectsManager : public iEditorObjectsListener
+{
+protected:
+
+ iEditorCentralInfo *central_info;
+
+public:
+
+ iaObjectsManager () : central_info (0) {;}
+
+ void OnSaveAnimation (wxWindow *parent)
+ {
+ wxFileDialog ofd (parent, _T ("Export character animation"),
+ wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T(""), _T("*.*"), wxSAVE);
+ if (ofd.ShowModal () == wxID_OK)
+ {
+ csRef<iPcCharacter> character = scfQueryInterface <iPcCharacter> (
+ central_info->GetObjectsInfo ()->GetSelectedObject (0));
+
+ central_info->GetObjectsInfo ()->ExportAnimation (character,
+ character->GetOutputAnimation (),
+ ofd.GetDirectory ().mb_str (),
+ ofd.GetFilename ().mb_str ());
+ }
+ }
+ void OnAttachScriptedController (wxWindow *parent)
+ {
+ wxFileDialog ofd (parent, _T ("Select script file"),
+ wxString (central_info->GetProjectPath ().c_str (), wxConvUTF8), _T (""), _T ("*.iascr"), wxOPEN);
...
[truncated message content] |