source: molecuilder/src/UIElements/UIFactory.cpp@ 34ff5e6

Last change on this file since 34ff5e6 was 6d21bd, checked in by Tillmann Crueger <crueger@…>, 16 years ago

Added Basis for creating globally accessible and compatible UIElements

  • Added Factories for UIElements that can be chosen at programm startup
  • Added Dialogs that can be used to query values
  • Property mode set to 100644
File size: 788 bytes
Line 
1/*
2 * UIFactory.cpp
3 *
4 * Created on: Jan 5, 2010
5 * Author: crueger
6 */
7
8
9#include <cassert>
10#include "UIElements/UIFactory.hpp"
11
12// all factories that can be used:
13#include "UIElements/TextUIFactory.hpp"
14
15UIFactory::UIFactory()
16{
17 // TODO Auto-generated constructor stub
18
19}
20
21UIFactory::~UIFactory()
22{
23 // TODO Auto-generated destructor stub
24}
25
26void UIFactory::makeUserInterface(InterfaceTypes type) {
27 assert(theFactory == 0 && "makeUserInterface should only be called once");
28 switch(type) {
29 case Text :
30 theFactory = new TextUIFactory();
31 break;
32
33 default:
34 assert(0 && "No such Factory in stock");
35 break;
36 }
37}
38
39UIFactory* UIFactory::get(){
40 assert(theFactory != 0 && "No UserInterface created prior to factory access");
41 return theFactory;
42}
Note: See TracBrowser for help on using the repository browser.