示例#1
0
bool wxTopLevelWindowX11::ShowFullScreen(bool show, long style)
{
    if (show)
    {
        if (IsFullScreen())
            return false;

        m_fsIsShowing = true;
        m_fsStyle = style;

        // TODO

        return true;
    }
    else
    {
        if (!IsFullScreen())
            return false;

        m_fsIsShowing = false;

        // TODO
        return true;
    }
}
示例#2
0
void Panel::Show()
{
	if (!GetModalMode())
	{
		const auto AnotherPanel = Parent()->GetAnotherPanel(this);
		if (AnotherPanel->IsVisible())
		{
			if (SaveScr)
			{
				SaveScr->AppendArea(AnotherPanel->SaveScr.get());
			}

			if (AnotherPanel->IsFocused())
			{
				if (AnotherPanel->IsFullScreen())
				{
					SetVisible(true);
					return;
				}

				if (GetType() == panel_type::FILE_PANEL && IsFullScreen())
				{
					ScreenObject::Show();
					AnotherPanel->Show();
					return;
				}
			}
		}
	}

	ScreenObject::Show();
	ShowScreensCount();
}
示例#3
0
void Panel::Hide()
{
	ScreenObject::Hide();
	const auto AnotherPanel = Parent()->GetAnotherPanel(this);

	if (AnotherPanel->IsVisible())
	{
		//if (AnotherPanel->IsFocused())
		if ((AnotherPanel->GetType() == panel_type::FILE_PANEL && AnotherPanel->IsFullScreen()) ||
			(GetType() == panel_type::FILE_PANEL && IsFullScreen()))
				AnotherPanel->Show();
	}
}
示例#4
0
void GX_BDirectWindow::MessageReceived(BMessage *msg)
{
	switch(msg->what)
	{
		case MSG_SYSAPPLICATION_CLOSE:
			printf("Close thread BDirectWindow\n");
			g_pApp->Kill();
		break;

		case MSG_SYSAPPLICATION_OPEN:
			printf("Resume thread BDirectWindow\n");
			resume_thread(m_DrawThread);

		break;
		case MSG_SYSAPPLICATION_SWITCHFS:
			printf("Toggle fullscreen BDirectWindow\n");
			SetFullScreen(!IsFullScreen());
		break;

		default:
			g_pApp->WindowMessage(msg);
			BDirectWindow::MessageReceived(msg);
		break;
	}
}
示例#5
0
static void IdleObject_Tick(IdleObject * obj)
{
	bool idle = false;
	int  idleType = 0, flags = 0;

	if (obj->useridlecheck && IdleObject_IsUserIdle(obj)) {
		idleType = 1; idle = true;
	}
	else if (IdleObject_IdleCheckSaver(obj) && IsScreenSaverRunning()) {
		idleType = 2; idle = true;
	}
	else if (IdleObject_IdleCheckFullScr(obj) && IsFullScreen()) {
		idleType = 5; idle = true;
	}
	else if (IdleObject_IdleCheckWorkstation(obj) && IsWorkstationLocked()) {
		idleType = 3; idle = true;
	}
	else if (IdleObject_IdleCheckTerminal(obj) && IsTerminalDisconnected()) {
		idleType = 4; idle = true;
	}

	if (IdleObject_IsPrivacy(obj))
		flags |= IDF_PRIVACY;

	if ( !IdleObject_IsIdle(obj) && idle) {
		IdleObject_SetIdle(obj);
		obj->idleType = idleType;
		NotifyEventHooks(hIdleEvent, 0, IDF_ISIDLE | flags);
	}
	if (IdleObject_IsIdle(obj) && !idle) {
		IdleObject_ClearIdle(obj);
		obj->idleType = 0;
		NotifyEventHooks(hIdleEvent, 0, flags);
}	}
示例#6
0
int PGE_Window::SDL_ToggleFS(SDL_Window *win)
{
    if(!win)
        win=window;

    if (IsFullScreen(win))
    {
        // Swith to WINDOWED mode
        if (SDL_SetWindowFullscreen(win, SDL_FALSE) < 0)
      {
         std::cout<<"Setting windowed failed : "<<SDL_GetError()<<std::endl;
         return -1;
      }

        return 0;
    }

    // Swith to FULLSCREEN mode
    if (SDL_SetWindowFullscreen(win, SDL_TRUE) < 0)
   {
      std::cout<<"Setting fullscreen failed : "<<SDL_GetError()<<std::endl;
      return -1;
   }

   return 1;
}
void GlSpectrumAnalyzerWindow::MessageReceived(BMessage *message)
{
	switch(message->what)
	{
	case 'file':
		{
			const char *oldname = name;
			const char *newname = message->FindString("name");
			name = strdup(newname?newname:"");
			free((void*)oldname);
		}
		break;
			
	case GO_FULLSCREEN:
		SetFullScreen( !IsFullScreen() );
//		ResizeBy(0,0);
		needResize = true;
		break;

	case B_KEY_DOWN:
		{
			const char *bytes = message->FindString( "bytes" );
			if (bytes[0] == B_ESCAPE && bytes[1] == '\0')
				PostMessage(B_QUIT_REQUESTED);
			else
				BDirectGLWindow::MessageReceived(message);
		}
		break;

	default:
		BDirectGLWindow::MessageReceived(message);
		break;
	}
}
示例#8
0
int PGE_Window::SDL_ToggleFS(SDL_Window *win)
{
    if(!win)
        win=window;

    if (IsFullScreen(win))
    {
        //Show mouse cursor
        if(showCursor)
            SDL_ShowCursor(SDL_ENABLE);

        // Swith to WINDOWED mode
        if (SDL_SetWindowFullscreen(win, SDL_FALSE) < 0)
        {
            qDebug() <<"Setting windowed failed : "<<SDL_GetError();
            return -1;
        }
        return 0;
    }

    // Swith to FULLSCREEN mode
    if (SDL_SetWindowFullscreen(win, SDL_WINDOW_FULLSCREEN_DESKTOP) < 0)
    {
        //Hide mouse cursor in full screen mdoe
        qDebug() <<"Setting fullscreen failed : "<<SDL_GetError();
        return -1;
    }
    SDL_ShowCursor(SDL_DISABLE);
    return 1;
}
示例#9
0
void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
{
#ifdef __linux__
	// Important Linux note: When the title is set in fullscreen the window is redrawn. Unfortunately
	// an intermediate white screen appears too which leads to a very annoying flickering.
	if (IsFullScreen()) return;
#endif
	AppConfig::UiTemplateOptions& templates = g_Conf->Templates;

	double fps = wxGetApp().FpsManager.GetFramerate();
	// The "not PAL" case covers both Region_NTSC and Region_NTSC_PROGRESSIVE
	float per = gsRegionMode == Region_PAL ? (fps * 100) / EmuConfig.GS.FrameratePAL.ToFloat() : (fps * 100) / EmuConfig.GS.FramerateNTSC.ToFloat();

	char gsDest[128];
	gsDest[0] = 0; // No need to set whole array to NULL.
	GSgetTitleInfo2( gsDest, sizeof(gsDest) );

	wxString limiterStr = templates.LimiterUnlimited;

	if( g_Conf->EmuOptions.GS.FrameLimitEnable )
	{
		switch( g_LimiterMode )
		{
			case Limit_Nominal:	limiterStr = templates.LimiterNormal; break;
			case Limit_Turbo:	limiterStr = templates.LimiterTurbo; break;
			case Limit_Slomo:	limiterStr = templates.LimiterSlowmo; break;
		}
	}

	FastFormatUnicode cpuUsage;
	if (m_CpuUsage.IsImplemented()) {
		m_CpuUsage.UpdateStats();

		cpuUsage.Write(L"EE: %3d%%", m_CpuUsage.GetEEcorePct());
		cpuUsage.Write(L" | GS: %3d%%", m_CpuUsage.GetGsPct());

		if (THREAD_VU1)
			cpuUsage.Write(L" | VU: %3d%%", m_CpuUsage.GetVUPct());

		pxNonReleaseCode(cpuUsage.Write(L" | UI: %3d%%", m_CpuUsage.GetGuiPct()));
	}

	const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);
	wxString omodef = (smode2 & 2) ? templates.OutputFrame : templates.OutputField;
	wxString omodei = (smode2 & 1) ? templates.OutputInterlaced : templates.OutputProgressive;

	wxString title = templates.TitleTemplate;
	title.Replace(L"${slot}",		pxsFmt(L"%d", States_GetCurrentSlot()));
	title.Replace(L"${limiter}",	limiterStr);
	title.Replace(L"${speed}",		pxsFmt(L"%3d%%", lround(per)));
	title.Replace(L"${vfps}",		pxsFmt(L"%.02f", fps));
	title.Replace(L"${cpuusage}",	cpuUsage);
	title.Replace(L"${omodef}",		omodef);
	title.Replace(L"${omodei}",		omodei);
	title.Replace(L"${gsdx}",		fromUTF8(gsDest));
	if (CoreThread.IsPaused())
		title = templates.Paused + title;

	SetTitle(title);
}
示例#10
0
int PGE_Window::setFullScreen(bool fs)
{
    if(window==NULL) return -1;
    if(fs != IsFullScreen(window))
    {
        if(fs)
        {
            // Swith to FULLSCREEN mode
            if (SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP) < 0)
            {
                //Hide mouse cursor in full screen mdoe
                qDebug() <<"Setting fullscreen failed : "<<SDL_GetError();
                return -1;
            }
            SDL_ShowCursor(SDL_DISABLE);
            return 1;
        }
        else
        {
            //Show mouse cursor
            if(showCursor)
                SDL_ShowCursor(SDL_ENABLE);

            // Swith to WINDOWED mode
            if (SDL_SetWindowFullscreen(window, SDL_FALSE) < 0)
            {
                qDebug() <<"Setting windowed failed : "<<SDL_GetError();
                return -1;
            }
            return 0;
        }
    }
    return 0;
}
示例#11
0
/*****************************************************************************
 * VideoWindow::_SetToSettings
 *****************************************************************************/
