本文整理汇总了C++中ListBox::handleOnItemSelect方法的典型用法代码示例。如果您正苦于以下问题:C++ ListBox::handleOnItemSelect方法的具体用法?C++ ListBox::handleOnItemSelect怎么用?C++ ListBox::handleOnItemSelect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListBox
的用法示例。
在下文中一共展示了ListBox::handleOnItemSelect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
// initialize glut
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
// create the main window
glutInitWindowPosition(30,30);
glutInitWindowSize(800,600);
glutCreateWindow("beGUI GLUT Example");
// set the display function
glutDisplayFunc(renderScene);
glutIdleFunc(renderScene);
// resize function
glutReshapeFunc(changeSize);
// handle mouse events
glutMouseFunc(processMouse);
glutMotionFunc(processMouseActiveMotion);
glutPassiveMotionFunc(processMousePassiveMotion);
// initialize beGUI subsystems
initBeGUI();
// create the beGUI window
myWindow.create(20, 20, 200, 200, "test");
myBtn1.create(20, 20, "Show Modal Dialog", 101, makeFunctor((Functor1<int>*)0, &onButtonClick));
myWindow.addComponent(&myBtn1);
myList1.create(20, 50, 160, 100, ListBox::SINGLE_SELECT);
myList1.handleOnItemSelect(makeFunctor((Functor1<int>*)0, &onListSelect));
myList1.addItem("White");
myList1.addItem("Red");
myList1.addItem("Orange");
myList1.addItem("Green");
myList1.addItem("Yellow");
myList1.addItem("Blue");
myList1.addItem("Purple");
myList1.addItem("Grey");
myWindow.addComponent(&myList1);
// create a container to hold all beGUI components
mainContainer.setPos(0,0);
mainContainer.setSize(800, 600);
mainContainer.addComponent(&myWindow);
// create a modal dialog
myModalDlg.create(100, 100, 300, 300, "Modal Dialog");
myDlgBtn1.create(30, 30, "Close Dialog", 10001, makeFunctor((Functor1<int>*)0, &onCloseDlg));
myModalDlg.addComponent(&myDlgBtn1);
// start the main loop
glutMainLoop();
return 0;
}