예제 #1
0
void CMatchingDlg::OnButtonClicked(GtkWidget *pBtn)
{
	if (!m_Updating) {
		m_Updating = true;
		if (pBtn==m_FrameBtn) {
			if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_FrameBtn))) {
				SetSelectMode(REFERENCE_FRAME);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==m_CatalogBtn) {
			if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(m_CatalogBtn))) {
				SetSelectMode(CATALOG_FILE);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==GTK_WIDGET(m_ShowChart)) {
			if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowChart))) {
				SetDisplayMode(DISPLAY_CHART);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==GTK_WIDGET(m_ShowImage)) {
			if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(m_ShowImage))) {
				SetDisplayMode(DISPLAY_IMAGE);
				UpdatePreview(true);
				UpdateControls();
			}
		} else if (pBtn==m_PathBtn) 
			ChangeCatalogPath();
		else if (pBtn==m_OptionsBtn)
			EditPreferences();
		m_Updating = false;
	}
}
void
TimeFormat::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("TimeFormat");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("displayMode")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetDisplayMode(DisplayMode(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            DisplayMode value;
            if(DisplayMode_FromString(node->AsString(), value))
                SetDisplayMode(value);
        }
    }
    if((node = searchNode->GetNode("precision")) != 0)
        SetPrecision(node->AsInt());
}
예제 #3
0
void SmsDrawable::InvPushButton (int whichButton, int whichMFD)
{
    
    FireControlComputer* pFCC = Sms->ownship->GetFCC();

    switch (whichButton)
    {
    case 3:
	if (!pFCC->IsNavMasterMode())
	    SetDisplayMode(Wpn);
	break;
	
    case 10:
	{
	    SetDisplayMode (SelJet);
	}
	break;
    case 11:
	if (g_bRealisticAvionics) {
	    MfdDrawable::PushButton(whichButton, whichMFD);
	}
	break;
	
    case 12:
	if (g_bRealisticAvionics) {
	    MfdDrawable::PushButton(whichButton, whichMFD);
	}
	break;
	
    case 13:
	if (g_bRealisticAvionics) {
	    MfdDrawable::PushButton(whichButton, whichMFD);
	}
	else if(pFCC->GetMasterMode() == FireControlComputer::ILS ||
	    pFCC->GetMasterMode() == FireControlComputer::Nav)
	{
	    SetDisplayMode(Wpn);
	    pFCC->SetMasterMode( FireControlComputer::Nav );
	}
	else
	{	
	    SetDisplayMode(Wpn);
	    pFCC->SetMasterMode( FireControlComputer::Nav );
	}
	break;
	
    case 14:
	MfdDrawable::PushButton(whichButton, whichMFD);
	break;
	
   }
   // 2000-08-26 ADDED BY S.G. SO WE SAVE THE JETTISON SELECTION
   //	if (displayMode == SelJet)	// Until I fixe oldp01 being private
   //		((AircraftClass *)Sms->ownship)->af->oldp01[5] = hardPointSelected;
}
예제 #4
0
void ToggleFullscreenMode(HWND hWnd, 
						  int iWidth, int iHeight, int iBpp, int iRefreshRate)
{
	static bool bFullScreen = true;
	static RECT rWindow = {0,0,g_nWINDOW_WIDTH,g_nWINDOW_HEIGHT};
	static HMENU hMenu = NULL;


	if(bFullScreen)
	{
		// Remember the window position.
		GetWindowRect(hWnd, &rWindow);
		// Switch to the requested display mode.
		SetDisplayMode(iWidth, iHeight, iBpp, iRefreshRate);
		// Remember the menu, then remove it.
		hMenu = GetMenu(hWnd);
		SetMenu(hWnd, NULL);
		// Remove the window's title bar.
		SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP);
		// Put the changes to the window into effect.
		SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
			SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
		// Size the window to cover the entire screen.
		SetWindowPos(hWnd, 0,
			0, 0,
			GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
			SWP_NOZORDER);
		// Remove the cursor.
		//ShowCursor(FALSE);
	}
	else
	{
		// Restore the display mode.
		SetDisplayMode(0, 0, 0, 0);
		// Restore the window's menu.
		SetMenu(hWnd, hMenu);
		// Restore the window's title bar.
		SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW);
		// Put the changes to the window into effect.
		SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
			SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
		// Size the window to its original position.
		int iWindowWidth = rWindow.right - rWindow.left;
		int iWindowHeight = rWindow.bottom - rWindow.top;
		SetWindowPos(hWnd, 0,
			rWindow.left,
			rWindow.top,
			iWindowWidth, iWindowHeight,
			SWP_NOZORDER);
		// Restore the cursor.
		ShowCursor(TRUE);
	}
	bFullScreen = !bFullScreen;
}
예제 #5
0
파일: DirectDraw.cpp 프로젝트: aybe/glrage
HRESULT WINAPI DirectDraw::SetDisplayMode(
    DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
{
    LOG_TRACE("");

    return SetDisplayMode(dwWidth, dwHeight, dwBPP, DEFAULT_REFRESH_RATE, 0);
}
예제 #6
0
파일: descent.cpp 프로젝트: paud/d2x-xl
int InitGraphics (void)
{
	u_int32_t	nScreenSize;
	int			t;

/*---*/PrintLog ("Initializing graphics\n");
if ((t = GrInit ())) {		//doesn't do much
	PrintLog ("Cannot initialize graphics\n");
	Error (TXT_CANT_INIT_GFX, t);
	return 0;
	}
nScreenSize = SM (scrSizes [gameStates.gfx.nStartScrMode].x, scrSizes [gameStates.gfx.nStartScrMode].y);
/*---*/PrintLog ("Initializing render buffers\n");
if (!gameStates.render.vr.buffers.offscreen)	//if hasn't been initialied (by headset init)
	SetDisplayMode (gameStates.gfx.nStartScrMode, gameStates.gfx.bOverride);		//..then set default display mode
/*---*/PrintLog ("Loading default palette\n");
paletteManager.SetDefault (paletteManager.Load (D2_DEFAULT_PALETTE, NULL));
CCanvas::Current ()->SetPalette (paletteManager.Default ());	//just need some valid palette here
/*---*/PrintLog ("Initializing game fonts\n");
fontManager.Setup ();	// must load after palette data loaded.
/*---*/PrintLog ("Setting screen mode\n");
SetScreenMode (SCREEN_MENU);
/*---*/PrintLog ("Showing loading screen\n");
ShowLoadingScreen ();
return 1;
}
예제 #7
0
DesktopManager::DesktopManager(int width, int height)
{
   Settings settings;

   m_currentDesktop = NULL;

   //Load the number of columns
   m_nbColumn = settings.LoadSetting(Settings::ColumnNumber);

   //Get the size
   m_width = width;
   m_height = height;

   //Initialize the display mode
   m_bkDisplayMode = NULL;
   m_displayMode = (DisplayMode)-1;
   SetDisplayMode((DisplayMode)settings.LoadSetting(Settings::DisplayMode));

   settings.LoadSetting(Settings::PreviewWindowFont, &m_lfPreviewWindowFontInfo);
   m_hPreviewWindowFont = CreateFontIndirect(&m_lfPreviewWindowFontInfo);
   m_crPreviewWindowFontColor = settings.LoadSetting(Settings::PreviewWindowFontColor);

   //Load the desktops
   LoadDesktops();

   //Initialize the OSD
   m_osd.Create();
   m_useOSD = settings.LoadSetting(Settings::DesktopNameOSD);

   vdWindow.SetMessageHandler(WM_VD_SWITCHDESKTOP, this, &DesktopManager::OnCmdSwitchDesktop);
   vdWindow.SetMessageHandler(WM_SETTINGCHANGE, this, &DesktopManager::OnSettingsChange);
}
unNotebookPage* unPackageTree::Initialize( pkgSerializer* serializer )
{
	Serializer = serializer;

	InitDisplayModes();

	// controls
	ModeCombo = new wxComboBox( this, wxID_ANY, ModeNames[0], wxDefaultPosition, wxDefaultSize, ModeNames, wxCB_READONLY );
	Tree = new unTreeList(this);

	// sizer
	wxBoxSizer* vs = new wxBoxSizer( wxVERTICAL );
	vs->Add( ModeCombo, 0, wxEXPAND | wxALIGN_TOP, 0 );	
	vs->Add( Tree, 1, wxEXPAND, 0 );	
	vs->SetSizeHints( this );
	SetSizerAndFit( vs ); 

	// init
	InitListTable( GetTable() );
	InitTreeList();

	SetDisplayMode( 0 );

	return this;
}
예제 #9
0
bool CDirectDraw::Initialize (HWND hWnd)
{
	if(dDinitialized)
		return true;

    dErr = DirectDrawCreate (NULL, &lpDD, NULL);
    if(FAILED(dErr))
        return false;

    dErr = lpDD -> CreateClipper (0, &lpDDClipper, NULL);
    if(FAILED(dErr))
        return false;

    dErr = lpDDClipper->SetHWnd (0, hWnd);
    if(FAILED(dErr))
        return false;

	if (!SetDisplayMode (GUI.FullscreenMode.width, GUI.FullscreenMode.height, max(GetFilterScale(GUI.Scale), GetFilterScale(GUI.ScaleHiRes)), GUI.FullscreenMode.depth, GUI.FullscreenMode.rate,
		TRUE, GUI.DoubleBuffered))
    {
        MessageBox( GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(7)"), MB_OK | MB_ICONSTOP);
        return (false);
    }

	dDinitialized = true;

    return (true);
}
예제 #10
0
// pure back end
static void
VerifyDisplayMode ()
{
    int mode;

    /* Get proper mode for current game */
    switch( gameMode ) {
    case IcsObserving:    // [HGM] ICS analyze
	if(!appData.icsEngineAnalyze) return;
    case AnalyzeFile:
    case MachinePlaysWhite:
    case MachinePlaysBlack:
        mode = 0;
        break;
    case AnalyzeMode:
        mode = second.analyzing;
        break;
    case IcsPlayingWhite:
    case IcsPlayingBlack:
        mode = appData.zippyPlay && opponentKibitzes; // [HGM] kibitz
        break;
    case TwoMachinesPlay:
        mode = 1;
        break;
    default:
        /* Do not change */
        return;
    }

    SetDisplayMode( mode );
}
예제 #11
0
void Game::Run(HWND hwnd)
{
	if(graphics == NULL) // if graphics not initialized
		return;

	// Calculate elapsed time of last frame, save in frameTime
	QueryPerformanceCounter(&timeEnd);
	frameTime = (float)(timeEnd.QuadPart - timeStart.QuadPart ) / (float)timerFreq.QuadPart;

	// Power saving code, requires winmm.lib
	// if not enough time has elapsed for desired frame rate
	if (frameTime < MIN_FRAME_TIME)
	{
		sleepTime = (DWORD)((MIN_FRAME_TIME - frameTime)*1000);
		timeBeginPeriod(1);			// request 1mS resolution for windows timer
		Sleep(sleepTime);			// release cpu for sleepTime
		timeEndPeriod(1);			// end 1mS timer resolution
		return;
	}

	if (frameTime > 0.0)
		fps = (fps*0.99f) + (0.01f/frameTime); // average fps
	if (frameTime > MAX_FRAME_TIME) // if frame rate is very slow
		frameTime = MAX_FRAME_TIME; // limit maximum frameTime
	timeStart = timeEnd;

	// Update(), AI(), and Collisions() are pure virtual functions.
	// These functions must be provided in the class that inherits from Game.
	if (!paused)
	{
		Collisions(); // handle collisions
		Update(); // update all game items
		AI(); // artificial intelligence
		//input->VibrateControllers(frameTime); // handle controller vibration
	}
	RenderGame();

	//check for console key
	if (input->WasKeyPressed(Key::TILDE))
	{
		console->showHide();
		paused = console->getVisible(); // pause game when console is visible
	}
	ConsoleCommand();               // process user entered console command

	input->ReadControllers(); // read state of controllers

	// if Alt+Enter toggle fullscreen/window
	if (input->IsKeyDown(Key::ALT) && input->WasKeyPressed(Key::ENTER))
		SetDisplayMode(GraphicsNS::TOGGLE); // toggle fullscreen/window

	// if Esc key, set window mode
	//if (input->IsKeyDown(Key::ESC))
		//SetDisplayMode(GraphicsNS::WINDOW); // set window mode

	// Clear input
	// Call this after all key checks are done
	input->Clear(InputNS::KEYS_PRESSED);
}
예제 #12
0
// Arexx List building commands
BOOL	RXStartList(char *args) {
	LIST	*lp = &CurDisplay->ds_List;

	FreeDLIST(lp);
	SetDisplayMode(DISPLAY_REXXLIST,0);

	return TRUE;
}
예제 #13
0
AccelerantBuffer::AccelerantBuffer(const display_mode& mode,
		const frame_buffer_config& config)
	: fDisplayModeSet(false),
	  fFrameBufferConfigSet(false),
	  fIsOffscreenBuffer(false)
{
	SetDisplayMode(mode);
	SetFrameBufferConfig(config);
}
예제 #14
0
파일: Panel.cpp 프로젝트: dakyri/qua
void
Panel::MessageReceived(BMessage *inMsg)
{
	if (inMsg->what == SET_DISPLAY_MODE) {
		SetDisplayMode(inMsg->FindInt32("display mode"));
	} else {
		BView::MessageReceived(inMsg);
	}
}
예제 #15
0
bool CDirectDraw::SetFullscreen(bool fullscreen)
{
	if (!SetDisplayMode (GUI.FullscreenMode.width, GUI.FullscreenMode.height, max(GetFilterScale(GUI.Scale), GetFilterScale(GUI.ScaleHiRes)), GUI.FullscreenMode.depth, GUI.FullscreenMode.rate, !fullscreen, GUI.DoubleBuffered))
	{
		MessageBox( GUI.hWnd, Languages[ GUI.Language].errModeDD, TEXT("Snes9X - DirectDraw(2)"), MB_OK | MB_ICONSTOP);
		return false;
	}
	return true;
}
예제 #16
0
파일: SymObject.cpp 프로젝트: dakyri/qua
QuaSymbolBridge::QuaSymbolBridge(StabEnt *S, BRect r, BBitmap *siconData, BBitmap *biconData,
					ObjectViewContainer *a, rgb_color dflt_col):
	ObjectView(r, S->UniqueName(), a, "QuaSymbolBridge", nullptr, B_WILL_DRAW|B_FRAME_EVENTS)
{
	SetFontSize(10);
	if (siconData) {
		sicon = new BBitmap(
					siconData->Bounds(),
					siconData->ColorSpace());
		uchar	*p = (uchar *)sicon->Bits(),
				*q = (uchar *)siconData->Bits();
		for (int i=0; i<siconData->BitsLength(); i++) {
			p[i] = q[i];
		}
	} else {
		sicon = nullptr;
	}
	if (biconData) {
		bicon = new BBitmap(
					biconData->Bounds(),
					biconData->ColorSpace());
		uchar	*p = (uchar *)bicon->Bits(),
				*q = (uchar *)biconData->Bits();
		for (int i=0; i<biconData->BitsLength(); i++) {
			p[i] = q[i];
		}
	} else {
		bicon = nullptr;
	}
	
	sym = S;
	if (Window()) Window()->Lock();
	SetColor(dflt_col);
	if (Window()) Window()->Unlock();
	
	if (bicon)
		SetDisplayMode(OBJECT_DISPLAY_BIG);
	else if (sicon)
		SetDisplayMode(OBJECT_DISPLAY_SMALL);
	else
		SetDisplayMode(OBJECT_DISPLAY_NIKON);
}
예제 #17
0
void FrameMain::OnVideoOpen() {
	if (!context->videoController->IsLoaded()) {
		SetDisplayMode(0, -1);
		return;
	}

	Freeze();
	int vidx = context->videoController->GetWidth(),
		vidy = context->videoController->GetHeight();

	// Set zoom level based on video resolution and window size
	double zoom = context->videoDisplay->GetZoom();
	wxSize windowSize = GetSize();
	if (vidx*3*zoom > windowSize.GetX()*4 || vidy*4*zoom > windowSize.GetY()*6)
		context->videoDisplay->SetZoom(zoom * .25);
	else if (vidx*3*zoom > windowSize.GetX()*2 || vidy*4*zoom > windowSize.GetY()*3)
		context->videoDisplay->SetZoom(zoom * .5);

	SetDisplayMode(1,-1);

	if (OPT_GET("Video/Detached/Enabled")->GetBool() && !context->dialog->Get<DialogDetachedVideo>())
		cmd::call("video/detach", context.get());
	Thaw();

	if (!blockAudioLoad && OPT_GET("Video/Open Audio")->GetBool() && context->audioController->GetAudioURL() != context->videoController->GetVideoName()) {
		try {
			context->audioController->OpenAudio(context->videoController->GetVideoName());
		}
		catch (agi::UserCancelException const&) { }
		// Opening a video with no audio data isn't an error, so just log
		// and move on
		catch (agi::fs::FileSystemError const&) {
			LOG_D("video/open/audio") << "File " << context->videoController->GetVideoName() << " found by video provider but not audio provider";
		}
		catch (agi::AudioDataNotFoundError const& e) {
			LOG_D("video/open/audio") << "File " << context->videoController->GetVideoName() << " has no audio data: " << e.GetChainedMessage();
		}
		catch (agi::AudioOpenError const& err) {
			wxMessageBox(to_wx(err.GetMessage()), "Error loading audio", wxOK | wxICON_ERROR | wxCENTER);
		}
	}
}
예제 #18
0
void ModuleSelector::Hide(){
  exposed = false;
  description_box->SetDisplayMode(UIWidget::DisplayMode::Invisible);
  lvl2_anim_end_wait = drawerlvl2->on_hide_complete.Subscribe([this](){
    this->lvl1_anim_end_wait = drawerlvl1->on_hide_complete.Subscribe([this](){
      SetDisplayMode(UIWidget::DisplayMode::Invisible);
    });
    drawerlvl1->StartHide(0.08);
  });
  drawerlvl2->StartHide(0.08);
}
예제 #19
0
파일: gr.cpp 프로젝트: paud/d2x-xl
int SetCustomDisplayMode (int w, int h)
{
displayModeInfo [NUM_DISPLAY_MODES].VGA_mode = SM (w, h);
displayModeInfo [NUM_DISPLAY_MODES].w = w;
displayModeInfo [NUM_DISPLAY_MODES].h = h;
if (!(displayModeInfo [NUM_DISPLAY_MODES].isAvailable = 
	   GrVideoModeOK (displayModeInfo [NUM_DISPLAY_MODES].VGA_mode)))
	return 0;
SetDisplayMode (NUM_DISPLAY_MODES, 0);
return 1;
}
예제 #20
0
TInt DLcdPowerHandler::HalFunction(TInt aFunction, TAny* a1, TAny* a2)
{
  TInt r=KErrNone;
  switch(aFunction)
	{
	case EDisplayHalScreenInfo:
	  {
		TPckgBuf<TScreenInfoV01> vPckg;
		ScreenInfo(vPckg());
		Kern::InfoCopy(*(TDes8*)a1,vPckg);
		break;
	  }
	case EDisplayHalWsRegisterSwitchOnScreenHandling:
	  {
		iWsSwitchOnScreen=(TBool)a1;
		break;
	  }
	case EDisplayHalWsSwitchOnScreen:
	  {
		WsSwitchOnScreen();
		break;
	  }
	case EDisplayHalModeCount:
	  {
		TInt ndm = KConfigLcdNumberOfDisplayModes;
		kumemput32(a1, &ndm, sizeof(ndm));
		break;
	  }
	case EDisplayHalSetMode:
	  {
		__KTRACE_OPT(KEXTENSION,Kern::Printf("EDisplayHalSetMode"));
		__SECURE_KERNEL(
						if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetMode")))
						return KErrPermissionDenied;
						)
		  r = SetDisplayMode((TInt)a1);
		break;
	  }
	case EDisplayHalMode:
	  {
		kumemput32(a1, &iVideoInfo.iDisplayMode, sizeof(iVideoInfo.iDisplayMode));
		r = KErrNone;
		break;
	  }
	case EDisplayHalSetPaletteEntry:
	  {
		__SECURE_KERNEL(
						if(!Kern::CurrentThreadHasCapability(ECapabilityMultimediaDD,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDisplayHalSetPaletteEntry")))
						return KErrPermissionDenied;
						)
		  r = KErrNotSupported;
		break;
	  }
예제 #21
0
void ModuleSelector::Expose(){
  exposed = true;
  lvl1_selection = "";
  listlvl1->SetHighlight("");
  SetDisplayMode(UIWidget::DisplayMode::Visible);
  lvl1_anim_end_wait = drawerlvl1->on_show_complete.Subscribe([this](){
    description_box->SetDisplayMode(UIWidget::DisplayMode::Visible);
  });
  lvl2_anim_end_wait.Release();
  drawerlvl1->StartShow(0.15);
  drawerlvl2->StartHide(0.0);
}
예제 #22
0
파일: Panel.cpp 프로젝트: dakyri/qua
void
Panel::MouseDown(BPoint where)
{
	long		channel, quant;
	BRect		area = Bounds();

	ulong		mods = modifiers(); // Key mods???
	ulong		buts;
	BMessage	*msg;
	BPoint		pt;
	drawing_mode	cur_mode = DrawingMode();
	long		clicks;
	
	GetMouse(&pt, &buts);
	msg = Window()->CurrentMessage();
	
	fprintf(stderr, "%x %d\n", buts, buts & B_SECONDARY_MOUSE_BUTTON);
	if ((clicks=msg->FindInt32("clicks")) == 1) {
		if (buts & B_SECONDARY_MOUSE_BUTTON) {
			RunControlMenu(where);
		} else {
//			msg = new BMessage(MOVE_OBJECT);
//		 	msg->AddPointer("object_view", this);
		 	
			if (mods & B_SHIFT_KEY) {
//				((ObjectViewContainer *)Parent())->AddSelection(this);
			} else {
//				((ObjectViewContainer *)Parent())->Select(this);
			}
		
//			DragMessage(msg, area);
		}
	} else if (clicks > 1) {	// rescale
		if (displayMode==PANEL_DISPLAY_SMALL)
			SetDisplayMode(PANEL_DISPLAY_BIG);
		else
			SetDisplayMode(PANEL_DISPLAY_SMALL);
	} else {
	}
}
void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
{
    int oldMode = GetDisplayMode();

    switch( event.GetId() )
    {
    case ID_TB_OPTIONS_SHOW_GBR_MODE_0:
        SetDisplayMode( 0 );
        break;

    case ID_TB_OPTIONS_SHOW_GBR_MODE_1:
        SetDisplayMode( 1 );
        break;

    case ID_TB_OPTIONS_SHOW_GBR_MODE_2:
        SetDisplayMode( 2 );
        break;
    }

    if( GetDisplayMode() != oldMode )
        m_canvas->Refresh();
}
예제 #24
0
		void IGraphics::Init(HWND hWnd, int width, int height, bool bWindowed)
		{
			//Set the window handle
			m_hWnd = hWnd;		

			//Set the back buffer and the device context
			m_MainDC  = GetDC(m_hWnd);
			m_BackDC  = CreateCompatibleDC(m_MainDC);
			m_BmpDC	  = CreateCompatibleDC(m_MainDC);

			SetDisplayMode(width, height, bWindowed);

		}
예제 #25
0
/*****************************************************************************
 * PlayListWindow::MessageReceived
 *****************************************************************************/
void
PlayListWindow::MessageReceived( BMessage * p_message )
{
    switch ( p_message->what )
    {
        case OPEN_DVD:
        case B_REFS_RECEIVED:
        case B_SIMPLE_DATA:
            // forward to interface window
            fMainWindow->PostMessage( p_message );
            break;
        case MSG_SELECT_ALL:
            fListView->Select( 0, fListView->CountItems() - 1 );
            break;
        case MSG_SELECT_NONE:
            fListView->DeselectAll();
            break;
        case MSG_RANDOMIZE:
            break;
        case MSG_SORT_REVERSE:
            fListView->SortReverse();
            break;
        case MSG_SORT_NAME:
            break;
        case MSG_SORT_PATH:
            break;
        case MSG_REMOVE:
            fListView->RemoveSelected();
            break;
        case MSG_REMOVE_ALL:
            fListView->Select( 0, fListView->CountItems() - 1 );
            fListView->RemoveSelected();
            break;
        case MSG_SELECTION_CHANGED:
            _CheckItemsEnableState();
            break;
        case MSG_SET_DISPLAY:
        {
            uint32 mode;
            if ( p_message->FindInt32( "mode", (int32*)&mode ) == B_OK )
                SetDisplayMode( mode );
            break;
        }
        case B_MODIFIERS_CHANGED:
            fListView->ModifiersChanged();
            break;
        default:
            BWindow::MessageReceived( p_message );
            break;
    }
}
예제 #26
0
파일: Panel.cpp 프로젝트: dakyri/qua
Panel::Panel(BRect rect, float maxw, char *nm, ulong flags)
	: BView(rect, nm?nm:"panel", (ulong)B_FOLLOW_LEFT|B_FOLLOW_TOP, (ulong)B_FRAME_EVENTS|B_WILL_DRAW|flags)
{
	SetViewColor(mdGray);
	SetFontSize(12);
	SetFont(be_bold_font);
	myHeight = rect.bottom - rect.top;
	myWidth = rect.right - rect.left;
	maxWidth = maxw;
	thePoint.Set(MIXER_MARGIN, MIXER_MARGIN);
	rowHeight = MIXER_MARGIN;
	
	SetDisplayMode(PANEL_DISPLAY_BIG);
}
예제 #27
0
void EbookController::SetDoc(Doc newDoc, int startReparseIdxArg, DisplayMode displayMode)
{
    CrashIf(!newDoc.IsDocLoaded());
    currPageReparseIdx = startReparseIdxArg;
    if ((size_t)currPageReparseIdx >= newDoc.GetHtmlDataSize())
        currPageReparseIdx = 0;
    CloseCurrentDocument();

    doc = newDoc;
    // displayMode could be any value if alternate UI was used, we have to limit it to
    // either DM_SINGLE_PAGE or DM_FACING
    if (DM_AUTOMATIC == displayMode)
        displayMode = gGlobalPrefs->defaultDisplayModeEnum;
    SetDisplayMode(displayMode);
    TriggerLayout();
    UpdateStatus();
}
int HWCDisplayPrimary::Perform(uint32_t operation, ...) {
  va_list args;
  va_start(args, operation);
  int val = 0;
  LayerRect *rect = NULL;

  switch (operation) {
    case SET_METADATA_DYN_REFRESH_RATE:
      val = va_arg(args, int32_t);
      SetMetaDataRefreshRateFlag(val);
      break;
    case SET_BINDER_DYN_REFRESH_RATE:
      val = va_arg(args, int32_t);
      ForceRefreshRate(UINT32(val));
      break;
    case SET_DISPLAY_MODE:
      val = va_arg(args, int32_t);
      SetDisplayMode(UINT32(val));
      break;
    case SET_QDCM_SOLID_FILL_INFO:
      val = va_arg(args, int32_t);
      SetQDCMSolidFillInfo(true, UINT32(val));
      break;
    case UNSET_QDCM_SOLID_FILL_INFO:
      val = va_arg(args, int32_t);
      SetQDCMSolidFillInfo(false, UINT32(val));
      break;
    case SET_QDCM_SOLID_FILL_RECT:
      rect = va_arg(args, LayerRect*);
      solid_fill_rect_ = *rect;
      break;
    default:
      DLOGW("Invalid operation %d", operation);
      va_end(args);
      return -EINVAL;
  }
  va_end(args);

  return 0;
}
예제 #29
0
bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser)
{
#ifdef __WXUNIVERSAL__
    wxString themeName;
    if ( parser.Found(OPTION_THEME, &themeName) )
    {
        wxTheme *theme = wxTheme::Create(themeName);
        if ( !theme )
        {
            wxLogError(_("Unsupported theme '%s'."), themeName.c_str());
            return false;
        }

        // Delete the defaultly created theme and set the new theme.
        delete wxTheme::Get();
        wxTheme::Set(theme);
    }
#endif // __WXUNIVERSAL__

#if defined(__WXMGL__)
    wxString modeDesc;
    if ( parser.Found(OPTION_MODE, &modeDesc) )
    {
        unsigned w, h, bpp;
        if ( wxSscanf(modeDesc.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3 )
        {
            wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str());
            return false;
        }

        if ( !SetDisplayMode(wxVideoMode(w, h, bpp)) )
            return false;
    }
#endif // __WXMGL__

    return wxAppConsole::OnCmdLineParsed(parser);
}
예제 #30
0
bool CDirectDraw::ApplyDisplayChanges(void)
{
	return SetDisplayMode (GUI.FullscreenMode.width, GUI.FullscreenMode.height, max(GetFilterScale(GUI.Scale), GetFilterScale(GUI.ScaleHiRes)), GUI.FullscreenMode.depth, GUI.FullscreenMode.rate,
		!GUI.FullScreen, GUI.DoubleBuffered);
}