Ignore:
Timestamp:
Jan 13, 2010, 10:22:29 AM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
3896fc
Parents:
c489d9
Message:

Changed dialog structure to use objects for queries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/UIElements/TextDialog.cpp

    rc489d9 rf89c1c  
    1717TextDialog::TextDialog()
    1818{
    19   // TODO Auto-generated constructor stub
    20 
    2119}
    2220
    2321TextDialog::~TextDialog()
    2422{
    25   // TODO Auto-generated destructor stub
    2623}
    2724
    28 void TextDialog::handleInt(std::string title, int *target) {
    29   Log() << Verbose(0) << title;
    30   cin >> (*target);
     25void TextDialog::queryInt(const char* title, int* target){
     26  registerQuery(new IntTextQuery(title,target));
    3127}
    3228
    33 void TextDialog::handleString(std::string title, string *target) {
    34   string input;
    35   Log() << Verbose(0) << title;
    36   cin >> (*target);
     29void TextDialog::queryString(const char* title, string* target){
     30  registerQuery(new StringTextQuery(title,target));
    3731}
     32
     33TextDialog::IntTextQuery::IntTextQuery(string title,int *_target) :
     34    Dialog::IntQuery(title,_target)
     35{}
     36
     37TextDialog::IntTextQuery::~IntTextQuery() {}
     38
     39bool TextDialog::IntTextQuery::handle() {
     40  Log() << Verbose(0) << IntQuery::getTitle();
     41  cin >> tmp;
     42  return true;
     43}
     44
     45TextDialog::StringTextQuery::StringTextQuery(string title,string *_target) :
     46    Dialog::StringQuery(title,_target)
     47{}
     48
     49TextDialog::StringTextQuery::~StringTextQuery() {}
     50
     51bool TextDialog::StringTextQuery::handle() {
     52  Log() << Verbose(0) << StringQuery::getTitle();
     53  cin >> tmp;
     54  return true;
     55}
Note: See TracChangeset for help on using the changeset viewer.