void
VideoWindow::_SetToSettings()
{
    // adjust dimensions
    uint32_t mode = RESIZE_100;
    switch (fSettings->VideoSize())
    {
        case VideoSettings::SIZE_50:
            mode = RESIZE_50;
            break;
        case VideoSettings::SIZE_200:
            mode = RESIZE_200;
            break;
        case VideoSettings::SIZE_100:
        case VideoSettings::SIZE_OTHER:
        default:
            break;
    }
    bool fullscreen = IsFullScreen();    // remember settings
    _SetVideoSize(mode);                // because this will reset settings
    // the fullscreen status is reflected in the settings,
    // but not yet in the windows state
    if (fullscreen)
        SetFullScreen(true);
    if (fSettings->HasFlags(VideoSettings::FLAG_ON_TOP_ALL))
        fCachedFeel = B_FLOATING_ALL_WINDOW_FEEL;
    else
        fCachedFeel = B_NORMAL_WINDOW_FEEL;
    SetFeel(fCachedFeel);
}
示例#12
0
/*****************************************************************************
 * VideoWindow::FrameResized
 *****************************************************************************/
void
VideoWindow::FrameResized( float width, float height )
{
    int32_t useWidth = CorrectAspectRatio() ? i_width : fTrueWidth;
    int32_t useHeight = CorrectAspectRatio() ? i_height : fTrueHeight;
    float out_width, out_height;
    float out_left, out_top;
    float width_scale = width / useWidth;
    float height_scale = height / useHeight;

    if (width_scale <= height_scale)
    {
        out_width = (useWidth * width_scale);
        out_height = (useHeight * width_scale);
        out_left = 0;
        out_top = (height - out_height) / 2;
    }
    else   /* if the height is proportionally smaller */
    {
        out_width = (useWidth * height_scale);
        out_height = (useHeight * height_scale);
        out_top = 0;
        out_left = (width - out_width) / 2;
    }
    view->MoveTo(out_left,out_top);
    view->ResizeTo(out_width, out_height);

    if (!IsFullScreen())
        winSize = Frame();
}
示例#13
0
/*****************************************************************************
 * VideoWindow::FrameMoved
 *****************************************************************************/
