NewDatabaseWizardPageMasterKey::NewDatabaseWizardPageMasterKey(QWidget* parent)
    : NewDatabaseWizardPage(parent)
{
    setPageWidget(new DatabaseSettingsWidgetMasterKey());

    setTitle(tr("Database Master Key"));
    setSubTitle(tr("A master key known only to you protects your database."));

    connect(pageWidget(), SIGNAL(sizeChanged()), SLOT(updateWindowSize()));
}
示例#2
0
bool VBA::updateRenderMethod0(bool force)
{
    bool initInput = false;

    if( display != NULL) {
        if( force ) {
            toolsLoggingClose(); // close log dialog
            initInput = true;
            changingVideoSize = true;
            shutdownDisplay();
            if(input) {
                delete input;
                input = NULL;
            }
            CWnd *pWnd = m_pMainWnd;

            m_pMainWnd = NULL;
            pWnd->DragAcceptFiles(FALSE);
            pWnd->DestroyWindow();
            delete pWnd;

            display = NULL;
        }
    } else {
        display = newDirect3DDisplay();
    }

    if( preInitialize() ) {
        if( display->initialize( sizeX, sizeY ) ) {
            if( initInput ) {
                if( !this->initInput() ) {
                    changingVideoSize = false;
                    AfxPostQuitMessage(0);
                    return false;
                }
                input->checkKeys();
                updateMenuBar();
                changingVideoSize = false;
                updateWindowSize(videoOption);

                m_pMainWnd->ShowWindow(SW_SHOW);
                m_pMainWnd->UpdateWindow();
                m_pMainWnd->SetFocus();

                return true;
            } else {
                changingVideoSize = false;
                return true;
            }
        }
    }
    changingVideoSize = false;
    
    return true;
}
示例#3
0
void VBA::updateVideoSize(UINT id)
{
  int value = 0;

  switch(id) {
  case ID_OPTIONS_VIDEO_X1:
    value = VIDEO_1X;
    break;
  case ID_OPTIONS_VIDEO_X2:
    value = VIDEO_2X;
    break;
  case ID_OPTIONS_VIDEO_X3:
    value = VIDEO_3X;
    break;
  case ID_OPTIONS_VIDEO_X4:
    value = VIDEO_4X;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN320X240:
    value = VIDEO_320x240;
    fsWidth = 320;
    fsHeight = 240;
    fsColorDepth = 16;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN640X480:
    value = VIDEO_640x480;
    fsWidth = 640;
    fsHeight = 480;
    fsColorDepth = 16;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN800X600:
    value = VIDEO_800x600;
    fsWidth = 800;
    fsHeight = 600;
    fsColorDepth = 16;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN1024X768:
    value = VIDEO_1024x768;
    fsWidth = 1024;
    fsHeight = 768;
    fsColorDepth = 32;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN1280X1024:
    value = VIDEO_1280x1024;
    fsWidth = 1280;
    fsHeight = 1024;
    fsColorDepth = 32;
    break;
  case ID_OPTIONS_VIDEO_FULLSCREEN:
    value = VIDEO_OTHER;
    break;
  }

  updateWindowSize(value);
}
//----------------------------------------
uint8_t renderResize(uint32_t w, uint32_t h,renderZoom newzoom)
{
int mul,xx,yy;

	if(screenBuffer) 
		{
			delete  [] screenBuffer;
			screenBuffer=NULL;
		}
        if(resized)
        {
                        delete resized;
                        resized=NULL;
        }
        if(resizer)
        {
                delete resizer;
                resizer=NULL;
        }
        zoom=newzoom;
        switch(zoom)
        {
                case ZOOM_1_4: mul=1;break;
                case ZOOM_1_2: mul=2;break;
                case ZOOM_1_1: mul=4;break;
                case ZOOM_2:   mul=8;break;
                case ZOOM_4:   mul=16;break;
                default : ADM_assert(0);

        }
        xx=(w*mul+3)/4;
        yy=(h*mul+3)/4;

        if(xx&1) xx++;
        if(yy&1) yy++;

        screenBuffer=new uint8_t[xx*yy*4];

        if(zoom!=ZOOM_1_1)
        {
                 resizer=new ADM_MplayerResize(w,h,xx,yy);
                 resized=new ADMImage(xx,yy);
        }

	updateWindowSize( draw,xx,yy);
	UI_purge();
	return 1;

}
示例#5
0
void Render::drawParticles(const b2Vec2 *centers, float32 radius, const b2ParticleColor *colors, int32 count, float depth) noexcept
{
    assert(centers != NULL);
    assert(colors != NULL);

    if (updateWindowSize())
    {
        glDeleteTextures(1, &particleTexture2);
        particleTexture2 = 0;
        genParticleTexture2();

        glDeleteFramebuffers(1, &particleFrameBuffer);
        particleFrameBuffer = 0;
        genParticleFrameBuffer();
    }

    particleRender1(centers, radius, colors, count);
    particleRender2(depth);
}
示例#6
0
    int Platform::enterMessagePump()
    {
        GP_ASSERT(_game);

        updateWindowSize();

        // Get the initial time.
        clock_gettime(CLOCK_REALTIME, &__timespec);
        __timeStart = timespec2millis(&__timespec);
        __timeAbsolute = 0L;

        if (_game->getState() != Game::RUNNING)
            _game->run();

        if (__attachToWindow)
            return 0;

        // Do something

        return 0;
    }
