2009-09-29 13:14:47 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// For the configuration screen, setup items that are not specific to the
|
|
|
|
// file being edited right now.
|
2013-07-28 22:08:34 +00:00
|
|
|
//
|
|
|
|
// Copyright 2008-2013 Jonathan Westhues.
|
2009-09-29 13:14:47 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#include "solvespace.h"
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeLightDirection(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%.2f, %.2f, %.2f", CO(SS.lightDir[v]));
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(29+2*v, 8, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_LIGHT_DIRECTION;
|
|
|
|
SS.TW.edit.i = v;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeLightIntensity(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%.2f", SS.lightIntensity[v]);
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(29+2*v, 31, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_LIGHT_INTENSITY;
|
|
|
|
SS.TW.edit.i = v;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeColor(int link, uint32_t v) {
|
2010-07-21 05:04:03 +00:00
|
|
|
SS.TW.ShowEditControlWithColorPicker(9+2*v, 13, SS.modelColor[v]);
|
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_COLOR;
|
|
|
|
SS.TW.edit.i = v;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeChordTolerance(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%.2f", SS.chordTol);
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(37, 3, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_CHORD_TOLERANCE;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeMaxSegments(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%d", SS.maxSegments);
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(41, 3, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_MAX_SEGMENTS;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeCameraTangent(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%.3f", 1000*SS.cameraTangent);
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(47, 3, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_CAMERA_TANGENT;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeGridSpacing(int link, uint32_t v) {
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(51, 3, SS.MmToString(SS.gridSpacing));
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_GRID_SPACING;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeDigitsAfterDecimal(int link, uint32_t v) {
|
2010-09-24 02:58:34 +00:00
|
|
|
char buf[128];
|
|
|
|
sprintf(buf, "%d", SS.UnitDigitsAfterDecimal());
|
|
|
|
SS.TW.ShowEditControl(55, 3, buf);
|
|
|
|
SS.TW.edit.meaning = EDIT_DIGITS_AFTER_DECIMAL;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeExportScale(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
char str[1024];
|
|
|
|
sprintf(str, "%.3f", (double)SS.exportScale);
|
|
|
|
|
2010-09-24 02:58:34 +00:00
|
|
|
SS.TW.ShowEditControl(61, 5, str);
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_EXPORT_SCALE;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeExportOffset(int link, uint32_t v) {
|
2010-09-24 02:58:34 +00:00
|
|
|
SS.TW.ShowEditControl(65, 3, SS.MmToString(SS.exportOffset));
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_EXPORT_OFFSET;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeFixExportColors(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.fixExportColors = !SS.fixExportColors;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeBackFaces(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.drawBackFaces = !SS.drawBackFaces;
|
|
|
|
InvalidateGraphics();
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeCheckClosedContour(int link, uint32_t v) {
|
2009-10-01 10:35:11 +00:00
|
|
|
SS.checkClosedContour = !SS.checkClosedContour;
|
|
|
|
InvalidateGraphics();
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeShadedTriangles(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.exportShadedTriangles = !SS.exportShadedTriangles;
|
|
|
|
InvalidateGraphics();
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangePwlCurves(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.exportPwlCurves = !SS.exportPwlCurves;
|
|
|
|
InvalidateGraphics();
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeCanvasSizeAuto(int link, uint32_t v) {
|
2010-05-09 18:25:23 +00:00
|
|
|
if(link == 't') {
|
|
|
|
SS.exportCanvasSizeAuto = true;
|
|
|
|
} else {
|
|
|
|
SS.exportCanvasSizeAuto = false;
|
|
|
|
}
|
2009-09-29 13:14:47 +00:00
|
|
|
InvalidateGraphics();
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeCanvasSize(int link, uint32_t v) {
|
2009-09-29 13:14:47 +00:00
|
|
|
double d;
|
|
|
|
switch(v) {
|
|
|
|
case 0: d = SS.exportMargin.left; break;
|
|
|
|
case 1: d = SS.exportMargin.right; break;
|
|
|
|
case 2: d = SS.exportMargin.bottom; break;
|
|
|
|
case 3: d = SS.exportMargin.top; break;
|
|
|
|
|
|
|
|
case 10: d = SS.exportCanvas.width; break;
|
|
|
|
case 11: d = SS.exportCanvas.height; break;
|
|
|
|
case 12: d = SS.exportCanvas.dx; break;
|
|
|
|
case 13: d = SS.exportCanvas.dy; break;
|
|
|
|
|
|
|
|
default: return;
|
|
|
|
}
|
2010-09-24 02:58:34 +00:00
|
|
|
int row = 81, col;
|
2009-09-29 13:14:47 +00:00
|
|
|
if(v < 10) {
|
|
|
|
row += v*2;
|
|
|
|
col = 11;
|
|
|
|
} else {
|
|
|
|
row += (v - 10)*2;
|
|
|
|
col = 13;
|
|
|
|
}
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(row, col, SS.MmToString(d));
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_CANVAS_SIZE;
|
|
|
|
SS.TW.edit.i = v;
|
|
|
|
}
|
|
|
|
|
Use C99 integer types and C++ boolean types/values
This change comprehensively replaces the use of Microsoft-standard integer
and boolean types with their C99/C++ standard equivalents, as the latter is
more appropriate for a cross-platform application. With matter-of-course
exceptions in the Win32-specific code, the types/values have been converted
as follows:
QWORD --> uint64_t
SQWORD --> int64_t
DWORD --> uint32_t
SDWORD --> int32_t
WORD --> uint16_t
SWORD --> int16_t
BYTE --> uint8_t
BOOL --> bool
TRUE --> true
FALSE --> false
The following related changes are also included:
* Added C99 integer type definitions for Windows, as stdint.h is not
available prior to Visual Studio 2010
* Changed types of some variables in the SolveSpace class from 'int' to
'bool', as they actually represent boolean settings
* Implemented new Cnf{Freeze,Thaw}Bool() functions to support boolean
variables in the Registry
* Cnf{Freeze,Thaw}DWORD() are now Cnf{Freeze,Thaw}Int()
* TtfFont::Get{WORD,DWORD}() are now TtfFont::Get{USHORT,ULONG}() (names
inspired by the OpenType spec)
* RGB colors are packed into an integer of type uint32_t (nee DWORD), but
in a few places, these were represented by an int; these have been
corrected to uint32_t
2013-10-02 05:45:13 +00:00
|
|
|
void TextWindow::ScreenChangeGCodeParameter(int link, uint32_t v) {
|
2015-11-06 08:40:12 +00:00
|
|
|
std::string buf;
|
2010-09-24 02:58:34 +00:00
|
|
|
int row = 93;
|
2010-01-14 04:47:17 +00:00
|
|
|
switch(link) {
|
|
|
|
case 'd':
|
|
|
|
SS.TW.edit.meaning = EDIT_G_CODE_DEPTH;
|
2015-11-06 08:40:12 +00:00
|
|
|
buf += SS.MmToString(SS.gCode.depth);
|
2010-01-14 04:47:17 +00:00
|
|
|
row += 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
SS.TW.edit.meaning = EDIT_G_CODE_PASSES;
|
2015-11-06 08:40:12 +00:00
|
|
|
buf += std::to_string(SS.gCode.passes);
|
2010-01-14 04:47:17 +00:00
|
|
|
row += 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'F':
|
|
|
|
SS.TW.edit.meaning = EDIT_G_CODE_FEED;
|
2015-11-06 08:40:12 +00:00
|
|
|
buf += SS.MmToString(SS.gCode.feed);
|
2010-01-14 04:47:17 +00:00
|
|
|
row += 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'P':
|
|
|
|
SS.TW.edit.meaning = EDIT_G_CODE_PLUNGE_FEED;
|
2015-11-06 08:40:12 +00:00
|
|
|
buf += SS.MmToString(SS.gCode.plungeFeed);
|
2010-01-14 04:47:17 +00:00
|
|
|
row += 6;
|
|
|
|
break;
|
|
|
|
}
|
2010-07-12 07:51:12 +00:00
|
|
|
SS.TW.ShowEditControl(row, 14, buf);
|
2010-01-14 04:47:17 +00:00
|
|
|
}
|
|
|
|
|
2015-03-29 04:46:57 +00:00
|
|
|
void TextWindow::ScreenChangeAutosaveInterval(int link, uint32_t v) {
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.TW.ShowEditControl(111, 3, std::to_string(SS.autosaveInterval));
|
2015-03-29 04:46:57 +00:00
|
|
|
SS.TW.edit.meaning = EDIT_AUTOSAVE_INTERVAL;
|
|
|
|
}
|
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
void TextWindow::ShowConfiguration(void) {
|
|
|
|
int i;
|
2010-08-14 19:00:25 +00:00
|
|
|
Printf(true, "%Ft user color (r, g, b)");
|
2015-03-29 00:30:52 +00:00
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
for(i = 0; i < SS.MODEL_COLORS; i++) {
|
Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)
Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.
RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.
(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)
Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.
(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)
In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-16 20:00:58 +00:00
|
|
|
Printf(false, "%Bp #%d: %Bz %Bp (%@, %@, %@) %f%D%Ll%Fl[change]%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
(i & 1) ? 'd' : 'a',
|
Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)
Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.
RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.
(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)
Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.
(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)
In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-16 20:00:58 +00:00
|
|
|
i, &SS.modelColor[i],
|
2009-09-29 13:14:47 +00:00
|
|
|
(i & 1) ? 'd' : 'a',
|
Replaced RGB-color integers with dedicated data structure
RGB colors were represented using a uint32_t with the red, green and blue
values stuffed into the lower three octets (i.e. 0x00BBGGRR), like
Microsoft's COLORREF. This approach did not lend itself to type safety,
however, so this change replaces it with an RgbColor class that provides
the same infomation plus a handful of useful methods to work with it. (Note
that sizeof(RgbColor) == sizeof(uint32_t), so this change should not lead
to memory bloat.)
Some of the new methods/fields replace what were previously macro calls;
e.g. RED(c) is now c.red, REDf(c) is now c.redF(). The .Equals() method is
now used instead of == to compare colors.
RGB colors still need to be represented as packed integers in file I/O and
preferences, so the methods .FromPackedInt() and .ToPackedInt() are
provided. Also implemented are Cnf{Freeze,Thaw}Color(), type-safe wrappers
around Cnf{Freeze,Thaw}Int() that facilitate I/O with preferences.
(Cnf{Freeze,Thaw}Color() are defined outside of the system-dependent code
to minimize the footprint of the latter; because the same can be done with
Cnf{Freeze,Thaw}Bool(), those are also moved out of the system code with
this commit.)
Color integers were being OR'ed with 0x80000000 in some places for two
distinct purposes: One, to indicate use of a default color in
glxFillMesh(); this has been replaced by use of the .UseDefault() method.
Two, to indicate to TextWindow::Printf() that the format argument of a
"%Bp"/"%Fp" specifier is an RGB color rather than a color "code" from
TextWindow::bgColors[] or TextWindow::fgColors[] (as the specifier can
accept either); instead, we define a new flag "z" (as in "%Bz" or "%Fz") to
indicate an RGBcolor pointer, leaving "%Bp"/"%Fp" to indicate a color code
exclusively.
(This also allows TextWindow::meta[][].bg to be a char instead of an int,
partly compensating for the new .bgRgb field added immediately after.)
In array declarations, RGB colors could previously be specified as 0 (often
in a terminating element). As that no longer works, we define NULL_COLOR,
which serves much the same purpose for RgbColor variables as NULL serves
for pointers.
2013-10-16 20:00:58 +00:00
|
|
|
SS.modelColor[i].redF(),
|
|
|
|
SS.modelColor[i].greenF(),
|
|
|
|
SS.modelColor[i].blueF(),
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeColor, i);
|
|
|
|
}
|
2015-03-29 00:30:52 +00:00
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft light direction intensity");
|
|
|
|
for(i = 0; i < 2; i++) {
|
|
|
|
Printf(false, "%Bp #%d (%2,%2,%2)%Fl%D%f%Ll[c]%E "
|
|
|
|
"%2 %Fl%D%f%Ll[c]%E",
|
|
|
|
(i & 1) ? 'd' : 'a', i,
|
|
|
|
CO(SS.lightDir[i]), i, &ScreenChangeLightDirection,
|
|
|
|
SS.lightIntensity[i], i, &ScreenChangeLightIntensity);
|
|
|
|
}
|
|
|
|
|
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft chord tolerance (in screen pixels)%E");
|
2009-09-30 10:02:15 +00:00
|
|
|
Printf(false, "%Ba %@ %Fl%Ll%f%D[change]%E; now %d triangles",
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.chordTol,
|
|
|
|
&ScreenChangeChordTolerance, 0,
|
|
|
|
SK.GetGroup(SS.GW.activeGroup)->displayMesh.l.n);
|
|
|
|
Printf(false, "%Ft max piecewise linear segments%E");
|
2009-09-30 10:02:15 +00:00
|
|
|
Printf(false, "%Ba %d %Fl%Ll%f[change]%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.maxSegments,
|
|
|
|
&ScreenChangeMaxSegments);
|
|
|
|
|
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft perspective factor (0 for parallel)%E");
|
2009-09-30 10:02:15 +00:00
|
|
|
Printf(false, "%Ba %# %Fl%Ll%f%D[change]%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.cameraTangent*1000,
|
|
|
|
&ScreenChangeCameraTangent, 0);
|
|
|
|
Printf(false, "%Ft snap grid spacing%E");
|
|
|
|
Printf(false, "%Ba %s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.gridSpacing).c_str(),
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeGridSpacing, 0);
|
2010-09-24 02:58:34 +00:00
|
|
|
Printf(false, "%Ft digits after decimal point to show%E");
|
|
|
|
Printf(false, "%Ba %d %Fl%Ll%f%D[change]%E (e.g. '%s')",
|
|
|
|
SS.UnitDigitsAfterDecimal(),
|
|
|
|
&ScreenChangeDigitsAfterDecimal, 0,
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.StringToMm("1.23456789")).c_str());
|
2009-09-29 13:14:47 +00:00
|
|
|
|
|
|
|
Printf(false, "");
|
2009-10-12 09:28:34 +00:00
|
|
|
Printf(false, "%Ft export scale factor (1:1=mm, 1:25.4=inch)");
|
|
|
|
Printf(false, "%Ba 1:%# %Fl%Ll%f%D[change]%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
(double)SS.exportScale,
|
|
|
|
&ScreenChangeExportScale, 0);
|
|
|
|
Printf(false, "%Ft cutter radius offset (0=no offset) ");
|
|
|
|
Printf(false, "%Ba %s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportOffset).c_str(),
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeExportOffset, 0);
|
|
|
|
|
|
|
|
Printf(false, "");
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%Ll%s export shaded 2d triangles%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeShadedTriangles,
|
2010-05-09 18:25:23 +00:00
|
|
|
SS.exportShadedTriangles ? CHECK_TRUE : CHECK_FALSE);
|
2009-09-29 13:14:47 +00:00
|
|
|
if(fabs(SS.exportOffset) > LENGTH_EPS) {
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%s curves as piecewise linear%E "
|
2010-05-09 18:25:23 +00:00
|
|
|
"(since cutter radius is not zero)", CHECK_TRUE);
|
2009-09-29 13:14:47 +00:00
|
|
|
} else {
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%Ll%s export curves as piecewise linear%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangePwlCurves,
|
2010-05-09 18:25:23 +00:00
|
|
|
SS.exportPwlCurves ? CHECK_TRUE : CHECK_FALSE);
|
2009-09-29 13:14:47 +00:00
|
|
|
}
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%Ll%s fix white exported lines%E",
|
2010-09-24 02:58:34 +00:00
|
|
|
&ScreenChangeFixExportColors,
|
|
|
|
SS.fixExportColors ? CHECK_TRUE : CHECK_FALSE);
|
2009-09-29 13:14:47 +00:00
|
|
|
|
|
|
|
Printf(false, "");
|
2010-05-09 18:25:23 +00:00
|
|
|
Printf(false, "%Ft export canvas size: "
|
2015-11-05 19:39:27 +00:00
|
|
|
"%f%Fd%Lf%s fixed%E "
|
|
|
|
"%f%Fd%Lt%s auto%E",
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeCanvasSizeAuto,
|
2010-05-09 18:25:23 +00:00
|
|
|
!SS.exportCanvasSizeAuto ? RADIO_TRUE : RADIO_FALSE,
|
2009-09-29 13:14:47 +00:00
|
|
|
&ScreenChangeCanvasSizeAuto,
|
2010-05-09 18:25:23 +00:00
|
|
|
SS.exportCanvasSizeAuto ? RADIO_TRUE : RADIO_FALSE);
|
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
if(SS.exportCanvasSizeAuto) {
|
|
|
|
Printf(false, "%Ft (by margins around exported geometry)");
|
|
|
|
Printf(false, "%Ba%Ft left: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportMargin.left).c_str(), &ScreenChangeCanvasSize, 0);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Bd%Ft right: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportMargin.right).c_str(), &ScreenChangeCanvasSize, 1);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Ba%Ft bottom: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportMargin.bottom).c_str(), &ScreenChangeCanvasSize, 2);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Bd%Ft top: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportMargin.top).c_str(), &ScreenChangeCanvasSize, 3);
|
2009-09-29 13:14:47 +00:00
|
|
|
} else {
|
|
|
|
Printf(false, "%Ft (by absolute dimensions and offsets)");
|
|
|
|
Printf(false, "%Ba%Ft width: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportCanvas.width).c_str(), &ScreenChangeCanvasSize, 10);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Bd%Ft height: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportCanvas.height).c_str(), &ScreenChangeCanvasSize, 11);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Ba%Ft offset x: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportCanvas.dx).c_str(), &ScreenChangeCanvasSize, 12);
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "%Bd%Ft offset y: %Fd%s %Fl%Ll%f%D[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.exportCanvas.dy).c_str(), &ScreenChangeCanvasSize, 13);
|
2009-09-29 13:14:47 +00:00
|
|
|
}
|
|
|
|
|
2010-01-14 04:47:17 +00:00
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft exported g code parameters");
|
|
|
|
Printf(false, "%Ba%Ft depth: %Fd%s %Fl%Ld%f[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.gCode.depth).c_str(), &ScreenChangeGCodeParameter);
|
2010-01-14 04:47:17 +00:00
|
|
|
Printf(false, "%Bd%Ft passes: %Fd%d %Fl%Ls%f[change]%E",
|
|
|
|
SS.gCode.passes, &ScreenChangeGCodeParameter);
|
|
|
|
Printf(false, "%Ba%Ft feed: %Fd%s %Fl%LF%f[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.gCode.feed).c_str(), &ScreenChangeGCodeParameter);
|
2010-01-14 04:47:17 +00:00
|
|
|
Printf(false, "%Bd%Ft plunge fd: %Fd%s %Fl%LP%f[change]%E",
|
2015-11-06 08:40:12 +00:00
|
|
|
SS.MmToString(SS.gCode.plungeFeed).c_str(), &ScreenChangeGCodeParameter);
|
2010-09-24 02:58:34 +00:00
|
|
|
|
|
|
|
Printf(false, "");
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%Ll%s draw triangle back faces in red%E",
|
2010-09-24 02:58:34 +00:00
|
|
|
&ScreenChangeBackFaces,
|
|
|
|
SS.drawBackFaces ? CHECK_TRUE : CHECK_FALSE);
|
2015-11-05 19:39:27 +00:00
|
|
|
Printf(false, " %Fd%f%Ll%s check sketch for closed contour%E",
|
2010-09-24 02:58:34 +00:00
|
|
|
&ScreenChangeCheckClosedContour,
|
|
|
|
SS.checkClosedContour ? CHECK_TRUE : CHECK_FALSE);
|
2015-03-29 00:30:52 +00:00
|
|
|
|
2015-03-29 04:46:57 +00:00
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, "%Ft autosave interval (in minutes)%E");
|
|
|
|
Printf(false, "%Ba %d %Fl%Ll%f[change]%E",
|
|
|
|
SS.autosaveInterval, &ScreenChangeAutosaveInterval);
|
|
|
|
|
2009-09-29 13:14:47 +00:00
|
|
|
Printf(false, "");
|
|
|
|
Printf(false, " %Ftgl vendor %E%s", glGetString(GL_VENDOR));
|
|
|
|
Printf(false, " %Ft renderer %E%s", glGetString(GL_RENDERER));
|
|
|
|
Printf(false, " %Ft version %E%s", glGetString(GL_VERSION));
|
|
|
|
}
|
|
|
|
|
2013-09-16 19:51:20 +00:00
|
|
|
bool TextWindow::EditControlDoneForConfiguration(const char *s) {
|
2009-09-29 13:14:47 +00:00
|
|
|
switch(edit.meaning) {
|
|
|
|
case EDIT_LIGHT_INTENSITY:
|
2015-03-27 15:43:28 +00:00
|
|
|
SS.lightIntensity[edit.i] = min(1.0, max(0.0, atof(s)));
|
2009-09-29 13:14:47 +00:00
|
|
|
InvalidateGraphics();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EDIT_LIGHT_DIRECTION: {
|
|
|
|
double x, y, z;
|
|
|
|
if(sscanf(s, "%lf, %lf, %lf", &x, &y, &z)==3) {
|
|
|
|
SS.lightDir[edit.i] = Vector::From(x, y, z);
|
|
|
|
} else {
|
|
|
|
Error("Bad format: specify coordinates as x, y, z");
|
|
|
|
}
|
|
|
|
InvalidateGraphics();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_COLOR: {
|
2010-08-14 19:00:25 +00:00
|
|
|
Vector rgb;
|
|
|
|
if(sscanf(s, "%lf, %lf, %lf", &rgb.x, &rgb.y, &rgb.z)==3) {
|
|
|
|
rgb = rgb.ClampWithin(0, 1);
|
|
|
|
SS.modelColor[edit.i] = RGBf(rgb.x, rgb.y, rgb.z);
|
2009-09-29 13:14:47 +00:00
|
|
|
} else {
|
|
|
|
Error("Bad format: specify color as r, g, b");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_CHORD_TOLERANCE: {
|
2015-03-27 15:43:28 +00:00
|
|
|
SS.chordTol = min(10.0, max(0.1, atof(s)));
|
2009-09-29 13:14:47 +00:00
|
|
|
SS.GenerateAll(0, INT_MAX);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_MAX_SEGMENTS: {
|
|
|
|
SS.maxSegments = min(1000, max(7, atoi(s)));
|
|
|
|
SS.GenerateAll(0, INT_MAX);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_CAMERA_TANGENT: {
|
2015-03-27 15:43:28 +00:00
|
|
|
SS.cameraTangent = (min(2.0, max(0.0, atof(s))))/1000.0;
|
2010-05-03 05:15:28 +00:00
|
|
|
if(!SS.usePerspectiveProj) {
|
2009-09-29 13:14:47 +00:00
|
|
|
Message("The perspective factor will have no effect until you "
|
2010-05-03 05:15:28 +00:00
|
|
|
"enable View -> Use Perspective Projection.");
|
2009-09-29 13:14:47 +00:00
|
|
|
}
|
|
|
|
InvalidateGraphics();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_GRID_SPACING: {
|
|
|
|
SS.gridSpacing = (float)min(1e4, max(1e-3, SS.StringToMm(s)));
|
|
|
|
InvalidateGraphics();
|
|
|
|
break;
|
|
|
|
}
|
2010-09-24 02:58:34 +00:00
|
|
|
case EDIT_DIGITS_AFTER_DECIMAL: {
|
|
|
|
int v = atoi(s);
|
|
|
|
if(v < 0 || v > 8) {
|
|
|
|
Error("Specify between 0 and 8 digits after the decimal.");
|
|
|
|
} else {
|
|
|
|
SS.SetUnitDigitsAfterDecimal(v);
|
|
|
|
}
|
|
|
|
InvalidateGraphics();
|
|
|
|
break;
|
|
|
|
}
|
2009-09-29 13:14:47 +00:00
|
|
|
case EDIT_EXPORT_SCALE: {
|
2010-01-04 00:35:28 +00:00
|
|
|
Expr *e = Expr::From(s, true);
|
2009-09-29 13:14:47 +00:00
|
|
|
if(e) {
|
|
|
|
double ev = e->Eval();
|
|
|
|
if(fabs(ev) < 0.001 || isnan(ev)) {
|
|
|
|
Error("Export scale must not be zero!");
|
|
|
|
} else {
|
|
|
|
SS.exportScale = (float)ev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_EXPORT_OFFSET: {
|
2010-01-04 00:35:28 +00:00
|
|
|
Expr *e = Expr::From(s, true);
|
2009-09-29 13:14:47 +00:00
|
|
|
if(e) {
|
|
|
|
double ev = SS.ExprToMm(e);
|
|
|
|
if(isnan(ev) || ev < 0) {
|
|
|
|
Error("Cutter radius offset must not be negative!");
|
|
|
|
} else {
|
|
|
|
SS.exportOffset = (float)ev;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_CANVAS_SIZE: {
|
2010-01-04 00:35:28 +00:00
|
|
|
Expr *e = Expr::From(s, true);
|
2009-09-29 13:14:47 +00:00
|
|
|
if(!e) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
float d = (float)SS.ExprToMm(e);
|
|
|
|
switch(edit.i) {
|
|
|
|
case 0: SS.exportMargin.left = d; break;
|
|
|
|
case 1: SS.exportMargin.right = d; break;
|
|
|
|
case 2: SS.exportMargin.bottom = d; break;
|
|
|
|
case 3: SS.exportMargin.top = d; break;
|
|
|
|
|
|
|
|
case 10: SS.exportCanvas.width = d; break;
|
|
|
|
case 11: SS.exportCanvas.height = d; break;
|
|
|
|
case 12: SS.exportCanvas.dx = d; break;
|
|
|
|
case 13: SS.exportCanvas.dy = d; break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2010-01-14 04:47:17 +00:00
|
|
|
case EDIT_G_CODE_DEPTH: {
|
|
|
|
Expr *e = Expr::From(s, true);
|
|
|
|
if(e) SS.gCode.depth = (float)SS.ExprToMm(e);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_G_CODE_PASSES: {
|
|
|
|
Expr *e = Expr::From(s, true);
|
|
|
|
if(e) SS.gCode.passes = (int)(e->Eval());
|
|
|
|
SS.gCode.passes = max(1, min(1000, SS.gCode.passes));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_G_CODE_FEED: {
|
|
|
|
Expr *e = Expr::From(s, true);
|
|
|
|
if(e) SS.gCode.feed = (float)SS.ExprToMm(e);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EDIT_G_CODE_PLUNGE_FEED: {
|
|
|
|
Expr *e = Expr::From(s, true);
|
|
|
|
if(e) SS.gCode.plungeFeed = (float)SS.ExprToMm(e);
|
|
|
|
break;
|
|
|
|
}
|
2015-03-29 04:46:57 +00:00
|
|
|
case EDIT_AUTOSAVE_INTERVAL: {
|
|
|
|
int interval;
|
|
|
|
if(sscanf(s, "%d", &interval)==1) {
|
|
|
|
if(interval >= 1) {
|
|
|
|
SS.autosaveInterval = interval;
|
|
|
|
SetAutosaveTimerFor(interval);
|
|
|
|
} else {
|
|
|
|
Error("Bad value: autosave interval should be positive");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Error("Bad format: specify interval in integral minutes");
|
|
|
|
}
|
|
|
|
}
|
2009-09-29 13:14:47 +00:00
|
|
|
|
|
|
|
default: return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|