Last change
on this file since f89c1c was f89c1c, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
Changed dialog structure to use objects for queries.
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | /*
|
---|
2 | * TextDialog.cpp
|
---|
3 | *
|
---|
4 | * Created on: Jan 5, 2010
|
---|
5 | * Author: crueger
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include <iostream>
|
---|
9 |
|
---|
10 | #include "TextDialog.hpp"
|
---|
11 | #include "log.hpp"
|
---|
12 | #include "verbose.hpp"
|
---|
13 |
|
---|
14 | using namespace std;
|
---|
15 |
|
---|
16 |
|
---|
17 | TextDialog::TextDialog()
|
---|
18 | {
|
---|
19 | }
|
---|
20 |
|
---|
21 | TextDialog::~TextDialog()
|
---|
22 | {
|
---|
23 | }
|
---|
24 |
|
---|
25 | void TextDialog::queryInt(const char* title, int* target){
|
---|
26 | registerQuery(new IntTextQuery(title,target));
|
---|
27 | }
|
---|
28 |
|
---|
29 | void TextDialog::queryString(const char* title, string* target){
|
---|
30 | registerQuery(new StringTextQuery(title,target));
|
---|
31 | }
|
---|
32 |
|
---|
33 | TextDialog::IntTextQuery::IntTextQuery(string title,int *_target) :
|
---|
34 | Dialog::IntQuery(title,_target)
|
---|
35 | {}
|
---|
36 |
|
---|
37 | TextDialog::IntTextQuery::~IntTextQuery() {}
|
---|
38 |
|
---|
39 | bool TextDialog::IntTextQuery::handle() {
|
---|
40 | Log() << Verbose(0) << IntQuery::getTitle();
|
---|
41 | cin >> tmp;
|
---|
42 | return true;
|
---|
43 | }
|
---|
44 |
|
---|
45 | TextDialog::StringTextQuery::StringTextQuery(string title,string *_target) :
|
---|
46 | Dialog::StringQuery(title,_target)
|
---|
47 | {}
|
---|
48 |
|
---|
49 | TextDialog::StringTextQuery::~StringTextQuery() {}
|
---|
50 |
|
---|
51 | bool TextDialog::StringTextQuery::handle() {
|
---|
52 | Log() << Verbose(0) << StringQuery::getTitle();
|
---|
53 | cin >> tmp;
|
---|
54 | return true;
|
---|
55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.