Add an operator-> to cStrDlog and cStringChoice, mainly for consistency since cPictChoice and cChoiceDlog already had one.
This commit is contained in:
@@ -182,6 +182,10 @@ void cStringChoice::attachHandlers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cDialog* cStringChoice::operator->() {
|
||||||
|
return &dlg;
|
||||||
|
}
|
||||||
|
|
||||||
size_t cStringChoice::show(size_t selectedIndex) {
|
size_t cStringChoice::show(size_t selectedIndex) {
|
||||||
cur = selectedIndex;
|
cur = selectedIndex;
|
||||||
page = cur / per_page;
|
page = cur / per_page;
|
||||||
@@ -518,6 +522,10 @@ cStrDlog& cStrDlog::setRecordHandler(record_callback_t rec){
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cDialog* cStrDlog::operator->() {
|
||||||
|
return &dlg;
|
||||||
|
}
|
||||||
|
|
||||||
void cStrDlog::show(){
|
void cStrDlog::show(){
|
||||||
if(sound > 0) play_sound(sound);
|
if(sound > 0) play_sound(sound);
|
||||||
dlg.run();
|
dlg.run();
|
||||||
|
@@ -35,6 +35,7 @@ public:
|
|||||||
cStrDlog(std::string str1,std::string str2,std::string title,pic_num_t pic,ePicType t,cDialog* parent = NULL);
|
cStrDlog(std::string str1,std::string str2,std::string title,pic_num_t pic,ePicType t,cDialog* parent = NULL);
|
||||||
cStrDlog& setSound(snd_num_t num);
|
cStrDlog& setSound(snd_num_t num);
|
||||||
cStrDlog& setRecordHandler(record_callback_t rec);
|
cStrDlog& setRecordHandler(record_callback_t rec);
|
||||||
|
cDialog* operator->();
|
||||||
void show();
|
void show();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ class cStringChoice {
|
|||||||
public:
|
public:
|
||||||
explicit cStringChoice(std::vector<std::string>& strs, std::string title, cDialog* parent = NULL);
|
explicit cStringChoice(std::vector<std::string>& strs, std::string title, cDialog* parent = NULL);
|
||||||
cStringChoice(std::vector<std::string>::iterator begin, std::vector<std::string>::iterator end, std::string title, cDialog* parent = NULL);
|
cStringChoice(std::vector<std::string>::iterator begin, std::vector<std::string>::iterator end, std::string title, cDialog* parent = NULL);
|
||||||
|
cDialog* operator->();
|
||||||
size_t show(size_t selectedIndex);
|
size_t show(size_t selectedIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user