Win32: implement support for full-screen graphics window.
This commit is contained in:
parent
d77f617dc4
commit
2e15f60ef6
|
@ -61,6 +61,7 @@ Other new features:
|
||||||
* In expressions, numbers can contain the digit group separator, "_".
|
* In expressions, numbers can contain the digit group separator, "_".
|
||||||
* The "=" key is bound to "Zoom In", like "+" key.
|
* The "=" key is bound to "Zoom In", like "+" key.
|
||||||
* The numpad decimal separator key is bound to "." regardless of locale.
|
* The numpad decimal separator key is bound to "." regardless of locale.
|
||||||
|
* On Windows, full-screen mode is implemented.
|
||||||
|
|
||||||
Bugs fixed:
|
Bugs fixed:
|
||||||
* A point in 3d constrained to any line whose length is free no longer
|
* A point in 3d constrained to any line whose length is free no longer
|
||||||
|
|
|
@ -81,10 +81,8 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = {
|
||||||
{ 1, NULL, Command::NONE, 0, TN, NULL },
|
{ 1, NULL, Command::NONE, 0, TN, NULL },
|
||||||
{ 1, N_("Dimensions in &Inches"), Command::UNITS_INCHES, 0, TR, mView },
|
{ 1, N_("Dimensions in &Inches"), Command::UNITS_INCHES, 0, TR, mView },
|
||||||
{ 1, N_("Dimensions in &Millimeters"), Command::UNITS_MM, 0, TR, mView },
|
{ 1, N_("Dimensions in &Millimeters"), Command::UNITS_MM, 0, TR, mView },
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
|
||||||
{ 1, NULL, Command::NONE, 0, TN, NULL },
|
{ 1, NULL, Command::NONE, 0, TN, NULL },
|
||||||
{ 1, N_("&Full Screen"), Command::FULL_SCREEN, C|F(11), TC, mView },
|
{ 1, N_("&Full Screen"), Command::FULL_SCREEN, C|F(11), TC, mView },
|
||||||
#endif
|
|
||||||
|
|
||||||
{ 0, N_("&New Group"), Command::NONE, 0, TN, NULL },
|
{ 0, N_("&New Group"), Command::NONE, 0, TN, NULL },
|
||||||
{ 1, N_("Sketch In &3d"), Command::GROUP_3D, S|'3', TN, mGrp },
|
{ 1, N_("Sketch In &3d"), Command::GROUP_3D, S|'3', TN, mGrp },
|
||||||
|
@ -685,9 +683,7 @@ void GraphicsWindow::EnsureValidActives() {
|
||||||
CheckMenuByCmd(Command::SHOW_TOOLBAR, /*checked=*/SS.showToolbar);
|
CheckMenuByCmd(Command::SHOW_TOOLBAR, /*checked=*/SS.showToolbar);
|
||||||
CheckMenuByCmd(Command::PERSPECTIVE_PROJ, /*checked=*/SS.usePerspectiveProj);
|
CheckMenuByCmd(Command::PERSPECTIVE_PROJ, /*checked=*/SS.usePerspectiveProj);
|
||||||
CheckMenuByCmd(Command::SHOW_GRID,/*checked=*/SS.GW.showSnapGrid);
|
CheckMenuByCmd(Command::SHOW_GRID,/*checked=*/SS.GW.showSnapGrid);
|
||||||
#if defined(__unix__) || defined(__APPLE__)
|
|
||||||
CheckMenuByCmd(Command::FULL_SCREEN, /*checked=*/FullScreenIsActive());
|
CheckMenuByCmd(Command::FULL_SCREEN, /*checked=*/FullScreenIsActive());
|
||||||
#endif
|
|
||||||
|
|
||||||
if(change) SS.ScheduleShowTW();
|
if(change) SS.ScheduleShowTW();
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,12 +850,34 @@ void SolveSpace::InvalidateGraphics()
|
||||||
|
|
||||||
void SolveSpace::ToggleFullScreen()
|
void SolveSpace::ToggleFullScreen()
|
||||||
{
|
{
|
||||||
// Implement me
|
static WINDOWPLACEMENT wp;
|
||||||
|
wp.length = sizeof(wp);
|
||||||
|
|
||||||
|
DWORD dwStyle = GetWindowLong(GraphicsWnd, GWL_STYLE);
|
||||||
|
if(dwStyle & WS_OVERLAPPEDWINDOW) {
|
||||||
|
MONITORINFO mi;
|
||||||
|
mi.cbSize = sizeof(mi);
|
||||||
|
|
||||||
|
if(GetWindowPlacement(GraphicsWnd, &wp) &&
|
||||||
|
GetMonitorInfo(MonitorFromWindow(GraphicsWnd, MONITOR_DEFAULTTOPRIMARY), &mi)) {
|
||||||
|
SetWindowLong(GraphicsWnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
|
||||||
|
SetWindowPos(GraphicsWnd, HWND_TOP,
|
||||||
|
mi.rcMonitor.left, mi.rcMonitor.top,
|
||||||
|
mi.rcMonitor.right - mi.rcMonitor.left,
|
||||||
|
mi.rcMonitor.bottom - mi.rcMonitor.top,
|
||||||
|
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SetWindowLong(GraphicsWnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
|
||||||
|
SetWindowPlacement(GraphicsWnd, &wp);
|
||||||
|
SetWindowPos(GraphicsWnd, NULL, 0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
|
||||||
|
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool SolveSpace::FullScreenIsActive()
|
bool SolveSpace::FullScreenIsActive()
|
||||||
{
|
{
|
||||||
// Implement me
|
return GetWindowLong(GraphicsWnd, GWL_STYLE) & WS_OVERLAPPEDWINDOW;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SolveSpace::InvalidateText()
|
void SolveSpace::InvalidateText()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user