本文整理汇总了C++中createMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ createMenu函数的具体用法?C++ createMenu怎么用?C++ createMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
int aux;
// inicialización del GLUT
glutInit( &argc, argv );
// inicialiación de la ventana
glutInitWindowSize( 1020, 850 ); //Tamaño de la Ventana Creada
glutInitWindowPosition( 100, 100 );
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutCreateWindow( "Catastrofe Global - Fin del Sol" );
glEnable(GL_SMOOTH);
// inicialización de los datos del programa
anos = 0;
dia = 0;
hora = 0;
min = 0;
explo= 0;
mov = 0;
mov2 = 0.01;
mov3 = 0;
//derr = x; arr = y; z = z
der = -5;
arr = 5;
z = -35;
//Variable para controlar el menú.
value = 0;
//Creamos el menú.
createMenu();
// registro de los eventos
glutReshapeFunc (reshapeevent);
glutDisplayFunc( displayevent );
//Cambio de teclas por menú.
glutSpecialFunc( specialkeyevent );
//Controlamos no sólo las teclas especiales, las normales también
//(Para aumentar y reducir velocidad de rotación)
//glutKeyboardFunc (Keyboard);
glutIdleFunc( animacion );
aux = carga_texturas();
// lazo de eventos
glutMainLoop();
return 0;
}
开发者ID:albornozwladimir,项目名称:OpenGl---Fin-del-Sol,代码行数:42,代码来源:main.c
示例2: printf
bool Victory::init()
{
// init the super
if ( !LayerColor::initWithColor(Color4B(205, 203, 166, 120))) {
return false;
}
Size parentVisibleSize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
// this->setVisible(false);
dialog = Sprite::create("Graphics/levelComplete.png");
if (!dialog) {
printf("Error opening levelComplete.png\n");
return false;
}
Size rawSize = dialog->getBoundingBox().size;
dialog->setAnchorPoint(Vec2(0,0));
createMenu();
dialog->setScale((rawSize.width/parentVisibleSize.width)*0.66);
Size dialogSize = dialog->getBoundingBox().size;
posX = (parentVisibleSize.width-dialogSize.width)/2.0;
posY = (parentVisibleSize.height-dialogSize.height)/2.0;
auto move = MoveTo::create(1.0, Vec2(posX, posY));
auto bounceIn = EaseElasticOut::create(move->clone());
dialog->setPosition(Vec2(posX, -dialogSize.height));
// is there any way to fade this in nicely?
// How do we scale to fit the phone size?
this->addChild(dialog, 1);
dialog->runAction(bounceIn);
return true;
}
开发者ID:duongbadu,项目名称:GravityJam,代码行数:42,代码来源:GJ_Victory.cpp
示例3: srand
MainWindow::MainWindow()
{
srand(time(NULL));
setWindowTitle(trUtf8("Gomoku"));
createMenu();
statusBarLabel = new QLabel(this);
scorePlayer1 = new QLabel(this);
scorePlayer2 = new QLabel(this);
statusBarLabel->setStyleSheet("font: 12pt;");
scorePlayer1->setStyleSheet("font: 12pt;");
scorePlayer2->setStyleSheet("font: 12pt;");
statusBar()->addPermanentWidget(scorePlayer1, 90);
statusBar()->addPermanentWidget(scorePlayer2, 200);
statusBar()->addPermanentWidget(statusBarLabel);
qApp->setStyleSheet("QStatusBar::item { border : 0px solid black }");
grid = new Grid(19, this);
grid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
connect(grid, SIGNAL(gameStateChanged(Gomoku::GameState, uint8_t, uint8_t)),
this, SLOT(applyGameState(Gomoku::GameState, uint8_t, uint8_t)));
windowLayout = new QHBoxLayout();
windowLayout->addWidget(grid);
centralWidget = new QWidget();
centralWidget->setLayout(windowLayout);
setCentralWidget(centralWidget);
resize(QSize(800, 800));
gridDrawer = new GomokuGui();
grid->setDisplay(gridDrawer);
grid->repaint();
newGame();
}
开发者ID:Shintouney,项目名称:MixedStuff,代码行数:42,代码来源:MainWindow.cpp
示例4: QMenu
void WBModelMenu::createMenu(const QModelIndex &parent, int max, QMenu *parentMenu, QMenu *menu)
{
if (!menu)
{
QString title = parent.data().toString();
menu = new QMenu(title, this);
QIcon icon = qvariant_cast<QIcon>(parent.data(Qt::DecorationRole));
menu->setIcon(icon);
parentMenu->addMenu(menu);
QVariant v;
v.setValue(parent);
menu->menuAction()->setData(v);
connect(menu, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
return;
}
int end = m_model->rowCount(parent);
if (max != -1)
end = qMin(max, end);
connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(triggered(QAction*)));
connect(menu, SIGNAL(hovered(QAction*)), this, SLOT(hovered(QAction*)));
for (int i = 0; i < end; ++i)
{
QModelIndex idx = m_model->index(i, 0, parent);
if (m_model->hasChildren(idx))
{
createMenu(idx, -1, menu);
}
else
{
if (m_separatorRole != 0
&& idx.data(m_separatorRole).toBool())
addSeparator();
else
menu->addAction(makeAction(idx));
}
if (menu == this && i == m_firstSeparator - 1)
addSeparator();
}
}
开发者ID:OpenBoard-org,项目名称:OpenBoard,代码行数:42,代码来源:WBModelMenu.cpp
示例5: nativeLoop
int nativeLoop(void) {
HINSTANCE hInstance = GetModuleHandle(NULL);
TCHAR* szWindowClass = TEXT("SystrayClass");
MyRegisterClass(hInstance, szWindowClass);
hWnd = InitInstance(hInstance, FALSE, szWindowClass); // Don't show window
if (!hWnd) {
return EXIT_FAILURE;
}
if (!createMenu() || !addNotifyIcon()) {
return EXIT_FAILURE;
}
systray_ready(0);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return EXIT_SUCCESS;
}
开发者ID:alex2108,项目名称:systray,代码行数:20,代码来源:systray_windows.c
示例6: log
void TDDHelper::addTestButton(Node *parent, Point pos)
{
if(HAS_TDD == false) {
log("ERROR: TDD Framework is disable!");
return;
}
if(parent == NULL) {
log("ERROR: addTestButton: parent is NULL"); // or use Assert
return;
}
Menu *menu = createMenu(pos, "Test!", [](Ref *sender) {
TDDHelper::showTests();
}
);
parent->addChild(menu);
}
开发者ID:tklee1975,项目名称:SDKTest,代码行数:20,代码来源:TDDHelper.cpp
示例7: QMainWindow
subMainWindow::subMainWindow(QWidget *parent) :
QMainWindow(parent)
{
createMenu();
subImageLabel = new QLabel;
subImageLabel->setBackgroundRole(QPalette::NoRole);
subImageLabel->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
subImageLabel->setScaledContents(true); //选择自动适应框的变化,就是无论将对话框,缩小放大都不影响像素,作用在看图片的时候,图片的像素会跟着相框调整
subScrollArea = new QScrollArea; //滚动区域
subScrollArea->setBackgroundRole(QPalette::Dark);
subScrollArea->setWidget(subImageLabel);
backImage = QImage();
setCentralWidget(subScrollArea);
setWindowTitle(tr("处理后的图片"));
resize(600,500);
}
开发者ID:rio-2607,项目名称:image_process,代码行数:20,代码来源:submainwindow.cpp
示例8: main
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(width, height);
glutInitWindowPosition((glutGet(GLUT_SCREEN_WIDTH)-width)/2,
(glutGet(GLUT_SCREEN_HEIGHT)-height)/2);
glutCreateWindow("Simple Paint And Draw Program");
glutDisplayFunc(display);
glutMouseFunc(mouse);
glutKeyboardFunc(keyboard);
glutReshapeFunc(reshape);
createMenu();
glClearColor(0.85f, 0.85f, 0.85f, 0.0f);
glColor3f(0.0, 0.0, 0.0);
glPointSize(5.0);
glEnable(GL_MAP1_VERTEX_3);
glutMainLoop();
}
开发者ID:gjiang3,项目名称:CS116A,代码行数:20,代码来源:simple_drawing.c
示例9: indexAt
void FSTableView::contextMenuEvent(QContextMenuEvent * event)
{
QModelIndex index = indexAt(event->pos());
QMenu * menu = 0;
if (index.isValid())
{
if (selectionModel()->selectedRows().count() > 1)
menu = createSelectionMenu();
else
menu = createItemMenu();
}
else
menu = createMenu();
menu->move(event->globalPos());
menu->exec();
delete menu;
}
开发者ID:Pileg8,项目名称:freebox-desktop,代码行数:20,代码来源:fstableview.cpp
示例10: createStarsBackground
// on "init" you need to initialize your instance
bool PizzaSpeedLevel::init()
{
// 1. super init first
if ( !Layer::init() ) return false;
createStarsBackground("Pictures/bigStar.png",20);
createStarsBackground("Pictures/smallStar.png",50);
showInstructions();
createMenu();
addRemainingTimeLabel();
addBackground("Pictures/PizzaSpeedBack.png");
addSpaceShip("Pictures/PizzaSpeedShip.png");
addTimeSlider();
schedule( schedule_selector( PizzaSpeedLevel::update) );
schedule( schedule_selector(PizzaSpeedLevel::updateRemainingTime));
return true;
}
开发者ID:jcamposobando,项目名称:physica,代码行数:21,代码来源:PizzaSpeedLevel.cpp
示例11: QMenu
TrayIcon::TrayIcon() {
trayIconMenu = new QMenu( this );
trayIcon = new QSystemTrayIcon( this );
createMenu();
trayIcon->setContextMenu( trayIconMenu );
trayIcon->setIcon( QIcon( QString::fromUtf8( ":/dboxfe_image" ) ) );
trayIcon->setToolTip( "DBoxFE - TrayIcon " + getAppVersion() );
trayIcon->show();
setWindowIcon( QIcon( QString::fromUtf8( ":/dboxfe_image" ) ) );
setWindowTitle( getAppTitel() );
update = new QTimer( this );
connect( update, SIGNAL( timeout() ), this, SLOT( reloadMenu() ) );
update->thread()->setPriority( QThread::NormalPriority );
update->start( 15000 );
}
开发者ID:BackupTheBerlios,项目名称:dboxfe-svn,代码行数:20,代码来源:tray.cpp
示例12: createWindow
/**
* create window & run main loop
*/
void createWindow(windowData *win){
FNAME();
if(!initialized) return;
if(!win) return;
int w = win->w, h = win->h;
DBG("create window with title %s", win->title);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(w, h);
win->GL_ID = glutCreateWindow(win->title);
DBG("created GL_ID=%d", win->GL_ID);
glutReshapeFunc(Resize);
glutDisplayFunc(RedrawWindow);
glutKeyboardFunc(keyPressed);
glutSpecialFunc(keySpPressed);
//glutMouseWheelFunc(mouseWheel);
glutMouseFunc(mousePressed);
glutMotionFunc(mouseMove);
//glutIdleFunc(glutPostRedisplay);
glutIdleFunc(NULL);
DBG("init textures");
glGenTextures(1, &(win->Tex));
calc_win_props(win, NULL, NULL);
win->zoom = 1. / win->Daspect;
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, win->Tex);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, win->image->w, win->image->h, 0,
GL_RGB, GL_UNSIGNED_BYTE, win->image->rawdata);
glDisable(GL_TEXTURE_2D);
totWindows++;
createMenu(win->GL_ID);
DBG("OK, total opened windows: %d", totWindows);
}
开发者ID:eddyem,项目名称:eddys_snippets,代码行数:44,代码来源:imageview.c
示例13: QLabel
Keyswitch::Keyswitch(XKeyboard *keyboard, QWidget *parent) : QLabel(parent)
{
keys=keyboard;
QSettings * antico = new QSettings(QCoreApplication::applicationDirPath() + "/antico.cfg", QSettings::IniFormat, this);
antico->beginGroup("Style");
map_path = antico->value("path").toString()+"/language/";
antico->endGroup(); //Style
xkbConf = X11tools::loadXKBconf();
if (xkbConf->status!=DONT_USE_XKB) {
load_rules();
qDebug()<<"XKB status : " <<xkbConf->status;
if (xkbConf->status==USE_XKB)
set_xkb();
init();
if (groupeName.count()>1 || xkbConf->showSingle) {
draw_icon();
createMenu();
}
}
}
开发者ID:sollidsnake,项目名称:qxkb,代码行数:21,代码来源:keyswitch.cpp
示例14: main
int main(int argc, char ** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(500,500); /*se voce deseja deixar em fullscreen comente essa linha
e descomente a glutFullScreen(). Se quer só aumentar o
tamanho inicial da janela, basta trocar os valores*/
glutCreateWindow("EP 2 - Fractais");
/* glutFullScreen(); */
init();
createMenu();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop(); /*O OpenGL passa a tomar controle total do programa*/
return 0;
}
开发者ID:gorobaum,项目名称:gorobaumhome,代码行数:21,代码来源:EP2+-+FUNFANDO.c
示例15: clearObject
void Plane::create()
{
clearObject();
object_.header.frame_id = frame_id_;
object_.name = name_;
object_.description = name_ + " plane";
object_.pose = pose_;
mesh_.type = Marker::CUBE;
mesh_.color = color_;
mesh_.scale = scale_;
mesh_.scale.z = 0.001;
control_.always_visible = true;
control_.interaction_mode = InteractiveMarkerControl::BUTTON;
control_.markers.push_back(mesh_);
object_.controls.push_back(control_);
createMenu();
}
开发者ID:beds-tao,项目名称:srs_public,代码行数:21,代码来源:plane.cpp
示例16: createMenu
// We initialize our instance
bool OptionsScene::init() {
// 1. super init first
if (!Layer::init()) { // if there is a mistake then we terminate the program, it couldnt launch
return false;
}
Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
// add a label shows "Creditos" create and initialize labels
auto labelTitulo = LabelTTF::create("Opciones", "Tahoma", 32);
// position the label on the upper center of the screen
labelTitulo->setPosition(Point(origin.x + visibleSize.width * 0.5f, origin.y + visibleSize.height * .88f));
// add the label as a child to this layer
this->addChild(labelTitulo, 1);
// We add the devs labels
this->showNames(origin, visibleSize);
// Creates the background of the game menu.
auto sprite = Sprite::create("GameMenu/0000.jpg"); // sprites are important, those are the images
// position the sprite on the center of the screen
sprite->setPosition(Point(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
// add the sprite as a child to this layer
this->addChild(sprite, 0);
createMenu(); // We bring to live this scene.
// Reproducir la musica de la seleccion del nivel: quiza sea mejor dejar la misma del menu
// principal y cambiarla cuando se haya iniciado el nivel. Se deja aqui por propositos
// ilustrativos
auto sound = CocosDenshion::SimpleAudioEngine::getInstance();
sound->stopBackgroundMusic(); // this steps are to change tracks.
sound->playBackgroundMusic("Music/Options.mp3", true); // We use a piece of music we already have and reproduce it for the options scene.
return true; // we managed to bring frankestein alive, I mean, the game.
}
开发者ID:Magnus1Proyect,项目名称:Magnus,代码行数:41,代码来源:OptionsScene.cpp
示例17: currentColumn
/**
\return
**/
void BlTreeWidget::contextMenuEvent ( QContextMenuEvent * )
{
BL_FUNC_DEBUG
int column = currentColumn();
if ( column < 0 ) return;
QMenu *menu = new QMenu ( this );
/// Lanzamos el evento para que pueda ser capturado por terceros.
emit pintaMenu ( menu );
/// Lanzamos la propagación del menú a través de las clases derivadas.
createMenu ( menu );
QAction *adjustColumnSize = menu->addAction ( _ ( "Ajustar columa" ) );
QAction *adjustAllColumnsSize = menu->addAction ( _ ( "Ajustar columnas" ) );
QAction *menuOption = menu->exec ( QCursor::pos() );
/// Si no hay ninguna opción pulsada se sale sin hacer nada.
if ( !menuOption ) return;
if ( menuOption == adjustAllColumnsSize ) {
for (int i = 0; i < columnCount(); i++) {
resizeColumnToContents (i);
} // end for
} else if ( menuOption == adjustColumnSize ) {
resizeColumnToContents ( column );
} // end if
emit trataMenu ( menuOption );
/// Activamos las herederas.
execMenuAction ( menuOption );
delete menu;
}
开发者ID:JustDevZero,项目名称:bulmages,代码行数:43,代码来源:bltreewidget.cpp
示例18: clearObject
void Billboard::create()
{
clearObject();
object_.header.frame_id = frame_id_;
object_.name = name_;
// object_.description = name_ + " billboard";
object_.pose.position.x = pose_.position.x;
object_.pose.position.y = pose_.position.y;
object_.pose.position.z = pose_.position.z;
createMesh();
control_.name = "billboard_control";
control_.always_visible = true;
control_.orientation_mode = InteractiveMarkerControl::VIEW_FACING;
control_.interaction_mode = InteractiveMarkerControl::BUTTON;
control_.markers.push_back(mesh_);
object_.controls.push_back(control_);
createMenu();
}
开发者ID:ankitasikdar,项目名称:srs_public,代码行数:22,代码来源:billboard.cpp
示例19: createMenu
MainWindow::MainWindow()
{
model = NULL;
view = NULL;
openBase = closeBase = createBase = clearBase = addRecord = deleteRecord =
editRecord = showRecord = selectRecord = diagram = NULL;
createMenu();
createWidgets();
setSize();
setButtonGroupLeftLayout();
setButtonsGroupRightLayout();
setMainLayout();
box = new QWidget;
box->setLayout(mainLayout);
setCentralWidget(box);
setConnect();
}
开发者ID:Chester94,项目名称:DataBase_People,代码行数:22,代码来源:mainwindow.cpp
示例20: createMenu
void SearchTeamResultLayer::initLayer()
{
//±³¾°
CCSprite* background=CCSprite::create(PVE_FIELD_POPWIN_BACKGROUND);
this->addChild(background);
background->setPosition(ccp(480,320));
CCLabelTTF* lbResult=ToolsFun::createLabel(LanguageManager::shareManager()->getContentByKey("SEARCH_RESULT").c_str(),DEF_FONT_NAME,30,ccp(495,525),this);
CCLabelTTF* lbTeamID=ToolsFun::createLabel(LanguageManager::shareManager()->getContentByKey("TEAM_ID").c_str(),DEF_FONT_NAME,28,ccp(421,440),this);
CCLabelTTF* lbTeamName=ToolsFun::createLabel(LanguageManager::shareManager()->getContentByKey("TEAM_NAME").c_str(),DEF_FONT_NAME,28,ccp(421,368),this);
CCLabelTTF* lbPlayerNum=ToolsFun::createLabel(LanguageManager::shareManager()->getContentByKey("PLAYER_NUM").c_str(),DEF_FONT_NAME,28,ccp(388,297),this);
m_LbTeamID=ToolsFun::createLabel("111",DEF_FONT_NAME,30,ccp(490,440),this);
m_LbTeamName=ToolsFun::createLabel("111",DEF_FONT_NAME,30,ccp(490,368),this);
m_LbPlayerNum=ToolsFun::createLabel("11/11",DEF_FONT_NAME,30,ccp(435,297),this);
m_LbTeamID->setAnchorPoint(ccp(0.0f,0.5f));
m_LbTeamName->setAnchorPoint(ccp(0.0f,0.5f));
m_LbPlayerNum->setAnchorPoint(ccp(0.0f,0.5f));
createMenu();
this->setTouchEnabled(true);
}
开发者ID:Dream-Hat,项目名称:mdsj,代码行数:22,代码来源:PVEPopLayer.cpp
注:本文中的createMenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论