本文整理汇总了C++中Windows::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Windows::begin方法的具体用法?C++ Windows::begin怎么用?C++ Windows::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows
的用法示例。
在下文中一共展示了Windows::begin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkEvents
bool Viewer::checkEvents()
{
// check events from any attached sources
for(Devices::iterator eitr = _eventSources.begin();
eitr != _eventSources.end();
++eitr)
{
osgGA::Device* es = eitr->get();
if (es->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)
{
if (es->checkEvents()) return true;
}
}
// get events from all windows attached to Viewer.
Windows windows;
getWindows(windows);
for(Windows::iterator witr = windows.begin();
witr != windows.end();
++witr)
{
if ((*witr)->checkEvents()) return true;
}
return false;
}
示例2: main
int main(int argc, char *argv[])
{
int ret = 0;
setlocale(LC_ALL,"");
init_keyboard();
initscr();
init_allwin();
resize_allwin();
signal(SIGWINCH, sig_winch);
work_thread_start();
main_loop();
close_keyboard();
cleanup();
for (int i = 30; i<129;i++) {
printf("%d %c\t", i, i);
}
printf("\n");
struct winsize size;
Win *win = NULL;
ioctl(STDIN_FILENO,TIOCGWINSZ,&size);
Windows::iterator iter;
for (iter=windows.begin(); iter!=windows.end(); iter++) {
win = &iter->second;
printf("%s @(%d,%d), (%dx%d) %s\n", win->name,
win->locate.x, win->locate.y,
win->locate.w, win->locate.h,
win->title);
}
printf("SCREEN: %d x %d\n", size.ws_col, size.ws_row);
return ret;
}
示例3: checkEvents
bool CompositeViewer::checkEvents()
{
for(RefViews::iterator itr = _views.begin();
itr != _views.end();
++itr)
{
osgViewer::View* view = itr->get();
if (view)
{
// check events from any attached sources
for(View::Devices::iterator eitr = view->getDevices().begin();
eitr != view->getDevices().end();
++eitr)
{
osgGA::Device* es = eitr->get();
if (es->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)
{
if (es->checkEvents()) return true;
}
}
}
}
// get events from all windows attached to Viewer.
Windows windows;
getWindows(windows);
for(Windows::iterator witr = windows.begin();
witr != windows.end();
++witr)
{
if ((*witr)->checkEvents()) return true;
}
return false;
}
示例4: resize_allwin
void resize_allwin()
{
Win *win = NULL;
Win *frame = NULL;
Windows::iterator iter;
struct winsize size;
// char msg[64] = {0};
int ret = 0;
ioctl(STDIN_FILENO,TIOCGWINSZ,&size);
for (iter=windows.begin(); iter!=windows.end(); iter++) {
win = &iter->second;
frame = get_frame(win->name);
if (NULL == frame) {
cleanup();
exit(0);
}
// set new size
frame->locate.x = size.ws_col * frame->scale.x;
frame->locate.y = size.ws_row * frame->scale.y;
frame->locate.w = size.ws_col * frame->scale.w;
frame->locate.h = size.ws_row * frame->scale.h;
win->locate.x = frame->locate.x + 1;
win->locate.y = frame->locate.y + 1;
win->locate.w = frame->locate.w - 2;
win->locate.h = frame->locate.h - 2;
if (iter->first.compare("RCMD") == 0) {
win->locate.h = 4;
}
// resize
ret = wresize(frame->win, frame->locate.h, frame->locate.w);
ret = wresize(win->win, win->locate.h, win->locate.w);
if (ERR == ret) {
printf("wresize failed:%s %d,%d\n", win->name, win->locate.x, win->locate.y);
}
// move
ret = mvwin(frame->win, frame->locate.y, frame->locate.x);
if (ERR == ret) {
cleanup();
printf("mvwin frame failed:%s %d,%d\n", frame->name, frame->locate.y, frame->locate.x);
printf("\t %d x %d\n", frame->locate.w, frame->locate.h);
exit(0);
}
ret = mvwin(win->win, win->locate.y, win->locate.x);
if (ERR == ret) {
cleanup();
printf("SCREEN=%d x %d\n", COLS, LINES);
printf("mvwin failed:%s %d,%d\n", win->name, win->locate.x, win->locate.y);
printf("\t %d x %d\n", win->locate.w, win->locate.h);
printf("frame %d,%d %d x %d\n", frame->locate.x, frame->locate.y, frame->locate.w, frame->locate.h);
exit(0);
}
//echo();
//touchwin(win->win);
//attron(A_REVERSE);
box(frame->win, '|', '-');
//mvaddstr(2, 2,win->name);
// mvwaddstr(win->win, 1, 1, win->name);
//sprintf(msg, "%d,%d", win->locate.y, win->locate.x);
//mvwaddstr(win->win, 2, 1, msg);
//attroff(A_REVERSE);
//move(1, 1);
//waddstr(win->win, win->name);
wrefresh(frame->win);
wrefresh(win->win);
// }
}
}