Changeset 78b9d9 for molecuilder/src/UIElements
- Timestamp:
- Mar 3, 2010, 1:57:41 PM (16 years ago)
- Children:
- 14d898
- Parents:
- dc5413
- Location:
- molecuilder/src/UIElements
- Files:
-
- 2 edited
-
MainWindow.hpp (modified) (1 diff)
-
UIFactory.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/UIElements/MainWindow.hpp
rdc5413 r78b9d9 25 25 }; 26 26 27 /** 28 * The type of menuPopulators 29 */ 27 30 typedef void (*MenuMaker)(Menu*,MoleculeListClass*, config*, periodentafel*); 28 31 32 /** 33 * This contains all Functions that are used to create the menus. 34 * Needs a specific funtion for each menu. All populators will be called 35 * by the UIFactory upon creation of the main menu. Thus the actuall construction 36 * of the Menus can be kept independent of the concrete type of UI that is being 37 * built. 38 */ 29 39 struct menuPopulaters{ 30 40 MenuMaker MakeEditMoleculesMenu; -
molecuilder/src/UIElements/UIFactory.hpp
rdc5413 r78b9d9 17 17 18 18 struct menuPopulaters; 19 19 /** 20 * Abstract Factory to create any kind of User interface object needed by the programm. 21 * 22 * The factory can be created and has to be set to a certain type upon creation. It will then 23 * only create UIelements of that certain type, so that all UIElements match. This way different 24 * UIs can be handled in a concise abstract way. 25 */ 20 26 class UIFactory 21 27 { … … 25 31 virtual ~UIFactory(); 26 32 27 // methods for creating UIElements 33 /** 34 * Produce some kind of main window, of whichever type was chosen when the factory was created 35 */ 28 36 virtual MainWindow* makeMainWindow(menuPopulaters,MoleculeListClass *, config *, periodentafel *, char *)=0; 37 38 /** 39 * Produce a User Interaction Dialog, that can query values from the User. 40 * Again the type is determined upon factory creation. 41 */ 29 42 virtual Dialog* makeDialog()=0; 30 43 … … 37 50 38 51 public: 52 /** 53 * create a Factory of a certain type. From that moment on only those UIElements can be produced by the factory 54 */ 39 55 static void makeUserInterface(InterfaceTypes type); 56 57 /** 58 * get the previously created factory 59 */ 40 60 static UIFactory* get(); 61 62 /** 63 * Destroy the created factory. 64 * 65 * Make sure that all UIElements that were created by the factory are destroyed before calling this method. 66 */ 41 67 static void purgeInstance(); 42 68 };
Note:
See TracChangeset
for help on using the changeset viewer.
