From 54a0bfe61256212ed0c21c6c05d84b8c989c6011 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 9 Aug 2013 21:56:52 +0000 Subject: [PATCH] Deleted old MFC files. --- win/3dsftk/3dsftk.vcxproj | 317 ---------------- win/3dsftk/source/swapbyte.c | 36 -- win/Caddoc.cpp | 33 -- win/Caddoc.h | 36 -- win/Clrpick.cpp | 211 ----------- win/Clrpopup.cpp | 566 ---------------------------- win/Colorlst.cpp | 460 ---------------------- win/Colorlst.h | 107 ------ win/Figdlg.cpp | 164 -------- win/Figdlg.h | 73 ---- win/Libdlg.cpp | 472 ----------------------- win/Libdlg.h | 61 --- win/Pieceprv.cpp | 94 ----- win/Pieceprv.h | 56 --- win/Povdlg.cpp | 115 ------ win/Stepdlg.cpp | 156 -------- win/Stepdlg.h | 58 --- win/Steppop.cpp | 86 ----- win/Steppop.h | 53 --- win/aboutdlg.cpp | 185 --------- win/aboutdlg.h | 50 --- win/arraydlg.cpp | 130 ------- win/arraydlg.h | 65 ---- win/basewnd.cpp | 52 --- win/cadbar.cpp | 129 ------- win/cadbar.h | 56 --- win/categdlg.cpp | 42 --- win/categdlg.h | 47 --- win/clrpick.h | 55 --- win/clrpopup.h | 88 ----- win/disabtab.cpp | 233 ------------ win/disabtab.h | 40 -- win/dynsplit.cpp | 91 ----- win/dynsplit.h | 12 - win/jpeglib/jconfig.h | 45 --- win/jpeglib/jpeglib.vcxproj | 122 ------ win/jpeglib/jpeglib.vcxproj.filters | 62 --- win/keyedit.cpp | 111 ------ win/keyedit.h | 56 --- win/lc_config.h | 25 -- win/libpng/libpng.vcxproj | 105 ------ win/povdlg.h | 55 --- win/progdlg.cpp | 181 --------- win/progdlg.h | 67 ---- win/splitter.cpp | 257 ------------- win/splitter.h | 63 ---- win/stdafx.cpp | 5 - win/transdlg.cpp | 50 --- win/transdlg.h | 51 --- win/zlib/zlib.vcxproj | 157 -------- 50 files changed, 5841 deletions(-) delete mode 100644 win/3dsftk/3dsftk.vcxproj delete mode 100644 win/3dsftk/source/swapbyte.c delete mode 100644 win/Caddoc.cpp delete mode 100644 win/Caddoc.h delete mode 100644 win/Clrpick.cpp delete mode 100644 win/Clrpopup.cpp delete mode 100644 win/Colorlst.cpp delete mode 100644 win/Colorlst.h delete mode 100644 win/Figdlg.cpp delete mode 100644 win/Figdlg.h delete mode 100644 win/Libdlg.cpp delete mode 100644 win/Libdlg.h delete mode 100644 win/Pieceprv.cpp delete mode 100644 win/Pieceprv.h delete mode 100644 win/Povdlg.cpp delete mode 100644 win/Stepdlg.cpp delete mode 100644 win/Stepdlg.h delete mode 100644 win/Steppop.cpp delete mode 100644 win/Steppop.h delete mode 100644 win/aboutdlg.cpp delete mode 100644 win/aboutdlg.h delete mode 100644 win/arraydlg.cpp delete mode 100644 win/arraydlg.h delete mode 100644 win/basewnd.cpp delete mode 100644 win/cadbar.cpp delete mode 100644 win/cadbar.h delete mode 100644 win/categdlg.cpp delete mode 100644 win/categdlg.h delete mode 100644 win/clrpick.h delete mode 100644 win/clrpopup.h delete mode 100644 win/disabtab.cpp delete mode 100644 win/disabtab.h delete mode 100644 win/dynsplit.cpp delete mode 100644 win/dynsplit.h delete mode 100644 win/jpeglib/jconfig.h delete mode 100644 win/jpeglib/jpeglib.vcxproj delete mode 100644 win/jpeglib/jpeglib.vcxproj.filters delete mode 100644 win/keyedit.cpp delete mode 100644 win/keyedit.h delete mode 100644 win/lc_config.h delete mode 100644 win/libpng/libpng.vcxproj delete mode 100644 win/povdlg.h delete mode 100644 win/progdlg.cpp delete mode 100644 win/progdlg.h delete mode 100644 win/splitter.cpp delete mode 100644 win/splitter.h delete mode 100644 win/stdafx.cpp delete mode 100644 win/transdlg.cpp delete mode 100644 win/transdlg.h delete mode 100644 win/zlib/zlib.vcxproj diff --git a/win/3dsftk/3dsftk.vcxproj b/win/3dsftk/3dsftk.vcxproj deleted file mode 100644 index 05739676..00000000 --- a/win/3dsftk/3dsftk.vcxproj +++ /dev/null @@ -1,317 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {E30CACDB-116F-4A85-AC64-0B9987FC9ADB} - - - - StaticLibrary - false - - - StaticLibrary - false - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Configuration)\ - $(Configuration)\ - $(Configuration)\ - $(Configuration)\ - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebug - .\Debug/3dsftk.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - OldStyle - - - 0x0409 - - - .\Debug\3dsftk.lib - true - - - true - .\Debug/3dsftk.bsc - - - - - MaxSpeed - OnlyExplicitInline - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - .\Release/3dsftk.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - 0x0409 - - - .\Release\3dsftk.lib - true - - - true - .\Release/3dsftk.bsc - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/3dsftk/source/swapbyte.c b/win/3dsftk/source/swapbyte.c deleted file mode 100644 index ef69f43a..00000000 --- a/win/3dsftk/source/swapbyte.c +++ /dev/null @@ -1,36 +0,0 @@ -/* this source was algorythmically generated by makeswap.c */ - -#include "3dstype.h" -#include "swapbyte.h" -void N2ILong3ds(void *native, void *intel){ - *((unsigned long *)(intel)) = *((unsigned long *)(native)); -} - -void I2NLong3ds(void *intel, void *native){ - *((unsigned long *)(native)) = *((unsigned long *)(intel)); -} - -void N2IShort3ds(void *native, void *intel){ - *((unsigned short *)(intel)) = *((unsigned short *)(native)); -} - -void I2NShort3ds(void *intel, void *native){ - *((unsigned short *)(native)) = *((unsigned short *)(intel)); -} - -void N2IFloat3ds(void *native, void *intel){ - *((float *)(intel)) = *((float *)(native)); -} - -void I2NFloat3ds(void *intel, void *native){ - *((float *)(native)) = *((float *)(intel)); -} - -void N2IDouble3ds(void *native, void *intel){ - *((double *)(intel)) = *((double *)(native)); -} - -void I2NDouble3ds(void *intel, void *native){ - *((double *)(native)) = *((double *)(intel)); -} - diff --git a/win/Caddoc.cpp b/win/Caddoc.cpp deleted file mode 100644 index 2a695f4c..00000000 --- a/win/Caddoc.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "lc_global.h" -#include "LeoCAD.h" -#include "CADDoc.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CCADDoc - -IMPLEMENT_DYNCREATE(CCADDoc, CDocument) - -BEGIN_MESSAGE_MAP(CCADDoc, CDocument) - //{{AFX_MSG_MAP(CCADDoc) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CCADDoc construction/destruction - -CCADDoc::CCADDoc() -{ -} - -CCADDoc::~CCADDoc() -{ -} - -///////////////////////////////////////////////////////////////////////////// -// CCADDoc commands diff --git a/win/Caddoc.h b/win/Caddoc.h deleted file mode 100644 index 7257f614..00000000 --- a/win/Caddoc.h +++ /dev/null @@ -1,36 +0,0 @@ -// CADDoc.h : interface of the CCADDoc class -// -///////////////////////////////////////////////////////////////////////////// - -#ifndef _CADDOC_H_ -#define _CADDOC_H_ - -class CCADDoc : public CDocument -{ -protected: // create from serialization only - CCADDoc(); - virtual ~CCADDoc(); - - DECLARE_DYNCREATE(CCADDoc) - -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CCADDoc) - //}}AFX_VIRTUAL - -// Generated message map functions -protected: - //{{AFX_MSG(CCADDoc) - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // _CADDOC_H_ diff --git a/win/Clrpick.cpp b/win/Clrpick.cpp deleted file mode 100644 index bc6db9ff..00000000 --- a/win/Clrpick.cpp +++ /dev/null @@ -1,211 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "ClrPopup.h" -#include "ClrPick.h" -#include "lc_colors.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CColorPicker - -CColorPicker::CColorPicker() -{ - m_bActive = FALSE; - m_nColor = -1; - SetColorIndex(-1); -} - -CColorPicker::~CColorPicker() -{ -} - -IMPLEMENT_DYNCREATE(CColorPicker, CButton) - -BEGIN_MESSAGE_MAP(CColorPicker, CButton) - //{{AFX_MSG_MAP(CColorPicker) - ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked) - ON_WM_CREATE() - //}}AFX_MSG_MAP - ON_MESSAGE(CPN_SELENDOK, OnSelEndOK) - ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CColorPicker message handlers - -LONG CColorPicker::OnSelEndOK(UINT /*lParam*/, LONG wParam) -{ - m_bActive = FALSE; - SetColorIndex(wParam); - - CWnd *pParent = GetParent(); - if (pParent) - pParent->SendMessage(CPN_SELENDOK, wParam, (LPARAM)GetDlgCtrlID()); - - return TRUE; -} - -LONG CColorPicker::OnSelEndCancel(UINT /*lParam*/, LONG wParam) -{ - m_bActive = FALSE; - - CWnd *pParent = GetParent(); - if (pParent) - pParent->SendMessage(CPN_SELENDCANCEL, (WPARAM)wParam, (LPARAM)GetDlgCtrlID()); - - return TRUE; -} - -int CColorPicker::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CButton::OnCreate(lpCreateStruct) == -1) - return -1; - - SetWindowSize(); // resize appropriately - return 0; -} - -// On mouse click, create and show a CColorPopup window for colour selection -BOOL CColorPicker::OnClicked() -{ - if (!IsWindowEnabled()) - return TRUE; - - m_bActive = TRUE; - CRect rect; - GetWindowRect(rect); - new CColorPopup(CPoint(rect.left, rect.bottom), m_nColor, this, false); - - return TRUE; -} - -void CColorPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) -{ - ASSERT(lpDrawItemStruct); - - CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); - CRect rect = lpDrawItemStruct->rcItem; - UINT state = lpDrawItemStruct->itemState; - DWORD dwStyle = GetStyle(); - CString m_strText; - - CSize Margins(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE)); - - // Draw arrow - if (m_bActive) state |= ODS_SELECTED; - pDC->DrawFrameControl(&m_ArrowRect, DFC_SCROLL, DFCS_SCROLLDOWN | - ((state & ODS_SELECTED) ? DFCS_PUSHED : 0) | - ((state & ODS_DISABLED) ? DFCS_INACTIVE : 0)); - - pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT); - - // Must reduce the size of the "client" area of the button due to edge thickness. - rect.DeflateRect(Margins.cx, Margins.cy); - rect.bottom +=1; - - // Fill remaining area with colour - rect.right -= m_ArrowRect.Width()-1; - - COLORREF brushColor; - if ((state & ODS_DISABLED) || m_nColor == -1) - brushColor = ::GetSysColor(COLOR_3DFACE); - else - { - float* Value = gColorList[m_nColor].Value; - brushColor = RGB(Value[0] * 255.0f, Value[1] * 255.0f, Value[2] * 255.0f); - } - - CBrush brush(brushColor); - CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush); - pDC->SelectStockObject(NULL_PEN); - pDC->Rectangle(rect); - pDC->SelectObject(pOldBrush); - - if (lcIsColorTranslucent(m_nColor)) - { - for (int x = rect.left; x < rect.right; x++) - { - for (int y = rect.top + x % 4; y < rect.bottom; y += 4) - pDC->SetPixel(x, y, RGB(255, 255, 255)); - - for (int y = rect.bottom - x % 4; y > rect.top; y -= 4) - pDC->SetPixel(x, y, RGB(255, 255, 255)); - } - } - - // Draw focus rect - if (state & ODS_FOCUS) - { - rect.DeflateRect(1, 1); - pDC->DrawFocusRect(rect); - } -} - -///////////////////////////////////////////////////////////////////////////// -// CColorPicker overrides - -void CColorPicker::PreSubclassWindow() -{ - ModifyStyle(0, BS_OWNERDRAW); // Make it owner drawn - CButton::PreSubclassWindow(); - SetWindowSize(); // resize appropriately -} - -///////////////////////////////////////////////////////////////////////////// -// CColorPicker attributes - -int CColorPicker::GetColorIndex() -{ - return m_nColor; -} - -void CColorPicker::SetColorIndex(int nColor) -{ - if (m_nColor != nColor) - { - m_nColor = nColor; - if (IsWindow(m_hWnd)) - RedrawWindow(); - } -} - -///////////////////////////////////////////////////////////////////////////// -// CColorPicker implementation - -void CColorPicker::SetWindowSize() -{ - // Get size dimensions of edges - CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE)); - - // Get size of dropdown arrow - int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx); - int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy); - CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight)); - - // Get window size - CRect rect; - GetWindowRect(rect); - - CWnd* pParent = GetParent(); - if (pParent) - pParent->ScreenToClient(rect); - - // Set window size at least as wide as 2 arrows, and as high as arrow + margins - int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx); - int nHeight = max(rect.Height(), ArrowSize.cy + 2*MarginSize.cy); - MoveWindow(rect.left, rect.top, nWidth, nHeight, TRUE); - - // Get the new coords of this window - GetWindowRect(rect); - ScreenToClient(rect); - - // Get the rect where the arrow goes, and convert to client coords. - m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx, - rect.top + MarginSize.cy, rect.right - MarginSize.cx, - rect.bottom - MarginSize.cy); -} diff --git a/win/Clrpopup.cpp b/win/Clrpopup.cpp deleted file mode 100644 index 4a1ec28b..00000000 --- a/win/Clrpopup.cpp +++ /dev/null @@ -1,566 +0,0 @@ -#include "lc_global.h" -#include -#include "ClrPick.h" -#include "ClrPopup.h" -#include "propertiesgridctrl.h" -#include "lc_colors.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -#define INVALID_COLOUR -1 - -#define MAX_COLOURS 256 - -///////////////////////////////////////////////////////////////////////////// -// CColorPopup - -CColorPopup::CColorPopup() -{ - Initialise(); -} - -CColorPopup::CColorPopup(CPoint p, int nColor, CWnd* pParentWnd, bool IgnoreMouse) -{ - Initialise(); - - m_nColor = m_nInitialColor = nColor; - m_pParent = pParentWnd; - m_IgnoreMouse = IgnoreMouse; - - CColorPopup::Create(p, nColor, pParentWnd); -} - -void CColorPopup::Initialise() -{ - m_nNumColumns = 0; - m_nNumRows = 0; - m_nBoxSize = 18; - m_nMargin = ::GetSystemMetrics(SM_CXEDGE); - m_nCurrentSel = INVALID_COLOUR; - m_nChosenColorSel = INVALID_COLOUR; - m_pParent = NULL; - m_nColor = m_nInitialColor = 0; - m_IgnoreMouse = false; - - // Idiot check: Make sure the colour square is at least 5 x 5; - if (m_nBoxSize - 2 * m_nMargin - 2 < 5) - m_nBoxSize = 5 + 2 * m_nMargin + 2; - - // Create the font - NONCLIENTMETRICS ncm; - ncm.cbSize = sizeof(NONCLIENTMETRICS); - VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0)); - m_Font.CreateFontIndirect(&(ncm.lfMessageFont)); - - // Create the palette - int NumColors = gColorList.GetSize() < MAX_COLOURS ? gColorList.GetSize() : MAX_COLOURS; - struct { - LOGPALETTE LogPalette; - PALETTEENTRY PalEntry[MAX_COLOURS]; - } pal; - - LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal; - pLogPalette->palVersion = 0x300; - pLogPalette->palNumEntries = (WORD)gColorList.GetSize(); - - for (int i = 0; i < NumColors; i++) - { - float* Value = gColorList[i].Value; - pLogPalette->palPalEntry[i].peRed = (BYTE)(Value[0] * 255); - pLogPalette->palPalEntry[i].peGreen = (BYTE)(Value[1] * 255); - pLogPalette->palPalEntry[i].peBlue = (BYTE)(Value[2] * 255); - pLogPalette->palPalEntry[i].peFlags = 0; - } - - m_Palette.CreatePalette(pLogPalette); -} - -CColorPopup::~CColorPopup() -{ - m_Font.DeleteObject(); - m_Palette.DeleteObject(); -} - -BOOL CColorPopup::Create(CPoint p, int nColor, CWnd* pParentWnd) -{ - ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd())); - ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CColorPicker)) || pParentWnd->IsKindOf(RUNTIME_CLASS(CMFCPropertyGridCtrl))); - - m_pParent = pParentWnd; - m_nColor = m_nInitialColor = nColor; - - // Get the class name and create the window - CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, (HBRUSH)GetStockObject(LTGRAY_BRUSH),0); - - if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP, p.x, p.y, 100, 100, pParentWnd->GetSafeHwnd(), 0, NULL)) - return FALSE; - - // Set the window size - SetWindowSize(); - - // Calculate the layout - CalculateLayout(); - - // Create the tooltips - CreateToolTips(); - - // Find which cell (if any) corresponds to the initial colour - for (int i = 0; i < mCells.GetSize(); i++) - { - if (mCells[i].ColorIndex == nColor) - { - m_nChosenColorSel = i; - break; - } - } - - // Capture all mouse events for the life of this window - SetCapture(); - - return TRUE; -} - -BEGIN_MESSAGE_MAP(CColorPopup, CWnd) - //{{AFX_MSG_MAP(CColorPopup) - ON_WM_NCDESTROY() - ON_WM_LBUTTONUP() - ON_WM_PAINT() - ON_WM_MOUSEMOVE() - ON_WM_KEYDOWN() - ON_WM_QUERYNEWPALETTE() - ON_WM_PALETTECHANGED() - ON_WM_KILLFOCUS() - ON_WM_ACTIVATEAPP() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CColorPopup message handlers - -// For tooltips -BOOL CColorPopup::PreTranslateMessage(MSG* pMsg) -{ - m_ToolTip.RelayEvent(pMsg); - return CWnd::PreTranslateMessage(pMsg); -} - -// If an arrow key is pressed, then move the selection -void CColorPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - if (nChar == VK_LEFT) - { - if (m_nCurrentSel > 0) - ChangeSelection(m_nCurrentSel - 1); - } - else if (nChar == VK_RIGHT) - { - if (m_nCurrentSel < mCells.GetSize() - 1) - ChangeSelection(m_nCurrentSel + 1); - } - else if (nChar == VK_UP || nChar == VK_DOWN) - { - if (m_nCurrentSel < 0 || m_nCurrentSel >= mCells.GetSize()) - m_nCurrentSel = 0; - - int CurGroup = 0; - int NumCells = 0; - - for (CurGroup = 0; CurGroup < LC_NUM_COLORGROUPS; CurGroup++) - { - int NumColors = gColorGroups[CurGroup].Colors.GetSize(); - - if (m_nCurrentSel < NumCells + NumColors) - break; - - NumCells += NumColors; - } - - int Row = (m_nCurrentSel - NumCells) / m_nNumColumns; - int Column = (m_nCurrentSel - NumCells) % m_nNumColumns; - - if (nChar == VK_UP) - { - if (Row > 0) - ChangeSelection(m_nCurrentSel - m_nNumColumns); - else if (CurGroup > 0) - { - int NumColors = gColorGroups[CurGroup - 1].Colors.GetSize(); - int NumColumns = NumColors % m_nNumColumns; - - if (NumColumns <= Column + 1) - ChangeSelection(m_nCurrentSel - NumColumns - m_nNumColumns); - else - ChangeSelection(m_nCurrentSel - NumColumns); - } - } - else if (nChar == VK_DOWN) - { - int NumColors = gColorGroups[CurGroup].Colors.GetSize(); - - if (m_nCurrentSel + m_nNumColumns < NumCells + NumColors) - ChangeSelection(m_nCurrentSel + m_nNumColumns); - else - { - int NumColumns = NumColors % m_nNumColumns; - - if (NumColumns > Column) - ChangeSelection(m_nCurrentSel + NumColumns); - else - ChangeSelection(m_nCurrentSel + m_nNumColumns + NumColumns); - } - } - } - else if (nChar == VK_ESCAPE) - { - m_nColor = m_nInitialColor; - EndSelection(CPN_SELENDCANCEL); - return; - } - else if (nChar == VK_RETURN || nChar == VK_SPACE) - { - EndSelection(CPN_SELENDOK); - return; - } - - CWnd::OnKeyDown(nChar, nRepCnt, nFlags); -} - -// auto-deletion -void CColorPopup::OnNcDestroy() -{ - CWnd::OnNcDestroy(); - delete this; -} - -void CColorPopup::OnPaint() -{ - CPaintDC dc(this); // device context for painting - - CRect rect; - GetClientRect(rect); - - dc.FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE)); - - CFont *pOldFont = (CFont*)dc.SelectObject(&m_Font); - dc.SetBkMode(TRANSPARENT); - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - dc.DrawText(gColorGroups[GroupIdx].Name, mGroups[GroupIdx], DT_CENTER | DT_VCENTER | DT_SINGLELINE); - - dc.SelectObject(pOldFont); - - // Draw colour cells - for (int i = 0; i < mCells.GetSize(); i++) - DrawCell(&dc, i); - - // Draw raised window edge (ex-window style WS_EX_WINDOWEDGE is sposed to do this, - // but for some reason isn't - dc.DrawEdge(rect, EDGE_RAISED, BF_RECT); -} - -void CColorPopup::OnMouseMove(UINT nFlags, CPoint point) -{ - int nNewSelection = INVALID_COLOUR; - - for (int i = 0; i < mCells.GetSize(); i++) - { - if (mCells[i].Rect.PtInRect(point)) - { - nNewSelection = i; - break; - } - } - - if (nNewSelection == INVALID_COLOUR) - { - CWnd::OnMouseMove(nFlags, point); - return; - } - - m_IgnoreMouse = false; - - // Has the row/col selection changed? If yes, then redraw old and new cells. - if (nNewSelection != m_nCurrentSel) - ChangeSelection(nNewSelection); - - CWnd::OnMouseMove(nFlags, point); -} - -// End selection on LButtonUp -void CColorPopup::OnLButtonUp(UINT nFlags, CPoint point) -{ - CWnd::OnLButtonUp(nFlags, point); - - if (m_IgnoreMouse) - { - m_IgnoreMouse = false; - return; - } - - DWORD pos = GetMessagePos(); - point = CPoint(LOWORD(pos), HIWORD(pos)); - - if (m_WindowRect.PtInRect(point)) - EndSelection(CPN_SELENDOK); - else - EndSelection(CPN_SELENDCANCEL); -} - -///////////////////////////////////////////////////////////////////////////// -// CColorPopup implementation - -// Works out an appropriate size and position of this window -void CColorPopup::SetWindowSize() -{ - CSize TextSize(0, 0); - - // Calculate the number of columns and rows. - m_nNumColumns = 14; - m_nNumRows = 0; - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - m_nNumRows += (gColorGroups[GroupIdx].Colors.GetSize() + m_nNumColumns - 1) / m_nNumColumns; - - // Calculate text size. - CClientDC dc(this); - CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font); - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - - CSize NameSize = dc.GetTextExtent(Group->Name); - if (NameSize.cx > TextSize.cx) - TextSize.cx = NameSize.cx; - TextSize.cy += NameSize.cy + 2; - } - - dc.SelectObject(pOldFont); - - // Get the current window position, and set the new size - CRect rect; - GetWindowRect(rect); - - m_WindowRect.SetRect(rect.left, rect.top, - rect.left + m_nNumColumns*m_nBoxSize + 2*m_nMargin, - rect.top + m_nNumRows*m_nBoxSize + 2*m_nMargin); - - if (TextSize.cx > m_WindowRect.Width()) - m_WindowRect.right = m_WindowRect.left + TextSize.cx; - m_WindowRect.bottom += TextSize.cy; - - // Need to check it'll fit on screen: Too far right? - CSize ScreenSize(::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN)); - if (m_WindowRect.right > ScreenSize.cx) - m_WindowRect.OffsetRect(-(m_WindowRect.right - ScreenSize.cx), 0); - - // Too far left? - if (m_WindowRect.left < 0) - m_WindowRect.OffsetRect( -m_WindowRect.left, 0); - - // Bottom falling out of screen? - if (m_WindowRect.bottom > ScreenSize.cy) - { - CRect ParentRect; - m_pParent->GetWindowRect(ParentRect); - m_WindowRect.OffsetRect(0, -(ParentRect.Height() + m_WindowRect.Height())); - } - - // Set the window size and position - MoveWindow(m_WindowRect, TRUE); -} - -void CColorPopup::CalculateLayout() -{ - CRect ClientRect; - GetClientRect(&ClientRect); - - CClientDC dc(this); - CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font); - - int CurCell = 0; - int CurY = m_nMargin; - - mGroups.RemoveAll(); - mGroups.SetSize(LC_NUM_COLORGROUPS); - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - int CurColumn = 0; - - CSize TextSize = dc.GetTextExtent(Group->Name); - mGroups[GroupIdx].SetRect(0, CurY + 1, ClientRect.Width(), CurY + TextSize.cy + 2); - CurY += TextSize.cy + 2; - - for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++) - { - int Left = m_nMargin + CurColumn * m_nBoxSize; - int Right = Left + m_nBoxSize; - int Top = CurY; - int Bottom = CurY + m_nBoxSize; - - lcColor* Color = &gColorList[Group->Colors[ColorIdx]]; - CColorPopupCell Cell; - - Cell.Color = RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255); - Cell.ColorIndex = Group->Colors[ColorIdx]; - Cell.Rect.SetRect(Left, Top, Right, Bottom); - - mCells.Add(Cell); - - CurColumn++; - if (CurColumn == m_nNumColumns) - { - CurColumn = 0; - CurY += m_nBoxSize; - } - - CurCell++; - } - - if (CurColumn != 0) - CurY += m_nBoxSize; - } - - dc.SelectObject(pOldFont); -} - -void CColorPopup::CreateToolTips() -{ - // Create the tool tip - if (!m_ToolTip.Create(this)) return; - - // Add a tool for each cell - for (int i = 0; i < mCells.GetSize(); i++) - { - CString Text; - lcColor* Color = &gColorList[mCells[i].ColorIndex]; - Text.Format("%s (%d)", Color->Name, Color->Code); - m_ToolTip.AddTool(this, Text, mCells[i].Rect, i + 1); - } -} - -void CColorPopup::ChangeSelection(int nIndex) -{ - CClientDC dc(this); // device context for drawing - - if (m_nCurrentSel >= 0 && m_nCurrentSel < mCells.GetSize()) - { - // Set Current selection as invalid and redraw old selection (this way - // the old selection will be drawn unselected) - int OldSel = m_nCurrentSel; - m_nCurrentSel = INVALID_COLOUR; - DrawCell(&dc, OldSel); - } - - // Set the current selection as row/col and draw (it will be drawn selected) - m_nCurrentSel = nIndex; - DrawCell(&dc, m_nCurrentSel); - - m_nColor = m_nCurrentSel; -} - -void CColorPopup::EndSelection(int nMessage) -{ - ReleaseCapture(); - - if (nMessage == CPN_SELENDCANCEL) - m_nColor = m_nInitialColor; - - int ColorIndex = m_nColor >= 0 ? mCells[m_nColor].ColorIndex : 0; - - if (m_pParent->IsKindOf(RUNTIME_CLASS(CMFCPropertyGridCtrl))) - { - CLeoCADMFCPropertyGridCtrl* Ctrl = (CLeoCADMFCPropertyGridCtrl*)m_pParent; - Ctrl->SetColor(ColorIndex); - } - else - m_pParent->SendMessage(nMessage, 0, (LPARAM)ColorIndex); - - DestroyWindow(); -} - -void CColorPopup::DrawCell(CDC* pDC, int nIndex) -{ - CRect rect = mCells[nIndex].Rect; - - // Select and realize the palette - CPalette* pOldPalette; - if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE) - { - pOldPalette = pDC->SelectPalette(&m_Palette, FALSE); - pDC->RealizePalette(); - } - - // fill background - if (m_nChosenColorSel == nIndex && m_nCurrentSel != nIndex) - pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DHILIGHT)); - else - pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE)); - - // Draw button - if (m_nCurrentSel == nIndex) - pDC->DrawEdge(rect, EDGE_RAISED, BF_RECT); - else if (m_nChosenColorSel == nIndex) - pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT); - - CBrush brush(PALETTERGB(GetRValue(mCells[nIndex].Color), GetGValue(mCells[nIndex].Color), GetBValue(mCells[nIndex].Color) )); - CPen pen; - pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW)); - - CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush); - CPen* pOldPen = (CPen*) pDC->SelectObject(&pen); - - // Draw the cell colour - rect.DeflateRect(m_nMargin+1, m_nMargin+1); - pDC->Rectangle(rect); - - rect.DeflateRect(1, 1); - rect.bottom -= 1; - - // restore DC and cleanup - pDC->SelectObject(pOldBrush); - pDC->SelectObject(pOldPen); - brush.DeleteObject(); - pen.DeleteObject(); - - if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE) - pDC->SelectPalette(pOldPalette, FALSE); -} - -BOOL CColorPopup::OnQueryNewPalette() -{ - Invalidate(); - return CWnd::OnQueryNewPalette(); -} - -void CColorPopup::OnPaletteChanged(CWnd* pFocusWnd) -{ - CWnd::OnPaletteChanged(pFocusWnd); - - if (pFocusWnd->GetSafeHwnd() != GetSafeHwnd()) - Invalidate(); -} - -void CColorPopup::OnKillFocus(CWnd* pNewWnd) -{ - CWnd::OnKillFocus(pNewWnd); - - ReleaseCapture(); - //DestroyWindow(); - causes crash when Custom colour dialog appears. -} - -// KillFocus problem fix suggested by Paul Wilkerson. -void CColorPopup::OnActivateApp(BOOL bActive, DWORD hTask) -{ - CWnd::OnActivateApp(bActive, hTask); - - // If Deactivating App, cancel this selection - if (!bActive) - EndSelection(CPN_SELENDCANCEL); -} diff --git a/win/Colorlst.cpp b/win/Colorlst.cpp deleted file mode 100644 index da1afbff..00000000 --- a/win/Colorlst.cpp +++ /dev/null @@ -1,460 +0,0 @@ -#include "lc_global.h" -#include "lc_colors.h" -#include "ColorLst.h" -#include "Piecebar.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -IMPLEMENT_DYNAMIC(CColorToolTipCtrl, CMFCToolTipCtrl) - -BEGIN_MESSAGE_MAP(CColorToolTipCtrl, CMFCToolTipCtrl) -END_MESSAGE_MAP() - -CSize CColorToolTipCtrl::GetIconSize() -{ - return CSize(24, 24); -} - -BOOL CColorToolTipCtrl::OnDrawIcon(CDC* pDC, CRect rectImage) -{ - ASSERT_VALID(pDC); - - CString Text; - GetWindowText(Text); - - const char* Ptr = strrchr((const char*)Text, '('); - if (!Ptr) - return FALSE; - - int Code; - if (sscanf(Ptr, "(%d)", &Code) != 1) - return FALSE; - - lcColor* Color = &gColorList[lcGetColorIndex(Code)]; - - pDC->SetBkColor(RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255)); - pDC->ExtTextOut(0, 0, ETO_OPAQUE, rectImage, NULL, 0, NULL); - - return TRUE; -} - -BEGIN_MESSAGE_MAP(CColorList, CWnd) - //{{AFX_MSG_MAP(CColorList) - ON_WM_PAINT() - ON_WM_ERASEBKGND() - ON_WM_LBUTTONUP() - ON_WM_LBUTTONDOWN() - ON_WM_MOUSEMOVE() - ON_WM_SIZE() - ON_WM_KEYDOWN() - ON_WM_SETFOCUS() - ON_WM_KILLFOCUS() - ON_WM_GETDLGCODE() - ON_WM_SETCURSOR() - ON_WM_CREATE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -CColorList::CColorList() -{ - mCurCell = 0; - mTracking = FALSE; - - UpdateColors(); -} - -CColorList::~CColorList() -{ -} - -void CColorList::UpdateColors() -{ - mCells.RemoveAll(); - mGroups.RemoveAll(); - mGroups.SetSize(LC_NUM_COLORGROUPS); - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - - for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++) - { - lcColor* Color = &gColorList[Group->Colors[ColorIdx]]; - CColorListCell Cell; - - Cell.Color = RGB(Color->Value[0] * 255, Color->Value[1] * 255, Color->Value[2] * 255); - Cell.ColorIndex = Group->Colors[ColorIdx]; - - mCells.Add(Cell); - } - } - - mColumns = 14; - mRows = 0; - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - mRows += (gColorGroups[GroupIdx].Colors.GetSize() + mColumns - 1) / mColumns; -} - -void CColorList::UpdateLayout() -{ - if (!IsWindow(m_hWnd)) - return; - - CRect ClientRect; - GetClientRect(&ClientRect); - - CClientDC dc(this); - CFont* OldFont = dc.SelectObject(&afxGlobalData.fontRegular); - float TextHeight = 0.0f; - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - - CSize TextSize = dc.GetTextExtent(Group->Name); - TextHeight += TextSize.cy; - } - - float CellWidth = (float)ClientRect.Width() / (float)mColumns; - float CellHeight = ((float)ClientRect.Height() - TextHeight) / (float)mRows; - - int CurCell = 0; - float CurY = 0.0f; - - for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - int CurColumn = 0; - - CSize TextSize = dc.GetTextExtent(Group->Name); - mGroups[GroupIdx].Rect.SetRect(0, (int)CurY, ClientRect.Width(), (int)CurY + TextSize.cy); - CurY += TextSize.cy; - - for (int ColorIdx = 0; ColorIdx < Group->Colors.GetSize(); ColorIdx++) - { - float Left = CurColumn * CellWidth; - float Right = (CurColumn + 1) * CellWidth; - float Top = CurY; - float Bottom = CurY + CellHeight; - - CRect CellRect((int)Left, (int)Top, (int)Right, (int)Bottom); - - mCells[CurCell].Rect = CellRect; - - CString Text; - lcColor* Color = &gColorList[mCells[CurCell].ColorIndex]; - Text.Format("%s (%d)", Color->Name, Color->Code); - mToolTip.AddTool(this, Text, CellRect, CurCell + 1); - - CurColumn++; - if (CurColumn == mColumns) - { - CurColumn = 0; - CurY += CellHeight; - } - - CurCell++; - } - - if (CurColumn != 0) - CurY += CellHeight; - } - - dc.SelectObject(OldFont); -} - -void CColorList::SelectCell(int CellIdx) -{ - if (CellIdx < 0 || CellIdx >= mCells.GetSize()) - return; - - if (CellIdx == mCurCell) - return; - - InvalidateRect(mCells[mCurCell].Rect, TRUE); - InvalidateRect(mCells[CellIdx].Rect, TRUE); - mCurCell = CellIdx; - - CPiecesBar* Bar = (CPiecesBar*)GetParent(); - Bar->OnSelChangeColor(); -} - -BOOL CColorList::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) -{ - ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd())); - - // Get the class name and create the window - CString ClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, CreateSolidBrush(GetSysColor(COLOR_BTNFACE)), 0); - - if (!CWnd::Create(ClassName, _T(""), dwStyle, rect, pParentWnd, nID, NULL)) - return FALSE; - - return TRUE; -} - -int CColorList::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - mToolTip.Create(this); - - return 0; -} - -BOOL CColorList::PreTranslateMessage(MSG* pMsg) -{ - if (mToolTip.m_hWnd) - mToolTip.RelayEvent(pMsg); - - return CWnd::PreTranslateMessage(pMsg); -} - -void CColorList::OnPaint() -{ - CPaintDC dc(this); - - CDC MemDC; - CRect rect; - CBitmap bitmap, *pOldBitmap; - dc.GetClipBox(&rect); - MemDC.CreateCompatibleDC(&dc); - bitmap.CreateCompatibleBitmap(&dc, rect.Width(), rect.Height()); - pOldBitmap = MemDC.SelectObject(&bitmap); - MemDC.SetWindowOrg(rect.left, rect.top); - Draw(MemDC); - dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &MemDC, rect.left, rect.top, SRCCOPY); - MemDC.SelectObject(pOldBitmap); -} - -BOOL CColorList::OnEraseBkgnd(CDC* pDC) -{ - return TRUE; -} - -void CColorList::Draw(CDC& dc) -{ - CRect VisRect, ClipRect, rect; - GetClientRect(VisRect); - CBrush Back(GetSysColor(COLOR_WINDOW)); - dc.FillRect(VisRect, &Back); - - CFont* OldFont = dc.SelectObject(&afxGlobalData.fontRegular); - dc.SetBkMode(TRANSPARENT); - - for (int GroupIdx = 0; GroupIdx < mGroups.GetSize(); GroupIdx++) - { - lcColorGroup* Group = &gColorGroups[GroupIdx]; - CColorListGroup* ListGroup = &mGroups[GroupIdx]; - - dc.DrawText(Group->Name, ListGroup->Rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE); - } - - dc.SelectObject(OldFont); - - for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++) - { - CBrush brush; - brush.CreateSolidBrush(mCells[CellIdx].Color); - - CBrush* OldBrush = (CBrush*)dc.SelectObject(&brush); - - CRect rc = mCells[CellIdx].Rect; - rc.bottom++; - rc.right++; - dc.Rectangle(rc); - - dc.SelectObject(OldBrush); - } - - if (mCurCell < mCells.GetSize()) - { - CBrush* OldBrush = dc.SelectObject(CBrush::FromHandle((HBRUSH)GetStockObject(NULL_BRUSH))); - - COLORREF cr = mCells[mCurCell].Color; - CPen BorderPen; - BorderPen.CreatePen(PS_SOLID, 1, RGB(255-GetRValue(cr), 255-GetGValue(cr), 255-GetBValue(cr))); - CPen* OldPen = (CPen*)dc.SelectObject(&BorderPen); - - CRect rc = mCells[mCurCell].Rect; - rc.OffsetRect(1, 1); - rc.bottom--; - rc.right--; - dc.Rectangle(rc); - - if (GetFocus() == this) - { - rc.DeflateRect(2, 2); - dc.DrawFocusRect(rc); - } - - dc.SelectObject(OldPen); - dc.SelectObject(OldBrush); - } -} - -void CColorList::OnLButtonDown(UINT Flags, CPoint pt) -{ - CWnd::OnLButtonDown(Flags, pt); - SetFocus(); - - CRect rc; - GetClientRect(&rc); - - if (!rc.PtInRect(pt)) - return; - - for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++) - { - if (!mCells[CellIdx].Rect.PtInRect(pt)) - continue; - - SelectCell(CellIdx); - - SetCapture(); - mMouseDown = pt; - mTracking = TRUE; - break; - } -} - -void CColorList::OnLButtonUp(UINT Flags, CPoint pt) -{ - mTracking = FALSE; - ReleaseCapture(); - - CWnd::OnLButtonUp(Flags, pt); -} - -void CColorList::OnMouseMove(UINT Flags, CPoint pt) -{ - /* - if (m_Tracking && m_MouseDown != pt) - { - m_Tracking = FALSE; - ReleaseCapture(); - lcGetActiveProject()->BeginColorDrop(); - - // Force a cursor update. - CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd(); - CView* pView = pFrame->GetActiveView(); - pView->PostMessage(WM_LC_SET_CURSOR, 0, 0); - } -*/ - CWnd::OnMouseMove(Flags, pt); -} - -void CColorList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - if (nChar == VK_LEFT) - { - if (mCurCell > 0) - SelectCell(mCurCell - 1); - } - else if (nChar == VK_RIGHT) - { - if (mCurCell < mCells.GetSize() - 1) - SelectCell(mCurCell + 1); - } - else if (nChar == VK_UP || nChar == VK_DOWN) - { - if (mCurCell < 0 || mCurCell >= mCells.GetSize()) - mCurCell = 0; - - int CurGroup = 0; - int NumCells = 0; - - for (CurGroup = 0; CurGroup < LC_NUM_COLORGROUPS; CurGroup++) - { - int NumColors = gColorGroups[CurGroup].Colors.GetSize(); - - if (mCurCell < NumCells + NumColors) - break; - - NumCells += NumColors; - } - - int Row = (mCurCell - NumCells) / mColumns; - int Column = (mCurCell - NumCells) % mColumns; - - if (nChar == VK_UP) - { - if (Row > 0) - SelectCell(mCurCell - mColumns); - else if (CurGroup > 0) - { - int NumColors = gColorGroups[CurGroup - 1].Colors.GetSize(); - int NumColumns = NumColors % mColumns; - - if (NumColumns <= Column + 1) - SelectCell(mCurCell - NumColumns - mColumns); - else - SelectCell(mCurCell - NumColumns); - } - } - else if (nChar == VK_DOWN) - { - int NumColors = gColorGroups[CurGroup].Colors.GetSize(); - - if (mCurCell + mColumns < NumCells + NumColors) - SelectCell(mCurCell + mColumns); - else - { - int NumColumns = NumColors % mColumns; - - if (NumColumns > Column) - SelectCell(mCurCell + NumColumns); - else - SelectCell(mCurCell + mColumns + NumColumns); - } - } - } - - CWnd::OnKeyDown(nChar, nRepCnt, nFlags); -} - -BOOL CColorList::OnSetCursor(CWnd* inWnd, UINT inHitTest, UINT inMessage) -{ - HCURSOR Cursor = LoadCursor(NULL, IDC_ARROW); - - if (Cursor) - { - SetCursor(Cursor); - return TRUE; - } - - return CWnd::OnSetCursor(inWnd, inHitTest, inMessage); -} - -UINT CColorList::OnGetDlgCode() -{ - return DLGC_WANTARROWS; -} - -void CColorList::OnSetFocus(CWnd* pOldWnd) -{ - if (mCurCell < mCells.GetSize()) - InvalidateRect(mCells[mCurCell].Rect, TRUE); - - CWnd::OnSetFocus(pOldWnd); -} - -void CColorList::OnKillFocus(CWnd* pNewWnd) -{ - if (mCurCell < mCells.GetSize()) - InvalidateRect(mCells[mCurCell].Rect, TRUE); - - CWnd::OnKillFocus(pNewWnd); -} - -void CColorList::OnSize(UINT nType, int cx, int cy) -{ - CWnd::OnSize(nType, cx, cy); - - UpdateLayout(); -} diff --git a/win/Colorlst.h b/win/Colorlst.h deleted file mode 100644 index ba6cebd6..00000000 --- a/win/Colorlst.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _COLORLST_H_ -#define _COLORLST_H_ - -class CColorToolTipCtrl : public CMFCToolTipCtrl -{ - DECLARE_DYNAMIC(CColorToolTipCtrl) - -public: - CColorToolTipCtrl(CMFCToolTipInfo* pParams = NULL) - : CMFCToolTipCtrl(pParams) - { - } - - virtual ~CColorToolTipCtrl() - { - } - -protected: - virtual CSize GetIconSize(); - virtual BOOL OnDrawIcon(CDC* pDC, CRect rectImage); - - DECLARE_MESSAGE_MAP() -}; - -struct CColorListGroup -{ - CRect Rect; -}; - -struct CColorListCell -{ - CRect Rect; - COLORREF Color; - int ColorIndex; -}; - -class CColorList : public CWnd -{ -public: - CColorList(); - virtual ~CColorList(); - - BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); - - void SetColorIndex(int ColorIndex) - { - for (int CellIdx = 0; CellIdx < mCells.GetSize(); CellIdx++) - { - if (mCells[CellIdx].ColorIndex == ColorIndex) - { - SelectCell(CellIdx); - return; - } - } - } - - int GetColorIndex() const - { - return mCells[mCurCell].ColorIndex; - } - -protected: - CArray mGroups; - CArray mCells; - - int mColumns; - int mRows; - - int mCurCell; - CPoint mMouseDown; - BOOL mTracking; - - CColorToolTipCtrl mToolTip; - - void UpdateColors(); - void UpdateLayout(); - void Draw(CDC& dc); - void SelectCell(int CellIdx); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CColorList) - public: - virtual BOOL PreTranslateMessage(MSG* pMsg); - //}}AFX_VIRTUAL - - // Generated message map functions -protected: - //{{AFX_MSG(CColorList) - afx_msg void OnPaint(); - afx_msg BOOL OnEraseBkgnd(CDC* pDC); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnSize(UINT nType, int cx, int cy); - afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnSetFocus(CWnd* pOldWnd); - afx_msg void OnKillFocus(CWnd* pNewWnd); - afx_msg UINT OnGetDlgCode(); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -#endif // _COLORLST_H_ \ No newline at end of file diff --git a/win/Figdlg.cpp b/win/Figdlg.cpp deleted file mode 100644 index b3d2b204..00000000 --- a/win/Figdlg.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#include "lc_global.h" -#include "LeoCAD.h" -#include "FigDlg.h" -#include "minifig.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CMinifigDlg dialog - -CMinifigDlg::CMinifigDlg(void* param, CWnd* pParent /*=NULL*/) - : CDialog(CMinifigDlg::IDD, pParent) -{ - m_pMinifig = (MinifigWizard*)param; - m_pMinifigWnd = NULL; - - //{{AFX_DATA_INIT(CMinifigDlg) - //}}AFX_DATA_INIT -} - - -void CMinifigDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CMinifigDlg) - DDX_Control(pDX, IDC_MF_HATSCOLOR, m_clrHats); - DDX_Control(pDX, IDC_MF_HATS2COLOR, m_clrHats2); - DDX_Control(pDX, IDC_MF_HEADCOLOR, m_clrHead); - DDX_Control(pDX, IDC_MF_NECKCOLOR, m_clrNeck); - DDX_Control(pDX, IDC_MF_BODYCOLOR, m_clrBody); - DDX_Control(pDX, IDC_MF_BODY2COLOR, m_clrBody2); - DDX_Control(pDX, IDC_MF_BODY3COLOR, m_clrBody3); - DDX_Control(pDX, IDC_MF_ARMLCOLOR, m_clrArmLeft); - DDX_Control(pDX, IDC_MF_ARMRCOLOR, m_clrArmRight); - DDX_Control(pDX, IDC_MF_HANDLCOLOR, m_clrHandLeft); - DDX_Control(pDX, IDC_MF_HANDRCOLOR, m_clrHandRight); - DDX_Control(pDX, IDC_MF_TOOLLCOLOR, m_clrToolLeft); - DDX_Control(pDX, IDC_MF_TOOLRCOLOR, m_clrToolRight); - DDX_Control(pDX, IDC_MF_LEGLCOLOR, m_clrLegLeft); - DDX_Control(pDX, IDC_MF_LEGRCOLOR, m_clrLegRight); - DDX_Control(pDX, IDC_MF_SHOELCOLOR, m_clrShoeLeft); - DDX_Control(pDX, IDC_MF_SHOERCOLOR, m_clrShoeRight); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CMinifigDlg, CDialog) - //{{AFX_MSG_MAP(CMinifigDlg) - //}}AFX_MSG_MAP - ON_MESSAGE(CPN_SELENDOK, OnColorSelEndOK) - ON_CONTROL_RANGE(CBN_SELENDOK, IDC_MF_HATS, IDC_MF_SHOER, OnPieceSelEndOK) - ON_CONTROL_RANGE(EN_CHANGE, IDC_MF_HATSANGLE, IDC_MF_SHOERANGLE, OnChangeAngle) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CMinifigDlg message handlers - -BOOL CMinifigDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - ModifyStyle(0, WS_CLIPCHILDREN, 0); - - RECT r; - ::GetWindowRect(::GetDlgItem(m_hWnd, IDC_PREVIEWSTATIC), &r); - ScreenToClient(&r); - - HINSTANCE hInst = AfxGetInstanceHandle(); - WNDCLASS wndcls; -LRESULT CALLBACK GLWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - -#define OPENGL_CLASSNAME _T("LeoCADOpenGLClass") -#define MINIFIG_CLASSNAME _T("LeoCADMinifigOpenGLClass") - - // check if our class is registered - if(!(GetClassInfo(hInst, MINIFIG_CLASSNAME, &wndcls))) - { - if (GetClassInfo(hInst, OPENGL_CLASSNAME, &wndcls)) - { - // set our class name - wndcls.lpszClassName = MINIFIG_CLASSNAME; - wndcls.lpfnWndProc = GLWindowProc; - - // register class - if (!AfxRegisterClass(&wndcls)) - AfxThrowResourceException(); - } - else - AfxThrowResourceException(); - } - - m_pMinifigWnd = new CWnd; - m_pMinifigWnd->CreateEx(0, MINIFIG_CLASSNAME, "LeoCAD", WS_BORDER | WS_CHILD | WS_VISIBLE, r, this, 0, m_pMinifig); - - for (int i = 0; i < LC_MFW_NUMITEMS; i++) - ((CColorPicker*)GetDlgItem(IDC_MF_HATSCOLOR+i))->SetColorIndex(m_pMinifig->m_Colors[i]); - - for (int i = 0; i < LC_MFW_NUMITEMS; i++) - { - CComboBox* pCombo = (CComboBox*)GetDlgItem(i+IDC_MF_HATS); - ObjArray& Pieces = m_pMinifig->mSettings[i]; - - for (int j = 0; j < Pieces.GetSize(); j++) - pCombo->AddString(Pieces[j].Description); - } - - for (int i = 0; i < LC_MFW_NUMITEMS; i++) - { - CComboBox* pCombo = (CComboBox*)GetDlgItem(i + IDC_MF_HATS); - pCombo->SetCurSel(m_pMinifig->GetSelectionIndex(i)); - } - - for (int i = IDC_MF_HATSSPIN; i <= IDC_MF_SHOERSPIN; i++) - ((CSpinButtonCtrl*)GetDlgItem(i))->SetRange(-360, 360); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -BOOL CMinifigDlg::DestroyWindow() -{ - if (m_pMinifigWnd) - { - m_pMinifigWnd->DestroyWindow(); - delete m_pMinifigWnd; - m_pMinifigWnd = NULL; - } - - return CDialog::DestroyWindow(); -} - -LONG CMinifigDlg::OnColorSelEndOK(UINT lParam, LONG wParam) -{ - m_pMinifig->SetColor(wParam - IDC_MF_HATSCOLOR, lParam); - m_pMinifig->Redraw(); - - return TRUE; -} - -void CMinifigDlg::OnPieceSelEndOK(UINT nID) -{ - CComboBox* Combo = (CComboBox*)GetDlgItem(nID); - m_pMinifig->SetSelectionIndex(nID - IDC_MF_HATS, Combo->GetCurSel()); - m_pMinifig->Redraw(); -} - -void CMinifigDlg::OnChangeAngle(UINT nID) -{ - int index[] = { LC_MFW_HATS, LC_MFW_HATS2, LC_MFW_HEAD, LC_MFW_RARM, LC_MFW_LARM, LC_MFW_RHAND, LC_MFW_LHAND, - LC_MFW_RHANDA, LC_MFW_LHANDA, LC_MFW_RLEG, LC_MFW_LLEG, LC_MFW_RLEGA, LC_MFW_LLEGA }; - - char tmp[65]; - GetDlgItem(nID)->GetWindowText(tmp, 65); - - if (m_pMinifigWnd) - { - m_pMinifig->SetAngle(index[nID-IDC_MF_HATSANGLE], (float)strtod(tmp, NULL)); - m_pMinifig->Redraw(); - } -} diff --git a/win/Figdlg.h b/win/Figdlg.h deleted file mode 100644 index 3f4be816..00000000 --- a/win/Figdlg.h +++ /dev/null @@ -1,73 +0,0 @@ -#if !defined(AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_) -#define AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// FigDlg.h : header file -// - -#include "ClrPick.h" - -///////////////////////////////////////////////////////////////////////////// -// CMinifigDlg dialog - -class MinifigWizard; - -class CMinifigDlg : public CDialog -{ -// Construction -public: - CMinifigDlg(void* param, CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CMinifigDlg) - enum { IDD = IDD_MINIFIG }; - CColorPicker m_clrHats; - CColorPicker m_clrHats2; - CColorPicker m_clrHead; - CColorPicker m_clrNeck; - CColorPicker m_clrBody; - CColorPicker m_clrBody2; - CColorPicker m_clrBody3; - CColorPicker m_clrArmLeft; - CColorPicker m_clrArmRight; - CColorPicker m_clrHandLeft; - CColorPicker m_clrHandRight; - CColorPicker m_clrToolLeft; - CColorPicker m_clrToolRight; - CColorPicker m_clrLegLeft; - CColorPicker m_clrLegRight; - CColorPicker m_clrShoeLeft; - CColorPicker m_clrShoeRight; - //}}AFX_DATA - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CMinifigDlg) - public: - virtual BOOL DestroyWindow(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - CWnd* m_pMinifigWnd; - MinifigWizard* m_pMinifig; - - afx_msg LONG OnColorSelEndOK(UINT lParam, LONG wParam); - void OnPieceSelEndOK(UINT nID); - void OnChangeAngle(UINT nID); - - // Generated message map functions - //{{AFX_MSG(CMinifigDlg) - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_FIGDLG_H__80DF3A21_90D2_11D1_A740_444553540000__INCLUDED_) diff --git a/win/Libdlg.cpp b/win/Libdlg.cpp deleted file mode 100644 index 06410d29..00000000 --- a/win/Libdlg.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "LibDlg.h" -#include "GroupDlg.h" -#include "Print.h" -#include "Tools.h" -#include "ProgDlg.h" -#include "project.h" -#include "pieceinf.h" -#include "globals.h" -#include "system.h" -#include "lc_library.h" -#include "lc_application.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -// Function to sort the list control. -static int CALLBACK ListCompare(LPARAM lP1, LPARAM lP2, LPARAM lParamSort) -{ - int ret; - - if ((lP1 < 0) || (lP2 < 0)) - return 0; - - if ((lParamSort & ~0xF0) == 0) - ret = strcmpi(((PieceInfo*)lP1)->m_strDescription, ((PieceInfo*)lP2)->m_strDescription); - else - ret = strcmpi(((PieceInfo*)lP1)->m_strName, ((PieceInfo*)lP2)->m_strName); - - return ret; -} - -///////////////////////////////////////////////////////////////////////////// -// CLibraryDlg dialog - -CLibraryDlg::CLibraryDlg(CWnd* pParent /*=NULL*/) - : CDialog(CLibraryDlg::IDD, pParent) -{ - m_SortColumn = 0; - - //{{AFX_DATA_INIT(CLibraryDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - -CLibraryDlg::~CLibraryDlg() -{ -} - -void CLibraryDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CLibraryDlg) - DDX_Control(pDX, IDC_LIBDLG_TREE, m_Tree); - DDX_Control(pDX, IDC_LIBDLG_LIST, m_List); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CLibraryDlg, CDialog) - //{{AFX_MSG_MAP(CLibraryDlg) - ON_NOTIFY(TVN_SELCHANGED, IDC_LIBDLG_TREE, OnSelChangedTree) - ON_NOTIFY(LVN_COLUMNCLICK, IDC_LIBDLG_LIST, OnListColumnClick) - //}}AFX_MSG_MAP - ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) - ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CLibraryDlg message handlers - -BOOL CLibraryDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Add the ToolBar. - if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_LIBRARY)) - { - TRACE0("Failed to create toolbar\n"); - return -1; // fail to create - } - - m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY); - - // We need to resize the dialog to make room for control bars. - // First, figure out how big the control bars are. - CRect rcClientStart; - CRect rcClientNow; - GetClientRect(rcClientStart); - RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0, reposQuery, rcClientNow); - - // Now move all the controls so they are in the same relative - // position within the remaining client area as they would be - // with no control bars. - CPoint ptOffset(rcClientNow.left - rcClientStart.left, rcClientNow.top - rcClientStart.top); - - CRect rcChild; - CWnd* pwndChild = GetWindow(GW_CHILD); - while (pwndChild) - { - pwndChild->GetWindowRect(rcChild); - ScreenToClient(rcChild); - rcChild.OffsetRect(ptOffset); - pwndChild->MoveWindow(rcChild, FALSE); - pwndChild = pwndChild->GetNextWindow(); - } - - // Adjust the dialog window dimensions - CRect rcWindow; - GetWindowRect(rcWindow); - rcWindow.right += rcClientStart.Width() - rcClientNow.Width(); - rcWindow.bottom += rcClientStart.Height() - rcClientNow.Height(); - MoveWindow(rcWindow, FALSE); - - // And position the control bars - RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); - - m_TreeImages.Create(IDB_PARTICONS, 16, 0, RGB (0,128,128)); - m_Tree.SetImageList(&m_TreeImages, TVSIL_NORMAL); - - RECT rect; - m_List.GetWindowRect(&rect); - m_List.InsertColumn(0, "Name", LVCFMT_LEFT, rect.right - rect.left - GetSystemMetrics(SM_CXVSCROLL) - 4 - 60, 0); - m_List.InsertColumn(1, "Number", LVCFMT_LEFT, 60, 1); - - UpdateList(); - UpdateTree(); - - return TRUE; -} - -BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam) -{ - switch (LOWORD(wParam)) - { - case ID_LIBDLG_FILE_OPEN: - { - lcGetPiecesLibrary()->LoadCategories(NULL); - UpdateTree(); - return TRUE; - } - - case ID_LIBDLG_FILE_SAVE: - { - lcGetPiecesLibrary()->DoSaveCategories(false); - return TRUE; - } - - case ID_LIBDLG_FILE_SAVEAS: - { - lcGetPiecesLibrary()->DoSaveCategories(true); - return TRUE; - } - - case ID_LIBDLG_FILE_PRINTCATALOG: - { - PRINT_PARAMS* param = (PRINT_PARAMS*)malloc(sizeof(PRINT_PARAMS)); - param->pParent = this; - param->pMainFrame = (CFrameWndEx*)AfxGetMainWnd(); - AfxBeginThread(PrintCatalogFunction, param); - - return TRUE; - } - - case ID_LIBDLG_FILE_TEXTURES: - { - } break; - - case ID_LIBDLG_CATEGORY_RESET: - { - if (SystemDoMessageBox("Are you sure you want to reset the categories?", LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES) - { - lcGetPiecesLibrary()->ResetCategories(); - - UpdateList(); - UpdateTree(); - } - - return TRUE; - } - - case ID_LIBDLG_CATEGORY_NEW: - { - LC_CATEGORYDLG_OPTS Opts; - Opts.Name = "New Category"; - Opts.Keywords = ""; - - if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts)) - { - lcGetPiecesLibrary()->AddCategory(Opts.Name, Opts.Keywords); - } - - UpdateTree(); - - return TRUE; - } - - case ID_LIBDLG_CATEGORY_REMOVE: - { - HTREEITEM Item = m_Tree.GetSelectedItem(); - - if (Item == NULL) - break; - - lcPiecesLibrary* Lib = lcGetPiecesLibrary(); - CString CategoryName = m_Tree.GetItemText(Item); - int Index = Lib->FindCategoryIndex((const char*)CategoryName); - - if (Index == -1) - break; - - char Msg[1024]; - const String& Name = Lib->mCategories[Index].Name; - sprintf(Msg, "Are you sure you want to remove the '%s' category?", Name); - - if (SystemDoMessageBox(Msg, LC_MB_YESNO | LC_MB_ICONQUESTION) == LC_YES) - { - Lib->RemoveCategory(Index); - } - - UpdateTree(); - - return TRUE; - } - - case ID_LIBDLG_CATEGORY_EDIT: - { - HTREEITEM Item = m_Tree.GetSelectedItem(); - - if (Item == NULL) - break; - - lcPiecesLibrary* Lib = lcGetPiecesLibrary(); - CString CategoryName = m_Tree.GetItemText(Item); - int Index = Lib->FindCategoryIndex((const char*)CategoryName); - - if (Index == -1) - break; - - LC_CATEGORYDLG_OPTS Opts; - Opts.Name = Lib->mCategories[Index].Name; - Opts.Keywords = Lib->mCategories[Index].Keywords; - - if (SystemDoDialog(LC_DLG_EDITCATEGORY, &Opts)) - { - String OldName = Lib->mCategories[Index].Name; - Lib->SetCategory(Index, Opts.Name, Opts.Keywords); - } - - UpdateTree(); - - return TRUE; - } - - case ID_LIBDLG_PIECE_NEW: - { - return TRUE; - } - - case ID_LIBDLG_PIECE_EDIT: - { - return TRUE; - } - } - - return CDialog::OnCommand(wParam, lParam); -} - -void CLibraryDlg::UpdateList() -{ - m_List.DeleteAllItems(); - m_List.SetRedraw(FALSE); - - lcPiecesLibrary *Lib = lcGetPiecesLibrary(); - - HTREEITEM CategoryItem = m_Tree.GetSelectedItem(); - CString CategoryName = m_Tree.GetItemText(CategoryItem); - int CategoryIndex = Lib->FindCategoryIndex((const char*)CategoryName); - - if (CategoryIndex != -1) - { - PtrArray SinglePieces, GroupedPieces; - - Lib->GetCategoryEntries(CategoryIndex, false, SinglePieces, GroupedPieces); - - for (int i = 0; i < SinglePieces.GetSize(); i++) - { - PieceInfo* Info = SinglePieces[i]; - - LVITEM lvi; - lvi.mask = LVIF_TEXT | LVIF_PARAM; - lvi.iItem = 0; - lvi.iSubItem = 0; - lvi.lParam = (LPARAM)Info; - lvi.pszText = Info->m_strDescription; - int idx = m_List.InsertItem(&lvi); - - m_List.SetItemText(idx, 1, Info->m_strName); - } - } - else - { - if (CategoryName == "Unassigned") - { - // Test each piece against all categories. - for (int i = 0; i < Lib->mPieces.GetSize(); i++) - { - PieceInfo* Info = Lib->mPieces[i]; - int j; - - for (j = 0; j < Lib->mCategories.GetSize(); j++) - { - if (Lib->PieceInCategory(Info, Lib->mCategories[j].Keywords)) - break; - } - - if (j == Lib->mCategories.GetSize()) - { - LVITEM lvi; - lvi.mask = LVIF_TEXT | LVIF_PARAM; - lvi.iItem = 0; - lvi.iSubItem = 0; - lvi.lParam = (LPARAM)Info; - lvi.pszText = Info->m_strDescription; - int idx = m_List.InsertItem(&lvi); - - m_List.SetItemText(idx, 1, Info->m_strName); - } - } - } - else if (CategoryName == "Pieces") - { - for (int i = 0; i < Lib->mPieces.GetSize(); i++) - { - PieceInfo* Info = Lib->mPieces[i]; - - LVITEM lvi; - lvi.mask = LVIF_TEXT | LVIF_PARAM; - lvi.iItem = 0; - lvi.iSubItem = 0; - lvi.lParam = (LPARAM)Info; - lvi.pszText = Info->m_strDescription; - int idx = m_List.InsertItem(&lvi); - - m_List.SetItemText(idx, 1, Info->m_strName); - } - } - } - - m_List.SortItems((PFNLVCOMPARE)ListCompare, m_SortColumn); - m_List.SetRedraw(TRUE); -} - -void CLibraryDlg::UpdateTree() -{ - m_Tree.SetRedraw(FALSE); - m_Tree.DeleteAllItems(); - - HTREEITEM Root = m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT, "Pieces", 0, 1, 0, 0, 0, TVI_ROOT, TVI_SORT); - - lcPiecesLibrary *Lib = lcGetPiecesLibrary(); - for (int i = 0; i < Lib->mCategories.GetSize(); i++) - m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT, Lib->mCategories[i].Name, 0, 1, 0, 0, 0, Root, TVI_SORT); - - m_Tree.InsertItem(TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM|TVIF_TEXT, "Unassigned", 0, 1, 0, 0, 0, Root, TVI_LAST); - - m_Tree.Expand(Root, TVE_EXPAND); - m_Tree.SetRedraw(TRUE); - m_Tree.Invalidate(); -} - -void CLibraryDlg::OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; - UpdateList(); - *pResult = 0; -} - -void CLibraryDlg::OnCancel() -{ - // Check if it's ok to close the dialog - if (!lcGetPiecesLibrary()->SaveCategories()) - return; - - CDialog::OnCancel(); -} - -void CLibraryDlg::OnOK() -{ - // Check if it's ok to close the dialog - if (!lcGetPiecesLibrary()->SaveCategories()) - return; - - CDialog::OnOK(); -} - -BOOL CLibraryDlg::ContinueModal() -{ - HTREEITEM h = m_Tree.GetSelectedItem(); - BOOL bValid = (h != m_Tree.GetRootItem()) && (h != NULL); - - EnableControl(ID_LIBDLG_GROUP_RENAME, bValid); - EnableControl(ID_LIBDLG_GROUP_DELETE, bValid); - - return CDialog::ContinueModal(); -} - -void CLibraryDlg::EnableControl(UINT nID, BOOL bEnable) -{ - GetMenu()->GetSubMenu(1)->EnableMenuItem(nID, MF_BYCOMMAND | (bEnable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED))); - int state = m_wndToolBar.GetToolBarCtrl().GetState(nID) & ~TBSTATE_ENABLED; - if (bEnable) - state |= TBSTATE_ENABLED; - m_wndToolBar.GetToolBarCtrl().SetState(nID, state); -} - -BOOL CLibraryDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) -{ - ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW); - - // allow top level routing frame to handle the message - if (GetRoutingFrame() != NULL) - return FALSE; - - // need to handle both ANSI and UNICODE versions of the message - TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR; - TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR; - CString cstTipText; - UINT nID = pNMHDR->idFrom; - - if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) || - pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND)) - { - // idFrom is actually the HWND of the tool - nID = ((UINT)(WORD)::GetDlgCtrlID((HWND)nID)); - } - - if (nID != 0) // will be zero on a separator - { - cstTipText.LoadString(nID); - } - - // Non-UNICODE Strings only are shown in the tooltip window... - if (pNMHDR->code == TTN_NEEDTEXTA) - lstrcpyn(pTTTA->szText, cstTipText, (sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0]))); - else - _mbstowcsz(pTTTW->szText, cstTipText, (sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0]))); - - *pResult = 0; - - // bring the tooltip window above other popup windows - ::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0, - SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE); - - return TRUE; // message was handled -} - -void CLibraryDlg::OnListColumnClick(NMHDR* pNMHDR, LRESULT* pResult) -{ - NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; - - // Save the column index. - m_SortColumn = pNMListView->iSubItem; - - m_List.SortItems((PFNLVCOMPARE)ListCompare, m_SortColumn); - - *pResult = 0; -} diff --git a/win/Libdlg.h b/win/Libdlg.h deleted file mode 100644 index c5d0039c..00000000 --- a/win/Libdlg.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _LIBDLG_H_ -#define _LIBDLG_H_ - -#include "array.h" -#include "str.h" - -class PieceInfo; - -class CLibraryDlg : public CDialog -{ -// Construction -public: - CLibraryDlg(CWnd* pParent = NULL); // standard constructor - virtual ~CLibraryDlg(); - -// Dialog Data - //{{AFX_DATA(CLibraryDlg) - enum { IDD = IDD_LIBRARY }; - CTreeCtrl m_Tree; - CListCtrl m_List; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CLibraryDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); - //}}AFX_VIRTUAL - -// Implementation -public: - void EnableControl(UINT nID, BOOL bEnable); - BOOL ContinueModal(); - void UpdateTree(); - void UpdateList(); - - CToolBar m_wndToolBar; - CImageList m_TreeImages; - int m_SortColumn; - -protected: - // Generated message map functions - //{{AFX_MSG(CLibraryDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult); - virtual void OnCancel(); - virtual void OnOK(); - afx_msg void OnListColumnClick(NMHDR* pNMHDR, LRESULT* pResult); - //}}AFX_MSG - - afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult); - - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // _LIBDLG_H_ diff --git a/win/Pieceprv.cpp b/win/Pieceprv.cpp deleted file mode 100644 index 6cdb33a4..00000000 --- a/win/Pieceprv.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "lc_global.h" -#include "lc_application.h" -#include "leocad.h" -#include "PiecePrv.h" -#include "Tools.h" -#include "pieceinf.h" -#include "globals.h" -#include "project.h" -#include "preview.h" -#include "view.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPiecePreview - -CPiecePreview::CPiecePreview() -{ - m_Preview = NULL; -} - -CPiecePreview::~CPiecePreview() -{ - delete m_Preview; -} - - -BEGIN_MESSAGE_MAP(CPiecePreview, CWnd) - //{{AFX_MSG_MAP(CPiecePreview) - ON_WM_CREATE() - ON_WM_DESTROY() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CPiecePreview message handlers - -int CPiecePreview::OnCreate(LPCREATESTRUCT lpCreateStruct) -{ - if (CWnd::OnCreate(lpCreateStruct) == -1) - return -1; - - Project* project = lcGetActiveProject(); - - m_Preview = new PiecePreview(project->GetActiveView()); - m_Preview->CreateFromWindow(m_hWnd); - m_Preview->MakeCurrent(); - - return 0; -} - -void CPiecePreview::OnDestroy() -{ - if (m_Preview) - { - m_Preview->DestroyContext(); - delete m_Preview; - m_Preview = NULL; - } - - CWnd::OnDestroy(); -} - -void CPiecePreview::SetPieceInfo(PieceInfo* pInfo) -{ - m_Preview->SetCurrentPiece(pInfo); -} - -PieceInfo* CPiecePreview::GetPieceInfo() const -{ - return m_Preview->GetCurrentPiece(); -} - -BOOL GLWindowPreTranslateMessage (GLWindow *wnd, MSG *pMsg); -LRESULT CPiecePreview::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) -{ - if (m_Preview) - { - MSG msg; - msg.message = message; - msg.wParam = wParam; - msg.lParam = lParam; - - if (GLWindowPreTranslateMessage(m_Preview, &msg)) - return TRUE; - } - - return CWnd::WindowProc(message, wParam, lParam); -} diff --git a/win/Pieceprv.h b/win/Pieceprv.h deleted file mode 100644 index 67f9e374..00000000 --- a/win/Pieceprv.h +++ /dev/null @@ -1,56 +0,0 @@ -#if !defined(AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_) -#define AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// PiecePrv.h : header file -// - -class PieceInfo; -class PiecePreview; - -///////////////////////////////////////////////////////////////////////////// -// CPiecePreview window - -class CPiecePreview : public CWnd -{ -// Construction -public: - CPiecePreview(); - -// Attributes -public: - void SetPieceInfo(PieceInfo* pInfo); - PieceInfo* GetPieceInfo () const; - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPiecePreview) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CPiecePreview(); - - // Generated message map functions -protected: - PiecePreview* m_Preview; - - //{{AFX_MSG(CPiecePreview) - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - afx_msg void OnDestroy(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PIECEPRV_H__FBCDC803_4059_11D2_8202_C2FDEFF7E618__INCLUDED_) diff --git a/win/Povdlg.cpp b/win/Povdlg.cpp deleted file mode 100644 index 986b7dcf..00000000 --- a/win/Povdlg.cpp +++ /dev/null @@ -1,115 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "POVDlg.h" -#include "tools.h" -#include "resource.hm" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CPOVDlg dialog - -const DWORD CPOVDlg::m_nHelpIDs[] = -{ - IDC_POVDLG_LGEO, HIDC_POVDLG_LGEO, - IDC_POVDLG_OUTPOV, HIDC_POVDLG_OUTPOV, - IDC_POVDLG_POVRAY, HIDC_POVDLG_POVRAY, - IDC_POVDLG_RENDER, HIDC_POVDLG_RENDER, - 0, 0 -}; - -CPOVDlg::CPOVDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPOVDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CPOVDlg) - m_bRender = FALSE; - m_strPOV = _T(""); - m_strOut = _T(""); - m_strLGEO = _T(""); - //}}AFX_DATA_INIT -} - -void CPOVDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CPOVDlg) - DDX_Check(pDX, IDC_POVDLG_RENDER, m_bRender); - DDX_Text(pDX, IDC_POVDLG_POVRAY, m_strPOV); - DDX_Text(pDX, IDC_POVDLG_OUTPOV, m_strOut); - DDX_Text(pDX, IDC_POVDLG_LGEO, m_strLGEO); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CPOVDlg, CDialog) - //{{AFX_MSG_MAP(CPOVDlg) - ON_BN_CLICKED(IDC_POVDLG_POVBROWSE, OnPovbrowse) - ON_BN_CLICKED(IDC_POVDLG_POVOUTBROWSE, OnPovoutbrowse) - ON_BN_CLICKED(IDC_POVDLG_LGEOBROWSE, OnPovdlgLgeobrowse) - ON_WM_CONTEXTMENU() - ON_WM_HELPINFO() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CPOVDlg message handlers - -void CPOVDlg::OnOK() -{ - UpdateData (TRUE); - - if (m_strOut.GetLength() == 0) - return; - - CDialog::OnOK(); -} - -void CPOVDlg::OnPovbrowse() -{ - CFileDialog dlg(TRUE, "*.exe", m_strPOV, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*||", this); - if (dlg.DoModal() == IDOK) - { - UpdateData (TRUE); - m_strPOV = dlg.GetPathName(); - UpdateData (FALSE); - } -} - -void CPOVDlg::OnPovoutbrowse() -{ - CFileDialog dlg(FALSE, "*.pov", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - "POV-Ray Files (*.pov)|*.pov|All Files (*.*)|*.*||", AfxGetMainWnd()); - if (dlg.DoModal() == IDOK) - { - UpdateData (TRUE); - m_strOut = dlg.GetPathName(); - UpdateData (FALSE); - } -} - -void CPOVDlg::OnContextMenu(CWnd* pWnd, CPoint point) -{ - ::WinHelp(pWnd->m_hWnd, theApp.m_pszHelpFilePath, - HELP_CONTEXTMENU, (DWORD)(LPVOID)m_nHelpIDs); -} - -BOOL CPOVDlg::OnHelpInfo(HELPINFO* pHelpInfo) -{ - return ::WinHelp((HWND)pHelpInfo->hItemHandle, theApp.m_pszHelpFilePath, - HELP_WM_HELP, (DWORD)(LPVOID)m_nHelpIDs); -} - -void CPOVDlg::OnPovdlgLgeobrowse() -{ - CString str; - if (FolderBrowse(&str, _T("Select LGEO folder"), GetSafeHwnd())) - { - UpdateData(TRUE); - m_strLGEO = str; - UpdateData(FALSE); - } -} diff --git a/win/Stepdlg.cpp b/win/Stepdlg.cpp deleted file mode 100644 index d9b92615..00000000 --- a/win/Stepdlg.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "StepDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CStepDlg dialog - - -CStepDlg::CStepDlg(CStepDlg** pointer, CWnd* pParent) - : CDialog(CStepDlg::IDD, pParent) -{ - m_pView = pParent; - m_pPointer = pointer; - - //{{AFX_DATA_INIT(CStepDlg) - m_nStep = 0; - //}}AFX_DATA_INIT -} - - -void CStepDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CStepDlg) - DDX_Control(pDX, IDC_STEP_SLIDER, m_Slider); - DDX_Text(pDX, IDC_STEP_EDIT, m_nStep); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CStepDlg, CDialog) - //{{AFX_MSG_MAP(CStepDlg) - ON_BN_CLICKED(IDAPPLY, OnApply) - ON_WM_HSCROLL() - ON_WM_DESTROY() - ON_EN_CHANGE(IDC_STEP_EDIT, OnEditChange) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CStepDlg message handlers - -void CStepDlg::UpdateRange(int nTime, int nTotal) -{ - m_Slider.SetRange (1, nTotal); - m_Slider.SetPos (nTime); - ((CSpinButtonCtrl*)GetDlgItem(IDC_STEP_SPIN))->SetRange(1, nTotal); - m_nStep = nTime; - UpdateData(FALSE); -} - -void CStepDlg::OnCancel() -{ - DestroyWindow(); -} - -void CStepDlg::OnOK() -{ - UpdateData(); - m_pView->PostMessage(WM_LC_SET_STEP, m_nStep); - DestroyWindow(); -} - -void CStepDlg::OnApply() -{ - UpdateData(); - m_pView->PostMessage(WM_LC_SET_STEP, m_nStep); -} - -void CStepDlg::PostNcDestroy() -{ - *m_pPointer = NULL; - delete this; -} - -void CStepDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ - m_nStep = m_Slider.GetPos(); - UpdateData(FALSE); - - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); -} - -void CStepDlg::OnEditChange() -{ - if (m_Slider.m_hWnd) - { - UpdateData(); - m_Slider.SetPos(m_nStep); - } -} - -void CStepDlg::OnDestroy() -{ - RECT rc; - GetWindowRect(&rc); - char buf[30]; - sprintf(buf, "%d, %d", rc.top, rc.left); - AfxGetApp()->WriteProfileString ("Settings", "Step Dialog", buf); - - CDialog::OnDestroy(); -} -/* -void CStepDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp) -{ - CRect rc = lpncsp->rgrc[0]; - rc.DeflateRect(2, 2, 2, 2); - rc.top += 10; -// rc.bottom -= 10; - lpncsp->rgrc[0] = rc; -} - -void CStepDlg::OnNcPaint() -{ - CWindowDC dc(this); - CRect rectClient; - GetClientRect(rectClient); - CRect rectWindow; - GetWindowRect(rectWindow); - ScreenToClient(rectWindow); - - rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top+2); - rectWindow.bottom = rectWindow.top + 10; - ::FillRect(dc.m_hDC, rectWindow, (HBRUSH)(COLOR_ACTIVECAPTION+1)); - - CRect rectBorder; - GetWindowRect(rectBorder); - rectBorder.OffsetRect(-rectBorder.left, -rectBorder.top); - - dc.Draw3dRect(rectBorder, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_3DDKSHADOW)); - rectBorder.DeflateRect(1, 1); - dc.Draw3dRect(rectBorder, ::GetSysColor(COLOR_3DHIGHLIGHT), ::GetSysColor(COLOR_BTNSHADOW)); - - rectClient.OffsetRect(-rectWindow.left, -rectWindow.top); - dc.ExcludeClipRect(rectClient); - - // draw borders in non-client area - rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top); - - // erase parts not drawn - dc.IntersectClipRect(rectWindow); - - // erase NC background the hard way -// HBRUSH hbr = (HBRUSH)GetClassLong(m_hWnd, GCL_HBRBACKGROUND); -// ::FillRect(dc.m_hDC, rectWindow, hbr); - - - ReleaseDC(&dc); -} -*/ diff --git a/win/Stepdlg.h b/win/Stepdlg.h deleted file mode 100644 index 8b948c78..00000000 --- a/win/Stepdlg.h +++ /dev/null @@ -1,58 +0,0 @@ -#if !defined(AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_) -#define AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// StepDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CStepDlg dialog - -class CStepDlg : public CDialog -{ -// Construction -public: - CStepDlg(CStepDlg** pointer, CWnd* pParent); // standard constructor - void UpdateRange(int nTime, int nTotal); - -// Dialog Data - //{{AFX_DATA(CStepDlg) - enum { IDD = IDD_STEP }; - CSliderCtrl m_Slider; - UINT m_nStep; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CStepDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual void PostNcDestroy(); - //}}AFX_VIRTUAL - -// Implementation -protected: - CWnd* m_pView; - CStepDlg** m_pPointer; - - // Generated message map functions - //{{AFX_MSG(CStepDlg) - afx_msg void OnApply(); - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - virtual void OnOK(); - afx_msg void OnDestroy(); - virtual void OnCancel(); - //}}AFX_MSG - - afx_msg void OnEditChange(); - - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STEPDLG_H__D8E4D902_5BCF_11D2_8202_A3A5E1B1BA04__INCLUDED_) diff --git a/win/Steppop.cpp b/win/Steppop.cpp deleted file mode 100644 index 5606e698..00000000 --- a/win/Steppop.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "StepPop.h" -#include "project.h" -#include "globals.h" -#include "lc_application.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CStepPopup - -CStepPopup::CStepPopup() -{ -} - -CStepPopup::CStepPopup(CPoint pt, CWnd* pParentWnd) -{ - pt.x = min (pt.x, GetSystemMetrics(SM_CXSCREEN)-100); - pt.y = min (pt.y, GetSystemMetrics(SM_CYSCREEN)-45); - - CString szClassName = AfxRegisterWndClass(CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW, 0, (HBRUSH)GetStockObject(LTGRAY_BRUSH),0); - CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP|WS_DLGFRAME, - pt.x, pt.y, 100, 45, pParentWnd->GetSafeHwnd(), 0, NULL); - - m_Slider.Create (WS_CHILD|WS_VISIBLE|TBS_BOTH|TBS_HORZ|TBS_NOTICKS, CRect(5,10,90,30), this, 1000); - - int from, to; - lcGetActiveProject()->GetTimeRange(&from, &to); - m_Slider.SetRange(1, to); - m_Slider.SetPos(from); -} - -CStepPopup::~CStepPopup() -{ -} - - -BEGIN_MESSAGE_MAP(CStepPopup, CWnd) - //{{AFX_MSG_MAP(CStepPopup) - ON_WM_NCDESTROY() - ON_WM_KILLFOCUS() - ON_WM_ACTIVATEAPP() - ON_WM_HSCROLL() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CStepPopup message handlers - -void CStepPopup::OnNcDestroy() -{ - AfxGetMainWnd()->SendMessage(WM_LC_POPUP_CLOSE); - CWnd::OnNcDestroy(); - delete this; -} - -void CStepPopup::OnKillFocus(CWnd* pNewWnd) -{ - CWnd::OnKillFocus(pNewWnd); - - if (pNewWnd && (pNewWnd->m_hWnd != m_Slider.m_hWnd)) - DestroyWindow(); -} - -void CStepPopup::OnActivateApp(BOOL bActive, DWORD hTask) -{ - CWnd::OnActivateApp(bActive, hTask); - - if (!bActive) - DestroyWindow(); -} - -void CStepPopup::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ - int pos = m_Slider.GetPos(); - if (pos > 0) - lcGetActiveProject()->HandleCommand(LC_VIEW_STEP_SET, pos); - - CWnd::OnHScroll(nSBCode, nPos, pScrollBar); -} diff --git a/win/Steppop.h b/win/Steppop.h deleted file mode 100644 index 7cdfb8c3..00000000 --- a/win/Steppop.h +++ /dev/null @@ -1,53 +0,0 @@ -#if !defined(AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_) -#define AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// StepPop.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CStepPopup window - -class CStepPopup : public CWnd -{ -// Construction -public: - CStepPopup(); - CStepPopup(CPoint pt, CWnd* pParentWnd); - -// Attributes -public: - CSliderCtrl m_Slider; - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CStepPopup) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CStepPopup(); - - // Generated message map functions -protected: - //{{AFX_MSG(CStepPopup) - afx_msg void OnNcDestroy(); - afx_msg void OnKillFocus(CWnd* pNewWnd); - afx_msg void OnActivateApp(BOOL bActive, DWORD hTask); - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STEPPOP_H__105A59A6_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_) diff --git a/win/aboutdlg.cpp b/win/aboutdlg.cpp deleted file mode 100644 index bfcd793f..00000000 --- a/win/aboutdlg.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "AboutDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg dialog - -CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) -{ - //{{AFX_DATA_INIT(CAboutDlg) - //}}AFX_DATA_INIT -} - -CAboutDlg::~CAboutDlg() -{ - m_Font.DeleteObject(); -} - -void CAboutDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlg) - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) - //{{AFX_MSG_MAP(CAboutDlg) - ON_BN_CLICKED(IDC_ABTDLG_HOMEPAGE, OnHomepage) - ON_WM_CTLCOLOR() - ON_WM_SETCURSOR() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg message handlers - -BOOL CAboutDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - // Initialize the OpenGL information box. - CString info, tmp; - PIXELFORMATDESCRIPTOR pfd; - DescribePixelFormat(m_hViewDC, GetPixelFormat(m_hViewDC), sizeof(PIXELFORMATDESCRIPTOR), &pfd); - - info = ("Pixel Format: "); - if (pfd.iPixelType == PFD_TYPE_RGBA) - info += "RGBA, "; - else - info += "Color Index, "; - - if (pfd.dwFlags & PFD_DOUBLEBUFFER) - info += "Double Buffer "; - else - info += "Single Buffer "; - - if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == 0) - info += "(Installable Client Driver)\r\n"; - else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) - info += "(Mini-Client Driver)\r\n"; - else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == PFD_GENERIC_FORMAT) - info += "(Generic Software Driver)\r\n"; - else if ((pfd.dwFlags & (PFD_GENERIC_ACCELERATED|PFD_GENERIC_FORMAT)) == PFD_GENERIC_ACCELERATED) - info += "(Unknown Driver Type)\r\n"; - - tmp.Format("Color bits: %d, Depth Buffer: %d bits\r\nOpenGL Version ", pfd.cColorBits, pfd.cDepthBits); - info += tmp; - info += (const char*)glGetString(GL_VERSION); - info += " ("; - info += (const char*)glGetString(GL_RENDERER); - info += " - "; - info += (const char*)glGetString(GL_VENDOR); - info += ")"; - - SetDlgItemText(IDC_ABTDLG_INFO, info); - - // Underline the homepage link. - LOGFONT lf; - CFont* pFont = GetDlgItem(IDC_ABTDLG_HOMEPAGE)->GetFont(); - if (pFont != NULL) - { - pFont->GetLogFont(&lf); - lf.lfUnderline = TRUE; - m_Font.DeleteObject(); - m_Font.CreateFontIndirect(&lf); - GetDlgItem(IDC_ABTDLG_HOMEPAGE)->SetFont(&m_Font); - } - - // Load a "hand" cursor. - m_hLinkCursor = LoadCursor(NULL,MAKEINTRESOURCE(IDC_HAND)); - - AdjustHomepageWindow(); - - // Fix the version number. - SetDlgItemText(IDC_ABTDLG_VERSION, "LeoCAD Version " LC_VERSION_TEXT); - - return TRUE; -} - -// Move and resize the window so that its client area has the same size as the hyperlink text. -// This prevents the hyperlink cursor being active when it is not over the text. -void CAboutDlg::AdjustHomepageWindow() -{ - CWnd *pWnd = GetDlgItem(IDC_ABTDLG_HOMEPAGE); - ASSERT(::IsWindow(pWnd->GetSafeHwnd())); - - // Get the current window rect - CRect rcWnd; - pWnd->GetWindowRect(rcWnd); - - // For a child CWnd object, window rect is relative to the - // upper-left corner of the parent window’s client area. - ScreenToClient(rcWnd); - - // Get the current client rect - CRect rcClient; - pWnd->GetClientRect(rcClient); - - // Calc border size based on window and client rects - int borderWidth = rcWnd.Width() - rcClient.Width(); - int borderHeight = rcWnd.Height() - rcClient.Height(); - - // Get the extent of window text - CString strWndText; - pWnd->GetWindowText(strWndText); - - CDC* pDC = pWnd->GetDC(); - CFont* pOldFont = pDC->SelectObject(&m_Font); - CSize Extent = pDC->GetTextExtent(strWndText); - pDC->SelectObject(pOldFont); - ReleaseDC(pDC); - - // Get the text justification style - DWORD dwStyle = pWnd->GetStyle(); - - // Recalc window size and position based on text justification - if (dwStyle & SS_CENTERIMAGE) - rcWnd.DeflateRect(0, (rcWnd.Height() - Extent.cy) / 2); - else - rcWnd.bottom = rcWnd.top + Extent.cy; - - if (dwStyle & SS_CENTER) - rcWnd.DeflateRect((rcWnd.Width() - Extent.cx) / 2, 0); - else if (dwStyle & SS_RIGHT) - rcWnd.left = rcWnd.right - Extent.cx; - else // SS_LEFT - rcWnd.right = rcWnd.left + Extent.cx; - - // Move and resize the window - pWnd->MoveWindow(rcWnd.left, rcWnd.top, rcWnd.Width() + borderWidth, rcWnd.Height() + borderHeight); -} - -HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) -{ - HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); - - if (pWnd->GetDlgCtrlID() == IDC_ABTDLG_HOMEPAGE) - pDC->SetTextColor(RGB(0, 0, 255)); - - return hbr; -} - -BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) -{ - if (pWnd->GetDlgCtrlID() == IDC_ABTDLG_HOMEPAGE) - { - if (m_hLinkCursor) - ::SetCursor(m_hLinkCursor); - - return TRUE; - } - - return CDialog::OnSetCursor(pWnd, nHitTest, message); -} - -void CAboutDlg::OnHomepage() -{ - ShellExecute(::GetDesktopWindow(), _T("open"), _T("http://www.leocad.org"), NULL, NULL, SW_NORMAL); -} diff --git a/win/aboutdlg.h b/win/aboutdlg.h deleted file mode 100644 index b403e141..00000000 --- a/win/aboutdlg.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef __ABOUTDLG_H__ -#define __ABOUTDLG_H__ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// AboutDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CAboutDlg dialog used for App About - -class CAboutDlg : public CDialog -{ -public: - HDC m_hViewDC; - CAboutDlg(); - virtual ~CAboutDlg(); - -// Dialog Data - //{{AFX_DATA(CAboutDlg) - enum { IDD = IDD_ABOUTBOX }; - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - //{{AFX_MSG(CAboutDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnHomepage(); - afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - void AdjustHomepageWindow(); - - CFont m_Font; // Underlined font. - HCURSOR m_hLinkCursor; // Hand cursor. -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif //__ABOUTDLG_H__ diff --git a/win/arraydlg.cpp b/win/arraydlg.cpp deleted file mode 100644 index f95ac6af..00000000 --- a/win/arraydlg.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "ArrayDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CArrayDlg dialog - - -CArrayDlg::CArrayDlg(CWnd* pParent /*=NULL*/) - : CDialog(CArrayDlg::IDD, pParent) -{ - m_bInitDone = FALSE; - - //{{AFX_DATA_INIT(CArrayDlg) - m_n1DCount = 10; - m_n2DCount = 1; - m_n3DCount = 1; - m_nArrayDimension = 0; - m_nTotal = 10; - m_f2DX = 0.0f; - m_f2DY = 0.0f; - m_f2DZ = 0.0f; - m_f3DX = 0.0f; - m_f3DY = 0.0f; - m_f3DZ = 0.0f; - m_fMoveX = 0.0f; - m_fMoveY = 0.0f; - m_fMoveZ = 0.0f; - m_fRotateX = 0.0f; - m_fRotateY = 0.0f; - m_fRotateZ = 0.0f; - //}}AFX_DATA_INIT -} - - -void CArrayDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CArrayDlg) - DDX_Text(pDX, IDC_ARRAY_1D_COUNT, m_n1DCount); - DDX_Text(pDX, IDC_ARRAY_2D_COUNT, m_n2DCount); - DDX_Text(pDX, IDC_ARRAY_3D_COUNT, m_n3DCount); - DDX_Radio(pDX, IDC_ARRAY_1D, m_nArrayDimension); - DDX_Text(pDX, IDC_ARRAY_TOTAL, m_nTotal); - DDX_Text(pDX, IDC_ARRAY_2D_X, m_f2DX); - DDX_Text(pDX, IDC_ARRAY_2D_Y, m_f2DY); - DDX_Text(pDX, IDC_ARRAY_2D_Z, m_f2DZ); - DDX_Text(pDX, IDC_ARRAY_3D_X, m_f3DX); - DDX_Text(pDX, IDC_ARRAY_3D_Y, m_f3DY); - DDX_Text(pDX, IDC_ARRAY_3D_Z, m_f3DZ); - DDX_Text(pDX, IDC_ARRAY_MOVE_X, m_fMoveX); - DDX_Text(pDX, IDC_ARRAY_MOVE_Y, m_fMoveY); - DDX_Text(pDX, IDC_ARRAY_MOVE_Z, m_fMoveZ); - DDX_Text(pDX, IDC_ARRAY_ROTATE_X, m_fRotateX); - DDX_Text(pDX, IDC_ARRAY_ROTATE_Y, m_fRotateY); - DDX_Text(pDX, IDC_ARRAY_ROTATE_Z, m_fRotateZ); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CArrayDlg, CDialog) - //{{AFX_MSG_MAP(CArrayDlg) - ON_BN_CLICKED(IDC_ARRAY_1D, OnArrayDimension) - ON_BN_CLICKED(IDC_ARRAY_2D, OnArrayDimension) - ON_BN_CLICKED(IDC_ARRAY_3D, OnArrayDimension) - ON_EN_CHANGE(IDC_ARRAY_1D_COUNT, OnChangeArrayCount) - ON_EN_CHANGE(IDC_ARRAY_2D_COUNT, OnChangeArrayCount) - ON_EN_CHANGE(IDC_ARRAY_3D_COUNT, OnChangeArrayCount) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CArrayDlg message handlers - -BOOL CArrayDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - UINT IDs[15] = { IDC_ARRAY_1D_COUNT_SPIN, IDC_ARRAY_2D_COUNT_SPIN, IDC_ARRAY_3D_COUNT_SPIN, - IDC_ARRAY_2D_X_SPIN, IDC_ARRAY_2D_Y_SPIN, IDC_ARRAY_2D_Z_SPIN, - IDC_ARRAY_3D_X_SPIN, IDC_ARRAY_3D_Y_SPIN, IDC_ARRAY_3D_Z_SPIN, - IDC_ARRAY_MOVE_X_SPIN, IDC_ARRAY_ROTATE_X_SPIN, IDC_ARRAY_MOVE_Y_SPIN, - IDC_ARRAY_ROTATE_Y_SPIN, IDC_ARRAY_MOVE_Z_SPIN, IDC_ARRAY_ROTATE_Z_SPIN }; - - for (int i = 0; i < 3; i++) - ((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(1, 1000); - for (int i = 3; i < 15; i++) - ((CSpinButtonCtrl*)GetDlgItem(IDs[i]))->SetRange(-1000, 1000); - - m_bInitDone = TRUE; - - return TRUE; -} - -void CArrayDlg::OnArrayDimension() -{ - if (!IsWindow(m_hWnd)) - return; - - UpdateData(); - for (UINT u = IDC_ARRAY_2D_COUNT; u <= IDC_ARRAY_2D_Z; u++) - GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0); - for (UINT u = IDC_ARRAY_2D_X_SPIN; u <= IDC_ARRAY_2D_Z_SPIN; u++) - GetDlgItem(u)->EnableWindow(m_nArrayDimension > 0); - for (UINT u = IDC_ARRAY_3D_COUNT; u <= IDC_ARRAY_3D_Z; u++) - GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1); - for (UINT u = IDC_ARRAY_3D_X_SPIN; u <= IDC_ARRAY_3D_Z_SPIN; u++) - GetDlgItem(u)->EnableWindow(m_nArrayDimension > 1); - OnChangeArrayCount(); -} - -void CArrayDlg::OnChangeArrayCount() -{ - if (!m_bInitDone) - return; - - UpdateData(); - m_nTotal = m_n1DCount; - if (m_nArrayDimension > 0) - m_nTotal *= m_n2DCount; - if (m_nArrayDimension > 1) - m_nTotal *= m_n3DCount; - UpdateData(FALSE); -} diff --git a/win/arraydlg.h b/win/arraydlg.h deleted file mode 100644 index 5968d1d3..00000000 --- a/win/arraydlg.h +++ /dev/null @@ -1,65 +0,0 @@ -#if !defined(AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_) -#define AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ArrayDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CArrayDlg dialog - -class CArrayDlg : public CDialog -{ -// Construction -public: - CArrayDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CArrayDlg) - enum { IDD = IDD_ARRAY }; - UINT m_n1DCount; - UINT m_n2DCount; - UINT m_n3DCount; - int m_nArrayDimension; - UINT m_nTotal; - float m_f2DX; - float m_f2DY; - float m_f2DZ; - float m_f3DX; - float m_f3DY; - float m_f3DZ; - float m_fMoveX; - float m_fMoveY; - float m_fMoveZ; - float m_fRotateX; - float m_fRotateY; - float m_fRotateZ; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CArrayDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - BOOL m_bInitDone; - - // Generated message map functions - //{{AFX_MSG(CArrayDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnArrayDimension(); - afx_msg void OnChangeArrayCount(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ARRAYDLG_H__4DF55C82_5A43_11D2_8202_B3F55E19C71F__INCLUDED_) diff --git a/win/basewnd.cpp b/win/basewnd.cpp deleted file mode 100644 index 6cd7e6ad..00000000 --- a/win/basewnd.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "lc_global.h" -#include "basewnd.h" - -BaseWnd::BaseWnd (BaseWnd *parent, int menu_count) -{ - m_pMenuItems = new BaseMenuItem[menu_count]; - m_pParent = parent; -} - -BaseWnd::~BaseWnd () -{ - delete [] m_pMenuItems; -} - -static HCURSOR g_hcurWaitCursorRestore; // old cursor to restore after wait cursor - -void BaseWnd::BeginWait () -{ - HCURSOR hcurPrev = SetCursor (LoadCursor (NULL, IDC_WAIT)); - g_hcurWaitCursorRestore = hcurPrev; -} - -void BaseWnd::EndWait () -{ - SetCursor (g_hcurWaitCursorRestore); -} - -int BaseWnd::MessageBox (const char* text, const char* caption, int flags) -{ - return m_pXID->MessageBox (text, caption, flags); -} - -void BaseWnd::ShowMenuItem (int id, bool show) -{ - /* - CBMPMenu* pMenu = (CBMPMenu*)GetMainMenu(0); - CMenu* pMenu = pFrame->GetMenu(); - return pMenu->GetSubMenu(nIndex); - */ -} - -void BaseWnd::EnableMenuItem (int id, bool enable) -{ -} - -void BaseWnd::CheckMenuItem (int id, bool check) -{ -} - -void BaseWnd::SetMenuItemText (int id, const char *text) -{ -} diff --git a/win/cadbar.cpp b/win/cadbar.cpp deleted file mode 100644 index 3a13f80a..00000000 --- a/win/cadbar.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "CADBar.h" -#include "StepPop.h" -#include "project.h" -#include "lc_application.h" - -#ifdef _DEBUG -#undef THIS_FILE -static char THIS_FILE[]=__FILE__; -#define new DEBUG_NEW -#endif - -#define ID_STATUS_PROGRESS 17234 - -BEGIN_MESSAGE_MAP(CCADStatusBar, CMFCStatusBar) - //{{AFX_MSG_MAP(CCADStatusBar) - ON_WM_LBUTTONDOWN() - ON_WM_RBUTTONDOWN() - ON_WM_SIZE() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -CCADStatusBar::CCADStatusBar() -{ - m_pPopup = NULL; - m_nProgressWidth = 150; - m_bProgressVisible = FALSE; -} - -CCADStatusBar::~CCADStatusBar() -{ -} - -BOOL CCADStatusBar::Create(CWnd *pParentWnd, DWORD dwStyle, UINT nID) -{ - // Default creation - BOOL bCreatedOK = CMFCStatusBar::Create(pParentWnd,dwStyle,nID); - - if (bCreatedOK) - { - // Also create the progress bar - m_Progress.Create(WS_CHILD | WS_EX_STATICEDGE | PBS_SMOOTH, CRect(0,0,m_nProgressWidth,10), this, ID_STATUS_PROGRESS); - } - - return bCreatedOK; -} - -void CCADStatusBar::OnLButtonDown(UINT nFlags, CPoint point) -{ - CRect rect; - - GetItemRect(CommandToIndex(ID_INDICATOR_STEP), rect); - if (rect.PtInRect(point)) - { - ClientToScreen(rect); - m_pPopup = new CStepPopup(CPoint(rect.left, rect.top), this); - } - - GetItemRect(CommandToIndex(ID_INDICATOR_SNAP), rect); - if (rect.PtInRect(point)) - { - ClientToScreen(&point); - - CMenu PopupMenus; - PopupMenus.LoadMenu(IDR_POPUPS); - - CMFCPopupMenu* Popup = new CMFCPopupMenu(); - Popup->Create(AfxGetMainWnd(), point.x, point.y, PopupMenus.GetSubMenu(7)->Detach()); - } - - CMFCStatusBar::OnLButtonDown(nFlags, point); -} - -void CCADStatusBar::OnRButtonDown(UINT nFlags, CPoint point) -{ - CRect rect; - GetItemRect(CommandToIndex(ID_INDICATOR_STEP), rect); - if (rect.PtInRect(point)) - AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_VIEW_STEP_CHOOSE); - - CMFCStatusBar::OnRButtonDown(nFlags, point); -} - -void CCADStatusBar::OnSize(UINT nType, int cx, int cy) -{ - CMFCStatusBar::OnSize(nType, cx, cy); - - if (m_bProgressVisible) - AdjustProgressBarPosition(); -} - -BOOL CCADStatusBar::ShowProgressBar(BOOL bShow) -{ - // Save old visible status - BOOL bOldVisible = m_bProgressVisible; - - if ((bOldVisible != bShow) && ::IsWindow(m_Progress.m_hWnd)) - { - // Show/hide - m_Progress.ShowWindow(bShow ? SW_SHOWNA : SW_HIDE); - m_bProgressVisible = bShow; - - // If just shown, make sure it's in the right position - if (bShow) - { - AdjustProgressBarPosition(); - RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); - } - } - - return bOldVisible; -} - -void CCADStatusBar::AdjustProgressBarPosition() -{ - // Make sure the progress bar is created - if(!::IsWindow(m_Progress.m_hWnd)) - return; - - CRect Rect; - GetItemRect(0, Rect); - m_Progress.SetWindowPos(NULL, Rect.right - m_nProgressWidth, Rect.top, - m_nProgressWidth, Rect.Height(), SWP_NOZORDER | SWP_NOACTIVATE); -} diff --git a/win/cadbar.h b/win/cadbar.h deleted file mode 100644 index 238cd9ac..00000000 --- a/win/cadbar.h +++ /dev/null @@ -1,56 +0,0 @@ -// CADBar.h: interface for the CCADStatusBar class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_) -#define AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CCADStatusBar : public CMFCStatusBar -{ -public: - CCADStatusBar(); - virtual ~CCADStatusBar(); - virtual BOOL Create(CWnd *pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, UINT nID = AFX_IDW_STATUS_BAR); - - BOOL IsProgressBarVisible() const - { return m_bProgressVisible; } - void SetProgressBarWidth(int nWidth) - { m_nProgressWidth = nWidth; } - BOOL ShowProgressBar(BOOL bShow = TRUE); - - void SetProgressBarRange(int nLower, int nUpper) - { m_Progress.SetRange(nLower,nUpper); } - int SetProgressBarPos(int nPos) - { return m_Progress.SetPos(nPos); } - int SetProgressBarStep(int nStep) - { return m_Progress.SetStep(nStep); } - int StepProgressBar() - { return m_Progress.StepIt(); } - -protected: - void AdjustProgressBarPosition(); - -public: - CWnd* m_pPopup; - -protected: - // Progress Bar variables. - CProgressCtrl m_Progress; - int m_nProgressWidth; - BOOL m_bProgressVisible; - -protected: - //{{AFX_MSG(CCADStatusBar) - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg void OnRButtonDown(UINT nFlags, CPoint point); - afx_msg void OnSize(UINT nType, int cx, int cy); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -#endif // !defined(AFX_CADBAR_H__105A59A3_586A_11D2_8202_D8BEE5C6EEBF__INCLUDED_) diff --git a/win/categdlg.cpp b/win/categdlg.cpp deleted file mode 100644 index fd832b11..00000000 --- a/win/categdlg.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "categdlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CCategoryDlg dialog - - -CCategoryDlg::CCategoryDlg(CWnd* pParent /*=NULL*/) - : CDialog(CCategoryDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CCategoryDlg) - m_Keywords = _T(""); - m_Name = _T(""); - //}}AFX_DATA_INIT -} - - -void CCategoryDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CCategoryDlg) - DDX_Text(pDX, IDC_CATDLG_KEYWORDS, m_Keywords); - DDX_Text(pDX, IDC_CATDLG_NAME, m_Name); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CCategoryDlg, CDialog) - //{{AFX_MSG_MAP(CCategoryDlg) - // NOTE: the ClassWizard will add message map macros here - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CCategoryDlg message handlers diff --git a/win/categdlg.h b/win/categdlg.h deleted file mode 100644 index 997e6b10..00000000 --- a/win/categdlg.h +++ /dev/null @@ -1,47 +0,0 @@ -#if !defined(AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_) -#define AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// categdlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CCategoryDlg dialog - -class CCategoryDlg : public CDialog -{ -// Construction -public: - CCategoryDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CCategoryDlg) - enum { IDD = IDD_CATEGORY }; - CString m_Keywords; - CString m_Name; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CCategoryDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CCategoryDlg) - // NOTE: the ClassWizard will add member functions here - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_CATEGDLG_H__DD3E0D88_ADD7_48A4_9B0E_99637F2010AB__INCLUDED_) diff --git a/win/clrpick.h b/win/clrpick.h deleted file mode 100644 index f79e7b9b..00000000 --- a/win/clrpick.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _CLRPICK_H_ -#define _CLRPICK_H_ - -#include "ClrPopup.h" - -class CColorPicker : public CButton -{ -// Construction -public: - CColorPicker(); - DECLARE_DYNCREATE(CColorPicker); - -// Attributes -public: - int GetColorIndex(); - void SetColorIndex(int nColor); - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CColorPicker) - public: - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); - protected: - virtual void PreSubclassWindow(); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CColorPicker(); - -protected: - void SetWindowSize(); - -// protected attributes -protected: - BOOL m_bActive; // Is the dropdown active? - CRect m_ArrowRect; - int m_nColor; - - // Generated message map functions -protected: - //{{AFX_MSG(CColorPicker) - afx_msg BOOL OnClicked(); - afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); - //}}AFX_MSG - afx_msg LONG OnSelEndOK(UINT lParam, LONG wParam); - afx_msg LONG OnSelEndCancel(UINT lParam, LONG wParam); - - DECLARE_MESSAGE_MAP() -}; - -#endif // _CLRPICK_H_ diff --git a/win/clrpopup.h b/win/clrpopup.h deleted file mode 100644 index ac6ddfbe..00000000 --- a/win/clrpopup.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _CLRPOPUP_H_ -#define _CLRPOPUP_H_ - -// CColorPopup messages -#define CPN_SELENDOK WM_USER + 1001 // Color Picker end OK -#define CPN_SELENDCANCEL WM_USER + 1002 // Color Picker end (cancelled) - -// forward declaration -class CColorPicker; - -///////////////////////////////////////////////////////////////////////////// -// CColorPopup window - -struct CColorPopupCell -{ - CRect Rect; - COLORREF Color; - int ColorIndex; -}; - -class CColorPopup : public CWnd -{ -// Construction -public: - CColorPopup(); - CColorPopup(CPoint p, int nColor, CWnd* pParentWnd, bool IgnoreMouse); - void Initialise(); - -// Attributes -public: - -// Operations -public: - BOOL Create(CPoint p, int nColor, CWnd* pParentWnd); - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CColorPopup) - public: - virtual BOOL PreTranslateMessage(MSG* pMsg); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CColorPopup(); - -protected: - void SetWindowSize(); - void CalculateLayout(); - void CreateToolTips(); - void ChangeSelection(int nIndex); - void EndSelection(int nMessage); - void DrawCell(CDC* pDC, int nIndex); - -// protected attributes -protected: - int m_nNumColumns, m_nNumRows; - int m_nBoxSize, m_nMargin; - int m_nCurrentSel; - int m_nChosenColorSel; - CRect m_WindowRect; - CFont m_Font; - CPalette m_Palette; - int m_nInitialColor, m_nColor; - CToolTipCtrl m_ToolTip; - CWnd* m_pParent; - bool m_IgnoreMouse; - - CArray mGroups; - CArray mCells; - - // Generated message map functions -protected: - //{{AFX_MSG(CColorPopup) - afx_msg void OnNcDestroy(); - afx_msg void OnLButtonUp(UINT nFlags, CPoint point); - afx_msg void OnPaint(); - afx_msg void OnMouseMove(UINT nFlags, CPoint point); - afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg BOOL OnQueryNewPalette(); - afx_msg void OnPaletteChanged(CWnd* pFocusWnd); - afx_msg void OnKillFocus(CWnd* pNewWnd); - afx_msg void OnActivateApp(BOOL bActive, DWORD hTask); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -#endif // _CLRPOPUP_H_ diff --git a/win/disabtab.cpp b/win/disabtab.cpp deleted file mode 100644 index df72977f..00000000 --- a/win/disabtab.cpp +++ /dev/null @@ -1,233 +0,0 @@ -//////////////////////////////////////////////////////////////// -// CTabCtrlWithDisable 1998 Microsoft Systems Journal. -// If this program works, it was written by Paul DiLascia. -// If not, I don't know who wrote it. -// -// CTabCtrlWithDisable implements a CTabCtrl with tabs that you can disable. - -#include "lc_global.h" -#include "DisabTab.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -IMPLEMENT_DYNAMIC(CTabCtrlWithDisable, CTabCtrl) - -BEGIN_MESSAGE_MAP(CTabCtrlWithDisable, CTabCtrl) - //{{AFX_MSG_MAP(CTabCtrlWithDisable) - //}}AFX_MSG_MAP - ON_NOTIFY_REFLECT_EX(TCN_SELCHANGING, OnSelChanging) -END_MESSAGE_MAP() - -CTabCtrlWithDisable::CTabCtrlWithDisable() -{ - m_bPrintOnly = FALSE; -} - -CTabCtrlWithDisable::~CTabCtrlWithDisable() -{ -} - -// Subclass the tab control: also make ownder-draw -BOOL CTabCtrlWithDisable::SubclassDlgItem(UINT nID, CWnd* pParent) -{ - if (!CTabCtrl::SubclassDlgItem(nID, pParent)) - return FALSE; - - ModifyStyle(0, TCS_OWNERDRAWFIXED); - - // If first tab is disabled, go to next enabled tab - if (!IsTabEnabled(0)) - { - int iTab = NextEnabledTab(0, TRUE); - SetActiveTab(iTab); - } - return TRUE; -} - -// Draw the tab: mimic SysTabControl32, except use gray if tab is disabled -void CTabCtrlWithDisable::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) -{ - DRAWITEMSTRUCT& ds = *lpDrawItemStruct; - - int iItem = ds.itemID; - - // Get tab item info - char text[128]; - TCITEM tci; - tci.mask = TCIF_TEXT; - tci.pszText = text; - tci.cchTextMax = sizeof(text); - GetItem(iItem, &tci); - - // use draw item DC - CDC dc; - dc.Attach(ds.hDC); - - dc.FillSolidRect(&ds.rcItem, GetSysColor(COLOR_3DFACE)); - - // calculate text rectangle and color - CRect rc = ds.rcItem; - rc += CPoint(0,3); // ?? by trial and error - - // draw the text - OnDrawText(dc, rc, text, !IsTabEnabled(iItem)); - - dc.Detach(); -} - -// Draw tab text. You can override to use different color/font. -void CTabCtrlWithDisable::OnDrawText(CDC& dc, CRect rc, CString sText, BOOL bDisabled) -{ - if (bDisabled) - rc += CPoint(1,1); - dc.SetBkMode(TRANSPARENT); - dc.SetTextColor(GetSysColor(bDisabled ? COLOR_3DHILIGHT : COLOR_BTNTEXT)); - dc.DrawText(sText, &rc, DT_CENTER|DT_VCENTER); - - if (bDisabled) - { - // disabled: draw again shifted northwest for shadow effect - rc -= CPoint(1,1); - dc.SetTextColor(GetSysColor(COLOR_GRAYTEXT)); - dc.DrawText(sText, &rc, DT_CENTER|DT_VCENTER); - } -} - -// Selection is changing: disallow if tab is disabled -BOOL CTabCtrlWithDisable::OnSelChanging(NMHDR* pnmh, LRESULT* pRes) -{ - // Figure out index of new tab we are about to go to, as opposed - // to the current one we're at. Believe it or not, Windows doesn't - // pass this info - TC_HITTESTINFO htinfo; - GetCursorPos(&htinfo.pt); - ScreenToClient(&htinfo.pt); - int iNewTab = HitTest(&htinfo); - - BOOL bDisallowChange = (iNewTab >= 0 && !IsTabEnabled(iNewTab)); - *pRes = bDisallowChange; - - // If change disallowed, return TRUE and stop processing; otherwise - // (change allowed) return FALSE to let MFC continue routing the message, - // so Windows will send PSN_KILLACTIVE to de-activate current prop page. - return bDisallowChange; -} - -// Trap arrow-left key to skip disabled tabs. -// This is the only way to know where we're coming from--ie from -// arrow-left (prev) or arrow-right (next). -BOOL CTabCtrlWithDisable::PreTranslateMessage(MSG* pMsg) -{ - if (pMsg->message == WM_KEYDOWN && - (pMsg->wParam == VK_LEFT || pMsg->wParam == VK_RIGHT)) - { - int iNewTab = (pMsg->wParam == VK_LEFT) ? - PrevEnabledTab(GetCurSel(), FALSE) : - NextEnabledTab(GetCurSel(), FALSE); - if (iNewTab >= 0) - SetActiveTab(iNewTab); - return TRUE; - } - return CTabCtrl::PreTranslateMessage(pMsg); -} - -// Translate parent property sheet message. Translates Control-Tab and -// Control-Shift-Tab keys. These are normally handled by the property -// sheet, so you must call this function from your prop sheet's -// PreTranslateMessage function. -BOOL CTabCtrlWithDisable::TranslatePropSheetMsg(MSG* pMsg) -{ - WPARAM key = pMsg->wParam; - if (pMsg->message == WM_KEYDOWN && GetAsyncKeyState(VK_CONTROL) < 0 && - (key == VK_TAB || key == VK_PRIOR || key == VK_NEXT)) - { - int iNewTab = (key==VK_PRIOR || GetAsyncKeyState(VK_SHIFT) < 0) ? - PrevEnabledTab(GetCurSel(), TRUE) : - NextEnabledTab(GetCurSel(), TRUE); - if (iNewTab >= 0) - SetActiveTab(iNewTab); - return TRUE; - } - return FALSE; -} - -// Helper to set the active page, when moving backwards (left-arrow and -// Control-Shift-Tab). Must simulate Windows messages to tell parent I -// am changing the tab; SetCurSel does not do this!! -// -// In normal operation, this fn will always succeed, because I don't call it -// unless I already know IsTabEnabled() = TRUE; but if you call SetActiveTab -// with a random value, it could fail. -BOOL CTabCtrlWithDisable::SetActiveTab(UINT iNewTab) -{ - // send the parent TCN_SELCHANGING - NMHDR nmh; - nmh.hwndFrom = m_hWnd; - nmh.idFrom = GetDlgCtrlID(); - nmh.code = TCN_SELCHANGING; - - if (GetParent()->SendMessage(WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh) >=0) - { - // OK to change: set the new tab - SetCurSel(iNewTab); - - // send parent TCN_SELCHANGE - nmh.code = TCN_SELCHANGE; - GetParent()->SendMessage(WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh); - return TRUE; - } - return FALSE; -} - -// Return the index of the next enabled tab after a given index, or -1 if none -// (0 = first tab). -// If bWrap is TRUE, wrap from beginning to end; otherwise stop at zero. -int CTabCtrlWithDisable::NextEnabledTab(int iCurrentTab, BOOL bWrap) -{ - int nTabs = GetItemCount(); - for (int iTab = iCurrentTab+1; iTab != iCurrentTab; iTab++) - { - if (iTab >= nTabs) - { - if (!bWrap) - return -1; - iTab = 0; - } - - if (IsTabEnabled(iTab)) - return iTab; - } - return -1; -} - -// Return the index of the previous enabled tab before a given index, or -1. -// (0 = first tab). -// If bWrap is TRUE, wrap from beginning to end; otherwise stop at zero. -int CTabCtrlWithDisable::PrevEnabledTab(int iCurrentTab, BOOL bWrap) -{ - for (int iTab = iCurrentTab-1; iTab != iCurrentTab; iTab--) - { - if (iTab < 0) - { - if (!bWrap) - return -1; - iTab = GetItemCount() - 1; - } - - if (IsTabEnabled(iTab)) - return iTab; - } - return -1; -} - -BOOL CTabCtrlWithDisable::IsTabEnabled(int iTab) -{ - if (m_bPrintOnly && (iTab != 4)) - return FALSE; - - return TRUE; -} diff --git a/win/disabtab.h b/win/disabtab.h deleted file mode 100644 index 8c30183c..00000000 --- a/win/disabtab.h +++ /dev/null @@ -1,40 +0,0 @@ -//////////////////////////////////////////////////////////////// -// 1998 Microsoft Systems Journal. -// If this code works, it was written by Paul DiLascia. -// If not, I don't know who wrote it. -// Compiles with Visual C++ 5.0 on Windows 95 -// See DisabTab.cpp -// -class CTabCtrlWithDisable : public CTabCtrl -{ - DECLARE_DYNAMIC(CTabCtrlWithDisable) -public: - BOOL m_bPrintOnly; - CTabCtrlWithDisable(); - virtual ~CTabCtrlWithDisable(); - - // functions you must implement/call - BOOL IsTabEnabled(int iTab); // you must override - BOOL TranslatePropSheetMsg(MSG* pMsg); // call from prop sheet - BOOL SubclassDlgItem(UINT nID, CWnd* pParent); // non-virtual override - - // helpers - int NextEnabledTab(int iTab, BOOL bWrap); // get next enabled tab - int PrevEnabledTab(int iTab, BOOL bWrap); // get prev enabled tab - BOOL SetActiveTab(UINT iNewTab); // set tab (fail if disabled) - -protected: - //{{AFX_MSG(CTabCtrlWithDisable) - //}}AFX_MSG - afx_msg BOOL OnSelChanging(NMHDR* pNmh, LRESULT* pRes); - - DECLARE_MESSAGE_MAP() - - // MFC overrides - virtual BOOL PreTranslateMessage(MSG* pMsg); - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); - - // override to draw text only; eg, colored text or different font - virtual void OnDrawText(CDC& dc, CRect rc, CString sText, BOOL bDisabled); -}; - diff --git a/win/dynsplit.cpp b/win/dynsplit.cpp deleted file mode 100644 index ffc1ea80..00000000 --- a/win/dynsplit.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// -// CDynamicSplitterWnd is a helper class built on top of the standard CSplitterWnd class -// to make it easier to dynamically split windows at run time. -// - -#include "lc_global.h" -#include "dynsplit.h" - -BOOL CDynamicSplitterWnd::AttachWindow(CWnd* Wnd, int Row, int Col) -{ - // Make sure the splitter window was created. - if (!IsWindow(m_hWnd)) - { - ASSERT(0); - TRACE(_T("Create splitter before attaching windows to panes")); - return FALSE; - } - - // Make sure the row and col indices are within bounds. - if (Row >= GetRowCount() || Col >= GetColumnCount()) - { - ASSERT(0); - return FALSE; - } - - // Is the window to be attached a valid one. - if (Wnd == NULL || (!IsWindow(Wnd->m_hWnd))) - { - ASSERT(0); - return FALSE; - } - - Wnd->SetDlgCtrlID(IdFromRowCol(Row, Col)); - Wnd->SetParent(this); - Wnd->ShowWindow(SW_SHOW); - Wnd->InvalidateRect(NULL); - - return TRUE; -} - -BOOL CDynamicSplitterWnd::DetachWindow(int Row, int Col) -{ - // Make sure the splitter window was created. - if (!IsWindow(m_hWnd)) - { - ASSERT(0); - TRACE(_T("Create splitter before attaching windows to panes")); - return FALSE; - } - - // Make sure the row and col indices are within bounds. - if (Row >= GetRowCount() || Col >= GetColumnCount()) - { - ASSERT(0); - return FALSE; - } - - CWnd* pWnd = GetPane(Row, Col); - if (pWnd == NULL || (!IsWindow(pWnd->m_hWnd))) - { - ASSERT(0); - return FALSE; - } - - // Set the parent window handle to NULL - // so that this child window is not destroyed - // when the parent (splitter) is destroyed - pWnd->SetParent(NULL); - - //Hide the window - pWnd->ShowWindow(SW_HIDE); - pWnd->UpdateWindow(); - - return TRUE; -} - -void CDynamicSplitterWnd::GetViewRowCol(CWnd* Window, int* Row, int* Col) -{ - for (*Row = 0; *Row < GetRowCount(); (*Row)++) - { - for (*Col = 0; *Col < GetColumnCount(); (*Col)++) - { - if (GetPane(*Row, *Col) == Window) - { - return; - } - } - } - - ASSERT(0); -} diff --git a/win/dynsplit.h b/win/dynsplit.h deleted file mode 100644 index acbf60b2..00000000 --- a/win/dynsplit.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _DYNSPLIT_H_ -#define _DYNSPLIT_H_ - -class CDynamicSplitterWnd : public CSplitterWndEx -{ -public: - BOOL AttachWindow(CWnd* Wnd, int Row, int Col); - BOOL DetachWindow(int Row, int Col); - void GetViewRowCol(CWnd* Window, int* Row, int* Col); -}; - -#endif // _DYNSPLIT_H_ diff --git a/win/jpeglib/jconfig.h b/win/jpeglib/jconfig.h deleted file mode 100644 index 7e291c75..00000000 --- a/win/jpeglib/jconfig.h +++ /dev/null @@ -1,45 +0,0 @@ -/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */ -/* see jconfig.doc for explanations */ - -#define HAVE_PROTOTYPES -#define HAVE_UNSIGNED_CHAR -#define HAVE_UNSIGNED_SHORT -/* #define void char */ -/* #define const */ -#undef CHAR_IS_UNSIGNED -#define HAVE_STDDEF_H -#define HAVE_STDLIB_H -#undef NEED_BSD_STRINGS -#undef NEED_SYS_TYPES_H -#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */ -#undef NEED_SHORT_EXTERNAL_NAMES -#undef INCOMPLETE_TYPES_BROKEN - -/* Define "boolean" as unsigned char, not int, per Windows custom */ -#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ -typedef unsigned char boolean; -#endif -#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ - - -#ifdef JPEG_INTERNALS - -#undef RIGHT_SHIFT_IS_UNSIGNED - -#endif /* JPEG_INTERNALS */ - -#ifdef JPEG_CJPEG_DJPEG - -#define BMP_SUPPORTED /* BMP image file format */ -#define GIF_SUPPORTED /* GIF image file format */ -#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ -#undef RLE_SUPPORTED /* Utah RLE image file format */ -#define TARGA_SUPPORTED /* Targa image file format */ - -#define TWO_FILE_COMMANDLINE /* optional */ -#define USE_SETMODE /* Microsoft has setmode() */ -#undef NEED_SIGNAL_CATCHER -#undef DONT_USE_B_MODE -#undef PROGRESS_REPORT /* optional */ - -#endif /* JPEG_CJPEG_DJPEG */ diff --git a/win/jpeglib/jpeglib.vcxproj b/win/jpeglib/jpeglib.vcxproj deleted file mode 100644 index f4509221..00000000 --- a/win/jpeglib/jpeglib.vcxproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {E4253912-37B8-C33E-42BB-4D178F0BBE9C} - Win32Proj - jpeglib - - - - StaticLibrary - true - - - StaticLibrary - false - true - - - - - - - - - - - - - $(Configuration)\ - - - $(Configuration)\ - - - - Level3 - Disabled - MultiThreadedDebug - - - Windows - true - - - - - MultiThreaded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/jpeglib/jpeglib.vcxproj.filters b/win/jpeglib/jpeglib.vcxproj.filters deleted file mode 100644 index 1654f23c..00000000 --- a/win/jpeglib/jpeglib.vcxproj.filters +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/keyedit.cpp b/win/keyedit.cpp deleted file mode 100644 index b1f0b73c..00000000 --- a/win/keyedit.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "keyedit.h" -#include "keyboard.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKeyEdit - -CKeyEdit::CKeyEdit() -{ - m_Key = 0; - m_Control = false; - m_Shift = false; -} - -CKeyEdit::~CKeyEdit() -{ -} - - -BEGIN_MESSAGE_MAP(CKeyEdit, CEdit) - //{{AFX_MSG_MAP(CKeyEdit) - ON_WM_KEYDOWN() - ON_WM_KEYUP() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKeyEdit message handlers - -void CKeyEdit::ResetKey() -{ - m_Key = 0; - m_Control = false; - m_Shift = false; - - SetWindowText(""); -} - -void CKeyEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - - CEdit::OnKeyDown(nChar, nRepCnt, nFlags); -} - -void CKeyEdit::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) -{ - - CEdit::OnKeyUp(nChar, nRepCnt, nFlags); -} - -BOOL CKeyEdit::PreTranslateMessage(MSG* pMsg) -{ - if (pMsg->message == WM_KEYDOWN) - { - // If the keys are for the dialog box or Windows, pass them. - if ((pMsg->wParam == VK_TAB) || (pMsg->wParam == VK_ESCAPE)) - { -// DoErasingStuff (hHotKeyEdit); -// return CEdit::PreTranslateMessage(pMsg); - } -/* - else if (pMsg->wParam == VK_BACK && !Control && !Shift) - { - // If backspace, then erase the edit control and disable the Assign button. -// DoErasingStuff (hHotKeyEdit); -// EnableWindow (GetDlgItem (GetParent (hHotKeyEdit), IDD_INSTALL), FALSE); - SetWindowText(""); - - return true; - } -*/ - else - { - CString Text; - - m_Control = (GetKeyState(VK_CONTROL) < 0); - m_Shift = (GetKeyState(VK_SHIFT) < 0); - - if (m_Control) - Text += "Ctrl+"; - - if (m_Shift) - Text += "Shift+"; - - const char* KeyName = GetKeyName(pMsg->wParam); - - if (KeyName) - { - Text += KeyName; - m_Key = pMsg->wParam; - } - else - { - m_Key = 0; - } - - SetWindowText(Text); - - return true; - } - } - - return CEdit::PreTranslateMessage(pMsg); -} diff --git a/win/keyedit.h b/win/keyedit.h deleted file mode 100644 index 86d7101d..00000000 --- a/win/keyedit.h +++ /dev/null @@ -1,56 +0,0 @@ -#if !defined(AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_) -#define AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// keyedit.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKeyEdit window - -class CKeyEdit : public CEdit -{ -// Construction -public: - CKeyEdit(); - -// Attributes -public: - char m_Key; - bool m_Control; - bool m_Shift; - - void ResetKey(); - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKeyEdit) - public: - virtual BOOL PreTranslateMessage(MSG* pMsg); - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CKeyEdit(); - - // Generated message map functions -protected: - //{{AFX_MSG(CKeyEdit) - afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); - //}}AFX_MSG - - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_KEYEDIT_H__E567D1C8_2DC3_4E8F_BA7D_CF628525F55C__INCLUDED_) diff --git a/win/lc_config.h b/win/lc_config.h deleted file mode 100644 index e9d36f9f..00000000 --- a/win/lc_config.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _LC_CONFIG_H_ -#define _LC_CONFIG_H_ - -#include "stdafx.h" - -#define LC_WINDOWS - -#define LC_POINTER_TO_INT(p) ((lcint32)(p)) - -typedef signed __int8 lcint8; -typedef unsigned __int8 lcuint8; -typedef signed __int16 lcint16; -typedef unsigned __int16 lcuint16; -typedef signed __int32 lcint32; -typedef unsigned __int32 lcuint32; -typedef signed __int64 lcint64; -typedef unsigned __int64 lcuint64; - -#define LC_LITTLE_ENDIAN - -#define LC_HAVE_3DSFTK -#define LC_HAVE_JPEGLIB -#define LC_HAVE_PNGLIB - -#endif // _LC_CONFIG_H_ diff --git a/win/libpng/libpng.vcxproj b/win/libpng/libpng.vcxproj deleted file mode 100644 index 3b5e2073..00000000 --- a/win/libpng/libpng.vcxproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {03C3A022-452E-40B3-BFD3-095713E5FFA2} - Win32Proj - libpng - - - - StaticLibrary - true - Unicode - - - StaticLibrary - false - true - Unicode - - - - - - - - - - - - - $(Configuration)\ - - - $(Configuration)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - ../zlib - MultiThreadedDebug - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - ../zlib - MultiThreaded - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/povdlg.h b/win/povdlg.h deleted file mode 100644 index 83ad4979..00000000 --- a/win/povdlg.h +++ /dev/null @@ -1,55 +0,0 @@ -#if !defined(AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_) -#define AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// POVDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CPOVDlg dialog - -class CPOVDlg : public CDialog -{ -// Construction -public: - CPOVDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CPOVDlg) - enum { IDD = IDD_EXPORTPOV }; - BOOL m_bRender; - CString m_strPOV; - CString m_strOut; - CString m_strLGEO; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CPOVDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - static const DWORD m_nHelpIDs[]; - - // Generated message map functions - //{{AFX_MSG(CPOVDlg) - virtual void OnOK(); - afx_msg void OnPovbrowse(); - afx_msg void OnPovoutbrowse(); - afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); - afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); - afx_msg void OnPovdlgLgeobrowse(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_POVDLG_H__17968F81_BCE9_11D1_A742_444553540000__INCLUDED_) diff --git a/win/progdlg.cpp b/win/progdlg.cpp deleted file mode 100644 index 098232fa..00000000 --- a/win/progdlg.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "ProgDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CProgressDlg dialog - -CProgressDlg::CProgressDlg(LPCTSTR pszTitle) -{ - //{{AFX_DATA_INIT(CProgressDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - - m_nMinValue = 0; - m_nMaxValue = 100; - m_nPrevPos = 0; - m_nPrevPercent = 0; - m_strTitle = pszTitle; - m_bCancel = FALSE; - m_bParentDisabled = FALSE; -} - -CProgressDlg::~CProgressDlg() -{ - if(m_hWnd != NULL) - DestroyWindow(); -} - -BOOL CProgressDlg::Create(CWnd* pParent) -{ - m_pParentWnd = CWnd::GetSafeOwner(pParent); - - if((m_pParentWnd != NULL) && m_pParentWnd->IsWindowEnabled()) - { - m_pParentWnd->EnableWindow(FALSE); - m_bParentDisabled = TRUE; - } - - if(!CDialog::Create(CProgressDlg::IDD, pParent)) - { - ReEnableParent(); - return FALSE; - } - - return TRUE; -} - -void CProgressDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CProgressDlg) - DDX_Control(pDX, IDC_PRGDLG_PROGRESS, m_Progress); - //}}AFX_DATA_MAP -} - -BEGIN_MESSAGE_MAP(CProgressDlg, CDialog) - //{{AFX_MSG_MAP(CProgressDlg) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CProgressDlg message handlers - -void CProgressDlg::OnCancel() -{ - m_bCancel = TRUE; -} - -BOOL CProgressDlg::CheckCancelButton() -{ - // Process all pending messages - PumpMessages(); - - BOOL bResult = m_bCancel; - m_bCancel = FALSE; - - return bResult; -} - -void CProgressDlg::PumpMessages() -{ - // Must call Create() before using the dialog - ASSERT(m_hWnd!=NULL); - - MSG msg; - while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - if(!IsDialogMessage(&msg)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } -} - -int CProgressDlg::StepIt() -{ - PumpMessages(); - return SetPos(m_nPrevPos + 1); -} - -int CProgressDlg::SetPos(int nPos) -{ - CString strTitle; - int nPercentage; - - m_nPrevPos = nPos; - - if (m_nMaxValue > m_nMinValue) - nPercentage = (nPos*100)/(m_nMaxValue - m_nMinValue); - else - nPercentage = 0; - - if ((nPercentage != m_nPrevPercent) || (nPos == 1)) - { - m_nPrevPercent = nPercentage; - strTitle.Format(_T("%s [%d%%]"), m_strTitle, nPercentage); - SetWindowText(strTitle); - } - - return m_Progress.SetPos(nPos); -} - -void CProgressDlg::SetRange(int nLower, int nUpper) -{ - ASSERT(0 <= nLower && nLower <= 65535); - ASSERT(0 <= nUpper && nUpper <= 65535); - - m_Progress.SetRange(nLower, nUpper); - m_nMaxValue = nUpper; - m_nMinValue = nLower; -} - -BOOL CProgressDlg::DestroyWindow() -{ - ReEnableParent(); - return CDialog::DestroyWindow(); -} - -void CProgressDlg::ReEnableParent() -{ - if(m_bParentDisabled && (m_pParentWnd != NULL)) - m_pParentWnd->EnableWindow(TRUE); - m_bParentDisabled = FALSE; -} - -BOOL CProgressDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - m_Progress.ModifyStyle(0, PBS_SMOOTH); - m_Progress.SetRange(m_nMinValue, m_nMaxValue); - m_Progress.SetStep(1); - SetPos(m_nMinValue); - - return TRUE; -} - -void CProgressDlg::SetStatus(LPCTSTR lpszMessage) -{ - ASSERT(m_hWnd); - CWnd *pWndStatus = GetDlgItem(IDC_PRGDLG_TEXT); - - ASSERT(pWndStatus != NULL); - pWndStatus->SetWindowText(lpszMessage); -} - -void CProgressDlg::SetSubStatus(LPCTSTR lpszMessage) -{ - ASSERT(m_hWnd); - CWnd *pWndStatus = GetDlgItem(IDC_PRGDLG_TEXT2); - - ASSERT(pWndStatus != NULL); - pWndStatus->SetWindowText(lpszMessage); -} diff --git a/win/progdlg.h b/win/progdlg.h deleted file mode 100644 index d1838db0..00000000 --- a/win/progdlg.h +++ /dev/null @@ -1,67 +0,0 @@ -#if !defined(AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_) -#define AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ProgDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CProgressDlg dialog - -class CProgressDlg : public CDialog -{ -// Construction -public: - void SetStatus(LPCTSTR lpszMessage); - void SetSubStatus(LPCTSTR lpszMessage); - BOOL Create(CWnd *pParent); - void SetRange(int nLower, int nUpper); - int SetPos(int nPos); - int StepIt(); - BOOL CheckCancelButton(); - CProgressDlg(LPCTSTR pszTitle); - ~CProgressDlg(); - -// Dialog Data - //{{AFX_DATA(CProgressDlg) - enum { IDD = IDD_PROGRESS }; - CProgressCtrl m_Progress; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CProgressDlg) - public: - virtual BOOL DestroyWindow(); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - BOOL m_bParentDisabled; - void ReEnableParent(); - CWnd* m_pParentWnd; - int m_nMaxValue; - int m_nMinValue; - CString m_strTitle; - int m_nPrevPercent; - int m_nPrevPos; - void PumpMessages(); - BOOL m_bCancel; - - // Generated message map functions - //{{AFX_MSG(CProgressDlg) - virtual void OnCancel(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROGDLG_H__7DBF6C04_6356_11D2_8202_82A791333B5C__INCLUDED_) diff --git a/win/splitter.cpp b/win/splitter.cpp deleted file mode 100644 index e59b3422..00000000 --- a/win/splitter.cpp +++ /dev/null @@ -1,257 +0,0 @@ -#include "lc_global.h" -#include "resource.h" -#include "Splitter.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CySplitterWnd - -CySplitterWnd::CySplitterWnd() -{ -} - -CySplitterWnd::~CySplitterWnd() -{ -} - -BOOL CySplitterWnd::BindWithControl(CWnd *parent, DWORD ctrlId) -{ - m_Parent = parent; - - SubclassWindow(m_Parent->GetDlgItem(ctrlId)->GetSafeHwnd()); - - // Make sure to get mouse message from the dialog window - DWORD style = GetStyle(); - ::SetWindowLong(GetSafeHwnd(), GWL_STYLE, style | SS_NOTIFY); - - return TRUE; -} - -void CySplitterWnd::Unbind(void) -{ - DetachAllPanes(); - UnsubclassWindow(); -} - -void CySplitterWnd::SetMinHeight(int above, int below) -{ - m_minAbove = above; - m_minBelow = below; -} - -BOOL CySplitterWnd::AttachAsAbovePane(DWORD ctrlId) -{ - m_aboveIds.Add(ctrlId); - return TRUE; -} - -BOOL CySplitterWnd::AttachAsBelowPane(DWORD ctrlId) -{ - m_belowIds.Add(ctrlId); - return TRUE; -} - -BOOL CySplitterWnd::DetachAllPanes(void) -{ - m_aboveIds.RemoveAll(); - m_belowIds.RemoveAll(); - return TRUE; -} - -void CySplitterWnd::RecalcLayout(void) -{ - CWnd *pane; - RECT rcBar, rcPane; - - GetWindowRect(&rcBar); - m_Parent->ScreenToClient(&rcBar); - - int i; - DWORD id; - - for (i=0; iGetDlgItem(id); - pane->GetWindowRect(&rcPane); - m_Parent->ScreenToClient(&rcPane); - rcPane.bottom = rcBar.top - 1; - pane->MoveWindow(&rcPane, FALSE); - } - - for (i=0; iGetDlgItem(id); - pane->GetWindowRect(&rcPane); - m_Parent->ScreenToClient(&rcPane); - rcPane.top = rcBar.bottom + 1; - pane->MoveWindow(&rcPane, FALSE); - } - - m_Parent->Invalidate(); -} - -BOOL CySplitterWnd::GetMouseClipRect(LPRECT rectClip, CPoint point) -{ - RECT rectOrg, rectTarget, rectParent, rectPane; - int i; - DWORD id; - - GetWindowRect(&rectOrg); - m_Parent->GetClientRect(&rectParent); - m_Parent->ClientToScreen(&rectParent); - - rectTarget = rectOrg; - rectTarget.top = rectParent.top + m_minAbove; - for (i=0; iGetDlgItem(id)->GetWindowRect(&rectPane); - if (rectTarget.top < rectPane.top + m_minAbove) { - rectTarget.top = rectPane.top + m_minAbove; - } - } - - rectTarget.bottom = rectParent.bottom - m_minBelow; - for (i=0; iGetDlgItem(id)->GetWindowRect(&rectPane); - if (rectTarget.bottom > rectPane.bottom - m_minBelow) { - rectTarget.bottom = rectPane.bottom - m_minBelow; - } - } - - if (rectTarget.top >= rectTarget.bottom) { - TRACE("No room to drag the y-splitter bar"); - return FALSE; - } - - rectClip->left = rectOrg.left; - rectClip->right = rectOrg.right; - rectClip->top = rectTarget.top + point.y; - rectClip->bottom = rectTarget.bottom - (rectOrg.bottom - rectOrg.top - point.y) + 1; - - return TRUE; -} - - -BEGIN_MESSAGE_MAP(CySplitterWnd, CWnd) - //{{AFX_MSG_MAP(CySplitterWnd) - ON_WM_LBUTTONDOWN() - ON_WM_SETCURSOR() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -///////////////////////////////////////////////////////////////////////////// -// CySplitterWnd message handlers - -BOOL CySplitterWnd::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/) -{ - // TODO: Add your message handler code here and/or call default - ::SetCursor(AfxGetApp()->LoadCursor(IDC_VSPLITBAR)); - return TRUE; - - //return CWnd::OnSetCursor(pWnd, nHitTest, message); -} - -void CySplitterWnd::OnLButtonDown(UINT /*nFlags*/, CPoint point) -{ - // TODO: Add your message handler code here and/or call default - - // don't handle if capture already set - if (::GetCapture() != NULL) return; - - // don't handle if no room to drag - RECT rectMouseClip; - if (!GetMouseClipRect(&rectMouseClip, point)) return; - ::ClipCursor(&rectMouseClip); - - // set capture to the window which received this message - SetCapture(); - ASSERT(this == CWnd::GetCapture()); - - // get DC for drawing - CDC* pDrawDC; - pDrawDC = m_Parent->GetDC(); - ASSERT_VALID(pDrawDC); - - int curX, curY; - int xDiff, yDiff; - CRect rectOrg, rectCur, rectOld; - CSize sizeBar; - - GetWindowRect(rectOrg); - sizeBar = CSize(rectOrg.Width(), rectOrg.Height()); - - m_Parent->ScreenToClient(rectOrg); - pDrawDC->DrawDragRect(&rectOrg, sizeBar, NULL, sizeBar); - rectOld = rectCur = rectOrg; - xDiff = yDiff = 0; - - // get messages until capture lost or cancelled/accepted - for (;;) { - MSG msg; - VERIFY(::GetMessage(&msg, NULL, 0, 0)); - - if (CWnd::GetCapture() != this) - break; - - switch (msg.message) { - // handle movement/accept messages - case WM_MOUSEMOVE: - // handle resize cases (and part of move) - curX = (int)(short)LOWORD(msg.lParam); - curY = (int)(short)HIWORD(msg.lParam); - - xDiff = curX - point.x; - yDiff = curY - point.y; - - rectCur = rectOrg; - rectCur.top += yDiff; - rectCur.bottom += yDiff; - pDrawDC->DrawDragRect(&rectCur, sizeBar, &rectOld, sizeBar); - rectOld = rectCur; - - break; - - // handle cancel messages - case WM_KEYDOWN: - if (msg.wParam != VK_ESCAPE) - break; - case WM_RBUTTONDOWN: - yDiff = 0; - case WM_LBUTTONUP: - goto ExitLoop; - - // just dispatch rest of the messages - default: - DispatchMessage(&msg); - break; - } - } - -ExitLoop: - pDrawDC->DrawDragRect(&rectCur, sizeBar, NULL, sizeBar); - - m_Parent->ReleaseDC(pDrawDC); - ReleaseCapture(); - ::ClipCursor(NULL); - - if (yDiff == 0) - { - m_Parent->SendMessage(WM_LC_SPLITTER_MOVED, 0, 0); - return; - } - - // move the splitter bar & re-position the attached panes if necessary - MoveWindow(rectCur, FALSE); - RecalcLayout(); - - m_Parent->SendMessage(WM_LC_SPLITTER_MOVED, yDiff, GetDlgCtrlID()); - - //CWnd::OnLButtonDown(nFlags, point); -} diff --git a/win/splitter.h b/win/splitter.h deleted file mode 100644 index 06217e07..00000000 --- a/win/splitter.h +++ /dev/null @@ -1,63 +0,0 @@ -// Splitter.h : header file -// -///////////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_) -#define AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -class CySplitterWnd : public CWnd -{ -// Construction -public: - CySplitterWnd(); - -// Attributes -public: - -// Operations -public: - BOOL BindWithControl(CWnd *parent, DWORD ctrlId); - void Unbind(void); - - void SetMinHeight(int above, int below); - - BOOL AttachAsAbovePane(DWORD ctrlId); - BOOL AttachAsBelowPane(DWORD ctrlId); - BOOL DetachAllPanes(void); - void RecalcLayout(void); - -protected: - BOOL GetMouseClipRect(LPRECT rectClip, CPoint point); - - CWnd *m_Parent; - CDWordArray m_aboveIds, m_belowIds; - int m_minAbove, m_minBelow; - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CySplitterWnd) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CySplitterWnd(); - - // Generated message map functions -protected: - //{{AFX_MSG(CySplitterWnd) - afx_msg void OnLButtonDown(UINT nFlags, CPoint point); - afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_XYSPLITTERWND_H__8E3E5264_02A9_11D2_BF99_000021000B7C__INCLUDED_) diff --git a/win/stdafx.cpp b/win/stdafx.cpp deleted file mode 100644 index 6b688edf..00000000 --- a/win/stdafx.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// LeoCAD.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "lc_global.h" diff --git a/win/transdlg.cpp b/win/transdlg.cpp deleted file mode 100644 index dd85d746..00000000 --- a/win/transdlg.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "lc_global.h" -#include "leocad.h" -#include "transdlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CTransformDlg dialog - - -CTransformDlg::CTransformDlg(CWnd* pParent /*=NULL*/) - : CDialog(CTransformDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(CTransformDlg) - m_GlobalX = 0.0f; - m_GlobalY = 0.0f; - m_GlobalZ = 0.0f; - m_OffsetX = 0.0f; - m_OffsetY = 0.0f; - m_OffsetZ = 0.0f; - //}}AFX_DATA_INIT -} - - -void CTransformDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CTransformDlg) - DDX_Text(pDX, IDC_TRANSDLG_GX, m_GlobalX); - DDX_Text(pDX, IDC_TRANSDLG_GY, m_GlobalY); - DDX_Text(pDX, IDC_TRANSDLG_GZ, m_GlobalZ); - DDX_Text(pDX, IDC_TRANSDLG_OX, m_OffsetX); - DDX_Text(pDX, IDC_TRANSDLG_OY, m_OffsetY); - DDX_Text(pDX, IDC_TRANSDLG_OZ, m_OffsetZ); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CTransformDlg, CDialog) - //{{AFX_MSG_MAP(CTransformDlg) - // NOTE: the ClassWizard will add message map macros here - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CTransformDlg message handlers diff --git a/win/transdlg.h b/win/transdlg.h deleted file mode 100644 index b536e168..00000000 --- a/win/transdlg.h +++ /dev/null @@ -1,51 +0,0 @@ -#if !defined(AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_) -#define AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// transdlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CTransformDlg dialog - -class CTransformDlg : public CDialog -{ -// Construction -public: - CTransformDlg(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CTransformDlg) - enum { IDD = IDD_TRANSFORM }; - float m_GlobalX; - float m_GlobalY; - float m_GlobalZ; - float m_OffsetX; - float m_OffsetY; - float m_OffsetZ; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CTransformDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CTransformDlg) - // NOTE: the ClassWizard will add member functions here - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TRANSDLG_H__FF6D1B48_BEEA_4A5F_9A00_48FD3ABE72C4__INCLUDED_) diff --git a/win/zlib/zlib.vcxproj b/win/zlib/zlib.vcxproj deleted file mode 100644 index 0cf807af..00000000 --- a/win/zlib/zlib.vcxproj +++ /dev/null @@ -1,157 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {A7D39990-9822-4302-9709-08D03ADF1170} - - - - StaticLibrary - false - - - StaticLibrary - false - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\Debug\ - .\Debug\ - .\Release\ - .\Release\ - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDebug - .\Debug/zlib.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - OldStyle - - - 0x0409 - - - .\Debug\zlib.lib - true - - - true - .\Debug/zlib.bsc - - - - - MaxSpeed - OnlyExplicitInline - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - MultiThreaded - true - .\Release/zlib.pch - .\Release/ - .\Release/ - .\Release/ - Level3 - true - - - 0x0409 - - - .\Release\zlib.lib - true - - - true - .\Release/zlib.bsc - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - - \ No newline at end of file