示例#7
0
void VBA::updateWindowSize(int value)
{
  regSetDwordValue("video", value);

  if(value == VIDEO_OTHER) {
    regSetDwordValue("fsWidth", fsWidth);
    regSetDwordValue("fsHeight", fsHeight);
    regSetDwordValue("fsColorDepth", fsColorDepth);
  }

  if(((value >= VIDEO_320x240) &&
      (videoOption != value)) ||
     (videoOption >= VIDEO_320x240 &&
      value <= VIDEO_4X) ||
     fsForceChange) {
    fsForceChange = false;
    changingVideoSize = true;
	if( videoOption <= VIDEO_4X ) {
		lastWindowed = (VIDEO_SIZE)videoOption; // save for when leaving full screen
	} else {
		lastFullscreen = (VIDEO_SIZE)videoOption; // save for when using quick switch to fullscreen
	}
    shutdownDisplay();
    if(input) {
      delete input;
      input = NULL;
    }
    m_pMainWnd->DragAcceptFiles(FALSE);
    CWnd *pWnd = m_pMainWnd;
    m_pMainWnd = NULL;
    pWnd->DestroyWindow();
    delete pWnd;
    videoOption = value;
    if(!initDisplay()) {
      if(videoOption == VIDEO_320x240 ||
         videoOption == VIDEO_640x480 ||
         videoOption == VIDEO_800x600 ||
         videoOption == VIDEO_1024x768 ||
         videoOption == VIDEO_1280x1024 ||
         videoOption == VIDEO_OTHER) {
        regSetDwordValue("video", VIDEO_1X);
      }
      changingVideoSize = false;
      AfxPostQuitMessage(0);
      return;
    }
    if(!initInput()) {
      changingVideoSize = false;
      AfxPostQuitMessage(0);
      return;
    }
    input->checkKeys();


    changingVideoSize = FALSE;
    updateWindowSize(videoOption);
    return;
  }

  sizeX = 240;
  sizeY = 160;

  videoOption = value;

  surfaceSizeX = sizeX;
  surfaceSizeY = sizeY;

  switch(videoOption) {
  case VIDEO_1X:
    surfaceSizeX = sizeX;
    surfaceSizeY = sizeY;
    break;
  case VIDEO_2X:
    surfaceSizeX = sizeX * 2;
    surfaceSizeY = sizeY * 2;
    break;
  case VIDEO_3X:
    surfaceSizeX = sizeX * 3;
    surfaceSizeY = sizeY * 3;
    break;
  case VIDEO_4X:
    surfaceSizeX = sizeX * 4;
    surfaceSizeY = sizeY * 4;
    break;
  case VIDEO_320x240:
  case VIDEO_640x480:
  case VIDEO_800x600:
  case VIDEO_1024x768:
  case VIDEO_1280x1024:
  case VIDEO_OTHER:
    {
      int scaleX = 1;
      int scaleY = 1;
      scaleX = (fsWidth / sizeX);
      scaleY = (fsHeight / sizeY);
      int min = scaleX < scaleY ? scaleX : scaleY;
      if(maxScale)
        min = min > maxScale ? maxScale : min;
      surfaceSizeX = min * sizeX;
      surfaceSizeY = min * sizeY;
      if(fullScreenStretch) {
        surfaceSizeX = fsWidth;
        surfaceSizeY = fsHeight;
      }
    }
    break;
  }

  rect.right = sizeX;
  rect.bottom = sizeY;

  int winSizeX = sizeX;
  int winSizeY = sizeY;

  if(videoOption <= VIDEO_4X) {
    dest.left = 0;
    dest.top = 0;
    dest.right = surfaceSizeX;
    dest.bottom = surfaceSizeY;

    DWORD style = WS_POPUP | WS_VISIBLE;

    style |= WS_OVERLAPPEDWINDOW;

    AdjustWindowRectEx(&dest, style, TRUE, 0); //WS_EX_TOPMOST);

    winSizeX = dest.right-dest.left;
    winSizeY = dest.bottom-dest.top;

      m_pMainWnd->SetWindowPos(0, //HWND_TOPMOST,
                               windowPositionX,
                               windowPositionY,
                               winSizeX,
                               winSizeY,
                               SWP_NOMOVE | SWP_SHOWWINDOW);

	  // content of old seperate 'winCheckMenuBarInfo' function:
      MENUBARINFO info;
      info.cbSize = sizeof(MENUBARINFO);
	  GetMenuBarInfo( theApp.m_pMainWnd->GetSafeHwnd(), OBJID_MENU, 0, &info );
      int menuHeight = GetSystemMetrics(SM_CYMENU); // includes white line
      if((info.rcBar.bottom - info.rcBar.top) > menuHeight) // check for double height menu
	  {
        winSizeY += (info.rcBar.bottom - info.rcBar.top) - menuHeight + 1;
        m_pMainWnd->SetWindowPos(
                                        0, //HWND_TOPMOST,
                                        theApp.windowPositionX,
                                        theApp.windowPositionY,
                                        winSizeX,
                                        winSizeY,
                                        SWP_NOMOVE | SWP_SHOWWINDOW);
      }
  }

  adjustDestRect();

  if(display)
    display->resize(theApp.dest.right-theApp.dest.left, theApp.dest.bottom-theApp.dest.top);

  m_pMainWnd->RedrawWindow(NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN);
}