1 #ifndef MYMODALSFRAMES_H_
2 #define MYMODALSFRAMES_H_
7 #include "common__globals.h"
9 //*****************************************************************
10 //*****************************************************************
11 class prObFileChooserCtrl
;
14 //*****************************************************************
15 // propsNames examples:
16 // "_NAME_" -> the object name
17 // "_TOKEN_3" -> the 3rd token of the object
18 // "_SUBOBJ_NUM%4%PROP%shape" -> the shape property of the 4d subobject
19 // "_SUBOBJ_NAME%boule%TOKEN%3" -> the 3rd token of the subobject "boule"
20 // "_SUBOBJ_NAME%boule%NUM%4%PROP%shape" -> the shape property of the 4d boule subobject
21 // "_SUBOBJ_TYPE%balon%NUM%4%TOKEN%3" -> the 3rd token of the 4d subobject of type balon
22 //*****************************************************************
24 const wxArrayString arrStr_empty
;
26 class frameEdit_request
30 const wxString
& _propname
= wxT("UNNAMED"),
31 const wxString
& _label
= wxT("NO-LABEL"),
32 int _type
= PROPTYPE_UNDEF
,
33 const wxString
& _request
= wxT("_TOKEN_0"),
34 bool _b_del_ifempty
= false,
35 wxArrayString _enums
= arrStr_empty
,
36 int _labelw
= wxDefaultCoord
,
37 int _fieldw
= wxDefaultCoord
40 const wxString _propname
= wxT("UNNAMED"),
41 const wxString _label
= wxT("NO-LABEL"),
42 int _type
= PROPTYPE_STRING_NO_WS
,
43 const wxString _request
= wxT("_TOKEN_0"),
44 bool _b_del_ifempty
= true,
45 wxArrayString _enums
= arrStr_empty
,
46 int _labelw
= wxDefaultCoord
,
47 int _fieldw
= wxDefaultCoord
52 void SetPropType( int _proptype
);
65 wxString
* missing_tokens
;
66 size_t nb_missing_tokens
;
72 class FrameEditProperties
: public wxDialog
75 FrameEditProperties(wxWindow
*_parent
, ob_object
* _theObj
= NULL
,
76 const wxString
& _title
= wxT("NO-TITLE"),
78 ~FrameEditProperties();
80 void EvtClose( wxCloseEvent
& event
);
81 void EvtClickOK(wxCommandEvent
& evt
);
82 void EvtClickCancel(wxCommandEvent
& evt
);
89 virtual wxString
GetObjValue( int ind
);
90 virtual bool SetObjValue( int ind
, const wxString
& val
, const wxString
& origin_val
);
92 virtual bool IsChanged();
93 virtual int WriteChangesToObject();
95 virtual void Clicked_OK(bool b_close
= true);
96 virtual void Clicked_Cancel(bool b_close
= true);
99 virtual void InitControls();
100 virtual void InitProps();
101 virtual void InitObj();
106 wxBoxSizer
*sizerTop
;
109 frameEdit_request
* reqs
;
110 wxString wndSavingName
; // For save and restore coords
113 bool b_creation
; //True -> an subobject will be create on write
115 DECLARE_EVENT_TABLE()
123 //*****************************************************************
124 // Init these var before create the GridPropFrame
125 #define MAXGRIDPROPFRAME_PROPSSIZE 200
128 class GridOb_ObjectProperties
;
130 class GridPropFrame
: public wxDialog
133 GridPropFrame( wxWindow
*parent
,
135 const wxString
& Title
=wxT("Set some properties"),
136 const wxString
& _intro
=wxT("You can change/add/del properties here"),
137 long style
= wxDEFAULT_DIALOG_STYLE
, bool b_sort
= true );
140 void SetFilter_Properties( wxArrayString
& _filter
, bool b__exclude
= true);
141 void SetFilter_Properties( int* arrObjIDs
, int nb_ids
);
143 void EvtClose( wxCloseEvent
& event
);
144 void EvtSize(wxSizeEvent
& event
);
145 void EvtCharPress(wxKeyEvent
& event
);
146 void EvtOkClicked( wxCommandEvent
& event
);
150 wxStaticText
*txtMessage
;
151 GridOb_ObjectProperties
*list_Props
;
153 DECLARE_EVENT_TABLE()
157 class GridOb_ObjectProperties
: public wxGrid
160 GridOb_ObjectProperties( wxWindow
*parent
, bool b_sort
= true);
161 ~GridOb_ObjectProperties();
163 void SetFilter_Properties( wxArrayString
& _filter
, bool b__exclude
= true);
164 void SetFilter_Properties( int* arrObjIDs
, int nb_ids
);
165 void SetObjectHandled( ob_object
* _theObj
);
167 void RefreshProperties();
172 void _AppendProp( ob_object
* theProp
, int& row_num
);
173 void UpdatePropGridSize();
174 void Init( bool b_sort
= true);
176 void EvtSize(wxSizeEvent
& event
);
177 void EvtPropertyChange( wxGridEvent
& event
);
178 void EvtAddRow(wxCommandEvent
& event
);
179 void EvtClose( wxCloseEvent
& event
);
180 void EvtReposCursor( wxCommandEvent
& event
);
181 void EvtCharPress(wxKeyEvent
& event
);
182 void EvtSelectChg( wxGridEvent
& event
);
183 void EvtRgSelectChg( wxGridRangeSelectEvent
& event
);
185 void DeletePropAtRow( int j
);
186 bool SetObjProperty_fromRow( int _row
);
187 wxString
GetPrevPropertyName( int _row
);
189 bool IsToExclude( const wxString
& _name
, ob_object
* t
= NULL
);
196 bool b_changing_prop
;
198 wxArrayString filter
;
202 bool b_Filter_exclude
;
205 ob_object
** arr_Props
;
206 size_t arr_Props_size
;
209 virtual bool ProcessEvent( wxEvent
& event
);
211 DECLARE_EVENT_TABLE()
214 class WndFromText
: public wxDialog
217 WndFromText( wxWindow
* _parent
, const wxString
& _title
, const wxString
& path
);
222 //-----------------------------------------------------------
223 class WndImgShow
: public wxDialog
226 WndImgShow( wxWindow
* parent
, const wxString
& _title
227 , wxImage
* _theImg
, const wxString
& some_text
= wxString() );
230 #endif /*MYMODALSFRAMES_H_*/