• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン451 (tree)
日時2007-08-17 16:41:33
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/EditorOnes/HPLLib/HPLMapTool.cpp (revision 450)
+++ marathon/trunk/EditorOnes/HPLLib/HPLMapTool.cpp (revision 451)
@@ -22,6 +22,19 @@
2222 //色情報の次元
2323 const int COL_NUM = 3;
2424
25+#ifdef WX
26+
27+wxString wx::string::getString(const char* format, ...)
28+{
29+ char message[BUF_MAX];
30+ va_list maker;
31+ va_start(maker, format);
32+ vsprintf(message, format, maker);
33+ wxString str = wxConvertMB2WX(message);
34+ return str;
35+}
36+#endif
37+
2538 int getKeyByValue(std::map<int, int>& indexMap, int targetValue)
2639 {
2740 for(std::map<int, int>::iterator it = indexMap.begin(); it != indexMap.end(); it ++){
--- marathon/trunk/EditorOnes/HPLLib/HPLAlephLib.h (revision 450)
+++ marathon/trunk/EditorOnes/HPLLib/HPLAlephLib.h (revision 451)
@@ -19,24 +19,5 @@
1919 #include "HPLSurfaceModifier.h"
2020 #include "HPLError.h"
2121
22-#ifdef WX
23-#include "wx/wx.h"
2422
25-//wxWidgets専用関数
26-//char->wx
27-namespace wx{
28- namespace string{
29- wxString getString(const char* format, ...)
30- {
31- char message[BUF_MAX];
32- va_list maker;
33- va_start(maker, format);
34- vsprintf(message, format, maker);
35- wxString str = wxConvertMB2WX(message);
36- return str;
37- }
38- };
39-};
4023 #endif
41-
42-#endif
--- marathon/trunk/EditorOnes/HPLLib/HPLMapTool.h (revision 450)
+++ marathon/trunk/EditorOnes/HPLLib/HPLMapTool.h (revision 451)
@@ -21,6 +21,17 @@
2121 #include <wx/debug.h>
2222 #endif
2323
24+#ifdef WX
25+#include "wx/wx.h"
26+//wxWidgets専用関数
27+//char->wx
28+namespace wx{
29+ namespace string{
30+ wxString getString(const char* format, ...);
31+ };
32+};
33+#endif
34+
2435 namespace hpl{namespace aleph{
2536 class HPLStockManager;
2637 }};
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/WeaponPanel.h (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/WeaponPanel.h (revision 451)
@@ -0,0 +1,12 @@
1+#ifndef _WEAPON_PANEL_
2+#define _WEAPON_PANEL_
3+
4+#include "../Common.h"
5+
6+class WeaponPanel: public wxPanel{
7+public:
8+ WeaponPanel(wxWindow* parent, wxWindowID id);
9+ DECLARE_EVENT_TABLE()
10+};
11+
12+#endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/ProjectilePanel.cpp (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/ProjectilePanel.cpp (revision 451)
@@ -0,0 +1,6 @@
1+#include "ProjectilePanel.h"
2+
3+ProjectilePanel::ProjectilePanel(wxWindow* parent, wxWindowID id):
4+wxPanel(parent, id)
5+{
6+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/EffectPanel.h (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/EffectPanel.h (revision 451)
@@ -0,0 +1,12 @@
1+#ifndef _EFFECT_PANEL_
2+#define _EFFECT_PANEL_
3+
4+#include "../Common.h"
5+
6+class EffectPanel: public wxPanel{
7+public:
8+ EffectPanel(wxWindow* parent, wxWindowID id);
9+ DECLARE_EVENT_TABLE()
10+};
11+
12+#endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/PhysicsPanel.cpp (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/PhysicsPanel.cpp (revision 451)
@@ -0,0 +1,6 @@
1+#include "PhysicsPanel.h"
2+
3+PhysicsPanel::PhysicsPanel(wxWindow* parent, wxWindowID id):
4+wxPanel(parent, id)
5+{
6+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/ProjectilePanel.h (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/ProjectilePanel.h (revision 451)
@@ -0,0 +1,12 @@
1+#ifndef _PROJECTILE_PANEL_
2+#define _PROJECTILE_PANEL_
3+
4+#include "../Common.h"
5+
6+class ProjectilePanel: public wxPanel{
7+public:
8+ ProjectilePanel(wxWindow* parent, wxWindowID id);
9+ DECLARE_EVENT_TABLE()
10+};
11+
12+#endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.cpp (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.cpp (revision 451)
@@ -0,0 +1,26 @@
1+#include "MonsterPanel.h"
2+
3+enum{
4+ ID_TYPE,
5+ ID_NOTE,
6+};
7+
8+BEGIN_EVENT_TABLE(MonsterPanel, wxPanel)
9+END_EVENT_TABLE()
10+
11+MonsterPanel::MonsterPanel(wxWindow* parent, wxWindowID id):
12+wxPanel(parent, id)
13+{
14+ //listbox
15+ monsterTypeListBox = new wxListBox(this, ID_TYPE);
16+ //notebook
17+ notebook = new wxNotebook(this, ID_NOTE);
18+
19+ //設定
20+
21+ //配置
22+ wxFlexGridSizer* sizerBase = new wxFlexGridSizer(1,2);
23+ SetSizer(sizerBase);
24+ sizerBase->Fit(this);
25+ Layout();
26+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/PhysicsPanel.h (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/PhysicsPanel.h (revision 451)
@@ -0,0 +1,12 @@
1+#ifndef _PHYSICS_PANEL_
2+#define _PHYSICS_PANEL_
3+
4+#include "../Common.h"
5+
6+class PhysicsPanel: public wxPanel{
7+public:
8+ PhysicsPanel(wxWindow* parent, wxWindowID id);
9+ DECLARE_EVENT_TABLE()
10+};
11+
12+#endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/WeaponPanel.cpp (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/WeaponPanel.cpp (revision 451)
@@ -0,0 +1,6 @@
1+#include "WeaponPanel.h"
2+
3+WeaponPanel::WeaponPanel(wxWindow* parent, wxWindowID id):
4+wxPanel(parent, id)
5+{
6+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.h (revision 450)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/MonsterPanel.h (revision 451)
@@ -20,7 +20,8 @@
2020 MonsterFlagsPanel* flagsPanel;
2121 MonsterAttackPanel* attackPanel;
2222 public:
23- void Create(wxWindow* parent, wxWindowID id);
23+ MonsterPanel(wxWindow* parent, wxWindowID id);
24+ DECLARE_EVENT_TABLE()
2425 };
2526
2627 #endif
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/EffectPanel.cpp (nonexistent)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/panel/EffectPanel.cpp (revision 451)
@@ -0,0 +1,6 @@
1+#include "EffectPanel.h"
2+
3+EffectPanel::EffectPanel(wxWindow* parent, wxWindowID id):
4+wxPanel(parent, id)
5+{
6+}
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/MainFrame.cpp (revision 450)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/MainFrame.cpp (revision 451)
@@ -1,4 +1,5 @@
11 #include "MainFrame.h"
2+#include "PhysicsEditorOneWX.h"
23
34 const int WINDOW_DEFAULT_WIDTH = 800;
45 const int WINDOW_DEFAULT_HEIGHT = 600;
@@ -5,11 +6,18 @@
56
67
78 /**
8- メニューの識別ID(特殊なものに限る)
9+ イベント処理用の識別ID(特殊なものに限る)
910 */
10-namespace MainFrameMenuId{
11+namespace MainFrameEventId{
1112 enum{
12-
13+ //ページ変更時
14+ ID_NOTE,
15+ //モンスターページ処理用
16+ ID_MONSTER_PAGE,
17+ ID_EFFECT_PAGE,
18+ ID_PROJECTILE_PAGE,
19+ ID_PHYSICS_PAGE,
20+ ID_WEAPON_PAGE,
1321 };
1422 };
1523
@@ -32,8 +40,8 @@
3240 }
3341
3442 //status bar
35- ::CreateStatusBar();
36- ::SetStatusText( _T("get ready..."));
43+ CreateStatusBar();
44+ SetStatusText( _T("get ready..."));
3745
3846 //メニューの作成
3947 //File
@@ -51,7 +59,38 @@
5159 SetMenuBar(menuBar);
5260
5361 //配置
54-
62+ this->notebook = new wxNotebook(this, MainFrameEventId::ID_NOTE, wxDefaultPosition, wxDefaultSize,
63+ wxNB_LEFT);
64+ bool select = true;
65+ wxNotebookPage* monsterPage = new wxNotebookPage(notebook, MainFrameEventId::ID_MONSTER_PAGE);
66+ this->notebook->AddPage(monsterPage, _T("Monsters"), select);
67+ wxNotebookPage* effectPage = new wxNotebookPage(notebook, MainFrameEventId::ID_EFFECT_PAGE);
68+ this->notebook->AddPage(effectPage, _T("Effects"));
69+ wxNotebookPage* projectilePage = new wxNotebookPage(notebook, MainFrameEventId::ID_PROJECTILE_PAGE);
70+ this->notebook->AddPage(projectilePage, _T("Projectiles"));
71+ wxNotebookPage* physicsPage = new wxNotebookPage(notebook, MainFrameEventId::ID_PHYSICS_PAGE);
72+ this->notebook->AddPage(physicsPage, _T("Physics"));
73+ wxNotebookPage* weaponPage = new wxNotebookPage(notebook, MainFrameEventId::ID_WEAPON_PAGE);
74+ this->notebook->AddPage(weaponPage, _T("Weapons"));
75+
76+ //モンスターパネル
77+ this->monsterPanel = new MonsterPanel(this, wxID_ANY);
78+ this->effectPanel = new EffectPanel(this, wxID_ANY);
79+ this->projectilePanel = new ProjectilePanel(this, wxID_ANY);
80+ this->physicsPanel = new PhysicsPanel(this, wxID_ANY);
81+ this->weaponPanel = new WeaponPanel(this, wxID_ANY);
82+
83+ this->notebook->SetMinSize(wxSize(WINDOW_DEFAULT_WIDTH, WINDOW_DEFAULT_HEIGHT));
84+
85+ wxGridSizer* sizer_base = new wxGridSizer(1);
86+ sizer_base->Add(this->notebook, 0,wxEXPAND,0);
87+ wxGridSizer* monsterSizer = new wxGridSizer(1);
88+ monsterSizer->Add(monsterPanel, 0, wxEXPAND, 0);
89+ notebook->SetSizer(monsterSizer);
90+
91+ SetSizer(sizer_base);
92+ sizer_base->Fit(this);
93+ Layout();
5594 }
5695 /**
5796 もし編集中であれば内容を破棄するか、その前に保存するか、キャンセルするか
@@ -161,4 +200,5 @@
161200 //キャンセル
162201 return;
163202 }
203+ Destroy();
164204 }
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.h (revision 450)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.h (revision 451)
@@ -3,7 +3,7 @@
33
44 #include "Common.h"
55 #include "PhysicsDefaultValues.h"
6-#include "PhysicsEditorCommon.h"
6+#include "PhysicsEditorCommonSrc/PhysicsEditorCommon.h"
77
88 static char* TITLE = "Physics Editor One wxWidgets version";
99
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/MainFrame.h (revision 450)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/MainFrame.h (revision 451)
@@ -2,9 +2,26 @@
22 #define _MAIN_FRAME_
33
44 #include "Common.h"
5+#include "panel/MonsterPanel.h"
6+#include "panel/EffectPanel.h"
7+#include "panel/ProjectilePanel.h"
8+#include "panel/PhysicsPanel.h"
9+#include "panel/WeaponPanel.h"
510
611 class MainFrame: public wxFrame{
712 public:
13+private:
14+ /**タブ*/
15+ wxNotebook* notebook;
16+
17+ /**各パネル*/
18+ MonsterPanel* monsterPanel;
19+ EffectPanel* effectPanel;
20+ ProjectilePanel* projectilePanel;
21+ PhysicsPanel* physicsPanel;
22+ WeaponPanel* weaponPanel;
23+
24+public:
825 void Create(wxWindow* parent, wxWindowID id);
926 protected:
1027 void OnNew(wxCommandEvent& ev);
--- marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 450)
+++ marathon/trunk/EditorOnes/PhysicsEditorOneWX/src/PhysicsEditorOneWX.cpp (revision 451)
@@ -1,10 +1,11 @@
11 #include "PhysicsEditorOneWX.h"
22 #include "MainFrame.h"
33
4+//実体を持たせます
5+IMPLEMENT_APP(PhysicsEditorOneWX)
6+
47 static char* DEFAULT_PHYSICS_FILE_PATH = "Physics.phyA";
58
6-//実体を持たせます
7-DECLARE_APP(PhysicsEditorOneWX)
89
910 bool PhysicsEditorOneWX::OnInit()
1011 {
@@ -12,6 +13,8 @@
1213
1314 this->frame = new MainFrame();
1415 frame->Create(NULL, wxID_ANY);
16+ //各種設定
17+ this->setNewAndChanged(true, false);
1518
1619 //デフォルトデータとしてファイルから読み込んでおく
1720 this->loadDefaultPhysicsFile();
@@ -224,9 +227,6 @@
224227 hpl::aleph::loadInformation("data/ShellCasingTypes.txt", NUMBER_OF_SHELL_CASING_TYPES,
225228 weaponShellCasingInfo);
226229
227- //各種設定
228- this->setNew(true);
229- this->setChanged(false);
230230
231231 }
232232
@@ -242,7 +242,7 @@
242242 this->isChanged_ = changed;
243243 this->isNew_ = new_;
244244
245- if(!prevChanged && changed){
245+ if(changed){
246246 //変更していない状態から変更状態へ移った
247247 if(this->isNew()){
248248 //タイトルバーの文字列を TITLE + " *" にする
@@ -251,7 +251,7 @@
251251 //タイトルバーの文字列を TITLE + " " + saveFilePath + " *" にする
252252 frame->SetTitle(wx::string::getString("%s %s *", TITLE, this->getSaveFilePath().c_str()));
253253 }
254- }else if(prevChanged && !changed){
254+ }else if(!changed){
255255 //変更状態から保存状態、新規状態に移った
256256 if(this->isNew()){
257257 //タイトルバーの文字列を TITLE にする
@@ -282,6 +282,9 @@
282282 return &this->defaultValues;
283283 }
284284
285+/**
286+ ライブラリに依存しない物理ファイル読み込み処理
287+*/
285288 static void independentLoadPhysicsFile(const char* filePath)
286289 {
287290 //物理ファイル名設定
@@ -297,6 +300,8 @@
297300 void PhysicsEditorOneWX::loadPhysicsFile(const char* filePath)
298301 {
299302 independentLoadPhysicsFile(filePath);
303+ //読み込みファイル名設定
304+ this->setSaveFilePath(filePath);
300305 //状態設定
301306 this->setNewAndChanged(false, false);
302307
旧リポジトリブラウザで表示