• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン346 (tree)
日時2007-06-24 18:39:03
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/JumpLevelDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/JumpLevelDialog.cpp (nonexistent)
@@ -1 +0,0 @@
1-#include "JumpLevelDialog.h"
--- marathon/trunk/MapEditorWX/src/JumpLevelDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/JumpLevelDialog.h (nonexistent)
@@ -1,12 +0,0 @@
1-#ifndef _JUMP_LEVEL_DIALOG_
2-#define _JUMP_LEVEL_DIALOG_
3-
4-#include "DlgCommon.h"
5-
6-class JumpLevelDialog: wxDialog{
7-public:
8- JumpLevelDialog();
9- virtual ~JumpLevelDialog();
10-};
11-
12-#endif
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 346)
@@ -76,16 +76,7 @@
7676 CreateStatusBar();
7777 SetStatusText( _T("get ready..."));
7878
79- //ダイアログ
80- //TODO dlg
81- //tool
82- this->toolDialog.Create(this, wxID_ANY);
83- this->toolDialog.Show();
84-
85- //height
86- this->heightDialog.Create(this, wxID_ANY);
87- this->heightDialog.Show();
88-
79+
8980 //ペン・ブラシのセットアップ
9081 this->setupPenAndBrush(wxGetApp().setting.getColorSetting());
9182
@@ -103,6 +94,30 @@
10394 dlg.Create(this, wxID_ANY);
10495 int id = dlg.ShowModal();
10596 hpl::error::halt("%d", id);*/
97+ //ダイアログ
98+ //TODO dlg
99+ //tool
100+ this->toolDialog.Create(this, wxID_ANY);
101+ this->toolDialog.Show();
102+
103+ //height
104+ this->heightDialog.Create(this, wxID_ANY);
105+ this->heightDialog.Show();
106+
107+ //パレット
108+ this->heightPaletteDialog.Create(this, wxID_ANY);
109+ this->lightPaletteDialog.Create(this, wxID_ANY);
110+ this->mediaPaletteDialog.Create(this, wxID_ANY);
111+ this->soundPaletteDialog.Create(this, wxID_ANY);
112+ this->textureDialog.Create(this, wxID_ANY);
113+
114+ //プロパティ
115+ this->objPropDialog.Create(this, wxID_ANY);
116+ this->linePropDialog.Create(this, wxID_ANY);
117+ this->pointPropDialog.Create(this, wxID_ANY);
118+ this->polyTypeDialog.Create(this, wxID_ANY);
119+ this->polyPropDialog.Create(this, wxID_ANY);
120+ this->sidePropDialog.Create(this, wxID_ANY);
106121 }
107122 MapEditorMainFrame::~MapEditorMainFrame()
108123 {
--- marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/PolygonPropDialog.cpp (revision 346)
@@ -195,6 +195,19 @@
195195 return result;
196196 }
197197
198+void PolygonPropDialog::setPolyIndex(int index)
199+{
200+ this->polyIndex = index;
201+ setupDialog();
202+}
203+int PolygonPropDialog::getPolyIndex()
204+{
205+ return polyIndex;
206+}
207+void PolygonPropDialog::setupDialog()
208+{
209+
210+}
198211 void PolygonPropDialog::OnIDEdit(wxCommandEvent &event)
199212 {
200213 event.Skip();
--- marathon/trunk/MapEditorWX/src/LightPaletteDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/LightPaletteDialog.h (revision 346)
@@ -0,0 +1,15 @@
1+#ifndef _LIGHT_PALETTE_DIALOG_
2+#define _LIGHT_PALETTE_DIALOG_
3+
4+#include "DlgCommon.h"
5+
6+class LightPaletteDialog: public wxDialog{
7+public:
8+ LightPaletteDialog();
9+ bool Create(wxWindow* parent, wxWindowID id);
10+ virtual ~LightPaletteDialog();
11+ //イベントテーブル作成<en>declare
12+ DECLARE_EVENT_TABLE()
13+};
14+
15+#endif
--- marathon/trunk/MapEditorWX/src/MediaPaletteDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/MediaPaletteDialog.h (revision 346)
@@ -0,0 +1,15 @@
1+#ifndef _MEDIA_PALETTE_DIALOG_
2+#define _MEDIA_PALETTE_DIALOG_
3+
4+#include "DlgCommon.h"
5+
6+class MediaPaletteDialog: public wxDialog{
7+public:
8+ MediaPaletteDialog();
9+ bool Create(wxWindow* parent, wxWindowID id);
10+ virtual ~MediaPaletteDialog();
11+ //イベントテーブル作成<en>declare
12+ DECLARE_EVENT_TABLE()
13+};
14+
15+#endif
--- marathon/trunk/MapEditorWX/src/SoundPaletteDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/SoundPaletteDialog.cpp (revision 346)
@@ -0,0 +1,16 @@
1+#include "SoundPaletteDialog.h"
2+#include "MapEditorWX.h"
3+BEGIN_EVENT_TABLE(SoundPaletteDialog, wxDialog)
4+END_EVENT_TABLE()
5+SoundPaletteDialog::SoundPaletteDialog()
6+{
7+}
8+SoundPaletteDialog::~SoundPaletteDialog()
9+{
10+}
11+bool SoundPaletteDialog::Create(wxWindow* parent, wxWindowID id)
12+{
13+ bool result = wxDialog::Create(parent, id, _T("Height Pallet"));
14+
15+ return result;
16+}
--- marathon/trunk/MapEditorWX/src/SelectLevelDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/SelectLevelDialog.cpp (revision 346)
@@ -1,6 +1,13 @@
11 #include "SelectLevelDialog.h"
22 #include "MapEditorWX.h"
3+enum{
4+ ID_List,
5+};
6+
37 BEGIN_EVENT_TABLE(SelectLevelDialog, wxDialog)
8+ EVT_LISTBOX(ID_List, SelectLevelDialog::OnList)
9+ EVT_BUTTON(wxID_OK, SelectLevelDialog::OnOk)
10+ EVT_BUTTON(wxID_CANCEL, SelectLevelDialog::OnCancel)
411 END_EVENT_TABLE()
512 SelectLevelDialog::SelectLevelDialog()
613 {
@@ -11,6 +18,43 @@
1118 bool SelectLevelDialog::Create(wxWindow* parent, wxWindowID id)
1219 {
1320 bool result = wxDialog::Create(parent, id, _T("Select Level"));
21+ label_57 = new wxStaticText(this, wxID_ANY, wxT("Select level"));
1422
23+ list_box_4 = new wxListBox(this, wxID_ANY);
24+ button_22 = new wxButton(this, wxID_OK, wxEmptyString);
25+ button_23 = new wxButton(this, wxID_CANCEL, wxEmptyString);
26+
27+ list_box_4->SetMinSize(wxSize(320, 320));
28+
29+ wxFlexGridSizer* grid_sizer_17 = new wxFlexGridSizer(3, 1, 0, 0);
30+ wxFlexGridSizer* grid_sizer_25 = new wxFlexGridSizer(1, 2, 0, 0);
31+ grid_sizer_17->Add(label_57, 0, 0, 0);
32+ grid_sizer_17->Add(list_box_4, 0, wxEXPAND, 0);
33+ grid_sizer_25->Add(button_22, 0, wxRIGHT|wxALIGN_RIGHT, 0);
34+ grid_sizer_25->Add(button_23, 0, wxRIGHT|wxALIGN_RIGHT, 0);
35+ grid_sizer_17->Add(grid_sizer_25, 1, wxALIGN_RIGHT, 0);
36+ SetSizer(grid_sizer_17);
37+ grid_sizer_17->Fit(this);
38+ Layout();
39+
1540 return result;
1641 }
42+void SelectLevelDialog::OnList(wxCommandEvent &event)
43+{
44+ event.Skip();
45+ std::cout<<"Event handler (SelectLevelDialog::OnList) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
46+}
47+
48+
49+void SelectLevelDialog::OnOk(wxCommandEvent &event)
50+{
51+ event.Skip();
52+ std::cout<<"Event handler (SelectLevelDialog::OnOk) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
53+}
54+
55+
56+void SelectLevelDialog::OnCancel(wxCommandEvent &event)
57+{
58+ event.Skip();
59+ std::cout<<"Event handler (SelectLevelDialog::OnCancel) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
60+}
--- marathon/trunk/MapEditorWX/src/PolygonNumDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/PolygonNumDialog.cpp (revision 346)
@@ -1,12 +1,21 @@
11 #include "PolygonNumDialog.h"
22 #include "MapEditorWX.h"
3+enum{
4+ iD_Poly3,
5+ iD_Poly4,
6+ iD_Poly5,
7+ iD_Poly6,
8+ iD_Poly7,
9+ iD_Poly8,
10+};
11+
312 BEGIN_EVENT_TABLE(PolygonNumDialog, wxDialog)
4- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly3)
5- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly4)
6- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly5)
7- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly6)
8- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly7)
9- EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly8)
13+ EVT_BUTTON(iD_Poly3, PolygonNumDialog::OnPoly3)
14+ EVT_BUTTON(iD_Poly4, PolygonNumDialog::OnPoly4)
15+ EVT_BUTTON(iD_Poly5, PolygonNumDialog::OnPoly5)
16+ EVT_BUTTON(iD_Poly6, PolygonNumDialog::OnPoly6)
17+ EVT_BUTTON(iD_Poly7, PolygonNumDialog::OnPoly7)
18+ EVT_BUTTON(iD_Poly8, PolygonNumDialog::OnPoly8)
1019 END_EVENT_TABLE()
1120 PolygonNumDialog::PolygonNumDialog()
1221 {
@@ -19,17 +28,17 @@
1928 bool result = wxDialog::Create(parent, id, _T("Polygon Num"));
2029 wxBitmap bmp;
2130 bmp.LoadFile(_T("data/img/poly3.bmp"));
22- bitmap_button_1 = new wxBitmapButton(this, wxID_ANY, bmp);
31+ bitmap_button_1 = new wxBitmapButton(this, iD_Poly3, bmp);
2332 bmp.LoadFile(_T("data/img/poly4.bmp"));
24- bitmap_button_2 = new wxBitmapButton(this, wxID_ANY, bmp);
33+ bitmap_button_2 = new wxBitmapButton(this, iD_Poly4, bmp);
2534 bmp.LoadFile(_T("data/img/poly5.bmp"));
26- bitmap_button_3 = new wxBitmapButton(this, wxID_ANY, bmp);
35+ bitmap_button_3 = new wxBitmapButton(this, iD_Poly5, bmp);
2736 bmp.LoadFile(_T("data/img/poly6.bmp"));
28- bitmap_button_4 = new wxBitmapButton(this, wxID_ANY, bmp);
37+ bitmap_button_4 = new wxBitmapButton(this, iD_Poly6, bmp);
2938 bmp.LoadFile(_T("data/img/poly7.bmp"));
30- bitmap_button_5 = new wxBitmapButton(this, wxID_ANY, bmp);
39+ bitmap_button_5 = new wxBitmapButton(this, iD_Poly7, bmp);
3140 bmp.LoadFile(_T("data/img/poly8.bmp"));
32- bitmap_button_6 = new wxBitmapButton(this, wxID_ANY, bmp);
41+ bitmap_button_6 = new wxBitmapButton(this, iD_Poly8, bmp);
3342
3443 //
3544 bitmap_button_1->SetSize(bitmap_button_1->GetBestSize());
--- marathon/trunk/MapEditorWX/src/ObjectPropDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/ObjectPropDialog.cpp (revision 346)
@@ -14,3 +14,15 @@
1414
1515 return result;
1616 }
17+void ObjectPropDialog::setObjIndex(int index)
18+{
19+ this->objIndex = index;
20+ setupDialog();
21+}
22+int ObjectPropDialog::getObjIndex()
23+{
24+ return this->objIndex;
25+}
26+void ObjectPropDialog::setupDialog()
27+{
28+}
--- marathon/trunk/MapEditorWX/src/AnnotationDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/AnnotationDialog.cpp (revision 346)
@@ -87,11 +87,17 @@
8787 */
8888 map_annotation AnnotationDialog::getAnnotation()
8989 {
90- //TODO
9190 map_annotation annotation = {NULL};
9291 annotation.location.x = this->wpoint.x;
9392 annotation.location.y = this->wpoint.y;
94- strcpy(annotation.text, wxConvertWX2MB(text_ctrl_7->GetValue()));
93+ //長さチェック
94+ wxString str = wxString(text_ctrl_7->GetValue());
95+ if(str.Length() > MAXIMUM_ANNOTATION_TEXT_LENGTH){
96+ hpl::error::caution("annotation text is too long (over %d). ignored after limit.",
97+ MAXIMUM_ANNOTATION_TEXT_LENGTH);
98+ str = str.Mid(0, MAXIMUM_ANNOTATION_TEXT_LENGTH);
99+ }
100+ strcpy(annotation.text, str.mb_str());
95101 annotation.type = choice_8->GetSelection();
96102 annotation.polygon_index = choice_7->GetSelection();
97103 if(annotation.polygon_index == PolygonList.size()){
--- marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 346)
@@ -270,7 +270,8 @@
270270 sel->addSelObject(i, offset);
271271 //オブジェクトのプロパティ・ダイアログを表示する
272272 //TODO
273- //this->objectPropDialog.Show(true);
273+ this->objPropDialog.setObjIndex(i);
274+ this->objPropDialog.Show(true);
274275 return true;
275276 }
276277 }
@@ -277,7 +278,7 @@
277278
278279 //no obj selected
279280 //TODO 選択ID関連の実装
280- //this->objectPropDialog->setSelectedObjectIndex(NONE);
281+ this->objPropDialog.setObjIndex(NONE);
281282
282283
283284 //////////
@@ -360,6 +361,8 @@
360361
361362 //ポリゴンプロパティ表示
362363 //TODO
364+ this->polyPropDialog.setPolyIndex(polyIndex);
365+ this->polyPropDialog.Show(true);
363366
364367 //オフセット
365368 for(int j = 0; j < n; j ++){
@@ -631,13 +634,40 @@
631634 {
632635 //カーソル設定
633636 wxGetApp().setCursor();
637+ int mx = ev.m_x;
638+ int my = ev.m_y;
634639 //マウス座標記録
635- wxGetApp().getViewGridManager()->setNewMousePoint(ev.m_x, ev.m_y);
640+ hpl::aleph::view::HPLViewGridManager* vmgr = wxGetApp().getViewGridManager();
641+ vmgr->setNewMousePoint(mx, my);
636642
637643 //ポップアップメニューを出す
638644 //TODO
639- //テスト
640- PopupMenu(&wxGetApp().linePopupMenu);
645+ //マウス座標をワールド座標にする
646+ world_point2d wmp = wxGetApp().getWorldPointFromViewPoint(mx, my);
647+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
648+ int div = vmgr->getZoomDivision();
649+ int zMin = vmgr->getViewHeightMin();
650+ int zMax = vmgr->getViewHeightMax();
651+
652+ int editMode = emgr->getEditModeType();
653+ int toolType = emgr->getToolType();
654+ if(editMode == EditModeType::EM_DRAW && toolType == ToolType::TI_ARROW){
655+ //点の上で右クリックしたか?
656+ int epIndex = hpl::aleph::map::getSelectPointIndex(wmp, POINT_DISTANCE_EPSILON * div, zMin, zMax);
657+ if(epIndex != NONE){
658+ //点ポップアップ表示
659+ PopupMenu(&wxGetApp().pointPopupMenu);
660+ }else{
661+ //点は押されなかった
662+ int lineIndex = hpl::aleph::map::getSelectLineIndex(wmp, LINE_DISTANCE_EPSILON * div, zMin, zMax);
663+ if(lineIndex != NONE){
664+ //線が押された
665+ //→線プロパティをだす
666+ PopupMenu(&wxGetApp().linePopupMenu);
667+ }
668+ }
669+ }
670+
641671 }
642672 ///////////////////////////////////////////////////////
643673 void MapEditorMainFrame::OnRightUp(wxMouseEvent& ev)
--- marathon/trunk/MapEditorWX/src/ToolDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/ToolDialog.h (revision 346)
@@ -11,6 +11,7 @@
1111 //イメージビットマップ
1212 wxImage toolBitmaps[ToolType::NUMBER_OF_TOOLS];
1313 wxImage selectedToolBitmaps[ToolType::NUMBER_OF_TOOLS];
14+
1415 public:
1516 /**
1617 @param parent 親ウインドウNULLでも可能
--- marathon/trunk/MapEditorWX/src/LightPaletteDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/LightPaletteDialog.cpp (revision 346)
@@ -0,0 +1,16 @@
1+#include "LightPaletteDialog.h"
2+#include "MapEditorWX.h"
3+BEGIN_EVENT_TABLE(LightPaletteDialog, wxDialog)
4+END_EVENT_TABLE()
5+LightPaletteDialog::LightPaletteDialog()
6+{
7+}
8+LightPaletteDialog::~LightPaletteDialog()
9+{
10+}
11+bool LightPaletteDialog::Create(wxWindow* parent, wxWindowID id)
12+{
13+ bool result = wxDialog::Create(parent, id, _T("Height Pallet"));
14+
15+ return result;
16+}
--- marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 346)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Wed Jun 20 19:53:28 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Sun Jun 24 17:32:57 2007 from C:\(0saved\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include <wx/wx.h>
44 #include <wx/image.h>
@@ -452,6 +452,8 @@
452452 void OnFloorLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
453453 void OnCenterYEdit(wxCommandEvent &event); // wxGlade: <event_handler>
454454 void OnCeilingLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
455+ void OnFloorOriginXEdit(wxCommandEvent &event); // wxGlade: <event_handler>
456+ void OnFloorOriginY(wxCommandEvent &event); // wxGlade: <event_handler>
455457 void OnAreaEdit(wxCommandEvent &event); // wxGlade: <event_handler>
456458 void OnFirstObjChoice(wxCommandEvent &event); // wxGlade: <event_handler>
457459 void OnMediaChoice(wxCommandEvent &event); // wxGlade: <event_handler>
@@ -564,4 +566,118 @@
564566 }; // wxGlade: end class
565567
566568
569+class JumpLevelDialog: public wxDialog {
570+public:
571+ // begin wxGlade: JumpLevelDialog::ids
572+ // end wxGlade
573+
574+ JumpLevelDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
575+
576+private:
577+ // begin wxGlade: JumpLevelDialog::methods
578+ void set_properties();
579+ void do_layout();
580+ // end wxGlade
581+
582+protected:
583+ // begin wxGlade: JumpLevelDialog::attributes
584+ wxStaticText* label_57;
585+ wxListBox* list_box_4;
586+ wxButton* button_22;
587+ wxButton* button_23;
588+ // end wxGlade
589+
590+ DECLARE_EVENT_TABLE();
591+
592+public:
593+ void OnList(wxCommandEvent &event); // wxGlade: <event_handler>
594+ void OnOk(wxCommandEvent &event); // wxGlade: <event_handler>
595+ void OnCancel(wxCommandEvent &event); // wxGlade: <event_handler>
596+}; // wxGlade: end class
597+
598+
599+class LinePropDialog: public wxDialog {
600+public:
601+ // begin wxGlade: LinePropDialog::ids
602+ // end wxGlade
603+
604+ LinePropDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
605+
606+private:
607+ // begin wxGlade: LinePropDialog::methods
608+ void set_properties();
609+ void do_layout();
610+ // end wxGlade
611+
612+protected:
613+ // begin wxGlade: LinePropDialog::attributes
614+ wxStaticBox* sizer_54_staticbox;
615+ wxStaticText* label_64;
616+ wxTextCtrl* text_ctrl_42;
617+ wxTextCtrl* text_ctrl_43;
618+ wxCheckBox* checkbox_45;
619+ wxCheckBox* checkbox_52;
620+ wxCheckBox* checkbox_53;
621+ wxCheckBox* checkbox_54;
622+ wxRadioBox* radio_box_1;
623+ wxStaticText* label_66;
624+ wxTextCtrl* text_ctrl_45;
625+ wxStaticText* label_67;
626+ wxTextCtrl* text_ctrl_46;
627+ wxStaticText* label_70;
628+ wxTextCtrl* text_ctrl_47;
629+ wxStaticText* label_71;
630+ wxChoice* choice_24;
631+ wxStaticText* label_69;
632+ wxChoice* choice_25;
633+ wxStaticText* label_72;
634+ wxChoice* choice_26;
635+ wxStaticText* label_68;
636+ wxChoice* choice_27;
637+ // end wxGlade
638+
639+ DECLARE_EVENT_TABLE();
640+
641+public:
642+ void OnEndpoint1Edit(wxCommandEvent &event); // wxGlade: <event_handler>
643+ void OnEndpoint2Edit(wxCommandEvent &event); // wxGlade: <event_handler>
644+ void OnLandscape(wxCommandEvent &event); // wxGlade: <event_handler>
645+ void OnElevation(wxCommandEvent &event); // wxGlade: <event_handler>
646+ void OnVariableElev(wxCommandEvent &event); // wxGlade: <event_handler>
647+ void OnHasTransSide(wxCommandEvent &event); // wxGlade: <event_handler>
648+ void OnRadioSel(wxCommandEvent &event); // wxGlade: <event_handler>
649+ void OnFloor(wxCommandEvent &event); // wxGlade: <event_handler>
650+ void OnCeiling(wxCommandEvent &event); // wxGlade: <event_handler>
651+ void OnClockwiseSide(wxCommandEvent &event); // wxGlade: <event_handler>
652+ void OnCClockwiseSide(wxCommandEvent &event); // wxGlade: <event_handler>
653+ void OnClockwisePoly(wxCommandEvent &event); // wxGlade: <event_handler>
654+ void OnCClockwisePoly(wxCommandEvent &event); // wxGlade: <event_handler>
655+}; // wxGlade: end class
656+
657+
658+class PolygonTypeDialog: public wxDialog {
659+public:
660+ // begin wxGlade: PolygonTypeDialog::ids
661+ // end wxGlade
662+
663+ PolygonTypeDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
664+
665+private:
666+ // begin wxGlade: PolygonTypeDialog::methods
667+ void set_properties();
668+ void do_layout();
669+ // end wxGlade
670+
671+protected:
672+ // begin wxGlade: PolygonTypeDialog::attributes
673+ wxListCtrl* list_ctrl_2;
674+ // end wxGlade
675+
676+ DECLARE_EVENT_TABLE();
677+
678+public:
679+ void OnSel(wxListEvent &event); // wxGlade: <event_handler>
680+}; // wxGlade: end class
681+
682+
567683 #endif // DIALOGUES_H
--- marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 346)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Wed Jun 20 19:53:28 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Sun Jun 24 17:32:57 2007 from C:\(0saved\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include "Dialogues.h"
44
@@ -770,7 +770,7 @@
770770 };
771771 list_box_3 = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, list_box_3_choices, 0);
772772 panel_7 = new wxPanel(this, wxID_ANY);
773- text_ctrl_13 = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
773+ text_ctrl_13 = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
774774 button_20 = new wxButton(this, wxID_OK, wxEmptyString);
775775
776776 set_properties();
@@ -1125,6 +1125,8 @@
11251125 EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnFloorLightEdit)
11261126 EVT_TEXT(wxID_ANY, PolygonPropDialog::OnCenterYEdit)
11271127 EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnCeilingLightEdit)
1128+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnFloorOriginXEdit)
1129+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnFloorOriginY)
11281130 EVT_TEXT(wxID_ANY, PolygonPropDialog::OnAreaEdit)
11291131 EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnFirstObjChoice)
11301132 EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnMediaChoice)
@@ -1204,6 +1206,20 @@
12041206 }
12051207
12061208
1209+void PolygonPropDialog::OnFloorOriginXEdit(wxCommandEvent &event)
1210+{
1211+ event.Skip();
1212+ std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1213+}
1214+
1215+
1216+void PolygonPropDialog::OnFloorOriginY(wxCommandEvent &event)
1217+{
1218+ event.Skip();
1219+ std::cout<<"Event handler (PolygonPropDialog::OnFloorOriginY) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1220+}
1221+
1222+
12071223 void PolygonPropDialog::OnAreaEdit(wxCommandEvent &event)
12081224 {
12091225 event.Skip();
@@ -1684,7 +1700,7 @@
16841700 grid_sizer_19->Add(label_58, 0, 0, 0);
16851701 grid_sizer_19->Add(text_ctrl_38, 0, 0, 0);
16861702 grid_sizer_18->Add(grid_sizer_19, 1, wxEXPAND, 0);
1687- grid_sizer_18->Add(panel_16, 1, wxEXPAND, 0);
1703+ grid_sizer_18->Add(panel_16, 1, 0, 0);
16881704 grid_sizer_15->Add(grid_sizer_18, 1, wxEXPAND, 0);
16891705 grid_sizer_20->Add(label_60, 0, 0, 0);
16901706 grid_sizer_20->Add(choice_23, 0, 0, 0);
@@ -1704,3 +1720,340 @@
17041720 // end wxGlade
17051721 }
17061722
1723+
1724+JumpLevelDialog::JumpLevelDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
1725+ wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
1726+{
1727+ // begin wxGlade: JumpLevelDialog::JumpLevelDialog
1728+ label_57 = new wxStaticText(this, wxID_ANY, wxT("Select level"));
1729+ const wxString list_box_4_choices[] = {
1730+
1731+ };
1732+ list_box_4 = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, list_box_4_choices, 0);
1733+ button_22 = new wxButton(this, wxID_OK, wxEmptyString);
1734+ button_23 = new wxButton(this, wxID_CANCEL, wxEmptyString);
1735+
1736+ set_properties();
1737+ do_layout();
1738+ // end wxGlade
1739+}
1740+
1741+
1742+BEGIN_EVENT_TABLE(JumpLevelDialog, wxDialog)
1743+ // begin wxGlade: JumpLevelDialog::event_table
1744+ EVT_LISTBOX(wxID_ANY, JumpLevelDialog::OnList)
1745+ EVT_BUTTON(wxID_OK, JumpLevelDialog::OnOk)
1746+ EVT_BUTTON(wxID_CANCEL, JumpLevelDialog::OnCancel)
1747+ // end wxGlade
1748+END_EVENT_TABLE();
1749+
1750+
1751+void JumpLevelDialog::OnList(wxCommandEvent &event)
1752+{
1753+ event.Skip();
1754+ std::cout<<"Event handler (JumpLevelDialog::OnList) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1755+}
1756+
1757+
1758+void JumpLevelDialog::OnOk(wxCommandEvent &event)
1759+{
1760+ event.Skip();
1761+ std::cout<<"Event handler (JumpLevelDialog::OnOk) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1762+}
1763+
1764+
1765+void JumpLevelDialog::OnCancel(wxCommandEvent &event)
1766+{
1767+ event.Skip();
1768+ std::cout<<"Event handler (JumpLevelDialog::OnCancel) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1769+}
1770+
1771+
1772+// wxGlade: add JumpLevelDialog event handlers
1773+
1774+
1775+void JumpLevelDialog::set_properties()
1776+{
1777+ // begin wxGlade: JumpLevelDialog::set_properties
1778+ SetTitle(wxT("dialog_12"));
1779+ list_box_4->SetMinSize(wxSize(320, 320));
1780+ // end wxGlade
1781+}
1782+
1783+
1784+void JumpLevelDialog::do_layout()
1785+{
1786+ // begin wxGlade: JumpLevelDialog::do_layout
1787+ wxFlexGridSizer* grid_sizer_17 = new wxFlexGridSizer(3, 1, 0, 0);
1788+ wxFlexGridSizer* grid_sizer_25 = new wxFlexGridSizer(1, 2, 0, 0);
1789+ grid_sizer_17->Add(label_57, 0, 0, 0);
1790+ grid_sizer_17->Add(list_box_4, 0, wxEXPAND, 0);
1791+ grid_sizer_25->Add(button_22, 0, wxRIGHT|wxALIGN_RIGHT, 0);
1792+ grid_sizer_25->Add(button_23, 0, wxRIGHT|wxALIGN_RIGHT, 0);
1793+ grid_sizer_17->Add(grid_sizer_25, 1, wxALIGN_RIGHT, 0);
1794+ SetSizer(grid_sizer_17);
1795+ grid_sizer_17->Fit(this);
1796+ Layout();
1797+ // end wxGlade
1798+}
1799+
1800+
1801+LinePropDialog::LinePropDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
1802+ wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
1803+{
1804+ // begin wxGlade: LinePropDialog::LinePropDialog
1805+ sizer_54_staticbox = new wxStaticBox(this, -1, wxT("flags"));
1806+ label_64 = new wxStaticText(this, wxID_ANY, wxT("endpoint indexes"));
1807+ text_ctrl_42 = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
1808+ text_ctrl_43 = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
1809+ checkbox_45 = new wxCheckBox(this, wxID_ANY, wxT("Landscape"));
1810+ checkbox_52 = new wxCheckBox(this, wxID_ANY, wxT("Elevation"));
1811+ checkbox_53 = new wxCheckBox(this, wxID_ANY, wxT("Variable elev"));
1812+ checkbox_54 = new wxCheckBox(this, wxID_ANY, wxT("Has trans side"));
1813+ const wxString radio_box_1_choices[] = {
1814+ wxT("Solid"),
1815+ wxT("Transparent")
1816+ };
1817+ radio_box_1 = new wxRadioBox(this, wxID_ANY, wxT("solidity"), wxDefaultPosition, wxDefaultSize, 2, radio_box_1_choices, 2, wxRA_SPECIFY_ROWS);
1818+ label_66 = new wxStaticText(this, wxID_ANY, wxT("length"));
1819+ text_ctrl_45 = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
1820+ label_67 = new wxStaticText(this, wxID_ANY, wxT("highest floor"));
1821+ text_ctrl_46 = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
1822+ label_70 = new wxStaticText(this, wxID_ANY, wxT("lowest ceiling"));
1823+ text_ctrl_47 = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
1824+ label_71 = new wxStaticText(this, wxID_ANY, wxT("clockwise side"));
1825+ const wxString choice_24_choices[] = {
1826+
1827+ };
1828+ choice_24 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_24_choices, 0);
1829+ label_69 = new wxStaticText(this, wxID_ANY, wxT("c-clockwise side"));
1830+ const wxString choice_25_choices[] = {
1831+
1832+ };
1833+ choice_25 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_25_choices, 0);
1834+ label_72 = new wxStaticText(this, wxID_ANY, wxT("clockwise poly"));
1835+ const wxString choice_26_choices[] = {
1836+
1837+ };
1838+ choice_26 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_26_choices, 0);
1839+ label_68 = new wxStaticText(this, wxID_ANY, wxT("c-clockwise poly"));
1840+ const wxString choice_27_choices[] = {
1841+
1842+ };
1843+ choice_27 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_27_choices, 0);
1844+
1845+ set_properties();
1846+ do_layout();
1847+ // end wxGlade
1848+}
1849+
1850+
1851+BEGIN_EVENT_TABLE(LinePropDialog, wxDialog)
1852+ // begin wxGlade: LinePropDialog::event_table
1853+ EVT_TEXT(wxID_ANY, LinePropDialog::OnEndpoint1Edit)
1854+ EVT_TEXT(wxID_ANY, LinePropDialog::OnEndpoint2Edit)
1855+ EVT_CHECKBOX(wxID_ANY, LinePropDialog::OnLandscape)
1856+ EVT_CHECKBOX(wxID_ANY, LinePropDialog::OnElevation)
1857+ EVT_CHECKBOX(wxID_ANY, LinePropDialog::OnVariableElev)
1858+ EVT_CHECKBOX(wxID_ANY, LinePropDialog::OnHasTransSide)
1859+ EVT_RADIOBOX(wxID_ANY, LinePropDialog::OnRadioSel)
1860+ EVT_TEXT(wxID_ANY, LinePropDialog::OnFloor)
1861+ EVT_TEXT(wxID_ANY, LinePropDialog::OnCeiling)
1862+ EVT_CHOICE(wxID_ANY, LinePropDialog::OnClockwiseSide)
1863+ EVT_CHOICE(wxID_ANY, LinePropDialog::OnCClockwiseSide)
1864+ EVT_CHOICE(wxID_ANY, LinePropDialog::OnClockwisePoly)
1865+ EVT_CHOICE(wxID_ANY, LinePropDialog::OnCClockwisePoly)
1866+ // end wxGlade
1867+END_EVENT_TABLE();
1868+
1869+
1870+void LinePropDialog::OnEndpoint1Edit(wxCommandEvent &event)
1871+{
1872+ event.Skip();
1873+ std::cout<<"Event handler (LinePropDialog::OnEndpoint1Edit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1874+}
1875+
1876+
1877+void LinePropDialog::OnEndpoint2Edit(wxCommandEvent &event)
1878+{
1879+ event.Skip();
1880+ std::cout<<"Event handler (LinePropDialog::OnEndpoint2Edit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1881+}
1882+
1883+
1884+void LinePropDialog::OnLandscape(wxCommandEvent &event)
1885+{
1886+ event.Skip();
1887+ std::cout<<"Event handler (LinePropDialog::OnLandscape) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1888+}
1889+
1890+
1891+void LinePropDialog::OnElevation(wxCommandEvent &event)
1892+{
1893+ event.Skip();
1894+ std::cout<<"Event handler (LinePropDialog::OnElevation) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1895+}
1896+
1897+
1898+void LinePropDialog::OnVariableElev(wxCommandEvent &event)
1899+{
1900+ event.Skip();
1901+ std::cout<<"Event handler (LinePropDialog::OnVariableElev) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1902+}
1903+
1904+
1905+void LinePropDialog::OnHasTransSide(wxCommandEvent &event)
1906+{
1907+ event.Skip();
1908+ std::cout<<"Event handler (LinePropDialog::OnHasTransSide) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1909+}
1910+
1911+
1912+void LinePropDialog::OnRadioSel(wxCommandEvent &event)
1913+{
1914+ event.Skip();
1915+ std::cout<<"Event handler (LinePropDialog::OnRadioSel) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1916+}
1917+
1918+
1919+void LinePropDialog::OnFloor(wxCommandEvent &event)
1920+{
1921+ event.Skip();
1922+ std::cout<<"Event handler (LinePropDialog::OnFloor) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1923+}
1924+
1925+
1926+void LinePropDialog::OnCeiling(wxCommandEvent &event)
1927+{
1928+ event.Skip();
1929+ std::cout<<"Event handler (LinePropDialog::OnCeiling) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1930+}
1931+
1932+
1933+void LinePropDialog::OnClockwiseSide(wxCommandEvent &event)
1934+{
1935+ event.Skip();
1936+ std::cout<<"Event handler (LinePropDialog::OnClockwiseSide) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1937+}
1938+
1939+
1940+void LinePropDialog::OnCClockwiseSide(wxCommandEvent &event)
1941+{
1942+ event.Skip();
1943+ std::cout<<"Event handler (LinePropDialog::OnCClockwiseSide) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1944+}
1945+
1946+
1947+void LinePropDialog::OnClockwisePoly(wxCommandEvent &event)
1948+{
1949+ event.Skip();
1950+ std::cout<<"Event handler (LinePropDialog::OnClockwisePoly) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1951+}
1952+
1953+
1954+void LinePropDialog::OnCClockwisePoly(wxCommandEvent &event)
1955+{
1956+ event.Skip();
1957+ std::cout<<"Event handler (LinePropDialog::OnCClockwisePoly) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1958+}
1959+
1960+
1961+// wxGlade: add LinePropDialog event handlers
1962+
1963+
1964+void LinePropDialog::set_properties()
1965+{
1966+ // begin wxGlade: LinePropDialog::set_properties
1967+ SetTitle(wxT("dialog_13"));
1968+ text_ctrl_42->SetMinSize(wxSize(50, -1));
1969+ text_ctrl_43->SetMinSize(wxSize(50, -1));
1970+ radio_box_1->SetSelection(0);
1971+ // end wxGlade
1972+}
1973+
1974+
1975+void LinePropDialog::do_layout()
1976+{
1977+ // begin wxGlade: LinePropDialog::do_layout
1978+ wxFlexGridSizer* grid_sizer_26 = new wxFlexGridSizer(9, 2, 0, 0);
1979+ wxStaticBoxSizer* sizer_54 = new wxStaticBoxSizer(sizer_54_staticbox, wxVERTICAL);
1980+ wxFlexGridSizer* grid_sizer_27 = new wxFlexGridSizer(1, 2, 0, 0);
1981+ grid_sizer_26->Add(label_64, 0, 0, 0);
1982+ grid_sizer_27->Add(text_ctrl_42, 0, 0, 0);
1983+ grid_sizer_27->Add(text_ctrl_43, 0, 0, 0);
1984+ grid_sizer_26->Add(grid_sizer_27, 1, wxEXPAND, 0);
1985+ sizer_54->Add(checkbox_45, 0, 0, 0);
1986+ sizer_54->Add(checkbox_52, 0, 0, 0);
1987+ sizer_54->Add(checkbox_53, 0, 0, 0);
1988+ sizer_54->Add(checkbox_54, 0, 0, 0);
1989+ grid_sizer_26->Add(sizer_54, 1, wxEXPAND, 0);
1990+ grid_sizer_26->Add(radio_box_1, 0, 0, 0);
1991+ grid_sizer_26->Add(label_66, 0, 0, 0);
1992+ grid_sizer_26->Add(text_ctrl_45, 0, 0, 0);
1993+ grid_sizer_26->Add(label_67, 0, 0, 0);
1994+ grid_sizer_26->Add(text_ctrl_46, 0, 0, 0);
1995+ grid_sizer_26->Add(label_70, 0, 0, 0);
1996+ grid_sizer_26->Add(text_ctrl_47, 0, 0, 0);
1997+ grid_sizer_26->Add(label_71, 0, 0, 0);
1998+ grid_sizer_26->Add(choice_24, 0, 0, 0);
1999+ grid_sizer_26->Add(label_69, 0, 0, 0);
2000+ grid_sizer_26->Add(choice_25, 0, 0, 0);
2001+ grid_sizer_26->Add(label_72, 0, 0, 0);
2002+ grid_sizer_26->Add(choice_26, 0, 0, 0);
2003+ grid_sizer_26->Add(label_68, 0, 0, 0);
2004+ grid_sizer_26->Add(choice_27, 0, 0, 0);
2005+ SetSizer(grid_sizer_26);
2006+ grid_sizer_26->Fit(this);
2007+ Layout();
2008+ // end wxGlade
2009+}
2010+
2011+
2012+PolygonTypeDialog::PolygonTypeDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
2013+ wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
2014+{
2015+ // begin wxGlade: PolygonTypeDialog::PolygonTypeDialog
2016+ list_ctrl_2 = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER);
2017+
2018+ set_properties();
2019+ do_layout();
2020+ // end wxGlade
2021+}
2022+
2023+
2024+BEGIN_EVENT_TABLE(PolygonTypeDialog, wxDialog)
2025+ // begin wxGlade: PolygonTypeDialog::event_table
2026+ EVT_LIST_ITEM_SELECTED(wxID_ANY, PolygonTypeDialog::OnSel)
2027+ // end wxGlade
2028+END_EVENT_TABLE();
2029+
2030+
2031+void PolygonTypeDialog::OnSel(wxListEvent &event)
2032+{
2033+ event.Skip();
2034+ std::cout<<"Event handler (PolygonTypeDialog::OnSel) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
2035+}
2036+
2037+
2038+// wxGlade: add PolygonTypeDialog event handlers
2039+
2040+
2041+void PolygonTypeDialog::set_properties()
2042+{
2043+ // begin wxGlade: PolygonTypeDialog::set_properties
2044+ SetTitle(wxT("dialog_14"));
2045+ // end wxGlade
2046+}
2047+
2048+
2049+void PolygonTypeDialog::do_layout()
2050+{
2051+ // begin wxGlade: PolygonTypeDialog::do_layout
2052+ wxBoxSizer* sizer_53 = new wxBoxSizer(wxHORIZONTAL);
2053+ sizer_53->Add(list_ctrl_2, 1, wxEXPAND, 0);
2054+ SetSizer(sizer_53);
2055+ sizer_53->Fit(this);
2056+ Layout();
2057+ // end wxGlade
2058+}
2059+
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 346)
@@ -1,31 +1,38 @@
11 #pragma once
22
33 //dialogues
4+//modal
45 #include "AnnotationDialog.h"
56 #include "ColorCustomizeDialog.h"
67 #include "EditorPreferencesDialog.h"
7-#include "HeightDialog.h"
8-#include "HeightPaletteDialog.h"
98 #include "LevelInfoDialog.h"
10-#include "LinePropDialog.h"
11-#include "ObjectPropDialog.h"
129 #include "PlacementDialog.h"
1310 #include "PlatformDialog.h"
14-#include "PointPropDialog.h"
1511 #include "PolygonNumDialog.h"
16-#include "PolygonPropDialog.h"
17-#include "PolygonTypeDialog.h"
1812 #include "SelectLevelDialog.h"
19-#include "SidePropDialog.h"
2013 #include "TerminalDialog.h"
21-#include "TextureDialog.h"
22-#include "ToolDialog.h"
2314 #include "VisualDialog.h"
2415
16+//modeless
17+//tool
18+#include "ToolDialog.h"
19+//height
20+#include "HeightDialog.h"
21+//palettes
22+#include "HeightPaletteDialog.h"
2523 #include "LightPaletteDialog.h"
2624 #include "MediaPaletteDialog.h"
2725 #include "SoundPaletteDialog.h"
26+#include "TextureDialog.h"
27+//properties
28+#include "ObjectPropDialog.h"
29+#include "LinePropDialog.h"
30+#include "PointPropDialog.h"
31+#include "PolygonPropDialog.h"
32+#include "PolygonTypeDialog.h"
33+#include "SidePropDialog.h"
2834
35+
2936 #include "MapEditorWX.h"
3037 #include "HPLLib/HPLAlephLib.h"
3138
@@ -96,6 +103,14 @@
96103 */
97104 class MapEditorMainFrame: public wxFrame
98105 {
106+public:
107+ //プロパティ類 <en> properties
108+ ObjectPropDialog objPropDialog;
109+ LinePropDialog linePropDialog;
110+ PointPropDialog pointPropDialog;
111+ PolygonTypeDialog polyTypeDialog;
112+ PolygonPropDialog polyPropDialog;
113+ SidePropDialog sidePropDialog;
99114 private:
100115 //ダブルバッファリング用Bitmap
101116 wxBitmap doubleBufferingBitmap;
@@ -104,17 +119,17 @@
104119
105120 /////////////////////
106121 //ダイアログ(モードレス)
107- //高さ
122+ //tool
123+ ToolDialog toolDialog;
124+ //高さ <en> height
108125 HeightDialog heightDialog;
109- //高さパレット
126+ //パレット類 <en> palettes
110127 HeightPaletteDialog heightPaletteDialog;
111- LinePropDialog linePropDialog;
112- ObjectPropDialog objPropDialog;
113- PointPropDialog pointPropDialog;
114- PolygonTypeDialog polyTypeDialog;
115- PolygonPropDialog polyPropDialog;
128+ LightPaletteDialog lightPaletteDialog;
129+ MediaPaletteDialog mediaPaletteDialog;
130+ SoundPaletteDialog soundPaletteDialog;
116131 TextureDialog textureDialog;
117- ToolDialog toolDialog;
132+
118133 //TODO サウンド・メディア・ライト
119134 //TODO 以上のパレットダイアログをさくせいすること
120135
--- marathon/trunk/MapEditorWX/src/PolygonPropDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/PolygonPropDialog.h (revision 346)
@@ -56,11 +56,17 @@
5656 wxPanel* panel_10;
5757 wxPanel* panel_11;
5858 wxPanel* panel_12;
59+
60+ int polyIndex;
5961 public:
6062 PolygonPropDialog();
6163 bool Create(wxWindow* parent, wxWindowID id);
6264 virtual ~PolygonPropDialog();
6365
66+ void setPolyIndex(int index);
67+ int getPolyIndex();
68+ void setupDialog();
69+
6470 //イベントテーブル作成<en>declare
6571 DECLARE_EVENT_TABLE()
6672 void OnIDEdit(wxCommandEvent &event); // wxGlade: <event_handler>
--- marathon/trunk/MapEditorWX/src/MediaPaletteDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/MediaPaletteDialog.cpp (revision 346)
@@ -0,0 +1,16 @@
1+#include "MediaPaletteDialog.h"
2+#include "MapEditorWX.h"
3+BEGIN_EVENT_TABLE(MediaPaletteDialog, wxDialog)
4+END_EVENT_TABLE()
5+MediaPaletteDialog::MediaPaletteDialog()
6+{
7+}
8+MediaPaletteDialog::~MediaPaletteDialog()
9+{
10+}
11+bool MediaPaletteDialog::Create(wxWindow* parent, wxWindowID id)
12+{
13+ bool result = wxDialog::Create(parent, id, _T("Height Pallet"));
14+
15+ return result;
16+}
--- marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 346)
@@ -294,7 +294,7 @@
294294 void MapEditorMainFrame::OnJumpLevel(wxCommandEvent& ev)
295295 {
296296 //TODO
297- JumpLevelDialog dlg;
297+ SelectLevelDialog dlg;
298298 dlg.Create(this, wxID_ANY);
299299 if(dlg.ShowModal() == wxID_OK){
300300 }
--- marathon/trunk/MapEditorWX/src/TerminalDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/TerminalDialog.cpp (revision 346)
@@ -1,5 +1,9 @@
11 #include "TerminalDialog.h"
2+#include "computer_interface.h"
3+#include "MapEditorWX.h"
24
5+const int BUF_MAX = 1024;
6+
37 enum{
48 ID_TERMINAL,
59 ID_SCREEN,
@@ -32,11 +36,11 @@
3236 list_box_2 = new wxListBox(this, ID_SCREEN);
3337 list_box_3 = new wxListBox(this, ID_INFO);
3438 panel_7 = new wxPanel(this, wxID_ANY);
35- text_ctrl_13 = new wxTextCtrl(this, ID_TEXT_EDIT, wxEmptyString);
39+ text_ctrl_13 = new wxTextCtrl(this, ID_TEXT_EDIT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
3640 button_20 = new wxButton(this, wxID_OK, wxEmptyString);
3741
38- list_box_1->SetMinSize(wxSize(-1, 200));
39- list_box_2->SetMinSize(wxSize(-1, 100));
42+ list_box_1->SetMinSize(wxSize(180, 200));
43+ list_box_2->SetMinSize(wxSize(180, 100));
4044 panel_7->SetMinSize(wxSize(500, 200));
4145 text_ctrl_13->SetMinSize(wxSize(500, 200));
4246
@@ -60,10 +64,16 @@
6064 //terminal_text_t* terminal = &map_terminal_text[i];
6165 char cstr[256];
6266 sprintf(cstr, "terminal%3d", i);
63- list_box_1->Insert(i, wxConvertMB2WX(cstr));
67+ list_box_1->Insert(wxString(wxConvertMB2WX(cstr)), i);
6468 }
65- if(map_terminal_text.size() > 0){
69+/* if(map_terminal_text.size() > 0){
70+ //選択状態にする <en> select one
71+ list_box_1->SetSelection(0);
72+
73+// wxCommandEvent dummy;
74+// OnSelTerminal(dummy);
6675 }
76+ */
6777 return result;
6878 }
6979 void TerminalDialog::OnOk(wxCommandEvent& ev)
@@ -73,15 +83,89 @@
7383 }
7484 void TerminalDialog::OnSelTerminal(wxCommandEvent &event)
7585 {
76- event.Skip();
77- std::cout<<"Event handler (TerminalDialog::OnSelTerminal) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
86+ int sel = event.GetSelection();
87+ if(sel < 0 || sel >= map_terminal_text.size()){
88+ //illegal selecting
89+ }else{
90+ //スクリーンリストを初期化
91+ this->list_box_2->Clear();
92+ terminal_text_t *terminal = &map_terminal_text[sel];
93+ for(int i = 0; i < terminal->groupings.size(); i ++){
94+ terminal_groupings *group = &terminal->groupings[i];
95+ list_box_2->Insert(
96+ wxString(wxConvertMB2WX(wxGetApp().terminalTypeInfo[i].jname.c_str())),
97+ i);
98+ }
99+ }
78100 }
79101
102+static void encode_text(
103+ terminal_text_t *terminal_text)
104+{
105+ int length = terminal_text->text_length;
106+ uint8 *p = terminal_text->text;
80107
108+ for (int i=0; i<length/4; i++) {
109+ p += 2;
110+ *p++ ^= 0xfe;
111+ *p++ ^= 0xed;
112+ }
113+ for (int i=0; i<length%4; i++)
114+ *p++ ^= 0xfe;
115+
116+ terminal_text->flags |= _text_is_encoded_flag;
117+}
118+static void decode_text(
119+ terminal_text_t *terminal_text)
120+{
121+ if(terminal_text->flags & _text_is_encoded_flag)
122+ {
123+ encode_text(terminal_text);
124+ terminal_text->flags &= ~_text_is_encoded_flag;
125+ }
126+}
127+
81128 void TerminalDialog::OnSelScreen(wxCommandEvent &event)
82129 {
83- event.Skip();
84- std::cout<<"Event handler (TerminalDialog::OnSelScreen) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
130+ //Editに流し込みます
131+ int tsel = this->list_box_1->GetSelection();
132+ if(tsel < 0 || tsel >= map_terminal_text.size()){
133+ return;
134+ }
135+
136+ terminal_text_t *terminal = &map_terminal_text[tsel];
137+ int sel = event.GetSelection();
138+ if(sel < 0 || sel >= terminal->groupings.size()){
139+ return;
140+ }
141+
142+ //Edit初期化
143+ this->text_ctrl_13->Clear();
144+ decode_text(terminal);
145+
146+ //文字列データへ変換
147+ int length = terminal->groupings[sel].length;
148+ char *cstr = new char[length + 1];
149+ for(int i = 0; i < length; i ++){
150+ uint8 u = terminal->text[i + terminal->groupings[sel].start_index];
151+ cstr[i] = static_cast<char>(u);
152+ }
153+ cstr[length] = '\0';
154+// hpl::error::caution("%s", cstr);
155+ wxString str = wxString(wxConvertMB2WX(cstr));
156+ this->text_ctrl_13->SetValue(str);
157+// this->text_ctrl_13->AppendText(str);
158+ delete cstr;
159+
160+ //情報も入れる
161+ this->list_box_3->Clear();
162+ char buf[BUF_MAX];
163+ sprintf(buf, "group_flags:%d", terminal->groupings[sel].flags);
164+ this->list_box_3->Insert( wxConvertMB2WX(buf), 0);
165+ sprintf(buf, "group_permutation:%d", terminal->groupings[sel].permutation);
166+ this->list_box_3->Insert(wxConvertMB2WX(buf), 1);
167+ sprintf(buf, "terminal_flags:%d", terminal->flags);
168+ this->list_box_3->Insert(wxConvertMB2WX(buf), 2);
85169 }
86170
87171
--- marathon/trunk/MapEditorWX/src/ObjectPropDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/ObjectPropDialog.h (revision 346)
@@ -4,10 +4,16 @@
44 #include "DlgCommon.h"
55
66 class ObjectPropDialog: public wxDialog{
7+ int objIndex;
78 public:
89 ObjectPropDialog();
910 bool Create(wxWindow* parent, wxWindowID id);
1011 virtual ~ObjectPropDialog();
12+
13+ void setObjIndex(int index);
14+ int getObjIndex();
15+private:
16+ void setupDialog();
1117 //イベントテーブル作成<en>declare
1218 DECLARE_EVENT_TABLE()
1319 };
--- marathon/trunk/MapEditorWX/src/SelectLevelDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/SelectLevelDialog.h (revision 346)
@@ -4,12 +4,21 @@
44 #include "DlgCommon.h"
55
66 class SelectLevelDialog: public wxDialog{
7+ wxStaticText* label_57;
8+ wxListBox* list_box_4;
9+ wxButton* button_22;
10+ wxButton* button_23;
711 public:
12+ int polygonIndex;
13+
814 SelectLevelDialog();
915 bool Create(wxWindow* parent, wxWindowID id);
1016 virtual ~SelectLevelDialog();
1117 //イベントテーブル作成<en>declare
1218 DECLARE_EVENT_TABLE()
19+ void OnList(wxCommandEvent &event); // wxGlade: <event_handler>
20+ void OnOk(wxCommandEvent &event); // wxGlade: <event_handler>
21+ void OnCancel(wxCommandEvent &event); // wxGlade: <event_handler>
1322 };
1423
1524 #endif
--- marathon/trunk/MapEditorWX/src/SoundPaletteDialog.h (revision 345)
+++ marathon/trunk/MapEditorWX/src/SoundPaletteDialog.h (revision 346)
@@ -0,0 +1,15 @@
1+#ifndef _SOUND_PALETTE_DIALOG_
2+#define _SOUND_PALETTE_DIALOG_
3+
4+#include "DlgCommon.h"
5+
6+class SoundPaletteDialog: public wxDialog{
7+public:
8+ SoundPaletteDialog();
9+ bool Create(wxWindow* parent, wxWindowID id);
10+ virtual ~SoundPaletteDialog();
11+ //イベントテーブル作成<en>declare
12+ DECLARE_EVENT_TABLE()
13+};
14+
15+#endif
--- marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 345)
+++ marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 346)
@@ -3,6 +3,7 @@
33
44 #include <string>
55 #include "PolygonNumDialog.h"
6+#include "MapEditorMainFrame.h"
67
78 BEGIN_EVENT_TABLE(ToolDialog, wxDialog)
89 EVT_PAINT(ToolDialog::OnPaint)
@@ -11,6 +12,7 @@
1112
1213 ToolDialog::ToolDialog():wxDialog()
1314 {
15+
1416 //イメージ名リスト読み込み
1517 hpl::aleph::Information infos[NUMBER_OF_TOOL_BAR_ICON_FILES];
1618 {
@@ -47,6 +49,7 @@
4749 long style = wxCAPTION;
4850 bool result = wxDialog::Create(parent, id, _T("Tool"), wxDefaultPosition//);
4951 , wxSize(TOOL_DIALOG_W, TOOL_DIALOG_H), style);
52+
5053 /* wxBitmapButton *bmpBtn = new wxBitmapButton(this, -1, toolBitmaps[0]);
5154 wxGridSizer *boxSizer = new wxGridSizer(2);
5255 this->SetSizer(boxSizer);
@@ -101,7 +104,8 @@
101104 if(i == ToolType::TI_SKULL){
102105 //オブジェクトツール
103106 //プロパティを表示する
104- //TODO wxGetApp().objectPropDialog.Show();
107+ ((MapEditorMainFrame*)GetParent())->objPropDialog.setObjIndex(NONE);
108+ ((MapEditorMainFrame*)GetParent())->objPropDialog.Show();
105109
106110 }else if(i == ToolType::TI_POLYGON){
107111 //ポリゴンツール
--- marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 345)
+++ marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 346)
@@ -30,14 +30,15 @@
3030 ?Q?F?z?u
3131 ?R?F?Ăяo???????L?q
3232 ?S?F?f?[?^???o?͋L?q
33+?T?F?f?o?b?O????
3334
34-Annotation :???o??
35+Annotation :?f?o?b?O?????i?I?????[?h?͖????j
3536 ColorCustomize :?z?u?ς?
3637 EditPreferences :?z?u?ς?
3738 Height :?z?u?ς݁B
3839 HeightPallet :
3940 LevelInfo
40-LineProp
41+LineProp :wx
4142 ObjectProp :wx
4243 Placement :?z?u?ς?
4344 Platform :?z?u?ς݁B
@@ -44,10 +45,10 @@
4445 PointProp :?z?u
4546 PolygonNum :?z?u
4647 PolygonProp :?z?u
47-PolygonType
48-SelectLevel
48+PolygonType :wx
49+SelectLevel :?z?u
4950 SideProp
50-Terminal :?z?u?ς?
51+Terminal :???o??
5152 Texture
5253 Tool :?z?u?ς?
5354 Visual
@@ -145,4 +146,8 @@
145146 ?ˑ??֌W
146147 ?_?????̒[?_?i?|???S???̈ꕔ?j
147148 ?????_?ASide?A?|???S??
148-?|???S???????A?_?A?I?u?W?F?N?g?ASide
\ No newline at end of file
149+?|???S???????A?_?A?I?u?W?F?N?g?ASide
150+
151+Terminal encode->Marathon ??????f?[?^
152+decode->char
153+?ۑ????ɃG???R?[?h???邱?Ƃ?Y?ꂸ?ɁI
\ No newline at end of file
--- marathon/trunk/MapDemergerOneWX/src/MapDemergerOneWX.h (nonexistent)
+++ marathon/trunk/MapDemergerOneWX/src/MapDemergerOneWX.h (revision 346)
@@ -0,0 +1,28 @@
1+#pragma once
2+//#ifndef _MAP_DEMERGER_ONE_WX_
3+//#define _MAP_DEMERGER_ONE_WX_
4+
5+//プリコンパイルを使いたい場合に使用
6+#include <wx/wxprec.h>
7+
8+//ボーランドC/C++用のおまじない
9+#ifdef __BORLANDC__
10+#pragma hdrstop
11+#endif
12+
13+//必要なインクルード
14+#ifndef WX_PRECOMP
15+// Include your minimal set of headers here, or wx.h
16+#include <wx/wx.h>
17+#endif
18+#include "wx/settings.h"
19+
20+class MapDemergerOneWX: public wxApp{
21+public:
22+// MapDemergerOneWX();
23+// ~MapDemergerOneWX();
24+ virtual bool OnInit();
25+};
26+DECLARE_APP(MapDemergerOneWX)
27+
28+//#endif
--- marathon/trunk/MapDemergerOneWX/src/MainFrame.h (nonexistent)
+++ marathon/trunk/MapDemergerOneWX/src/MainFrame.h (revision 346)
@@ -0,0 +1,12 @@
1+#ifndef _MAIN_FRAME_
2+#define _MAIN_FRAME_
3+
4+#include "MapDemergerOneWX.h"
5+
6+class MainFrame: public wxFrame{
7+public:
8+ MainFrame(const wxString& title);
9+ DECLARE_EVENT_TABLE()
10+};
11+
12+#endif
--- marathon/trunk/MapDemergerOneWX/src/MapDemergerOneWX.cpp (nonexistent)
+++ marathon/trunk/MapDemergerOneWX/src/MapDemergerOneWX.cpp (revision 346)
@@ -0,0 +1,106 @@
1+#include "MapDemergerOneWX.h"
2+#include "HPLLib/HPLAlephLib.h"
3+#include "platforms.h"
4+#include "game_wad.h"
5+#include "FileHandler.h"
6+#include "map.h"
7+#include <wx/dirdlg.h>
8+#include <wx/filedlg.h>
9+#include <string>
10+#include <vector>
11+
12+IMPLEMENT_APP(MapDemergerOneWX)
13+
14+//const int MAX_PATH = 260;
15+
16+static std::vector<std::string> getLevelList()
17+{
18+ //
19+ initialize_map_for_new_level();
20+ std::vector<std::string> names;
21+ char cstr[MAX_PATH];
22+ short index = 0;
23+ struct entry_point ep;
24+ int type = 3;
25+ int num = 0;
26+ while(get_indexed_entry_point(&ep, &index, type)){
27+ sprintf(cstr, "%d,", ep.level_number);
28+ std::string str = std::string(ep.level_name);
29+ names.push_back(str);
30+ num ++;
31+ }
32+ if(num == 0){
33+ //theApp.LevelNameList.Add(CString("unmerged"));
34+ names.push_back(std::string("unmerged"));
35+ }
36+ return names;
37+}
38+
39+bool MapDemergerOneWX::OnInit()
40+{
41+ //ファイル選択ダイアログ
42+ wxString path = ::wxFileSelector();
43+ if(path.empty()){
44+ wxMessageBox(_T("Operation canceld by user. exit"));
45+ return false;
46+ }
47+ FileSpecifier mapFile = FileSpecifier(path.mb_str());
48+ //set map file
49+ set_map_file(mapFile);
50+
51+ build_trig_tables();
52+
53+ allocate_map_memory();
54+ initialize_map_for_new_level();
55+ load_level_from_map(0);
56+
57+ wxString dirPath = wxDirSelector();
58+ if(dirPath.empty()){
59+ wxMessageBox(_T("Operation canceled by user. exit"));
60+ return false;
61+ }
62+ wxString last = dirPath.Right(1);
63+ if(last != _T("\\") && last != _T("/")){
64+ dirPath.Append(_T("/"));
65+ }
66+#ifdef MAC
67+ //TODO separator in MacOSX may not be "/" nor "\".
68+#endif
69+
70+ //インデックス取得
71+ std::vector<std::string> names = getLevelList();
72+ for(int i = 0; i < (int)names.size(); i ++){
73+ char buf[MAX_PATH];
74+ //読み込み
75+ if(!load_level_from_map(i)){
76+ wxString str = wxConvertMB2WX("Fail to load map");
77+ str.Append(wxString(wxConvertMB2WX(names[i].c_str())));
78+ wxMessageBox(str);
79+ continue;
80+ }
81+ sprintf(buf, "%d", i);
82+ std::string numstr = hpl::string::appendFrontString(
83+ std::string(buf), 2, std::string("0"));
84+ for(int n = 0; n < (int)names.size(); n ++){
85+ //表示不可の文字を置き換える
86+ if(names[i][n] == '?' || names[i][n] == ';' || names[i][n] == ':'){
87+ names[i][n] = '-';
88+ }
89+ }
90+ sprintf(buf, "%sL%s%s.sceA", dirPath.mb_str(),
91+ numstr.c_str(), names[i].c_str());
92+ if(!save_level(buf)){
93+ wxString str = wxConvertMB2WX("Fail to save map:[");
94+ str.Append(wxString(wxConvertMB2WX(buf)));
95+ str.Append(_T("] If you want, push cancel button to interrupt operation. If not, push ok button to continue."));
96+ if(wxMessageBox(_T("Fail to save map:"), _T("Message"), wxOK | wxCANCEL ) == wxID_OK){
97+ continue;
98+ }else{
99+ return false;
100+ }
101+ }
102+ }
103+
104+ wxMessageBox(_T("All convertion completed"));
105+ return false;
106+}
\ No newline at end of file
--- marathon/trunk/HPLLib/HPLMapTool.cpp (revision 345)
+++ marathon/trunk/HPLLib/HPLMapTool.cpp (revision 346)
@@ -146,6 +146,14 @@
146146 }
147147 return NONE;
148148 }
149+int hpl::aleph::map::getSelectPointIndex(int viewX, int viewY, int threshold, int zMin, int zMax,
150+ int voffsetX, int voffsetY, int offsetXW, int offsetYW, int div)
151+{
152+ world_point2d wpoint = hpl::aleph::map::getWorldPoint2DFromViewPoint(viewX, viewY, offsetXW, offsetYW, div,
153+ voffsetX, voffsetY);
154+ int index = hpl::aleph::map::getSelectPointIndex(wpoint, threshold * div, zMin, zMax);
155+ return index;
156+}
149157
150158 /**
151159 ある高さが規定範囲内にあるかを確かめます
@@ -188,6 +196,14 @@
188196 }
189197 return NONE;
190198 }
199+int hpl::aleph::map::getSelectLineIndex(int viewX, int viewY, int threshold, int zMin, int zMax,
200+ int voffsetX, int voffsetY, int offsetXW, int offsetYW, int div)
201+{
202+ world_point2d wpoint = hpl::aleph::map::getWorldPoint2DFromViewPoint(viewX, viewY, offsetXW, offsetYW, div,
203+ voffsetX, voffsetY);
204+ int index = hpl::aleph::map::getSelectLineIndex(wpoint, threshold * div, zMin, zMax);
205+ return index;
206+}
191207
192208 /////////////////////// Lines ////////////////////////////////////////////
193209
--- marathon/trunk/HPLLib/HPLMapTool.h (revision 345)
+++ marathon/trunk/HPLLib/HPLMapTool.h (revision 346)
@@ -129,8 +129,10 @@
129129 @return その場所に点があればそのインデックスがかえります。
130130 なければNONE
131131 */
132- int getSelectPointIndex(world_point2d& wpoint, int threshold, int zMin, int zMax);
133-
132+ int getSelectPointIndex(world_point2d& wpoint, int thresholdWorld, int zMin, int zMax);
133+ int getSelectPointIndex(int viewX, int viewY, int threshold, int zMin, int zMax,
134+ int voffsetX, int voffsetY, int offsetXW, int offsetYW, int div);
135+
134136 /**
135137 ある高さが規定範囲内にあるかを確かめます
136138 @return ある高度の範囲が規定範囲と共有する部分を持たない場合負
@@ -141,6 +143,8 @@
141143 指定した点が線を踏んでいる場合、その点
142144 */
143145 int getSelectLineIndex(world_point2d& wpoint, int threshold, int zMin, int zMax);
146+ int getSelectLineIndex(int viewX, int viewY, int threshold, int zMin, int zMax,
147+ int voffsetX, int voffsetY, int offsetXW, int offsetYW, int div);
144148
145149 /////////////////////// Lines ////////////////////////////////////////////
146150 /**
旧リポジトリブラウザで表示