void
VideoWindow::FrameMoved(BPoint origin)
{
    if (IsFullScreen())
        return ;
    winSize = Frame();
}
示例#14
0
HRESULT FMPlayerDShow::Start()
{
	HRESULT hr = E_FAIL; 

	CComQIPtr<IFilterGraph> pFilterGraph = m_FilterGraph; 

	if (pFilterGraph == NULL)
		return E_FAIL; 


	m_MediaEvent = pFilterGraph; 
	m_pBV		 = pFilterGraph; 

	BOOL bIsFullScreen = IsFullScreen(); 
	SetParentWnd(m_hWndParent); 

	if (bIsFullScreen)
		SetFullScreen(TRUE); 

	if (m_MediaControl != NULL)
	{
		hr = SeekPosition(m_Offset);
		m_Offset = 0; 
	}
	return hr; 
}
示例#15
0
void wxTopLevelWindowGTK::GTKUpdateDecorSize(const DecorSize& decorSize)
{
    if (!IsMaximized() && !IsFullScreen())
        GetCachedDecorSize() = decorSize;
    if (m_updateDecorSize && memcmp(&m_decorSize, &decorSize, sizeof(DecorSize)))
    {
        m_useCachedClientSize = false;
        const wxSize diff(
            decorSize.left - m_decorSize.left + decorSize.right - m_decorSize.right,
            decorSize.top - m_decorSize.top + decorSize.bottom - m_decorSize.bottom);
        m_decorSize = decorSize;
        bool resized = false;
        if (m_minWidth > 0 || m_minHeight > 0 || m_maxWidth > 0 || m_maxHeight > 0)
        {
            // update size hints, they depend on m_decorSize
            DoSetSizeHints(m_minWidth, m_minHeight, m_maxWidth, m_maxHeight, m_incWidth, m_incHeight);
        }
        if (m_deferShow)
        {
            // keep overall size unchanged by shrinking m_widget
            int w, h;
            GTKDoGetSize(&w, &h);
            // but not if size would be less than minimum, it won't take effect
            if (w >= m_minWidth - (decorSize.left + decorSize.right) &&
                h >= m_minHeight - (decorSize.top + decorSize.bottom))
            {
                gtk_window_resize(GTK_WINDOW(m_widget), w, h);
                if (!gtk_window_get_resizable(GTK_WINDOW(m_widget)))
                    gtk_widget_set_size_request(GTK_WIDGET(m_widget), w, h);
                resized = true;
            }
        }
        if (!resized)
        {
            // adjust overall size to match change in frame extents
            m_width  += diff.x;
            m_height += diff.y;
            if (m_width  < 1) m_width  = 1;
            if (m_height < 1) m_height = 1;
            m_clientWidth = 0;
            gtk_widget_queue_resize(m_wxwindow);
        }
    }
    if (m_deferShow)
    {
        // gtk_widget_show() was deferred, do it now
        m_deferShow = false;
        DoGetClientSize(&m_clientWidth, &m_clientHeight);
        wxSizeEvent sizeEvent(GetSize(), GetId());
        sizeEvent.SetEventObject(this);
        HandleWindowEvent(sizeEvent);

        gtk_widget_show(m_widget);

        wxShowEvent showEvent(GetId(), true);
        showEvent.SetEventObject(this);
        HandleWindowEvent(showEvent);
    }
}
示例#16
0
void VLCWindowsManager::ToggleFullScreen()
{
    if( IsFullScreen() ) {
        EndFullScreen();
    } else {
        StartFullScreen();
    }
}
示例#17
0
void CMainFrame::OnFullScreen()
{
    ShowFullScreen();

    if (!IsFullScreen ())
    {
        AdjustClientArea ();
    }
}
示例#18
0
文件: GSFrame.cpp 项目: Apicio/rpcs3
void GSFrame::OnKeyDown(wxKeyEvent& event)
{
	switch (event.GetKeyCode())
	{
	case WXK_RETURN: if (event.AltDown()) { OnFullScreen(); return; } break;
	case WXK_ESCAPE: if (IsFullScreen()) { ShowFullScreen(false); return; } break;
	}
	event.Skip();
}
示例#19
0
void GSFrame::OnUpdateTitle( wxTimerEvent& evt )
{
#ifdef __linux__
    // Important Linux note: When the title is set in fullscreen the window is redrawn. Unfortunately
    // an intermediate white screen appears too which leads to a very annoying flickering.
    if (IsFullScreen()) return;
#endif

    double fps = wxGetApp().FpsManager.GetFramerate();

    char gsDest[128];
    GSgetTitleInfo2( gsDest, sizeof(gsDest) );

    const wxChar* limiterStr = L"None";

    if( g_Conf->EmuOptions.GS.FrameLimitEnable )
    {
        switch( g_LimiterMode )
        {
        case Limit_Nominal:
            limiterStr = L"Normal";
            break;
        case Limit_Turbo:
            limiterStr = L"Turbo";
            break;
        case Limit_Slomo:
            limiterStr = L"Slomo";
            break;
        }
    }

    FastFormatUnicode cpuUsage;
    if (m_CpuUsage.IsImplemented()) {
        m_CpuUsage.UpdateStats();
        if (THREAD_VU1) { // Display VU thread's usage
            cpuUsage.Write(L" | EE: %3d%% | GS: %3d%% | VU: %3d%% | UI: %3d%%",
                           m_CpuUsage.GetEEcorePct(),	m_CpuUsage.GetGsPct(),
                           m_CpuUsage.GetVUPct(),		m_CpuUsage.GetGuiPct());
        }
        else {
            cpuUsage.Write(L" | EE: %3d%% | GS: %3d%% | UI: %3d%%",
                           m_CpuUsage.GetEEcorePct(),	m_CpuUsage.GetGsPct(),
                           m_CpuUsage.GetGuiPct());
        }
    }

    const u64& smode2 = *(u64*)PS2GS_BASE(GS_SMODE2);

    SetTitle( pxsFmt( L"%s | %ls (%ls) | Limiter: %ls | fps: %6.02f%ls | State %d",
                      WX_STR(fromUTF8(gsDest)),
                      (smode2 & 1) ? L"Interlaced" : L"Progressive",
                      (smode2 & 2) ? L"frame" : L"field",
                      limiterStr, fps, cpuUsage.c_str(), States_GetCurrentSlot() )
            );

    //States_GetCurrentSlot()
}
示例#20
0
文件: MainFrm.cpp 项目: viticm/pap2
void CMainFrame::OnUpdateViewFullScreen(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable();

	if (IsFullScreen())
		pCmdUI->SetCheck();
	else
		pCmdUI->SetCheck(0);

}
示例#21
0
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
    BOOL isFullScreen = IsFullScreen();

    if (!isFullScreen)
    {
        if (pMsg->message == WM_SYSKEYUP)
        {
            BOOL  isCtrlPressed =  (0x8000 & GetKeyState(VK_CONTROL)) != 0;
            BOOL  isShiftPressed = (0x8000 & GetKeyState(VK_SHIFT)) != 0;

            if (pMsg->wParam == VK_MENU ||
                    (pMsg->wParam == VK_F10 && !isCtrlPressed && !isShiftPressed))
            {
                if (m_wndMenuBar.IsTempVisible ())
                {
                    OnViewMenuBar();
                }
                else if (!m_wndMenuBar.IsWindowVisible ())
                {
                    OnViewMenuBar();
                    m_wndMenuBar.SetFocus ();
                    m_wndMenuBar.SetTempVisible (TRUE);
                    return TRUE;
                }
            }
        }
    }

    BOOL bRes = CMDIFrameWnd::PreTranslateMessage(pMsg);

    if (isFullScreen)
    {
        if (pMsg->message == WM_KEYDOWN &&
                pMsg->wParam == VK_ESCAPE && !IsFullScreen())
        {
            AdjustClientArea ();
        }
    }

    return bRes;
}
示例#22
0
文件: MainFrm.cpp 项目: viticm/pap2
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) 
{
	if (IsFullScreen())
	{
		lpMMI->ptMaxSize.y = m_FullScreenWindowRect.Height();
		lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y;
		lpMMI->ptMaxSize.x = m_FullScreenWindowRect.Width();
		lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x;
	}

}
示例#23
0
void PqwxFrame::OnCloseFrame(wxCloseEvent& event) {
  if (event.CanVeto()) {
    if (!documentsBook->ConfirmCloseAll()) {
      event.Veto();
      return;
    }
  }
  if (!IsFullScreen())
    SaveFrameGeometry();
  Destroy();
}
//****************************************************************************************
void CBCGPFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
    if (IsFullScreen ())
    {
        m_Impl.m_FullScreenMgr.OnGetMinMaxInfo (lpMMI);
    }
    else
    {
        m_Impl.OnGetMinMaxInfo (lpMMI);
        CFrameWnd::OnGetMinMaxInfo (lpMMI);
    }
}
示例#25
0
static bool DoAddPopup(POPUPDATAT *data)
{
	if (ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (DWORD)TlsGetValue(itlsSettings)) && IsFullScreen()) {
		HWND handle = CreateWindowEx(WS_EX_TOOLWINDOW, TEMP_WINDOW_CLASS_NAME, NULL, WS_OVERLAPPED | WS_VISIBLE, -100, -100, 10, 10, 0, 0, 0, 0);
		if (handle) {
			ShowWindow(handle, SW_MINIMIZE);
			ShowWindow(handle, SW_RESTORE);
		}
		DestroyWindow(handle);
	}

	return PUAddPopupT(data) == 0;
}
示例#26
0
void PGE_Window::setCursorVisibly(bool viz)
{
    showCursor=viz;
    if(window!=NULL)
    {
        if(!IsFullScreen(window))
        {
            if(showCursor)
                SDL_ShowCursor(SDL_ENABLE);
            else
                SDL_ShowCursor(SDL_DISABLE);
        }
    }
}
示例#27
0
/*	FUNCTION:		MainWindow :: MessageReceived
	ARGUMENTS:		message
	RETURN:			n/a
	DESCRIPTION:	Called by BeOS
*/
void MainWindow :: MessageReceived(BMessage *message)
{
    switch (message->what)
    {
    case MSG_FULLSCREEN:
        SetFullScreen(!IsFullScreen());
        break;

    /*	TODO - Due to a bug when creating a 2nd BGLView in Haiku, I've decided to spawn a new window
    	instead of creating a new BGLView (and using AddChild(new_view) / RemoveChild(old_view).
    	Under Zeta, there is no problem replacing the current view with a new view.
    */

    case MSG_SHAPE_BOOK:
        new MainWindow(BRect(50, 50, 400+50, 300+50), BOOK);
        break;

    case MSG_SHAPE_CUBE:
        new MainWindow(BRect(50, 50, 400+50, 300+50), CUBE);
        break;

    case MSG_SHAPE_SPHERE:
        new MainWindow(BRect(50, 50, 400+50, 300+50), SPHERE);
        break;

    case MSG_OPTION_WIREFRAME:
        fOptionWireframe = !fOptionWireframe;
        fCurrentView->ToggleWireframe(fOptionWireframe);
        break;

    case 'DATA':	// user drag/dropped file from Tracker
    {
        BPoint point;
        message->FindPoint("_drop_point_", &point);
        BRect frame = Frame();
        point.x -= frame.left;
        point.y -= frame.top;

        entry_ref aRef;
        message->FindRef("refs", &aRef);

        fCurrentView->DragDrop(&aRef, point.x, point.y);
        break;
    }

    default:
        BDirectWindow::MessageReceived(message);
        break;
    }
}
示例#28
0
void MainFrame::OnMenu(wxContextMenuEvent &event)
{
	if (IsFullScreen() && ctx_menu)
	{
		wxPoint p(event.GetPosition());
#if 0 // wx actually recommends ignoring the position

		if (p != wxDefaultPosition)
			p = ScreenToClient(p);

#endif
		PopupMenu(ctx_menu, p);
	}
}
示例#29
0
void FileViewer::ShowStatus()
{
	string strName;
	string strStatus;

	if (!IsTitleBarVisible())
		return;

	GetTitle(strName);
	int NameLength=ScrX-43; //???41

	if (Opt.ViewerEditorClock && IsFullScreen())
		NameLength-=6;

	if (NameLength<20)
		NameLength=20;

	TruncPathStr(strName, NameLength);
	const wchar_t *lpwszStatusFormat = L"%-*s %5u %13I64u %7.7s %-4I64d %s%3d%%";
	strStatus.Format(
	    lpwszStatusFormat,
	    NameLength,
	    strName.CPtr(),
	    View.VM.CodePage,
	    View.FileSize,
	    MSG(MViewerStatusCol),
	    View.LeftPos,
	    Opt.ViewerEditorClock ? L"":L" ",
	    (View.LastPage ? 100:ToPercent64(View.FilePos,View.FileSize))
	);
	SetColor(COL_VIEWERSTATUS);
	GotoXY(X1,Y1);
	FS<<fmt::LeftAlign()<<fmt::Width(View.Width+(View.ViOpt.ShowScrollbar?1:0))<<fmt::Precision(View.Width+(View.ViOpt.ShowScrollbar?1:0))<<strStatus;

	if (Opt.ViewerEditorClock && IsFullScreen())
		ShowTime(FALSE);
}
示例#30
0
void wxTopLevelWindowGTK::GTKUpdateDecorSize(const wxSize& decorSize)
{
    if (!IsMaximized() && !IsFullScreen())
        GetCachedDecorSize() = decorSize;
    if (m_updateDecorSize && m_decorSize != decorSize)
    {
        const wxSize diff = decorSize - m_decorSize;
        m_decorSize = decorSize;
        bool resized = false;
        if (m_deferShow)
        {
            // keep overall size unchanged by shrinking m_widget
            int w, h;
            GTKDoGetSize(&w, &h);
            // but not if size would be less than minimum, it won't take effect
            const wxSize minSize = GetMinSize();
            if (w >= minSize.x && h >= minSize.y)
            {
                gtk_window_resize(GTK_WINDOW(m_widget), w, h);
                resized = true;
            }
        }
        if (!resized)
        {
            // adjust overall size to match change in frame extents
            m_width  += diff.x;
            m_height += diff.y;
            if (m_width  < 0) m_width  = 0;
            if (m_height < 0) m_height = 0;
            m_oldClientWidth = 0;
            gtk_widget_queue_resize(m_wxwindow);
        }
    }
    if (m_deferShow)
    {
        // gtk_widget_show() was deferred, do it now
        m_deferShow = false;
        GetClientSize(&m_oldClientWidth, &m_oldClientHeight);
        wxSizeEvent sizeEvent(GetSize(), GetId());
        sizeEvent.SetEventObject(this);
        HandleWindowEvent(sizeEvent);

        gtk_widget_show(m_widget);

        wxShowEvent showEvent(GetId(), true);
        showEvent.SetEventObject(this);
        HandleWindowEvent(showEvent);
    }
}