00001
00004 #ifndef _ProblemPanelFactory_h
00005 #define _ProblemPanelFactory_h
00006
00007
00008
00009 #include <map>
00010
00011
00012
00013 #include <wx/panel.h>
00014
00015
00016
00017 #include "../ProblemBase.h"
00018
00019
00020
00021
00022
00023 class ProblemPanelFactory
00024 {
00025 public:
00031 typedef wxPanel*(*PanelCreator)(ProblemBase* pProblem, wxWindow* pParent);
00032
00033
00034
00037 ~ProblemPanelFactory(void);
00038
00039
00040
00041
00042
00048 void* Register(ProblemIdType id, PanelCreator function);
00049
00052 wxPanel* CreatePanel(ProblemBase* pProblem,
00053 wxWindow* pParent) const;
00054
00057 wxSize MinSize();
00058
00059
00060
00063 static ProblemPanelFactory& GetInstance();
00064
00065
00066
00067 protected:
00068 private:
00071 ProblemPanelFactory(void);
00072
00073 map<ProblemIdType, PanelCreator> mFactories;
00074 };
00075
00076
00077
00078
00079
00080
00081
00082 #endif // _ProblemPanelFactory_h