2 * levels__sidesWindows.cpp
4 * Created on: 27 avr. 2009
13 #include "common__tools.h"
14 #include "common__object_stage.h"
15 #include "levels__sidesWindows.h"
16 #include "levels__globals.h"
17 #include "levels__Ctrl_SceneView.h"
20 //****************************************************
21 //****************************************************
22 //****************************************************
23 //****************************************************
24 //****************************************************
25 //****************************************************
26 //****************************************************
27 //****************************************************
28 //****************************************************
29 //****************************************************
32 myWnd_SETProperties::myWnd_SETProperties(wxWindow
*_parent
, ob_StagesSet
* _set
, const wxString
& wnd_name
)
33 :FrameEditProperties( _parent
, _set
, wnd_name
)
35 wndSavingName
= wnd_name
;
40 //****************************************************
42 myWnd_SETProperties::~myWnd_SETProperties()
47 //****************************************************
49 void myWnd_SETProperties::InitObj()
53 theObj
= new ob_StagesSet();
54 theObj
->SetToDefault();
60 //****************************************************
62 void myWnd_SETProperties::InitProps()
65 reqs
= new frameEdit_request
[alloc
];
68 reqs
[i
].name
= wxT("_TOKEN_0");
69 reqs
[i
].label
= wxT("SET name : ");
70 reqs
[i
].SetPropType( PROPTYPE_STRING_NO_WS
);
74 reqs
[i
].name
= wxT("20");
75 //reqs[i].label = "Custom Selection screen file : ";
76 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
80 reqs
[i
].name
= wxT("select");
81 reqs
[i
].b_optional
= true;
82 reqs
[i
].label
= wxT("Custom Selection screen file : ");
83 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
87 reqs
[i
].name
= wxT("20");
88 //reqs[i].label = "Custom Selection screen file : ";
89 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
93 reqs
[i
].name
= wxT("nosame");
94 reqs
[i
].label
= wxT("Clones characters forbidden");
95 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
99 reqs
[i
].name
= wxT("noshare");
100 reqs
[i
].label
= wxT("Players don't share credits");
101 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
105 reqs
[i
].name
= wxT("ifcomplete");
106 reqs
[i
].label
= wxT("Secret level");
107 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
111 reqs
[i
].name
= wxT("20");
112 //reqs[i].label = "Custom Selection screen file : ";
113 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
117 reqs
[i
].name
= wxT("lives");
118 reqs
[i
].label
= wxT("Nb of lives");
119 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
123 reqs
[i
].name
= wxT("credits");
124 reqs
[i
].label
= wxT("Nb of credits");
125 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
129 reqs
[i
].name
= wxT("20");
130 //reqs[i].label = "Custom Selection screen file : ";
131 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
135 reqs
[i
].name
= wxT("maxplayers");
136 reqs
[i
].label
= wxT("Max players");
137 reqs
[i
].SetPropType( PROPTYPE_ENUMS
);
138 wxString t0
[] = { wxT("1"), wxT("2"), wxT("3"), wxT("4") };
139 TabStringToArrayString( t0
, 4, reqs
[i
].enums
);
142 reqs
[i
].name
= wxT("typemp");
143 reqs
[i
].label
= wxT("MP recovery mode");
144 reqs
[i
].SetPropType( PROPTYPE_RANGE
);
145 wxString t1
[] = { wxT("With time"), wxT("Hitting Enemies"), wxT("Items and rebirth") };
146 TabStringToArrayString( t1
, 3, reqs
[i
].enums
);
149 reqs
[i
].name
= wxT("cansave");
150 reqs
[i
].label
= wxT("Saving mode");
151 reqs
[i
].SetPropType( PROPTYPE_RANGE
);
152 wxString t2
[] = { wxT("Disable"), wxT("Last Level"), wxT("Full") };
153 TabStringToArrayString( t2
, 3, reqs
[i
].enums
);
160 //****************************************************
161 //****************************************************
162 //****************************************************
163 //****************************************************
164 //****************************************************
165 //****************************************************
166 //****************************************************
167 //****************************************************
168 //****************************************************
169 //****************************************************
172 myWnd_LEVELSSTAGEProperties::myWnd_LEVELSSTAGEProperties(wxWindow
*_parent
, ob_StageDeclaration
* _stDeclar
, bool b_init
, const wxString
& wnd_name
)
173 :FrameEditProperties( _parent
, NULL
, wnd_name
)
176 b_newObj
= (theObj
== NULL
);
178 wndSavingName
= wxT("LevelstxtStageProperties");
185 //****************************************************
187 myWnd_LEVELSSTAGEProperties::~myWnd_LEVELSSTAGEProperties()
191 //****************************************************
193 void myWnd_LEVELSSTAGEProperties::Clicked_OK(bool b_close
)
195 FrameEditProperties::Clicked_OK(false);
197 wxString _newName
= theObj
->GetSubObject_Token( wxT("temp_name") );
199 if( _newName
!= ((ob_StageDeclaration
*)theObj
)->GetStageName() )
202 // Must update the branch point
203 if( b_has_branch
&& !StrToInt( theObj
->GetSubObject_Token(wxT( "temp_bhasbranch") ) ) )
205 ob_object
* branch
= theObj
->GetSubObject(wxT( "branch") );
210 else if( ! b_has_branch
&& StrToInt( theObj
->GetSubObject_Token( wxT("temp_bhasbranch" )) ) )
212 ob_object
* t
= new ob_object( wxT("branch"), _newName
);
213 theObj
->Add_SubObj( t
);
217 ((ob_StageDeclaration
*)theObj
)->SetStageName( _newName
);
225 //****************************************************
227 myWnd_LEVELSSTAGEProperties::Clicked_Cancel(bool b_close
)
229 FrameEditProperties::Clicked_Cancel(false);
236 //-----------------------------------------------------------------
238 myWnd_LEVELSSTAGEProperties::Cleanings()
240 ob_object
* t
= theObj
->GetSubObject( wxT("temp_bhasbranch") );
243 t
= theObj
->GetSubObject( wxT("temp_name" ));
247 // Branch tag must be before the file tag
250 ob_object
* t
= theObj
->first_subobj
;
251 ob_object
* _f
= NULL
;
252 ob_object
* _b
= NULL
;
255 if( t
->name
.Upper() == wxT("BRANCH") )
264 else if( t
->name
.Upper() == wxT("FILE") )
273 // Branch found after the file
276 _f
->InsertObject_Before( _b
);
283 //****************************************************
285 void myWnd_LEVELSSTAGEProperties::InitObj()
289 theObj
= new ob_StageDeclaration();
290 theObj
->SetToDefault();
294 // Handle the stage name problem -> Create a name property
295 wxString StageName
= ((ob_StageDeclaration
*)theObj
)->GetStageName();
296 b_has_branch
= (theObj
->GetSubObject( wxT("branch") ) != NULL
);
297 theObj
->SetProperty( wxT("temp_name"), StageName
);
298 theObj
->SetProperty( wxT("temp_bhasbranch"), BoolToStr(b_has_branch
) );
302 //****************************************************
304 void myWnd_LEVELSSTAGEProperties::InitProps()
307 reqs
= new frameEdit_request
[alloc
];
312 reqs
[i
].name
= wxT("temp_name");
313 reqs
[i
].label
= wxT("Stage name : ");
314 reqs
[i
].SetPropType( PROPTYPE_STRING_NO_WS
);
318 reqs
[i
].name
= wxT("20");
319 //reqs[i].label = "Custom Selection screen file : ";
320 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
324 reqs
[i
].name
= wxT("file");
325 reqs
[i
].label
= wxT("Stage file : ");
326 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
329 reqs
[i
].name
= wxT("20");
330 //reqs[i].label = "Custom Selection screen file : ";
331 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
335 reqs
[i
].name
= wxT("_SUBOBJ_NAME%z%ALLTOKENS");
336 reqs
[i
].label
= wxT("Z : ");
338 reqs
[i
].SetPropType( PROPTYPE_STRING
);
342 reqs
[i
].name
= wxT("20");
343 //reqs[i].label = "Custom Selection screen file : ";
344 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
348 reqs
[i
].name
= wxT("temp_bhasbranch");
349 reqs
[i
].label
= wxT("Is a branch point");
350 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
354 reqs
[i
].name
= wxT("next");
355 reqs
[i
].label
= wxT("Display 'Stage complete' screen");
356 reqs
[i
].SetPropType( PROPTYPE_BOOL_EXSISTENCE
);
359 reqs
[i
].name
= wxT("end");
360 reqs
[i
].label
= wxT("Game End");
361 reqs
[i
].SetPropType( PROPTYPE_BOOL_EXSISTENCE
);
369 //****************************************************
370 //****************************************************
371 //****************************************************
372 //****************************************************
373 //****************************************************
374 //****************************************************
375 //****************************************************
376 //****************************************************
377 //****************************************************
380 myWnd_STAGEProperties::myWnd_STAGEProperties(wxWindow
*_parent
, ob_stage
* _stage
)
381 :FrameEditProperties( _parent
, NULL
, wxT("STAGE properties"))
385 b_newObj
= (theObj
== NULL
);
387 wndSavingName
= wxT("StageProperties");
393 //****************************************************
395 myWnd_STAGEProperties::~myWnd_STAGEProperties()
399 //****************************************************
401 void myWnd_STAGEProperties::Clicked_OK(bool b_close
)
403 FrameEditProperties::Clicked_OK(false);
411 //****************************************************
413 void myWnd_STAGEProperties::Clicked_Cancel(bool b_close
)
415 FrameEditProperties::Clicked_Cancel(false);
422 //****************************************************
424 void myWnd_STAGEProperties::Cleanings()
429 //****************************************************
431 void myWnd_STAGEProperties::InitObj()
435 theObj
= new ob_stage();
436 theObj
->SetToDefault();
443 //****************************************************
445 void myWnd_STAGEProperties::InitProps()
448 reqs
= new frameEdit_request
[alloc
];
453 reqs
[i
].name
= wxT("direction");
454 reqs
[i
].label
= wxT("Direction");
455 reqs
[i
].SetPropType( PROPTYPE_ENUMS
);
469 TabStringToArrayString( t0
, 11, reqs
[i
].enums
);
470 reqs
[i
].defVal
= wxT("right");
471 reqs
[i
].b_optional
= true;
475 reqs
[i
].name
= wxT("_SUBOBJ_NAME%type%TOKEN%0");
476 reqs
[i
].label
= wxT("Is Bonus Stage");
477 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
478 reqs
[i
].b_optional
= true;
481 reqs
[i
].name
= wxT("_SUBOBJ_NAME%type%TOKEN%1");
482 reqs
[i
].label
= wxT("Specials are forbidden");
483 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
484 reqs
[i
].nb_missing_tokens
= 1;
485 reqs
[i
].missing_tokens
= new wxString
[1];
486 reqs
[i
].missing_tokens
[0] = wxT("0");
487 reqs
[i
].b_optional
= true;
490 reqs
[i
].name
= wxT("_SUBOBJ_NAME%type%TOKEN%2");
491 reqs
[i
].label
= wxT("Players are invicible");
492 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
493 reqs
[i
].nb_missing_tokens
= 2;
494 reqs
[i
].missing_tokens
= new wxString
[2];
495 reqs
[i
].missing_tokens
[0] = wxT("0");
496 reqs
[i
].missing_tokens
[1] = wxT("0");
497 reqs
[i
].b_optional
= true;
500 reqs
[i
].name
= wxT("15");
501 //reqs[i].label = "Custom Selection screen file : ";
502 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
506 reqs
[i
].name
= wxT("music");
507 reqs
[i
].label
= wxT("Level music");
508 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
509 reqs
[i
].b_optional
= true;
512 reqs
[i
].name
= wxT("bossmusic");
513 reqs
[i
].label
= wxT("Bosses music");
514 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
515 reqs
[i
].b_optional
= true;
518 reqs
[i
].name
= wxT("15");
519 //reqs[i].label = "Custom Selection screen file : ";
520 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
524 reqs
[i
].name
= wxT("settime");
525 reqs
[i
].label
= wxT("Level time limit");
526 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
529 reqs
[i
].name
= wxT("noreset");
530 reqs
[i
].label
= wxT("Time reset mod :");
531 reqs
[i
].SetPropType( PROPTYPE_RANGE
);
532 wxString t1
[] = { wxT("Respawns and Joins"), wxT("Only on time out"), wxT("On respawns") };
533 TabStringToArrayString( t1
, 3, reqs
[i
].enums
);
536 reqs
[i
].name
= wxT("notime");
537 reqs
[i
].label
= wxT("Timer is hidden");
538 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
541 reqs
[i
].name
= wxT("15");
542 //reqs[i].label = "Custom Selection screen file : ";
543 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
547 reqs
[i
].name
= wxT("rock");
548 reqs
[i
].label
= wxT("Background Rocking effect :");
549 reqs
[i
].labelw
= 255;
550 reqs
[i
].SetPropType( PROPTYPE_RANGE
);
551 wxString t2
[] = { wxT("None"), wxT("Boat"), wxT("Train"), wxT("Hard road") };
552 TabStringToArrayString( t2
, 4, reqs
[i
].enums
);
553 reqs
[i
].b_optional
= true;
556 reqs
[i
].name
= wxT("mirror");
557 reqs
[i
].label
= wxT("Mirror in the background");
558 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
559 reqs
[i
].b_optional
= true;
562 reqs
[i
].name
= wxT("blocked");
563 reqs
[i
].label
= wxT("The end of stage is a solid wall");
564 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
565 reqs
[i
].b_optional
= true;
568 reqs
[i
].name
= wxT("endhole");
569 reqs
[i
].label
= wxT("The end of stage is hole");
570 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
571 reqs
[i
].b_optional
= true;
574 reqs
[i
].name
= wxT("15");
575 //reqs[i].label = "Custom Selection screen file : ";
576 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
580 reqs
[i
].name
= wxT("gravity");
581 reqs
[i
].label
= wxT("Gravity :");
582 reqs
[i
].labelw
= 150;
583 reqs
[i
].SetPropType( PROPTYPE_NEGATIVENUMBER
);
584 reqs
[i
].b_optional
= true;
585 reqs
[i
].defVal
= wxT("-10");
588 reqs
[i
].name
= wxT("maxfallspeed");
589 reqs
[i
].label
= wxT("Maximum falling speed :");
590 reqs
[i
].labelw
= 150;
591 reqs
[i
].SetPropType( PROPTYPE_NEGATIVENUMBER
);
592 reqs
[i
].defVal
= wxT("-10");
595 reqs
[i
].name
= wxT("maxtossspeed");
596 reqs
[i
].label
= wxT("Maximum jumpheight :");
597 reqs
[i
].labelw
= 200;
598 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
599 reqs
[i
].defVal
= wxT("1000");
602 reqs
[i
].name
= wxT("15");
603 //reqs[i].label = "Custom Selection screen file : ";
604 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
608 reqs
[i
].name
= wxT("noslow");
609 reqs
[i
].label
= wxT("Game not slow down when beating a boss");
610 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
613 reqs
[i
].name
= wxT("setweap");
614 reqs
[i
].label
= wxT("Nb weapons at start");
615 reqs
[i
].labelw
= 200;
616 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
620 reqs
[i
].name
= wxT("15");
621 //reqs[i].label = "Custom Selection screen file : ";
622 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
630 //****************************************************
631 //****************************************************
632 //****************************************************
633 //****************************************************
634 //****************************************************
635 //****************************************************
636 //****************************************************
637 //****************************************************
638 //****************************************************
641 myWnd_STAGE_New::myWnd_STAGE_New(wxWindow
*_parent
)
642 :myWnd_LEVELSSTAGEProperties( _parent
, NULL
, false, wxT("New Stage Declaration Properties"))
644 wndSavingName
= wxT("STAGE_New");
650 //****************************************************
652 myWnd_STAGE_New::~myWnd_STAGE_New()
656 //****************************************************
658 void myWnd_STAGE_New::Clicked_OK(bool b_close
)
660 myWnd_LEVELSSTAGEProperties::Clicked_OK(false);
662 // Add the new stage at the correct position
663 int ind
= cbCtrl_where
->GetSelection();
664 if( ind
== (int) nb_stage
&& curr_set
!= NULL
)
666 curr_set
->Add_SubObj( theObj
);
668 else if( curr_set
== NULL
)
672 wxMessageBox( wxT("No current SET selected !!\n\n"), wxT("BUG"), wxOK
| wxICON_EXCLAMATION
, this );
676 stage_list
[ind
]->InsertObject_Before( theObj
);
685 //****************************************************
687 void myWnd_STAGE_New::Clicked_Cancel(bool b_close
)
689 FrameEditProperties::Clicked_Cancel(false);
696 //****************************************************
698 void myWnd_STAGE_New::Cleanings()
700 myWnd_LEVELSSTAGEProperties::Cleanings();
704 //****************************************************
706 void myWnd_STAGE_New::InitControls()
708 myWnd_LEVELSSTAGEProperties::InitControls();
710 // Add the after which one control
711 wxBoxSizer
* sizer_temp
= new wxBoxSizer( wxHORIZONTAL
);
713 wxStaticText
* t_stat
= new wxStaticText( this, wxID_ANY
, wxT("Add it before the Stage : ") );
714 t_stat
->SetMinSize( wxSize(270, wxDefaultCoord
) );
715 sizer_temp
->Add( t_stat
, 0, wxALIGN_CENTER
);
717 // Build the list of Stages
719 for( size_t i
= 0; i
< nb_stage
; i
++)
721 if( stage_list
[i
] != NULL
)
722 t
.Add( stage_list
[i
]->GetStageName());
725 t
.Add( wxT("AT THE END") );
727 // Build the list of Stages
728 cbCtrl_where
= new wxComboBox(this, wxID_ANY
, wxString()
729 , wxDefaultPosition
, wxDefaultSize
731 wxCB_DROPDOWN
| wxCB_READONLY
);
732 cbCtrl_where
->SetSelection( nb_stage
);
733 // cbCtrl_temp->SetMinSize( wxSize(reqs[i].fieldw, wxDefaultCoord) );
734 sizer_temp
->Add( cbCtrl_where
);
736 sizerTop
->Add( sizer_temp
, 0, wxTOP
| wxBOTTOM
, 20 );
741 //****************************************************
742 //****************************************************
743 //****************************************************
744 //****************************************************
745 //****************************************************
746 //****************************************************
747 //****************************************************
748 //****************************************************
749 //****************************************************
752 myWnd_LoadedEnt::myWnd_LoadedEnt( wxWindow
* _parent
, ob_stage
* _stage
)
753 :wxDialog( _parent
, wxID_ANY
, wxT("Loaded Entities for this stage"), wxDefaultPosition
, wxDefaultSize
,
754 wxDEFAULT_DIALOG_STYLE
| wxRESIZE_BORDER
)
756 wxBoxSizer
*sizerWrapper
= new wxBoxSizer( wxVERTICAL
);
757 wxPanel
* thePanel
= new wxPanel( this );
758 sizerWrapper
->Add( thePanel
, 0, wxALL
, 20 );
760 wxBoxSizer
*sizer_main
= new wxBoxSizer( wxVERTICAL
);
761 thePanel
->SetSizer( sizer_main
);
765 ob_object
** l_loads
= _stage
->GetSubObjectS( wxT("LOAD"), nb_loads
);
768 wxStaticText
* t_stat
= new wxStaticText( this, wxID_ANY
, wxT("NO LOADED ENTITIES") );
769 sizer_main
->Add( t_stat
);
773 wxArrayString sorted_list
;
774 for ( size_t i
=0; i
< nb_loads
; i
++)
776 sorted_list
.Add( l_loads
[i
]->GetToken( 0 ) );
780 for( size_t i
= 0; i
< sorted_list
.Count(); i
++)
782 wxStaticText
* t_stat
= new wxStaticText( this, wxID_ANY
, sorted_list
[i
] );
783 sizer_main
->Add( t_stat
);
787 if( l_loads
!= NULL
)
789 SetSizer( sizerWrapper
);
793 //****************************************************
795 myWnd_LoadedEnt::~myWnd_LoadedEnt()
801 //****************************************************
802 //****************************************************
803 //****************************************************
804 //****************************************************
805 //****************************************************
806 //****************************************************
807 //****************************************************
808 //****************************************************
809 //****************************************************
812 myWnd_PanelProperties::myWnd_PanelProperties(wxWindow
*_parent
, ob_stage_panel
* _stage
, bool b_init
)
813 :FrameEditProperties( _parent
, NULL
, wxT("Panel properties") )
817 b_newObj
= (theObj
== NULL
);
819 wndSavingName
= wxT("PanelProperties");
826 //****************************************************
828 myWnd_PanelProperties::~myWnd_PanelProperties()
832 //****************************************************
834 void myWnd_PanelProperties::Clicked_OK(bool b_close
)
836 FrameEditProperties::Clicked_OK(false);
838 wxString new_path_norm
= theObj
->GetToken(0);
839 if( new_path_norm
== wxString() )
840 new_path_norm
= wxT("none");
841 wxString new_path_neon
= theObj
->GetToken(1);
842 if( new_path_neon
== wxString() )
843 new_path_neon
= wxT("none");
844 wxString new_path_screen
= theObj
->GetToken(2);
845 if( new_path_screen
== wxString() )
846 new_path_screen
= wxT("none");
848 if( new_path_norm
!= path_norm
849 || new_path_neon
!= path_neon
850 || new_path_screen
!= path_screen
)
855 theObj
->SetToken( 0, new_path_norm
);
856 theObj
->SetToken( 1, new_path_neon
);
857 theObj
->SetToken( 2, new_path_screen
);
864 //****************************************************
866 void myWnd_PanelProperties::Clicked_Cancel(bool b_close
)
868 FrameEditProperties::Clicked_Cancel(false);
874 //****************************************************
876 void myWnd_PanelProperties::InitObj()
880 theObj
= new ob_stage_panel();
881 theObj
->SetToDefault();
885 path_norm
= theObj
->GetToken(0);
886 path_neon
= theObj
->GetToken(1);
887 path_screen
= theObj
->GetToken(2);
891 //****************************************************
893 void myWnd_PanelProperties::InitProps()
896 reqs
= new frameEdit_request
[alloc
];
901 reqs
[i
].name
= wxT("_TOKEN_0");
902 reqs
[i
].label
= wxT("Panel image file");
903 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
906 reqs
[i
].name
= wxT("_TOKEN_1");
907 reqs
[i
].label
= wxT("Neon file");
908 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
909 reqs
[i
].nb_missing_tokens
= 1;
910 reqs
[i
].missing_tokens
= new wxString
[1];
911 reqs
[i
].missing_tokens
[0] = wxT("none");
914 reqs
[i
].name
= wxT("_TOKEN_2");
915 reqs
[i
].label
= wxT("Screen file");
916 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
917 reqs
[i
].nb_missing_tokens
= 2;
918 reqs
[i
].missing_tokens
= new wxString
[2];
919 reqs
[i
].missing_tokens
[0] = wxT("none");
920 reqs
[i
].missing_tokens
[1] = wxT("none");
923 reqs
[i
].name
= wxT("15");
924 //reqs[i].label = "Custom Selection screen file : ";
925 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
935 //****************************************************
936 //****************************************************
937 //****************************************************
938 //****************************************************
939 //****************************************************
940 //****************************************************
941 //****************************************************
942 //****************************************************
943 //****************************************************
946 myWnd_FrontPanelProperties::myWnd_FrontPanelProperties(wxWindow
*_parent
, ob_front_panel
* _stage
, bool b_init
)
947 :FrameEditProperties( _parent
, NULL
, wxT("FrontPanel properties") )
950 b_newObj
= (theObj
== NULL
);
952 wndSavingName
= wxT("FrontPanelProperties");
959 //****************************************************
961 myWnd_FrontPanelProperties::~myWnd_FrontPanelProperties()
965 //****************************************************
967 void myWnd_FrontPanelProperties::Clicked_OK(bool b_close
)
969 FrameEditProperties::Clicked_OK(false);
971 wxString new_path
= theObj
->GetToken(0);
972 if( new_path
== wxString() )
973 new_path
= wxT("none");
975 if( new_path
!= path
)
978 theObj
->SetToken( 0, new_path
);
989 //****************************************************
991 void myWnd_FrontPanelProperties::Clicked_Cancel(bool b_close
)
993 FrameEditProperties::Clicked_Cancel(false);
999 //****************************************************
1001 void myWnd_FrontPanelProperties::InitObj()
1003 if( theObj
== NULL
)
1005 theObj
= new ob_stage_panel();
1006 theObj
->SetName( wxT("frontpanel" ));
1010 path
= theObj
->GetToken(0);
1014 //****************************************************
1016 void myWnd_FrontPanelProperties::InitProps()
1019 reqs
= new frameEdit_request
[alloc
];
1024 reqs
[i
].name
= wxT("_TOKEN_0");
1025 reqs
[i
].label
= wxT("FrontPanel image file");
1026 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
1034 //****************************************************
1035 //****************************************************
1036 //****************************************************
1037 //****************************************************
1038 //****************************************************
1039 //****************************************************
1040 //****************************************************
1041 //****************************************************
1042 //****************************************************
1045 myWnd_BGProperties::myWnd_BGProperties(wxWindow
*_parent
, ob_BG_Layer
* _stage
, bool _b_background
, bool b_init
)
1046 :FrameEditProperties( _parent
, NULL
, wxT("Background Layer properties") )
1050 b_newObj
= (theObj
== NULL
);
1052 b_background
= _b_background
;
1053 wndSavingName
= wxT("BG_Properties");
1060 //****************************************************
1062 myWnd_BGProperties::~myWnd_BGProperties()
1066 //****************************************************
1068 void myWnd_BGProperties::Clicked_OK(bool b_close
)
1070 FrameEditProperties::Clicked_OK(false);
1071 if( theObj
!= NULL
)
1072 if( theObj
->GetToken( 0 ) == wxString() )
1073 theObj
->SetToken( 0, wxT("data") );
1080 //****************************************************
1082 void myWnd_BGProperties::Clicked_Cancel(bool b_close
)
1084 FrameEditProperties::Clicked_Cancel(false);
1090 //****************************************************
1092 void myWnd_BGProperties::InitObj()
1094 if( theObj
== NULL
)
1096 theObj
= new ob_BG_Layer();
1097 theObj
->SetToDefault();
1098 if( b_background
== true )
1099 theObj
->SetName( wxT("background") );
1101 theObj
->SetName( wxT("bglayer") );
1105 ((ob_BG_Layer
*)theObj
)->FillMissings();
1109 //****************************************************
1111 void myWnd_BGProperties::InitProps()
1114 reqs
= new frameEdit_request
[alloc
];
1119 reqs
[i
].name
= wxT("_TOKEN_0");
1120 reqs
[i
].label
= wxT("Background image file");
1121 reqs
[i
].SetPropType( PROPTYPE_OBFILE
);
1124 reqs
[i
].name
= wxT("15");
1125 //reqs[i].label = "Custom Selection screen file : ";
1126 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
1127 // reqs[i].enums = ;
1131 reqs
[i
].name
= wxT("_TOKEN_1");
1132 reqs
[i
].label
= wxT("xratio");
1133 reqs
[i
].SetPropType( PROPTYPE_FLOAT
);
1134 reqs
[i
].nb_missing_tokens
= 1;
1135 reqs
[i
].missing_tokens
= new wxString
[1];
1136 reqs
[i
].missing_tokens
[0] = wxT("data");
1137 reqs
[i
].defVal
= wxT("0.5");
1140 reqs
[i
].name
= wxT("_TOKEN_2");
1141 reqs
[i
].label
= wxT("zratio");
1142 reqs
[i
].SetPropType( PROPTYPE_FLOAT
);
1143 reqs
[i
].nb_missing_tokens
= 2;
1144 reqs
[i
].missing_tokens
= new wxString
[2];
1145 reqs
[i
].missing_tokens
[0] = wxT("data");
1146 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1147 reqs
[i
].defVal
= wxT("0.5");
1150 reqs
[i
].name
= wxT("15");
1151 //reqs[i].label = "Custom Selection screen file : ";
1152 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
1153 // reqs[i].enums = ;
1157 reqs
[i
].name
= wxT("_TOKEN_3");
1158 reqs
[i
].label
= wxT("xpos");
1159 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1160 reqs
[i
].nb_missing_tokens
= 3;
1161 reqs
[i
].missing_tokens
= new wxString
[3];
1162 reqs
[i
].missing_tokens
[0] =wxT("data");
1163 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1164 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1165 reqs
[i
].defVal
= wxT("0");
1168 reqs
[i
].name
= wxT("_TOKEN_4");
1169 reqs
[i
].label
= wxT("zpos");
1170 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1171 reqs
[i
].nb_missing_tokens
= 4;
1172 reqs
[i
].missing_tokens
= new wxString
[4];
1173 reqs
[i
].missing_tokens
[0] = wxT("data");
1174 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1175 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1176 reqs
[i
].missing_tokens
[3] = wxT("0");
1177 reqs
[i
].defVal
= wxT("0");
1181 reqs
[i
].name
= wxT("_TOKEN_5");
1182 reqs
[i
].label
= wxT("xspace");
1183 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1184 reqs
[i
].nb_missing_tokens
= 5;
1185 reqs
[i
].missing_tokens
= new wxString
[5];
1186 reqs
[i
].missing_tokens
[0] = wxT("data");
1187 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1188 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1189 reqs
[i
].missing_tokens
[3] = wxT("0");
1190 reqs
[i
].missing_tokens
[4] = wxT("0");
1191 reqs
[i
].defVal
= wxT("0");
1195 reqs
[i
].name
= wxT("_TOKEN_6");
1196 reqs
[i
].label
= wxT("zspace");
1197 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1198 reqs
[i
].nb_missing_tokens
= 6;
1199 reqs
[i
].missing_tokens
= new wxString
[6];
1200 reqs
[i
].missing_tokens
[0] = wxT("data");
1201 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1202 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1203 reqs
[i
].missing_tokens
[3] = wxT("0");
1204 reqs
[i
].missing_tokens
[4] = wxT("0");
1205 reqs
[i
].missing_tokens
[5] = wxT("0");
1206 reqs
[i
].defVal
= wxT("0");
1210 reqs
[i
].name
= wxT("_TOKEN_7");
1211 reqs
[i
].label
= wxT("xrepeat");
1212 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1213 reqs
[i
].nb_missing_tokens
= 7;
1214 reqs
[i
].missing_tokens
= new wxString
[7];
1215 reqs
[i
].missing_tokens
[0] = wxT("data");
1216 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1217 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1218 reqs
[i
].missing_tokens
[3] = wxT("0");
1219 reqs
[i
].missing_tokens
[4] = wxT("0");
1220 reqs
[i
].missing_tokens
[5] = wxT("0");
1221 reqs
[i
].missing_tokens
[6] = wxT("0");
1222 reqs
[i
].defVal
= wxT("5000");
1225 reqs
[i
].name
= wxT("_TOKEN_8");
1226 reqs
[i
].label
= wxT("zrepeat");
1227 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1228 reqs
[i
].nb_missing_tokens
= 8;
1229 reqs
[i
].missing_tokens
= new wxString
[8];
1230 reqs
[i
].missing_tokens
[0] = wxT("data");
1231 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1232 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1233 reqs
[i
].missing_tokens
[3] = wxT("0");
1234 reqs
[i
].missing_tokens
[4] = wxT("0");
1235 reqs
[i
].missing_tokens
[5] = wxT("0");
1236 reqs
[i
].missing_tokens
[6] = wxT("0");
1237 reqs
[i
].missing_tokens
[7] = wxT("5000");
1238 reqs
[i
].defVal
= wxT("5000");
1241 if( ! b_background
)
1244 reqs
[i
].name
= wxT("15");
1245 //reqs[i].label = "Custom Selection screen file : ";
1246 reqs
[i
].SetPropType( PROPTYPE_SPACER
);
1247 // reqs[i].enums = ;
1251 reqs
[i
].name
= wxT("_TOKEN_9");
1252 reqs
[i
].label
= wxT("use transparency");
1253 reqs
[i
].SetPropType( PROPTYPE_BOOL
);
1254 reqs
[i
].nb_missing_tokens
= 9;
1255 reqs
[i
].missing_tokens
= new wxString
[9];
1256 reqs
[i
].missing_tokens
[0] = wxT("data");
1257 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1258 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1259 reqs
[i
].missing_tokens
[3] = wxT("0");
1260 reqs
[i
].missing_tokens
[4] = wxT("0");
1261 reqs
[i
].missing_tokens
[5] = wxT("0");
1262 reqs
[i
].missing_tokens
[6] = wxT("0");
1263 reqs
[i
].missing_tokens
[7] = wxT("5000");
1264 reqs
[i
].missing_tokens
[8] = wxT("5000");
1265 reqs
[i
].b_optional
= true;
1268 reqs
[i
].name
= wxT("_TOKEN_10");
1269 reqs
[i
].label
= wxT("alpha");
1270 reqs
[i
].SetPropType( PROPTYPE_ENUMS
);
1271 wxString t0
[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6") };
1272 TabStringToArrayString( t0
, 7, reqs
[i
].enums
);
1273 reqs
[i
].nb_missing_tokens
= 10;
1274 reqs
[i
].missing_tokens
= new wxString
[10];
1275 reqs
[i
].missing_tokens
[0] = wxT("data");
1276 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1277 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1278 reqs
[i
].missing_tokens
[3] = wxT("0");
1279 reqs
[i
].missing_tokens
[4] = wxT("0");
1280 reqs
[i
].missing_tokens
[5] = wxT("0");
1281 reqs
[i
].missing_tokens
[6] = wxT("0");
1282 reqs
[i
].missing_tokens
[7] = wxT("5000");
1283 reqs
[i
].missing_tokens
[8] = wxT("5000");
1284 reqs
[i
].missing_tokens
[9] = wxT("0");
1285 reqs
[i
].b_optional
= true;
1288 reqs
[i
].name
= wxT("_TOKEN_11");
1289 reqs
[i
].label
= wxT("watermode");
1290 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1291 reqs
[i
].nb_missing_tokens
= 11;
1292 reqs
[i
].missing_tokens
= new wxString
[reqs
[i
].nb_missing_tokens
];
1293 reqs
[i
].missing_tokens
[0] = wxT("data");
1294 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1295 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1296 reqs
[i
].missing_tokens
[3] = wxT("0");
1297 reqs
[i
].missing_tokens
[4] = wxT("0");
1298 reqs
[i
].missing_tokens
[5] = wxT("0");
1299 reqs
[i
].missing_tokens
[6] = wxT("0");
1300 reqs
[i
].missing_tokens
[7] = wxT("5000");
1301 reqs
[i
].missing_tokens
[8] = wxT("5000");
1302 reqs
[i
].missing_tokens
[9] = wxT("0");
1303 reqs
[i
].missing_tokens
[10] = wxT("0");
1304 reqs
[i
].b_optional
= true;
1307 reqs
[i
].name
= wxT("_TOKEN_12");
1308 reqs
[i
].label
= wxT("amplitude");
1309 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1310 reqs
[i
].nb_missing_tokens
= 12;
1311 reqs
[i
].missing_tokens
= new wxString
[reqs
[i
].nb_missing_tokens
];
1312 reqs
[i
].missing_tokens
[0] = wxT("data");
1313 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1314 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1315 reqs
[i
].missing_tokens
[3] = wxT("0");
1316 reqs
[i
].missing_tokens
[4] = wxT("0");
1317 reqs
[i
].missing_tokens
[5] = wxT("0");
1318 reqs
[i
].missing_tokens
[6] = wxT("0");
1319 reqs
[i
].missing_tokens
[7] = wxT("5000");
1320 reqs
[i
].missing_tokens
[8] = wxT("5000");
1321 reqs
[i
].missing_tokens
[9] = wxT("0");
1322 reqs
[i
].missing_tokens
[10] = wxT("0");
1323 reqs
[i
].missing_tokens
[11] = wxT("0");
1324 reqs
[i
].b_optional
= true;
1327 reqs
[i
].name
= wxT("_TOKEN_13");
1328 reqs
[i
].label
= wxT("wavelength");
1329 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1330 reqs
[i
].nb_missing_tokens
= 13;
1331 reqs
[i
].missing_tokens
= new wxString
[reqs
[i
].nb_missing_tokens
];
1332 reqs
[i
].missing_tokens
[0] = wxT("data");
1333 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1334 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1335 reqs
[i
].missing_tokens
[3] = wxT("0");
1336 reqs
[i
].missing_tokens
[4] = wxT("0");
1337 reqs
[i
].missing_tokens
[5] = wxT("0");
1338 reqs
[i
].missing_tokens
[6] = wxT("0");
1339 reqs
[i
].missing_tokens
[7] = wxT("5000");
1340 reqs
[i
].missing_tokens
[8] = wxT("5000");
1341 reqs
[i
].missing_tokens
[9] = wxT("0");
1342 reqs
[i
].missing_tokens
[10] = wxT("0");
1343 reqs
[i
].missing_tokens
[11] = wxT("0");
1344 reqs
[i
].missing_tokens
[12] = wxT("0");
1345 reqs
[i
].b_optional
= true;
1348 reqs
[i
].name
= wxT("_TOKEN_14");
1349 reqs
[i
].label
= wxT("wavespeed");
1350 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1351 reqs
[i
].nb_missing_tokens
= 14;
1352 reqs
[i
].missing_tokens
= new wxString
[reqs
[i
].nb_missing_tokens
];
1353 reqs
[i
].missing_tokens
[0] = wxT("data");
1354 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1355 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1356 reqs
[i
].missing_tokens
[3] = wxT("0");
1357 reqs
[i
].missing_tokens
[4] = wxT("0");
1358 reqs
[i
].missing_tokens
[5] = wxT("0");
1359 reqs
[i
].missing_tokens
[6] = wxT("0");
1360 reqs
[i
].missing_tokens
[7] = wxT("5000");
1361 reqs
[i
].missing_tokens
[8] = wxT("5000");
1362 reqs
[i
].missing_tokens
[9] = wxT("0");
1363 reqs
[i
].missing_tokens
[10] = wxT("0");
1364 reqs
[i
].missing_tokens
[11] = wxT("0");
1365 reqs
[i
].missing_tokens
[12] = wxT("0");
1366 reqs
[i
].missing_tokens
[13] = wxT("0");
1367 reqs
[i
].b_optional
= true;
1370 reqs
[i
].name
= wxT("_TOKEN_14");
1371 reqs
[i
].label
= wxT("bgspeedratio");
1372 reqs
[i
].SetPropType( PROPTYPE_NUMBER
);
1373 reqs
[i
].nb_missing_tokens
= 15;
1374 reqs
[i
].missing_tokens
= new wxString
[reqs
[i
].nb_missing_tokens
];
1375 reqs
[i
].missing_tokens
[0] = wxT("data");
1376 reqs
[i
].missing_tokens
[1] = wxT("0.5");
1377 reqs
[i
].missing_tokens
[2] = wxT("0.5");
1378 reqs
[i
].missing_tokens
[3] = wxT("0");
1379 reqs
[i
].missing_tokens
[4] = wxT("0");
1380 reqs
[i
].missing_tokens
[5] = wxT("0");
1381 reqs
[i
].missing_tokens
[6] = wxT("0");
1382 reqs
[i
].missing_tokens
[7] = wxT("5000");
1383 reqs
[i
].missing_tokens
[8] = wxT("5000");
1384 reqs
[i
].missing_tokens
[9] = wxT("0");
1385 reqs
[i
].missing_tokens
[10] = wxT("0");
1386 reqs
[i
].missing_tokens
[11] = wxT("0");
1387 reqs
[i
].missing_tokens
[12] = wxT("0");
1388 reqs
[i
].missing_tokens
[13] = wxT("0");
1389 reqs
[i
].missing_tokens
[14] = wxT("0");
1390 reqs
[i
].b_optional
= true;
1402 //****************************************************
1403 //****************************************************
1404 //****************************************************
1406 myWnd_SceneTest::myWnd_SceneTest(
1409 , ob_StageDeclaration
* _stage_declaration
1410 , ob_StagesSet
* _stage_set
1412 :wxDialog( _parent
, wxID_ANY
, wxT("Scene Tests") , wxDefaultPosition
, wxDefaultSize
,
1413 wxDEFAULT_DIALOG_STYLE
| wxRESIZE_BORDER
)
1415 // Launch the Window with Ctrl_SceneView
1416 sceneView
= new Panel_SceneView( this
1417 , _stage
, _stage_declaration
, _stage_set
);
1419 SetMinSize( wxSize( 250,250) );
1421 Frame_RestorePrevCoord( this, wxT("testScene"));
1424 //****************************************************
1425 myWnd_SceneTest::~myWnd_SceneTest()
1429 //****************************************************
1431 myWnd_SceneTest::Set_Panels( ob_stage_panel
**& p_panels
, size_t& p_nb_panels
)
1433 sceneView
->Set_Panels( p_panels
, p_nb_panels
);
1434 sceneView
->Update_View();
1437 //****************************************************
1439 myWnd_SceneTest::Set_Background( ob_BG_Layer
**& p_bg_layers
, size_t& p_nb_layers
)
1441 sceneView
->Set_Background( p_bg_layers
, p_nb_layers
);
1442 sceneView
->Update_View();
1445 //****************************************************
1447 myWnd_SceneTest::Set_Front_Panels(ob_front_panel
**& p_front_panels
, size_t& p_nb_front_panels
)
1449 sceneView
->Set_Front_Panels( p_front_panels
, p_nb_front_panels
);
1450 sceneView
->Update_View();
1453 //****************************************************
1455 myWnd_SceneTest::EvtClose( wxCloseEvent
& event
)
1457 Frame_SaveCoord( this, wxT("testScene"));
1463 BEGIN_EVENT_TABLE(myWnd_SceneTest
, wxDialog
)
1464 EVT_CLOSE(myWnd_SceneTest::EvtClose
)