ShutdownConfirmDlg::ShutdownConfirmDlg(QWidget *parent, const ShutdownDialogAction &action) : QDialog(parent) , m_ui(new Ui::confirmShutdownDlg) , m_timeout(15) , m_action(action) { m_ui->setupUi(this); initText(); QIcon warningIcon(style()->standardIcon(QStyle::SP_MessageBoxWarning)); m_ui->warningLabel->setPixmap(warningIcon.pixmap(32)); if (m_action == ShutdownDialogAction::Exit) m_ui->neverShowAgainCheckbox->setVisible(true); else m_ui->neverShowAgainCheckbox->setVisible(false); // Cancel Button QPushButton *cancelButton = m_ui->buttonBox->button(QDialogButtonBox::Cancel); cancelButton->setFocus(); cancelButton->setDefault(true); // Always on top setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); move(Utils::Misc::screenCenter(this)); m_timer.setInterval(1000); // 1sec connect(&m_timer, SIGNAL(timeout()), this, SLOT(updateSeconds())); Utils::Gui::resize(this); }
int main() { sf::ContextSettings settings; settings.antialiasingLevel = 8; sf::RenderWindow window(sf::VideoMode(800, 600), "Lab7", sf::Style::Default, settings); sf::View view = sf::View(sf::FloatRect(0, 0, float(window.getSize().x), float(window.getSize().y))); window.setView(view); window.setVerticalSyncEnabled(true); sf::Clock clock; //init some objects struct tm time = getTime(); struct vectorObjects shapes = initVectorObjects(); sf::Vector2f center = getCenter(window); sf::Text text = initText("rubik.ttf"); resize(window, shapes); setFirstPosition(shapes); while (window.isOpen()) { sf::Time elapsed = clock.restart(); animationUpdate(elapsed, shapes); drawWindows(window, shapes, text); window.display(); events(window, shapes); } return 0; }
ChangeTileTerrain::ChangeTileTerrain() : mTilesetDocument(nullptr) , mTileset(nullptr) , mMergeable(false) { initText(); }
void UIFont::changed(ConstFieldMaskArg whichField, UInt32 origin, BitVector details) { Inherited::changed(whichField, origin, details); if(whichField & ( FamilyFieldMask | GlyphPixelSizeFieldMask | GapFieldMask | StyleFieldMask | TextureWidthFieldMask | AttachmentsFieldMask) ) { initText(); } if((whichField & AntiAliasingFieldMask) && getTexture() != NULL) { //if(getAntiAliasing()) //{ getTexture()->setMinFilter(GL_LINEAR_MIPMAP_NEAREST); getTexture()->setMagFilter(GL_LINEAR); //} //else //{ //getTexture()->setMinFilter(GL_NEAREST); //getTexture()->setMagFilter(GL_NEAREST); //} } }
void DebugRenderer::draw3dText(const osg::Vec3& location,const char* textString) { if( !getEnabled() ) return; FIXME(Bullet Text) //if( (_debugMode & btIDebugDraw::DBG_DrawText) == 0 ) // return; if( !_active ) { osg::notify( osg::WARN ) << "DebugRenderer: BeginDraw was not called." << std::endl; return; } if( _textStrings == _textVec.size() ) { int oldSize( _textVec.size() ); int newSize( oldSize * 2 ); _textVec.resize( newSize ); int idx; for( idx=oldSize; idx<newSize; idx++ ) _textVec[ idx ] = initText(); } osgText::Text* text = _textVec[ _textStrings ].get(); _textStrings++; text->setPosition( location /*osgbCollision::asOsgVec3( location )*/ ); text->setText( std::string( textString ) ); _geode->addDrawable( text ); }
TupProjectCommand::TupProjectCommand(TupCommandExecutor *executor, const TupProjectRequest *request) : QUndoCommand(), k(new Private()) { #ifdef K_DEBUG T_FUNCINFO; #endif k->executor = executor; k->executed = false; TupRequestParser parser; if (!parser.parse(request->xml())) { #ifdef K_DEBUG tFatal() << "TupProjectCommand::TupProjectCommand(): - Parser error!"; #endif } k->response = parser.response(); k->response->setExternal(request->isExternal()); if (!k->response) { #ifdef K_DEBUG tFatal() << "TupProjectCommand::TupProjectCommand() - Unparsed response!"; #endif } initText(); }
ChangeTileTerrain::ChangeTileTerrain() : mMapEditor(0), mTileset(0), mMergeable(false) { initText(); }
void myClock() { int loop=1; int h,m,s; int color=1, size=1; char symbol='X'; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO consoleInfo; WORD saved_attributes; GetConsoleScreenBufferInfo(hConsole, &consoleInfo); saved_attributes = consoleInfo.wAttributes; while(loop) { if(GetAsyncKeyState(VK_ESCAPE)) { break; } if(GetAsyncKeyState('C')) { writeConfig(color, size, symbol, hConsole, saved_attributes); GetAsyncKeyState(VK_SPACE); //Clear GetAsyncKeyState('C');//Clear } readConfig(&color, &size, &symbol); initClock(&h,&m,&s); char f[17]= {}; initText(f,h,m,s,symbol); system("cls"); digitalClock(h,m,s); printClock(f,color,size,hConsole,saved_attributes); sleep(1); } }
void init() { colorWhiteInt = SDL_MapRGB(screen->format, 255, 255, 255); colorBlackInt = SDL_MapRGB(screen->format, 0, 0, 0); colorYellowInt = SDL_MapRGB(screen->format, 200, 200, 0); fprintf(stderr, "White is %x\n", colorWhiteInt); initText(); }
ChangeTileTerrain::ChangeTileTerrain(MapEditor *editor, Changes &changes) : mMapEditor(editor), mTileset(changes.begin().key()->tileset()), mChanges(changes), mMergeable(true) { initText(); }
void MVC_Model_Test::Init(void) { MVC_Model::Init(); srand(time(NULL)); initEnvironment(); initText(); }
ChangeTileTerrain::ChangeTileTerrain(MapEditor *editor, Tile *tile, unsigned terrain) : mMapEditor(editor), mTileset(tile->tileset()), mMergeable(true) { initText(); mChanges.insert(tile, Change(tile->terrain(), terrain)); }
ChangeTileTerrain::ChangeTileTerrain(TilesetDocument *tilesetDocument, Tile *tile, unsigned terrain) : mTilesetDocument(tilesetDocument) , mTileset(tile->tileset()) , mMergeable(true) { initText(); mChanges.insert(tile, Change(tile->terrain(), terrain)); }
UIWidget::UIWidget() { m_lastFocusReason = Fw::ActiveFocusReason; m_states = Fw::DefaultState; initBaseStyle(); initText(); initImage(); }
void TextItem::geometryChangedEvent(QRectF , QRectF) { // if ((m_angle==Angle0)||(m_angle==Angle180)){ // m_text->setTextWidth(rect().width()-fakeMarginSize()*2); // } else { // m_text->setTextWidth(rect().height()-fakeMarginSize()*2); // } // m_textSize=m_text->size(); if (itemMode() == DesignMode) initText(); }
ChangeTileTerrain::ChangeTileTerrain(TilesetDocument *tilesetDocument, const Changes &changes, QUndoCommand *parent) : QUndoCommand(parent) , mTilesetDocument(tilesetDocument) , mTileset(changes.begin().key()->tileset()) , mChanges(changes) , mMergeable(true) { initText(); }
UIWidget::UIWidget() { m_lastFocusReason = Fw::ActiveFocusReason; m_states = Fw::DefaultState; m_clickTimer.stop(); m_autoRepeatDelay = 500; initBaseStyle(); initText(); initImage(); }
/** * Basically initializes everything */ void GP2DEngine::initAll(void) throw(GP2DException) { int status = SDL_Init(SDL_INIT_EVERYTHING); if(status != 0) { throw GP2DException("Failed to initialize the complete engine", SDL_GetError()); } try { initText(); } catch (GP2DException& ex) { throw; // re throw it. } }
void UIFont::layout(const std::string &utf8Text, const TextLayoutParam ¶m, TextLayoutResult &result) { if (_face == NULL) { initText(); } if (_face != NULL) { _face->layout(utf8Text,param,result); } }
TupProjectCommand::TupProjectCommand(TupCommandExecutor *executor, TupProjectResponse *response) : QUndoCommand(), k(new Private) { #ifdef K_DEBUG T_FUNCINFO; #endif k->executor = executor; k->response = response; k->executed = false; initText(); }
void TextItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight) { if (isNeedExpandContent()) expandContent(dataManager, pass); if (!isLoading()) initText(); if (m_textSize.width()>width() && ((m_autoWidth==MaxWordLength)||(m_autoWidth==MaxStringLength))){ setWidth(m_textSize.width() + fakeMarginSize()*2); } if ((m_textSize.height()>height()) && (m_autoHeight) ){ setHeight(m_textSize.height()+5); } BaseDesignIntf::updateItemSize(dataManager, pass, maxHeight); }
const TextTXFGlyph* UIFont::getTXFGlyph(TextGlyph::Index glyphIndex) { if (_face == NULL) { initText(); } if (_face != NULL) { return &(_face->getTXFGlyph(glyphIndex)); } else { return NULL; } }
Marker::Marker(Diagram *Diag_, Graph *pg_, int _nn, int cx_, int cy_) { Type = isMarker; isSelected = transparent = false; Diag = Diag_; pGraph = pg_; Precision = 3; // before createText() numMode = nVarPos = 0; cx = cx_; cy = -cy_; if(!pGraph) makeInvalid(); else initText(_nn); // finally create marker x1 = cx + 60; y1 = -cy - 60; }
Game2::Game2(sf::RenderWindow* hwnd, Input* in) { window = hwnd; input = in; if (!defaultFont.loadFromFile("font/interbureau.ttf")) { //something went wrong } //Initialise rewardVal = ""; initBackAndFace(); initLogosAndButtons(); initText(); //Add background noise audioMgr.addMusic("sfx/BarNoise.wav", "barNoise"); }
void TextItem::setContent(const QString &value) { if (m_strText.compare(value)!=0){ QString oldValue = m_strText; m_strText=value; if (allowHTML()) m_text->setHtml(replaceReturns(value.trimmed())); else m_text->setPlainText(value); //m_text->setTextWidth(width()); //m_textSize=m_text->size(); if (itemMode() == DesignMode){ initText(); } if (!isLoading()){ update(rect()); notify("content",oldValue,value); //updateLayout(); } } }
void CMessageBoxBitmapGalaxy::init() { initGalaxyFrame(); SDL_Rect rect = mMBRect; rect.x = 16; // Move text to the right if bitmap is on the left side if( mAlignment == LEFT ) rect.x += mBitmap.getWidth(); rect.w -= 16; rect.h -= 8; rect.y = (rect.h-mTextHeight)/2; initText(rect); const Uint16 bmpX = ( mAlignment == LEFT ) ? 10 : mMBRect.w-(mBitmap.getWidth()+32); mBitmap._draw( mpMBSurface.get(), bmpX, 10 ); }
void initGame(void) { lcdMainOnTop(); int oldv=getMemFree(); NOGBA("mem free : %dko (%do)",getMemFree()/1024,getMemFree()); NOGBA("initializing..."); videoSetMode(MODE_5_3D | DISPLAY_BG3_ACTIVE); videoSetModeSub(MODE_5_2D | DISPLAY_BG3_ACTIVE); glInit(); vramSetPrimaryBanks(VRAM_A_TEXTURE,VRAM_B_TEXTURE,VRAM_C_LCD,VRAM_D_MAIN_BG_0x06000000); vramSetBankH(VRAM_H_SUB_BG); vramSetBankI(VRAM_I_SUB_BG_0x06208000); glEnable(GL_TEXTURE_2D); // glEnable(GL_ANTIALIAS); glDisable(GL_ANTIALIAS); glEnable(GL_BLEND); glEnable(GL_OUTLINE); glSetOutlineColor(0,RGB15(0,0,0)); //TEMP? glSetOutlineColor(1,RGB15(0,0,0)); //TEMP? glSetOutlineColor(7,RGB15(31,0,0)); //TEMP? glSetToonTableRange(0, 15, RGB15(8,8,8)); //TEMP? glSetToonTableRange(16, 31, RGB15(24,24,24)); //TEMP? glClearColor(31,31,0,31); glClearPolyID(63); glClearDepth(0x7FFF); glViewport(0,0,255,191); // initVramBanks(1); initVramBanks(2); initTextures(); initSound(); initCamera(NULL); initPlayer(NULL); initLights(); initParticles(); initMaterials(); loadMaterialSlices("slices.ini"); loadMaterials("materials.ini"); loadControlConfiguration("config.ini"); initElevators(); initWallDoors(); initTurrets(); initBigButtons(); initTimedButtons(); initEnergyBalls(); initPlatforms(); initCubes(); initEmancipation(); initDoors(); initSludge(); initPause(); initText(); NOGBA("lalala"); getPlayer()->currentRoom=&gameRoom; currentBuffer=false; getVramStatus(); fadeIn(); mainBG=bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0); bgSetPriority(mainBG, 0); REG_BG0CNT=BG_PRIORITY(3); #ifdef DEBUG_GAME consoleInit(&bottomScreen, 3, BgType_Text4bpp, BgSize_T_256x256, 16, 0, false, true); consoleSelect(&bottomScreen); #endif // glSetToonTableRange(0, 14, RGB15(16,16,16)); // glSetToonTableRange(15, 31, RGB15(26,26,26)); initPortals(); //PHYSICS initPI9(); strcpy(&mapFilePath[strlen(mapFilePath)-3], "map"); newReadMap(mapFilePath, NULL, 255); transferRectangles(&gameRoom); makeGrid(); generateRoomGrid(&gameRoom); gameRoom.displayList=generateRoomDisplayList(&gameRoom, vect(0,0,0), vect(0,0,0), false); getVramStatus(); startPI(); NOGBA("START mem free : %dko (%do)",getMemFree()/1024,getMemFree()); NOGBA("vs mem free : %dko (%do)",oldv/1024,oldv); levelInfoCounter=60; }
long FAR PASCAL WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; RECT rect; switch(message) { case WM_CREATE: ghDC = GetDC(hWnd); if (!bSetupPixelFormat(ghDC)) PostQuitMessage (0); ghRC = wglCreateContext(ghDC); if (!ghRC) { MessageBox(NULL, "Could not initialize GL", "ERROR", MB_OK); PostQuitMessage (0); } if (!wglMakeCurrent(ghDC, ghRC)) { MessageBox(NULL, "wglMakeCurrent failed", "ERROR", MB_OK); PostQuitMessage (0); } GetClientRect(hWnd, &rect); initializeGL(rect.right, rect.bottom); // Other Initialisation should go here initText(); TimeInit(); TerrainInit("hmap.raw"); break; case WM_PAINT: ghDC = BeginPaint(hWnd, &ps); EndPaint(hWnd, &ps); return TRUE; case WM_SIZE: GetClientRect(hWnd, &rect); resize(rect.right, rect.bottom); break; case WM_CLOSE: if (ghRC) wglDeleteContext(ghRC); if (ghDC) ReleaseDC(hWnd, ghDC); ghRC = 0; ghDC = 0; DestroyWindow (hWnd); break; case WM_DESTROY: if (ghRC) wglDeleteContext(ghRC); if (ghDC) ReleaseDC(hWnd, ghDC); PostQuitMessage (0); break; case WM_KEYDOWN: KeyDown(wParam); break; } return DefWindowProc(hWnd, message, wParam, lParam); }
DebugRenderer::DebugRenderer() : _enabled( true ), _active( false ), _textSize( 1.f ), _textStrings( 0 ), _frame( 0 ), _contacts( 0 ) { setDebugMode( ~0u ); _group = new osg::Group(); _group->setName( "Bullet Debug" ); _geode = new osg::Geode(); _geode->setName( "Bullet pts, lns, tris, and text" ); _geode->setDataVariance( osg::Object::DYNAMIC ); { osg::StateSet* ss = _geode->getOrCreateStateSet(); ss->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); } _group->addChild( _geode.get() ); _ptGeom = new osg::Geometry; _ptGeom->setDataVariance( osg::Object::DYNAMIC ); _ptGeom->setUseDisplayList( false ); _ptGeom->setUseVertexBufferObjects( false ); { osg::StateSet* ss = _geode->getOrCreateStateSet(); ss->setMode( GL_POINT_SMOOTH, osg::StateAttribute::ON ); osg::Point* point = new osg::Point( 20. ); ss->setAttributeAndModes( point, osg::StateAttribute::ON ); } _geode->addDrawable( _ptGeom.get() ); _ptVerts = new osg::Vec3Array(); _ptGeom->setVertexArray( _ptVerts ); _ptColors = new osg::Vec4Array(); _ptGeom->setColorArray( _ptColors ); _ptGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); _lnGeom = new osg::Geometry; _lnGeom->setDataVariance( osg::Object::DYNAMIC ); _lnGeom->setUseDisplayList( false ); _lnGeom->setUseVertexBufferObjects( false ); _geode->addDrawable( _lnGeom.get() ); _lnVerts = new osg::Vec3Array(); _lnGeom->setVertexArray( _lnVerts ); _lnColors = new osg::Vec4Array(); _lnGeom->setColorArray( _lnColors ); _lnGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); _triGeom = new osg::Geometry; _triGeom->setDataVariance( osg::Object::DYNAMIC ); _triGeom->setUseDisplayList( false ); _triGeom->setUseVertexBufferObjects( false ); _geode->addDrawable( _triGeom.get() ); _triVerts = new osg::Vec3Array(); _triGeom->setVertexArray( _triVerts ); _triColors = new osg::Vec4Array(); _triGeom->setColorArray( _triColors ); _triGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); // Initialize _textVec to display 10 text strings; resize later if necessary _textVec.resize( 10 ); int idx; for( idx=0; idx<10; idx++ ) _textVec[ idx ] = initText(); }
GLDebugDrawer::GLDebugDrawer() : _enabled( true ), _active( false ), _textSize( 1.f ), _textStrings( 0 ), _frame( 0 ), _contacts( 0 ) { setDebugMode( ~0u ); _group = new osg::Group(); _group->setName( "Bullet Debug" ); _geode = new osg::Geode(); _geode->setName( "Bullet pts, lns, tris, and text" ); _geode->setDataVariance( osg::Object::DYNAMIC ); { osg::StateSet* ss = _geode->getOrCreateStateSet(); ss->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); } _group->addChild( _geode.get() ); _ptGeom = new osg::Geometry; _ptGeom->setDataVariance( osg::Object::DYNAMIC ); _ptGeom->setUseDisplayList( false ); _ptGeom->setUseVertexBufferObjects( false ); { osg::StateSet* ss = _geode->getOrCreateStateSet(); ss->setMode( GL_POINT_SMOOTH, osg::StateAttribute::ON ); osg::Point* point = new osg::Point( 20. ); ss->setAttributeAndModes( point, osg::StateAttribute::ON ); } _geode->addDrawable( _ptGeom.get() ); _ptVerts = new osg::Vec3Array(); _ptGeom->setVertexArray( _ptVerts ); _ptColors = new osg::Vec4Array(); _ptGeom->setColorArray( _ptColors ); _ptGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); _lnGeom = new osg::Geometry; _lnGeom->setDataVariance( osg::Object::DYNAMIC ); _lnGeom->setUseDisplayList( false ); _lnGeom->setUseVertexBufferObjects( false ); _geode->addDrawable( _lnGeom.get() ); _lnVerts = new osg::Vec3Array(); _lnGeom->setVertexArray( _lnVerts ); _lnColors = new osg::Vec4Array(); _lnGeom->setColorArray( _lnColors ); _lnGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); _triGeom = new osg::Geometry; _triGeom->setDataVariance( osg::Object::DYNAMIC ); _triGeom->setUseDisplayList( false ); _triGeom->setUseVertexBufferObjects( false ); _geode->addDrawable( _triGeom.get() ); _triVerts = new osg::Vec3Array(); _triGeom->setVertexArray( _triVerts ); _triColors = new osg::Vec4Array(); _triGeom->setColorArray( _triColors ); _triGeom->setColorBinding( osg::Geometry::BIND_PER_VERTEX ); // Initialize _textVec to display 10 text strings; resize later if necessary _textVec.resize( 10 ); int idx; for( idx=0; idx<10; idx++ ) _textVec[ idx ] = initText(); // Set up for HUD _hudCam = new osg::Camera; _hudCam->setRenderOrder( osg::Camera::POST_RENDER ); _hudCam->setClearMask( GL_DEPTH_BUFFER_BIT ); _hudCam->setReferenceFrame( osg::Transform::ABSOLUTE_RF ); _hudCam->setViewMatrix( osg::Matrix::identity() ); _hudCam->setProjectionMatrixAsOrtho( 0., 1., 0., 1., -1., 1. ); _group->addChild( _hudCam.get() ); _chart = new Chart; _chart->createChart(); _hudCam->addChild( _chart->get() ); }