本文整理汇总了C++中ListboxItem::getText方法的典型用法代码示例。如果您正苦于以下问题:C++ ListboxItem::getText方法的具体用法?C++ ListboxItem::getText怎么用?C++ ListboxItem::getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListboxItem
的用法示例。
在下文中一共展示了ListboxItem::getText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: droplist_SelectionAcceptedHandler
/*************************************************************************
Handler for selections made in the drop-list
*************************************************************************/
bool Combobox::droplist_SelectionAcceptedHandler(const EventArgs& e)
{
// copy the text from the selected item into the edit box
ListboxItem* item = ((ComboDropList*)((WindowEventArgs&)e).window)->getFirstSelectedItem();
if (item != NULL)
{
// Put the text from the list item into the edit box
d_editbox->setText(item->getText());
// select text if it's editable, and move carat to end
if (!isReadOnly())
{
d_editbox->setSelection(0, item->getText().length());
d_editbox->setCaratIndex(item->getText().length());
}
d_editbox->setCaratIndex(0);
// fire off an event of our own
WindowEventArgs args(this);
onListSelectionAccepted(args);
// finally, activate the edit box
d_editbox->activate();
}
return true;
}
示例2: BookmarkSelect
bool BookmarkSelect(const CEGUI::EventArgs& event)
{
using namespace CEGUI;
dbg(0,"1\n");
MultiColumnList* mcl = static_cast<MultiColumnList*>(WindowManager::getSingleton().getWindow("Bookmarks/Listbox"));
dbg(0,"2\n");
ListboxItem * item = mcl->getFirstSelectedItem();
if(item){
dbg(0,"item %s is at row %i\n",item->getText().c_str(),mcl->getItemRowIndex(item));
BookmarkGo(item->getText().c_str());
}
WindowManager::getSingleton().getWindow("BookmarkSelection")->hide();
}
示例3: handleItemSelect
bool handleItemSelect(int r)
{
using namespace CEGUI;
extern CEGUI::Window* myRoot;
MultiColumnList* mcl = static_cast<MultiColumnList*>(WindowManager::getSingleton().getWindow("DestinationWindow/Listbox"));
ListboxItem * item = mcl->getItemAtGridReference(MCLGridRef(r,0));
ListboxItem * itemid = mcl->getItemAtGridReference(MCLGridRef(r,1));
ListboxItem * item_assoc = mcl->getItemAtGridReference(MCLGridRef(r,2));
Window* country_edit = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/CountryEditbox"));
Window* twn_edit = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/TownEditbox"));
Window* street_edit = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/StreetEditbox"));
if(SDL_dest.current_search==SRCH_COUNTRY){
country_edit->setText(item->getText());
// Need to record the country here
twn_edit->activate();
SDL_dest.current_search=SRCH_TOWN;
myRoot->getChild("Navit/Keyboard")->getChild("Navit/Keyboard/Input")->setText("");
} else if(SDL_dest.current_search==SRCH_TOWN){
twn_edit->setText(item->getText());
// SDL_dest.town_street_assoc=atoi(item_assoc->getText().c_str());
// SDL_dest.town=atoi(itemid->getText().c_str());
// printf(" town %s , id=%lx, assoc=%li\n",item->getText().c_str(),SDL_dest.town_street_assoc,SDL_dest.town_street_assoc);
ListboxItem * itemx = mcl->getItemAtGridReference(MCLGridRef(r,3));
ListboxItem * itemy = mcl->getItemAtGridReference(MCLGridRef(r,4));
Window* Dest_x = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_x"));
Dest_x->setText(itemx->getText().c_str());
Window* Dest_y = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_y"));
Dest_y->setText(itemy->getText().c_str());
mcl->resetList();
SDL_dest.current_search=SRCH_STREET;
street_edit->activate();
myRoot->getChild("Navit/Keyboard")->getChild("Navit/Keyboard/Input")->setText("");
} else if(SDL_dest.current_search==SRCH_STREET){
street_edit->setText(item->getText());
myRoot->getChild("Navit/Keyboard")->hide();
ListboxItem * itemx = mcl->getItemAtGridReference(MCLGridRef(r,3));
ListboxItem * itemy = mcl->getItemAtGridReference(MCLGridRef(r,4));
Window* Dest_x = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_x"));
Dest_x->setText(itemx->getText().c_str());
Window* Dest_y = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_y"));
Dest_y->setText(itemy->getText().c_str());
mcl->resetList();
SDL_dest.current_search=SRCH_STREET;
myRoot->getChild("Navit/Keyboard")->getChild("Navit/Keyboard/Input")->setText("");
/*
ListboxItem * itemid = mcl->getItemAtGridReference(MCLGridRef(r,1));
int segment_id=atoi(itemid->getText().c_str());
printf("street seg id : %li\n",segment_id);
extern struct container *co;
struct block_info res_blk_inf;
struct street_str *res_str;
street_get_by_id(co->map_data, 33, segment_id,&res_blk_inf,&res_str );
struct street_coord * streetcoord;
streetcoord=street_coord_get(&res_blk_inf,res_str);
printf("Street coordinates : %i,%i\n",streetcoord->c->x,streetcoord->c->y);
char xbuff [256];
sprintf(xbuff,"%li",streetcoord->c->x);
char ybuff [256];
sprintf(ybuff,"%li",streetcoord->c->y);
Window* Dest_x = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_x"));
Dest_x->setText(xbuff);
Window* Dest_y = static_cast<Window*>(myRoot->getChild("DestinationWindow")->getChild("DestinationWindow/Dest_y"));
Dest_y->setText(ybuff);
struct street_name name;
// printf("street_name_get_by_id returns : %i\n",street_name_get_by_id(&name, res_blk_inf.mdata, res_str->nameid));
street_name_get_by_id(&name, res_blk_inf.mdata, res_str->nameid);
// printf("name1:%s / name2%s\n",name.name1,name.name2);
struct street_name_number_info num;
struct street_name_info inf;
//.........这里部分代码省略.........
示例4: handleItemSelect
bool handleItemSelect(int r)
{
using namespace CEGUI;
MultiColumnList* mcl = static_cast<MultiColumnList*>(WindowManager::getSingleton().getWindow("AdressSearch/Listbox"));
ListboxItem * item = mcl->getItemAtGridReference(MCLGridRef(r,0));
ListboxItem * itemid = mcl->getItemAtGridReference(MCLGridRef(r,1));
ListboxItem * item_assoc = mcl->getItemAtGridReference(MCLGridRef(r,2));
Window* country_edit = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/CountryEditbox"));
Window* twn_edit = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/TownEditbox"));
Window* street_edit = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/StreetEditbox"));
if(SDL_dest.current_search==SRCH_COUNTRY){
country_edit->setText(item->getText());
twn_edit->activate();
SDL_dest.current_search=SRCH_TOWN;
WindowManager::getSingleton().getWindow("Navit/Keyboard/Input")->setText("");
} else if(SDL_dest.current_search==SRCH_TOWN){
twn_edit->setText(item->getText());
ListboxItem * itemx = mcl->getItemAtGridReference(MCLGridRef(r,3));
ListboxItem * itemy = mcl->getItemAtGridReference(MCLGridRef(r,4));
Window* Dest_x = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/Dest_x"));
Dest_x->setText(itemx->getText().c_str());
Window* Dest_y = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/Dest_y"));
Dest_y->setText(itemy->getText().c_str());
mcl->resetList();
SDL_dest.current_search=SRCH_STREET;
street_edit->activate();
WindowManager::getSingleton().getWindow("Navit/Keyboard/Input")->setText("");
} else if(SDL_dest.current_search==SRCH_STREET){
street_edit->setText(item->getText());
WindowManager::getSingleton().getWindow("Navit/Keyboard")->hide();
ListboxItem * itemx = mcl->getItemAtGridReference(MCLGridRef(r,3));
ListboxItem * itemy = mcl->getItemAtGridReference(MCLGridRef(r,4));
Window* Dest_x = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/Dest_x"));
Dest_x->setText(itemx->getText().c_str());
Window* Dest_y = static_cast<Window*>(WindowManager::getSingleton().getWindow("AdressSearch/Dest_y"));
Dest_y->setText(itemy->getText().c_str());
mcl->resetList();
SDL_dest.current_search=SRCH_STREET;
WindowManager::getSingleton().getWindow("Navit/Keyboard/Input")->setText("");
} else if (SDL_dest.current_search==SRCH_NUMBER){
struct coord pos;
ListboxItem * itemx = mcl->getItemAtGridReference(MCLGridRef(r,3));
ListboxItem * itemy = mcl->getItemAtGridReference(MCLGridRef(r,4));
pos.x=atoi(itemx->getText().c_str());
pos.y=atoi(itemy->getText().c_str());
route_to(pos.x,pos.y);
}
return true;
}
示例5: atoi
bool ListboxNumberItem::operator > ( const ListboxItem& rhs ) const
{
return atoi ( d_itemText.c_str () ) > atoi ( rhs.getText ().c_str () );
}