void U2Panel::themeSelected(){ themeDialogShows=FALSE; ZConfig cfg1("/ezxlocal/MarsInput/theme/theme.cfg"); cfg1.writeEntry("Theme","Name",themeAvilable[themeIndex]); cfg1.flush(); initSkin(); text_ptr=0; text_order(); text_genePos(); startCursorTimer(); }
U2Panel::U2Panel(QWidget *parent,QString text):QWidget(parent){ skin=NULL; initSkin(); initGlobalVars(); initWindowAttrs(); initPixmapBuffer(); initFonts(); initPinYinDB(); initCursorTimer(); startCursorTimer(); themeDialogShows=FALSE; text_buf=text; if(text_buf.length()>0){ cout<<"text buf length "<<text_buf.length()<<endl; cout<<text_buf<<endl; text_ptr=text_buf.length(); text_order(); text_genePos(); } initClipBoard(); }
// on "init" you need to initialize your instance bool KeyInputTestScene::init() { ////////////////////////////// // 1. super init first if (!Layer::init()) { return false; } Size visibleSize = Director::getInstance()->getVisibleSize(); Vec2 origin = Director::getInstance()->getVisibleOrigin(); // menu initialization initMenu(); // background initialization initBackground(); // skin initialization initSkin(); // sound file initialization initBaseSound(); // add KeyboardEvent auto kbListener = EventListenerKeyboard::create(); // make call back on each methods kbListener->onKeyPressed = CC_CALLBACK_2(KeyInputTestScene::onKeyPressed, this); kbListener->onKeyReleased = CC_CALLBACK_2(KeyInputTestScene::onKeyReleased, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(kbListener, this); // add "KeyInputTestScene" splash screen" //auto sprite = Sprite::create("HelloWorld.png"); // position the sprite on the center of the screen //sprite->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y)); // add the sprite as a child to this layer //this->addChild(sprite, 0); return true; }