summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorleo2005-12-27 22:18:14 +0000
committerleo2005-12-27 22:18:14 +0000
commit49055c86feda30d3d7e4f6d5c8738c2aef5b68d9 (patch)
tree1e2d8e3b4390ab58408b31cfb9f019ed583681bd /win
parentfcd555cd2f169b2ebf04f09c3977094d06aa7cb0 (diff)
Removed code for the old pieces list.
git-svn-id: http://svn.leocad.org/trunk@449 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win')
-rw-r--r--win/LeoCAD.dsp28
-rw-r--r--win/LeoCAD.rc4
-rw-r--r--win/Leocad.cpp11
-rw-r--r--win/Mainfrm.cpp30
-rw-r--r--win/Piecebar.cpp202
-rw-r--r--win/Piecebar.h27
-rw-r--r--win/Piecelst.cpp532
-rw-r--r--win/Piecelst.h89
-rw-r--r--win/Prefpage.cpp6
-rw-r--r--win/Prefpage.h1
-rwxr-xr-xwin/SortHead.cpp163
-rwxr-xr-xwin/SortHead.h52
-rw-r--r--win/Stdafx.h2
-rw-r--r--win/System.cpp5
-rw-r--r--win/Titletip.cpp253
-rw-r--r--win/Transbar.cpp196
-rw-r--r--win/Transbar.h76
-rw-r--r--win/res/piecebar.bmpbin1318 -> 0 bytes
-rw-r--r--win/resource.h1
-rw-r--r--win/titletip.h62
20 files changed, 28 insertions, 1712 deletions
diff --git a/win/LeoCAD.dsp b/win/LeoCAD.dsp
index 627091e..f8d7ca4 100644
--- a/win/LeoCAD.dsp
+++ b/win/LeoCAD.dsp
@@ -243,10 +243,6 @@ SOURCE=.\Piececmb.cpp
# End Source File
# Begin Source File
-SOURCE=.\Piecelst.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\Pieceprv.cpp
# End Source File
# Begin Source File
@@ -291,10 +287,6 @@ SOURCE=.\Seldlg.cpp
# End Source File
# Begin Source File
-SOURCE=.\SortHead.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\Splitter.cpp
# End Source File
# Begin Source File
@@ -336,18 +328,10 @@ SOURCE=.\texdlg.cpp
# End Source File
# Begin Source File
-SOURCE=.\Titletip.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\Tools.cpp
# End Source File
# Begin Source File
-SOURCE=.\Transbar.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\transdlg.cpp
# End Source File
# Begin Source File
@@ -484,10 +468,6 @@ SOURCE=.\PieceInf.h
# End Source File
# Begin Source File
-SOURCE=.\PieceLst.h
-# End Source File
-# Begin Source File
-
SOURCE=.\PiecePrv.h
# End Source File
# Begin Source File
@@ -536,10 +516,6 @@ SOURCE=.\SelDlg.h
# End Source File
# Begin Source File
-SOURCE=.\SortHead.h
-# End Source File
-# Begin Source File
-
SOURCE=.\Splitter.h
# End Source File
# Begin Source File
@@ -584,10 +560,6 @@ SOURCE=.\Tools.h
# End Source File
# Begin Source File
-SOURCE=.\Transbar.h
-# End Source File
-# Begin Source File
-
SOURCE=.\transdlg.h
# End Source File
# Begin Source File
diff --git a/win/LeoCAD.rc b/win/LeoCAD.rc
index f9cc65d..736cbb6 100644
--- a/win/LeoCAD.rc
+++ b/win/LeoCAD.rc
@@ -78,7 +78,6 @@ IDR_PARTFRAME ICON DISCARDABLE "res\\idr_part.ico"
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
-IDB_PIECEBAR BITMAP DISCARDABLE "res\\piecebar.bmp"
IDB_VIEWPORTS BITMAP FIXED IMPURE "res\\views.bmp"
IDR_TOOLSBAR BITMAP DISCARDABLE "res\\toolsbar.bmp"
IDR_ANIMATORBAR BITMAP DISCARDABLE "res\\animator.bmp"
@@ -364,7 +363,6 @@ BEGIN
MENUITEM "Remove Category...", ID_PIECEBAR_REMOVECATEGORY
MENUITEM "Edit Category...", ID_PIECEBAR_EDITCATEGORY
MENUITEM SEPARATOR
- MENUITEM "Group Pieces", ID_PIECEBAR_GROUP
MENUITEM "Show Numbers", ID_PIECEBAR_NUMBERS
MENUITEM "Show Subparts", ID_PIECEBAR_SUBPARTS
MENUITEM SEPARATOR
@@ -980,8 +978,6 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,152,19,81,8
CONTROL "Show piece numbers",IDC_GENDLG_NUMBERS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,152,32,81,8
- CONTROL "Sort pieces by group",IDC_GENDLG_GROUP,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,152,45,81,8
CONTROL "Check for updates on startup",IDC_GENDLG_UPDATES,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,11,113,119,8
END
diff --git a/win/Leocad.cpp b/win/Leocad.cpp
index 7f2dd5b..51a2635 100644
--- a/win/Leocad.cpp
+++ b/win/Leocad.cpp
@@ -205,6 +205,17 @@ BOOL CCADApp::InitInstance()
if (!project->Initialize(__argc, __targv, app, NULL))
return false;
+ // Show something in the piece preview window.
+ PieceInfo* Info = project->GetPiecesLibrary()->FindPieceInfo("3005");
+ if (!Info)
+ Info = project->GetPiecesLibrary()->GetPieceInfo(0);
+ if (Info)
+ {
+ project->SetCurrentPiece(Info);
+ ((CMainFrame*)(AfxGetMainWnd()))->m_wndPiecesBar.m_wndPiecePreview.SetPieceInfo(Info);
+ ((CMainFrame*)(AfxGetMainWnd()))->m_wndPiecesBar.m_wndPiecePreview.PostMessage(WM_PAINT);
+ }
+
// TODO: move this to the project.
CString cfg = GetProfileString("Settings","Groups","");
if (!cfg.IsEmpty())
diff --git a/win/Mainfrm.cpp b/win/Mainfrm.cpp
index 78b4b52..619eaf9 100644
--- a/win/Mainfrm.cpp
+++ b/win/Mainfrm.cpp
@@ -112,8 +112,8 @@ BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_MESSAGE(WM_SETMESSAGESTRING, OnSetMessageString)
ON_WM_DROPFILES()
//}}AFX_MSG_MAP
- ON_COMMAND_RANGE(ID_PIECEBAR_GROUP, ID_PIECEBAR_SUBPARTS, OnPieceBar)
- ON_UPDATE_COMMAND_UI_RANGE(ID_PIECEBAR_GROUP, ID_PIECEBAR_SUBPARTS, OnUpdatePieceBar)
+ ON_COMMAND_RANGE(ID_PIECEBAR_NUMBERS, ID_PIECEBAR_SUBPARTS, OnPieceBar)
+ ON_UPDATE_COMMAND_UI_RANGE(ID_PIECEBAR_NUMBERS, ID_PIECEBAR_SUBPARTS, OnUpdatePieceBar)
// Global help commands
ON_COMMAND(ID_HELP_FINDER, CFrameWnd::OnHelpFinder)
ON_COMMAND(ID_HELP, CFrameWnd::OnHelp)
@@ -314,13 +314,6 @@ void CMainFrame::Dump(CDumpContext& dc) const
// lParam = update pieces, wParam = update colors
LONG CMainFrame::OnUpdateList(UINT lParam, LONG wParam)
{
- if (lParam)
- {
- if (lParam > 2)
- m_wndPiecesBar.m_nCurGroup = lParam - 2;
- m_wndPiecesBar.m_wndPiecesList.UpdateList();
- }
-
if (wParam != 0)
{
int x = wParam-1;
@@ -474,9 +467,8 @@ LONG CMainFrame::OnPopupClose(UINT /*lParam*/, LONG /*wParam*/)
LONG CMainFrame::UpdateSettings(UINT /*lParam*/, LONG /*wParam*/)
{
- int i = theApp.GetProfileInt("Settings", "Piecebar Options", PIECEBAR_GROUP);
+ int i = theApp.GetProfileInt("Settings", "Piecebar Options", 0);
m_wndPiecesBar.m_bSubParts = (i & PIECEBAR_SUBPARTS) != 0;
- m_wndPiecesBar.m_bGroups = (i & PIECEBAR_GROUP) != 0;
m_wndPiecesBar.m_bNumbers = (i & PIECEBAR_PARTNUMBERS) != 0;
RECT rc;
@@ -540,11 +532,6 @@ void CMainFrame::OnPieceBar(UINT nID)
{
switch (nID)
{
- case ID_PIECEBAR_GROUP:
- {
- m_wndPiecesBar.m_bGroups = !m_wndPiecesBar.m_bGroups;
- m_wndPiecesBar.m_wndPiecesList.UpdateList();
- } break;
case ID_PIECEBAR_NUMBERS:
{
m_wndPiecesBar.m_bNumbers = !m_wndPiecesBar.m_bNumbers;
@@ -552,7 +539,7 @@ void CMainFrame::OnPieceBar(UINT nID)
case ID_PIECEBAR_SUBPARTS:
{
m_wndPiecesBar.m_bSubParts = !m_wndPiecesBar.m_bSubParts;
- m_wndPiecesBar.m_wndPiecesList.UpdateList();
+// m_wndPiecesBar.UpdatePiecesTree(false);
} break;
}
@@ -568,7 +555,6 @@ void CMainFrame::OnPieceBar(UINT nID)
UINT u = 0;
if (m_wndPiecesBar.m_bSubParts) u |= PIECEBAR_SUBPARTS;
- if (m_wndPiecesBar.m_bGroups) u |= PIECEBAR_GROUP;
if (m_wndPiecesBar.m_bNumbers) u |= PIECEBAR_PARTNUMBERS;
theApp.WriteProfileInt("Settings", "Piecebar Options", u);
}
@@ -577,8 +563,6 @@ void CMainFrame::OnUpdatePieceBar(CCmdUI* pCmdUI)
{
switch (pCmdUI->m_nID)
{
- case ID_PIECEBAR_GROUP:
- pCmdUI->SetCheck(m_wndPiecesBar.m_bGroups); break;
case ID_PIECEBAR_NUMBERS:
pCmdUI->SetCheck(m_wndPiecesBar.m_bNumbers); break;
case ID_PIECEBAR_SUBPARTS:
@@ -1191,8 +1175,7 @@ BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
if (Focus != NULL)
{
- if (m_wndPiecesBar.m_wndPiecesCombo.IsChild(Focus) ||
- m_wndPiecesBar.m_wndPiecesList.IsChild(Focus))
+ if (m_wndPiecesBar.m_wndPiecesCombo.IsChild(Focus))
{
return CFrameWnd::PreTranslateMessage(pMsg);
}
@@ -1206,8 +1189,7 @@ BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
}
}
- if (m_wndPiecesBar.m_wndPiecesCombo.IsChild(GetFocus()) ||
- m_wndPiecesBar.m_wndPiecesList.IsChild(GetFocus()))
+ if (m_wndPiecesBar.m_wndPiecesCombo.IsChild(GetFocus()))
{
if (!Control && (((pMsg->wParam >= 'A') && (pMsg->wParam <= 'Z')) || ((pMsg->wParam >= '0') && (pMsg->wParam <= '9'))))
{
diff --git a/win/Piecebar.cpp b/win/Piecebar.cpp
index 87ac3f5..e6fedfd 100644
--- a/win/Piecebar.cpp
+++ b/win/Piecebar.cpp
@@ -22,11 +22,9 @@ static char THIS_FILE[] = __FILE__;
CPiecesBar::CPiecesBar()
{
- int i = AfxGetApp()->GetProfileInt("Settings", "Piecebar Options", PIECEBAR_GROUP);
+ int i = AfxGetApp()->GetProfileInt("Settings", "Piecebar Options", 0);
m_bSubParts = (i & PIECEBAR_SUBPARTS) != 0;
- m_bGroups = (i & PIECEBAR_GROUP) != 0;
m_bNumbers = (i & PIECEBAR_PARTNUMBERS) != 0;
- m_nCurGroup = 1;
m_sizeMin = CSize(222, 200);
m_sizeHorz = CSize(200, 200);
@@ -66,10 +64,7 @@ BEGIN_MESSAGE_MAP(CPiecesBar, CControlBar)
ON_WM_CONTEXTMENU()
//}}AFX_MSG_MAP
ON_LBN_SELCHANGE(IDW_COLORSLIST, OnSelChangeColor)
- ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText)
- ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText)
ON_MESSAGE(WM_LC_SPLITTER_MOVED, OnSplitterMoved)
- ON_COMMAND_RANGE(ID_PIECE_GROUP01, ID_PIECE_GROUP32, OnPieceGroupClicked)
END_MESSAGE_MAP()
@@ -627,46 +622,14 @@ void CPiecesBar::OnSize(UINT nType, int cx, int cy)
off += 30;
m_wndPiecesCombo.SetWindowPos (NULL, 5, cy-off, cx-10, 140, SWP_NOZORDER);
- if (m_bGroups)
- {
- off += 28;
- m_wndGroupsBar.SetWindowPos (NULL, 5, cy-off, cx-10, 24, SWP_NOZORDER);
- m_wndGroupsBar.ShowWindow (SW_SHOW);
- }
- else
- m_wndGroupsBar.ShowWindow (SW_HIDE);
-
m_wndSplitter.SetWindowPos (NULL, 5, m_nPreviewHeight+6, cx-10, 4, SWP_NOZORDER);
- m_wndPiecesList.SetWindowPos (NULL, 5, m_nPreviewHeight+10, cx-10, cy-off-15-m_nPreviewHeight, SWP_NOZORDER);
m_PiecesTree.SetWindowPos (NULL, 5, m_nPreviewHeight+10, cx-10, cy-off-15-m_nPreviewHeight, SWP_NOZORDER);
m_wndPiecePreview.SetWindowPos (NULL, 5, 5, cx-10, m_nPreviewHeight, 0);
m_wndPiecePreview.EnableWindow (TRUE);
m_wndPiecePreview.ShowWindow (SW_SHOW);
m_wndSplitter.ShowWindow (SW_SHOW);
- RECT rect;
- m_wndPiecesList.GetWindowRect (&rect);
-
- if (m_bNumbers)
- {
- LV_COLUMN lvc;
- lvc.mask = LVCF_WIDTH;
- if (!m_wndPiecesList.GetColumn(1,&lvc))
- {
- m_wndPiecesList.InsertColumn(1, "Number", LVCFMT_LEFT, 60, 1);
- rect.right -= 60;
- }
- else
- rect.right -= lvc.cx;
- }
- else
- m_wndPiecesList.DeleteColumn (1);
-
- m_wndPiecesList.SetColumnWidth(0, rect.right - rect.left - GetSystemMetrics(SM_CXVSCROLL) -2);
m_wndPiecesCombo.ShowWindow(SW_SHOW);
-
-
-m_wndPiecesList.ShowWindow(FALSE);
}
void CPiecesBar::OnUpdateCmdUI(CFrameWnd * pTarget, BOOL bDisableIfNoHndler)
@@ -679,7 +642,6 @@ void CPiecesBar::OnUpdateCmdUI(CFrameWnd * pTarget, BOOL bDisableIfNoHndler)
// sta |= TBSTATE_ENABLED|TBSTATE_CHECKED;
// m_wndGroupsBar.GetToolBarCtrl().SetState(nID, sta);
- m_wndGroupsBar.OnUpdateCmdUI(pTarget, FALSE);
UpdateDialogControls(pTarget, FALSE);
}
@@ -691,15 +653,6 @@ int CPiecesBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
m_PiecesTree.Create(WS_VISIBLE|WS_TABSTOP|WS_BORDER|TVS_SHOWSELALWAYS|TVS_HASBUTTONS|TVS_DISABLEDRAGDROP|TVS_HASLINES|TVS_LINESATROOT,
CRect(0,0,0,0), this, IDW_PIECESTREE);
- m_wndPiecesList.Create(LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_AUTOARRANGE|
- LVS_SORTASCENDING|WS_VISIBLE|WS_TABSTOP|LVS_REPORT|WS_BORDER,
- CRect(0,0,0,0), this, IDW_PIECESLIST);
-
- m_wndPiecesList.InsertColumn(0, "Description", LVCFMT_LEFT, 129, 0);
- m_wndPiecesList.SubclassHeader();
- if (m_bNumbers)
- m_wndPiecesList.InsertColumn(1, "Number", LVCFMT_LEFT, 60, 1);
-
m_wndColorsList.Create(LBS_MULTICOLUMN|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY|
LBS_OWNERDRAWFIXED|WS_VISIBLE|WS_TABSTOP|WS_CHILD|WS_BORDER,
CRect (0,0,0,0), this, IDW_COLORSLIST);
@@ -732,8 +685,6 @@ int CPiecesBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
m_wndPiecePreview.Create (NULL, NULL, WS_BORDER|WS_CHILD|WS_VISIBLE,
CRect(0, 0, 0, 0), this, IDW_PIECEPREVIEW);
- CreateGroupsBar();
-
CreateWindow("STATIC", "", WS_VISIBLE|WS_CHILD|SS_ETCHEDFRAME, 0, 0, 0, 0,
m_hWnd, (HMENU)IDW_PIECEBAR_SPLITTER, AfxGetInstanceHandle(), NULL);
@@ -757,64 +708,6 @@ void CPiecesBar::OnSelChangeColor()
m_wndPiecePreview.PostMessage (WM_PAINT);
}
-BOOL CPiecesBar::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
-{
- ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);
-
- if (GetRoutingFrame() != NULL)
- return FALSE;
-
- TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
- TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
-
- UINT nID = pNMHDR->idFrom;
- if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
- pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
- {
- nID = ((UINT)(WORD)::GetDlgCtrlID((HWND)nID));
- }
- if (nID >= ID_PIECE_GROUP01 && nID <= ID_PIECE_GROUP32) // will be zero on a separator
- {
- if (pNMHDR->code == TTN_NEEDTEXTA)
- lstrcpyn(pTTTA->szText, m_GroupNames[nID-ID_PIECE_GROUP01],(sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])));
- else
- _mbstowcsz(pTTTW->szText, m_GroupNames[nID-ID_PIECE_GROUP01],(sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0])));
- }
-/* else if (nID == IDW_COLORSLIST)
- {
- POINT pt;
- GetCursorPos(&pt);
- m_wndColorsList.ScreenToClient(&pt);
- CString str;
-
- for (int i = 0; i < 14; i++)
- {
- CRect rect (i*15,0,(i+1)*15,12);
- if (rect.PtInRect(pt))
- {
- str.LoadString(IDS_COLOR01+i);
- break;
- }
- rect.OffsetRect (0,12);
- if (rect.PtInRect(pt))
- {
- str.LoadString(IDS_COLOR15+i);
- break;
- }
- }
- if (pNMHDR->code == TTN_NEEDTEXTA)
- lstrcpyn(pTTTA->szText, str,(sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])));
- else
- _mbstowcsz(pTTTW->szText, str,(sizeof(pTTTW->szText)/sizeof(pTTTW->szText[0])));
- }
-*/
- *pResult = 0;
-
- ::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE);
-
- return TRUE; // message was handled
-}
-
LONG CPiecesBar::OnSplitterMoved(UINT lParam, LONG wParam)
{
UNREFERENCED_PARAMETER(wParam);
@@ -827,99 +720,6 @@ LONG CPiecesBar::OnSplitterMoved(UINT lParam, LONG wParam)
return TRUE;
}
-void CPiecesBar::OnPieceGroupClicked(UINT nID)
-{
- m_nCurGroup = nID - ID_PIECE_GROUP01;
- project->HandleNotify(LC_GROUP_CHANGED, m_nCurGroup);
- AfxGetMainWnd()->PostMessage (WM_LC_UPDATE_LIST, 1, 0);
-}
-
-void CPiecesBar::CreateGroupsBar()
-{
- BYTE nGroups = 0;
- memset (m_GroupNames, 0, sizeof(m_GroupNames));
- CString str, cfg = AfxGetApp()->GetProfileString("Settings", "Groups", "");
-
- for (int i = 0; i < 32; i++)
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].iBitmap = min (i,9);
- m_wndGroupsBar.m_ToolbarData.himl = NULL;
-
- if (!cfg.IsEmpty())
- {
- CFile f;
- if (f.Open(cfg, CFile::modeRead|CFile::shareDenyWrite) != 0)
- if (f.GetLength() != 0)
- {
- CArchive ar(&f, CArchive::load | CArchive::bNoFlushOnDelete);
- char tmp[33];
- float ver;
- CString str;
- ar.Read (tmp, 32);
- ar >> ver;
- if (ver == 0.1f)
- ar >> i;
- else
- {
- ar >> nGroups;
- for (i = 0; i < nGroups; i++)
- {
- ar.Read (m_GroupNames[i], 33);
-
- if (ver > 0.2f)
- ar >> m_wndGroupsBar.m_ToolbarData.ButtonData[i].iBitmap;
- }
- }
-
- if (ver > 0.2f)
- {
- CImageList iml;
- iml.Read(&ar);
- m_wndGroupsBar.m_ToolbarData.himl = iml.Detach();
- }
-
- ar.Close();
- f.Close();
- }
- }
-
- if (nGroups == 0)
- nGroups = 9;
-
- for (i = 0; i < nGroups; i++)
- {
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].idCommand = ID_PIECE_GROUP01 + i;
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].fsState = TBSTATE_ENABLED;
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].fsStyle = TBSTYLE_BUTTON;
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].lpszButtonText = "";
- m_wndGroupsBar.m_ToolbarData.ButtonData[i].lpszTooltip = "";
-
- if (m_GroupNames[i][0] == 0)
- {
- str.LoadString (ID_PIECE_GROUP01 + i);
- strcpy (m_GroupNames[i], str);
- }
- }
-
- m_wndGroupsBar.m_ToolbarData.dwStyle = TBSTYLE_FLAT;
- m_wndGroupsBar.m_ToolbarData.idControl = IDW_GROUPSBAR;
- m_wndGroupsBar.m_ToolbarData.idbDefault = IDB_PIECEBAR;
- m_wndGroupsBar.m_ToolbarData.idbHot = NULL;
- m_wndGroupsBar.m_ToolbarData.iButtons = nGroups;
- m_wndGroupsBar.m_ToolbarData.iButtonCX = 16;
- m_wndGroupsBar.m_ToolbarData.iButtonCY = 15;
-
- if (m_wndGroupsBar.m_ToolbarData.himl == NULL)
- m_wndGroupsBar.m_ToolbarData.himl = ImageList_LoadImage
- (AfxGetInstanceHandle(), MAKEINTRESOURCE(m_wndGroupsBar.m_ToolbarData.idbDefault), m_wndGroupsBar.m_ToolbarData.iButtonCX, 0, 0x00ff00ff, IMAGE_BITMAP, 0);
-
- if (m_wndGroupsBar.m_hWnd)
- m_wndGroupsBar.DestroyWindow();
- m_wndGroupsBar.Create(m_hWnd);
- m_wndGroupsBar.SetBarStyle(m_wndGroupsBar.GetBarStyle() | CBRS_FLYBY | CBRS_ALIGN_ANY);
- m_wndGroupsBar.SetWindowPos (NULL,5,210,216,24,SWP_NOZORDER);
- m_wndGroupsBar.EnableToolTips();
-}
-
void CPiecesBar::OnContextMenu(CWnd* pWnd, CPoint point)
{
UNREFERENCED_PARAMETER(pWnd);
diff --git a/win/Piecebar.h b/win/Piecebar.h
index c5e9775..adb67ec 100644
--- a/win/Piecebar.h
+++ b/win/Piecebar.h
@@ -9,11 +9,9 @@
#pragma once
#endif // _MSC_VER >= 1000
-#include "PieceLst.h"
#include "ColorLst.h"
#include "PieceCmb.h"
#include "PiecePrv.h"
-#include "TransBar.h"
#include "Splitter.h"
/////////////////////////////////////////////////////////////////////////
@@ -61,13 +59,13 @@ protected:
protected:
// used for resizing
- CSize m_sizeMin;
+ CSize m_sizeMin;
CSize m_sizeMax;
- CPoint m_ptOld;
+ CPoint m_ptOld;
CRect m_rectBorder;
BOOL m_bTracking;
- BOOL m_bDragShowContent;
- CSize m_sizeOld;
+ BOOL m_bDragShowContent;
+ CSize m_sizeOld;
BOOL m_bInRecalcNC;
UINT m_nDockBarID;
@@ -80,22 +78,15 @@ protected:
void SaveState();
public:
- void CreateGroupsBar();
BOOL m_bSubParts;
- BOOL m_bGroups;
BOOL m_bNumbers;
- CPiecesList m_wndPiecesList;
- CColorsList m_wndColorsList;
- CPiecesCombo m_wndPiecesCombo;
- CPiecePreview m_wndPiecePreview;
- CTransToolBar m_wndGroupsBar;
- CySplitterWnd m_wndSplitter;
+ CColorsList m_wndColorsList;
+ CPiecesCombo m_wndPiecesCombo;
+ CPiecePreview m_wndPiecePreview;
+ CySplitterWnd m_wndSplitter;
CTreeCtrl m_PiecesTree;
- char m_GroupNames[32][33];
- int m_nCurGroup;
-
void UpdatePiecesTree(bool SearchOnly);
void UpdatePiecesTree(const char* OldCategory, const char* NewCategory);
void SelectPiece(const char* Category, PieceInfo* Info);
@@ -126,9 +117,7 @@ protected:
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
//}}AFX_MSG
- afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
afx_msg LONG OnSplitterMoved(UINT lParam, LONG wParam);
- void OnPieceGroupClicked(UINT nID);
DECLARE_MESSAGE_MAP()
};
diff --git a/win/Piecelst.cpp b/win/Piecelst.cpp
deleted file mode 100644
index 9586529..0000000
--- a/win/Piecelst.cpp
+++ /dev/null
@@ -1,532 +0,0 @@
-// PieceLst.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "leocad.h"
-#include "PieceLst.h"
-#include "PieceBar.h"
-#include "project.h"
-#include "pieceinf.h"
-#include "library.h"
-#include "globals.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CPiecesList
-
-static int CALLBACK ListViewCompareProc(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);
-
- if (lParamSort & 0xF0)
- return ret;
- else
- return -ret;
-}
-
-CPiecesList::CPiecesList()
-{
- // TODO: Load from registry
- memset(m_nLastPieces, 0, sizeof(m_nLastPieces));
-
- m_nSortedCol = 0;
- m_bAscending = FALSE;
-}
-
-CPiecesList::~CPiecesList()
-{
- ClearGroups();
- // TODO: save m_nLastPieces to registry
-}
-
-
-BEGIN_MESSAGE_MAP(CPiecesList, CListCtrl)
- //{{AFX_MSG_MAP(CPiecesList)
- ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
- ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemchanged)
- ON_WM_MOUSEMOVE()
- ON_WM_CREATE()
- ON_WM_KEYDOWN()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPiecesList message handlers
-
-void CPiecesList::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
-{
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
-
- // set the sort order.
- if (pNMListView->iSubItem == m_nSortedCol)
- m_bAscending = !m_bAscending;
- else
- m_bAscending = FALSE;
-
- // save the column index.
- m_nSortedCol = pNMListView->iSubItem;
-
- if (m_bAscending)
- SortItems((PFNLVCOMPARE)ListViewCompareProc, m_nSortedCol);
- else
- SortItems((PFNLVCOMPARE)ListViewCompareProc, m_nSortedCol|0xF0);
-
- m_HeaderCtrl.SetSortImage(m_nSortedCol, m_bAscending);
- *pResult = 0;
-}
-
-void CPiecesList::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult)
-{
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
-
- if (pNMListView->uNewState & LVIS_SELECTED)
- {
- CPiecesBar* pBar = (CPiecesBar*)GetParent();
-
- LV_ITEM lvi;
- lvi.iItem = pNMListView->iItem;
- lvi.iSubItem = 0;
- lvi.mask = LVIF_PARAM;
- GetItem (&lvi);
-
- // Let everybody know the selection changed.
- PieceInfo* pInfo = (PieceInfo*)lvi.lParam;
- project->SetCurrentPiece(pInfo);
- pBar->m_wndPiecePreview.SetPieceInfo(pInfo);
- pBar->m_wndPiecePreview.PostMessage(WM_PAINT);
-
- if (pBar->m_bGroups)
- m_nLastPieces[pBar->m_nCurGroup] = pNMListView->iItem;
-
- CRect Rect;
- POINT MousePos;
-
- GetCursorPos(&MousePos);
- GetItemRect(pNMListView->iItem, &Rect, LVIR_BOUNDS);
- ScreenToClient(&MousePos);
-
- if (Rect.PtInRect(MousePos))
- {
- int row, col;
- RECT cellrect;
- row = CellRectFromPoint (CPoint(MousePos), &cellrect, &col);
- if (row != -1)
- {
- int offset = 7;
- if( col == 0 )
- {
- CRect rcLabel;
- GetItemRect(row, &rcLabel, LVIR_LABEL);
- offset = rcLabel.left - cellrect.left + offset / 2;
- }
- cellrect.top--;
-
- m_TitleTip.ShowWindow(SW_HIDE);
- m_TitleTip.Show (cellrect, GetItemText(row, col), offset-1, GetItemState (row, LVIS_FOCUSED));
- }
- }
- }
- else if (pNMListView->uOldState & LVIS_SELECTED)
- {
- CRect Rect;
- POINT MousePos;
-
- GetCursorPos(&MousePos);
- GetItemRect(pNMListView->iItem, &Rect, LVIR_BOUNDS);
- ScreenToClient(&MousePos);
-
- if (Rect.PtInRect(MousePos))
- {
- CWnd* CaptureWnd = GetCapture();
- if ((CaptureWnd != NULL) && (CaptureWnd ->m_hWnd == m_TitleTip.m_hWnd))
- ReleaseCapture();
-
- m_TitleTip.ShowWindow(SW_HIDE);
- }
- }
-
- *pResult = 0;
-}
-
-void CPiecesList::ClearGroups()
-{
- for (int i = 0; i < m_Groups.GetSize(); i++)
- delete m_Groups[i];
-
- m_Groups.RemoveAll();
- m_Pieces.RemoveAll();
-}
-
-void CPiecesList::UpdateGroups()
-{
- CPiecesBar* Bar = (CPiecesBar*)GetParent();
- PiecesLibrary *Lib = project->GetPiecesLibrary();
- int i, j;
-
- ClearGroups();
-
- for (i = 0; i < Lib->GetPieceCount(); i++)
- {
- PieceInfo* Info = Lib->GetPieceInfo(i);
-
- // Skip subparts if the user doesn't want to see them.
- if ((Info->m_strDescription[0] == '~') && !Bar->m_bSubParts)
- continue;
-
- // Skip pieces not in the current category.
- if (Bar->m_bGroups && ((Info->m_nGroups & (DWORD)(1 << Bar->m_nCurGroup)) == 0))
- continue;
-
- // There's nothing else to check if we're not grouping patterned pieces together.
- if (!m_GroupPatterns)
- {
- m_Pieces.Add(Info);
- continue;
- }
-
- // Check if it's a patterned piece.
- const char* Name = Info->m_strName;
- while (*Name)
- {
- if (!*Name || *Name < '0' || *Name > '9')
- break;
-
- if (*Name == 'P')
- break;
-
- Name++;
- }
-
- if (*Name == 'P')
- {
- PieceListGroup* Group = NULL;
- PieceInfo* Parent;
-
- char ParentName[9];
- strcpy(ParentName, Info->m_strName);
- ParentName[Name - Info->m_strName] = '\0';
-
- Parent = Lib->FindPieceInfo(ParentName);
-
- if (Parent)
- {
- // Search for the parent's group.
- for (j = 0; j < m_Groups.GetSize(); j++)
- {
- if (m_Groups[j]->Parent == Parent)
- {
- Group = m_Groups[j];
- break;
- }
- }
-
- // Check if the parent wasn't added as a single piece.
- if (!Group)
- {
- for (j = 0; j < m_Pieces.GetSize(); j++)
- {
- if (m_Pieces[j] == Parent)
- {
- m_Pieces.RemoveIndex(j);
-
- Group = new PieceListGroup();
- Group->Parent = Parent;
- Group->Collapsed = true;
- m_Groups.Add(Group);
-
- break;
- }
- }
- }
-
- // Create a new group for the parent.
- if (!Group)
- {
- Group = new PieceListGroup();
- Group->Parent = Parent;
- Group->Collapsed = true;
- m_Groups.Add(Group);
- }
-
- Group->Children.Add(Info);
- }
- else
- {
- m_Pieces.Add(Info);
- }
- }
- else
- {
- bool Found = false;
-
- // Add piece to the list if it's not there already,
- // this could be the parent whose child was added earlier.
- for (j = 0; j < m_Groups.GetSize(); j++)
- {
- if (m_Groups[j]->Parent == Info)
- {
- Found = true;
- break;
- }
- }
-
- if (!Found)
- {
- m_Pieces.Add(Info);
- }
- }
- }
-}
-
-void CPiecesList::AddPiece(PieceInfo* Info, int ImageIndex)
-{
- LV_ITEM lvi;
-
- if (ImageIndex == -1)
- lvi.mask = LVIF_TEXT | LVIF_PARAM;
- else
- lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
-
- TCHAR tmp[65], tmp2[10];
- strcpy(tmp, Info->m_strDescription);
- lvi.iImage = ImageIndex;
- lvi.iItem = 0;
- lvi.iSubItem = 0;
- lvi.pszText = tmp;
- lvi.lParam = (LPARAM)Info;
- int idx = InsertItem(&lvi);
-
- strcpy(tmp2, Info->m_strName);
- SetItemText(idx, 1, tmp2);
-}
-
-void CPiecesList::UpdateList(bool Repopulate)
-{
- CWaitCursor wc;
- int i;
-
- if (Repopulate)
- UpdateGroups();
-
- SetRedraw(FALSE);
- DeleteAllItems();
-
-/*
- PiecesLibrary *pLib = project->GetPiecesLibrary();
-
- for (int i = 0; i < pLib->GetPieceCount(); i++)
- {
- PieceInfo* pInfo = pLib->GetPieceInfo(i);
-
- // Skip subparts if the user doesn't want to see them.
- if ((pInfo->m_strDescription[0] == '~') && !pBar->m_bSubParts)
- continue;
-
- // Skip pieces not in the current category.
- if (pBar->m_bGroups && ((pInfo->m_nGroups & (DWORD)(1 << pBar->m_nCurGroup)) == 0))
- continue;
-
- TCHAR tmp[65], tmp2[10];
- strcpy(tmp, pInfo->m_strDescription);
- lvi.iItem = 0;
- lvi.iSubItem = 0;
- lvi.pszText = tmp;
- lvi.lParam = (LPARAM)pInfo;
- lvi.iImage = 1;
- int idx = InsertItem(&lvi);
-
- strcpy(tmp2, pInfo->m_strName);
- SetItemText(idx, 1, tmp2);
- }
-*/
-
- for (i = 0; i < m_Groups.GetSize(); i++)
- {
- PieceListGroup* Group = m_Groups[i];
-
- AddPiece(Group->Parent, (Group->Collapsed) ? 0 : 1);
-
- if (!Group->Collapsed)
- {
- for (int j = 0; j < Group->Children.GetSize(); j++)
- {
- AddPiece(Group->Children[j], 3);
- }
- }
- }
-
- for (i = 0; i < m_Pieces.GetSize(); i++)
- {
- AddPiece(m_Pieces[i], 3);
- }
-
- if (m_bAscending)
- SortItems((PFNLVCOMPARE)ListViewCompareProc, m_nSortedCol);
- else
- SortItems((PFNLVCOMPARE)ListViewCompareProc, m_nSortedCol|0xF0);
-
- CPiecesBar* pBar = (CPiecesBar*)GetParent();
- EnsureVisible(m_nLastPieces[pBar->m_nCurGroup], FALSE);
- SetItemState(m_nLastPieces[pBar->m_nCurGroup], LVIS_SELECTED | LVIS_FOCUSED , LVIS_SELECTED | LVIS_FOCUSED);
- SetRedraw(TRUE);
- Invalidate();
-}
-
-int CPiecesList::CellRectFromPoint(CPoint & point, RECT* cellrect, int* col) const
-{
- int colnum;
-
- if((GetStyle() & LVS_TYPEMASK) != LVS_REPORT)
- return -1;
-
- // Get the top and bottom row visible
- int row = GetTopIndex();
- int bottom = row + GetCountPerPage();
- if( bottom > GetItemCount() )
- bottom = GetItemCount();
-
- // Get the number of columns
- CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
- if (!pHeader) return -1;
- int nColumnCount = pHeader->GetItemCount();
-
- // Loop through the visible rows
- for( ;row <=bottom;row++)
- {
- // Get bounding rect of item and check whether point falls in it.
- CRect rect;
- GetItemRect( row, &rect, LVIR_BOUNDS );
- if( rect.PtInRect(point) )
- {
- // Now find the column
- for (colnum = 0; colnum < nColumnCount; colnum++)
- {
- int colwidth = GetColumnWidth(colnum);
- if( point.x >= rect.left &&
- point.x <= (rect.left + colwidth ) )
- {
- // Found the column
- RECT rectClient;
- GetClientRect( &rectClient );
- if( point.x > rectClient.right )
- return -1;
- if( col )
- *col = colnum;
- rect.right = rect.left + colwidth;
- if( rect.right > rectClient.right )
- rect.right = rectClient.right;
- *cellrect = rect;
- return row;
- }
- rect.left += colwidth;
- }
- }
- }
- return -1;
-}
-
-void CPiecesList::OnMouseMove(UINT nFlags, CPoint point)
-{
- if (nFlags == 0)
- {
- int row, col;
- RECT cellrect;
- row = CellRectFromPoint (point, &cellrect, &col);
- if (row != -1)
- {
- int offset = 7;
- if( col == 0 )
- {
- CRect rcLabel;
- GetItemRect(row, &rcLabel, LVIR_LABEL);
- offset = rcLabel.left - cellrect.left + offset / 2;
- }
- cellrect.top--;
-
- m_TitleTip.Show(cellrect, GetItemText(row, col), offset-1, GetItemState(row, LVIS_FOCUSED) && (col == 0));
- }
- }
-
- CListCtrl::OnMouseMove(nFlags, point);
-}
-
-int CPiecesList::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if (CListCtrl::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- m_Images.Create(IDB_PARTICONS, 16, 0, RGB (0,128,128));
- SetImageList(&m_Images, LVSIL_SMALL);
-
- m_TitleTip.Create(this);
-
- return 0;
-}
-
-void CPiecesList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
- if (nChar == VK_INSERT)
- {
- project->HandleCommand(LC_PIECE_INSERT, 0);
-
- CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
- CView* pView = pFrame->GetActiveView();
- pView->SetFocus();
- }
- else if (nChar == VK_RIGHT)
- {
- int Index = GetNextItem(-1, LVNI_ALL | LVNI_SELECTED);
- PieceInfo* Info = (PieceInfo*)GetItemData(Index);
-
- for (int i = 0; i < m_Groups.GetSize(); i++)
- {
- PieceListGroup* Group = m_Groups[i];
-
- if (Group->Parent == Info)
- Group->Collapsed = false;
- }
-
- UpdateList(false);
- }
- else if (nChar == VK_LEFT)
- {
- int Index = GetNextItem(-1, LVNI_ALL | LVNI_SELECTED);
- PieceInfo* Info = (PieceInfo*)GetItemData(Index);
-
- for (int i = 0; i < m_Groups.GetSize(); i++)
- {
- PieceListGroup* Group = m_Groups[i];
-
- if (Group->Parent == Info)
- Group->Collapsed = true;
- }
-
- UpdateList(false);
- }
- else
- CListCtrl::OnKeyDown(nChar, nRepCnt, nFlags);
-}
-
-void CPiecesList::SubclassHeader()
-{
- // Get the window handle to the existing header control.
- HWND hWnd = GetDlgItem(0)->GetSafeHwnd();
- ASSERT(hWnd);
-
- // subclass the header control.
- m_HeaderCtrl.SubclassWindow(hWnd);
- m_HeaderCtrl.SetSortImage(0, FALSE);
-}
diff --git a/win/Piecelst.h b/win/Piecelst.h
deleted file mode 100644
index 180986d..0000000
--- a/win/Piecelst.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#if !defined(AFX_PIECELST_H__533899A4_4008_11D2_8202_D2B1707B2D1B__INCLUDED_)
-#define AFX_PIECELST_H__533899A4_4008_11D2_8202_D2B1707B2D1B__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// PieceLst.h : header file
-//
-
-#include "TitleTip.h"
-#include "SortHead.h"
-#include "array.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CPiecesList window
-
-class PieceInfo;
-
-class CPiecesList : public CListCtrl
-{
-// Construction
-public:
- CPiecesList();
-
-// Attributes
-public:
-
-// Operations
-public:
- void SubclassHeader();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPiecesList)
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CPiecesList();
-
- void ChangeGroup();
- void UpdateList(bool Repopulate = true);
-
- // Generated message map functions
-protected:
- UINT m_nLastPieces[32];
- int CellRectFromPoint(CPoint & point, RECT * cellrect, int * col) const;
-
- BOOL m_bAscending;
- int m_nSortedCol;
-
- CTitleTip m_TitleTip;
- CSortHeaderCtrl m_HeaderCtrl;
-
- void AddPiece(PieceInfo* Info, int ImageIndex);
-
- // Variables for grouping patterned pieces together.
- typedef struct
- {
- PieceInfo* Parent;
- PtrArray<PieceInfo> Children;
- bool Collapsed;
- } PieceListGroup;
-
- CImageList m_Images;
- bool m_GroupPatterns;
- PtrArray<PieceListGroup> m_Groups;
- PtrArray<PieceInfo> m_Pieces;
-
- void UpdateGroups();
- void ClearGroups();
-
- //{{AFX_MSG(CPiecesList)
- afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- //}}AFX_MSG
-
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PIECELST_H__533899A4_4008_11D2_8202_D2B1707B2D1B__INCLUDED_)
diff --git a/win/Prefpage.cpp b/win/Prefpage.cpp
index cb1e21c..9d22e67 100644
--- a/win/Prefpage.cpp
+++ b/win/Prefpage.cpp
@@ -30,7 +30,6 @@ CPreferencesGeneral::CPreferencesGeneral() : CPropertyPage(CPreferencesGeneral::
m_bSubparts = FALSE;
m_nSaveTime = 0;
m_bNumbers = FALSE;
- m_bGroup = FALSE;
m_strFolder = _T("");
m_bAutoSave = FALSE;
m_strUser = _T("");
@@ -51,7 +50,6 @@ void CPreferencesGeneral::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_GENDLG_SAVETIME, m_nSaveTime);
DDV_MinMaxInt(pDX, m_nSaveTime, 1, 60);
DDX_Check(pDX, IDC_GENDLG_NUMBERS, m_bNumbers);
- DDX_Check(pDX, IDC_GENDLG_GROUP, m_bGroup);
DDX_Text(pDX, IDC_GENDLG_FOLDER, m_strFolder);
DDX_Check(pDX, IDC_GENDLG_AUTOSAVE, m_bAutoSave);
DDX_Text(pDX, IDC_GENDLG_USER, m_strUser);
@@ -87,9 +85,8 @@ void CPreferencesGeneral::SetOptions(int nSaveInterval, int nMouse, const char*
m_strUser = strUser;
m_Updates = AfxGetApp()->GetProfileInt("Settings", "CheckUpdates", 1);
- int i = AfxGetApp()->GetProfileInt("Settings", "Piecebar Options", PIECEBAR_GROUP);
+ int i = AfxGetApp()->GetProfileInt("Settings", "Piecebar Options", 0);
m_bSubparts = (i & PIECEBAR_SUBPARTS) != 0;
- m_bGroup = (i & PIECEBAR_GROUP) != 0;
m_bNumbers = (i & PIECEBAR_PARTNUMBERS) != 0;
}
@@ -103,7 +100,6 @@ void CPreferencesGeneral::GetOptions(int* nSaveTime, int* nMouse, char* strFolde
int i = 0;
if (m_bSubparts) i |= PIECEBAR_SUBPARTS;
- if (m_bGroup) i |= PIECEBAR_GROUP;
if (m_bNumbers) i |= PIECEBAR_PARTNUMBERS;
AfxGetApp()->WriteProfileInt("Settings", "Piecebar Options", i);
diff --git a/win/Prefpage.h b/win/Prefpage.h
index 04149b2..4231f51 100644
--- a/win/Prefpage.h
+++ b/win/Prefpage.h
@@ -27,7 +27,6 @@ public:
BOOL m_bSubparts;
int m_nSaveTime;
BOOL m_bNumbers;
- BOOL m_bGroup;
CString m_strFolder;
BOOL m_bAutoSave;
CString m_bUser;
diff --git a/win/SortHead.cpp b/win/SortHead.cpp
deleted file mode 100755
index f3e65d2..0000000
--- a/win/SortHead.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-// SortHead.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "leocad.h"
-#include "SortHead.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CSortHeaderCtrl
-
-CSortHeaderCtrl::CSortHeaderCtrl()
-{
- m_nSortCol = -1;
-}
-
-CSortHeaderCtrl::~CSortHeaderCtrl()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CSortHeaderCtrl, CHeaderCtrl)
- //{{AFX_MSG_MAP(CSortHeaderCtrl)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CSortHeaderCtrl message handlers
-
-int CSortHeaderCtrl::SetSortImage(int nCol, BOOL bAsc)
-{
- int nPrevCol = m_nSortCol;
-
- m_nSortCol = nCol;
- m_bSortAsc = bAsc;
-
- // Change the item to ownder drawn
- HD_ITEM hditem;
-
- hditem.mask = HDI_FORMAT;
- GetItem(nCol, &hditem);
- hditem.fmt |= HDF_OWNERDRAW;
- SetItem(nCol, &hditem);
-
- // Invalidate header control so that it gets redrawn
- Invalidate();
-
- return nPrevCol;
-}
-
-void CSortHeaderCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
-{
- CDC dc;
- dc.Attach(lpDrawItemStruct->hDC);
-
- // Get the column rect
- CRect rcLabel(lpDrawItemStruct->rcItem);
-
- // Save DC
- int nSavedDC = dc.SaveDC();
-
- // Set clipping region to limit drawing within column
- CRgn rgn;
- rgn.CreateRectRgnIndirect(&rcLabel);
- dc.SelectObject(&rgn);
- rgn.DeleteObject();
-
- // Draw the background
- dc.FillRect(rcLabel, &CBrush(::GetSysColor(COLOR_3DFACE)));
-
- // Labels are offset by a certain amount
- // This offset is related to the width of a space character
- int offset = dc.GetTextExtent(_T(" "), 1 ).cx*2;
-
- // Get the column text and format
- TCHAR buf[256];
- HD_ITEM hditem;
- hditem.mask = HDI_TEXT | HDI_FORMAT;
- hditem.pszText = buf;
- hditem.cchTextMax = 255;
-
- GetItem(lpDrawItemStruct->itemID, &hditem);
-
- // Determine format for drawing column label
- UINT uFormat = DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP
- | DT_VCENTER | DT_END_ELLIPSIS ;
-
- if (hditem.fmt & HDF_CENTER)
- uFormat |= DT_CENTER;
- else if (hditem.fmt & HDF_RIGHT)
- uFormat |= DT_RIGHT;
- else
- uFormat |= DT_LEFT;
-
- // Adjust the rect if the mouse button is pressed on it
- if (lpDrawItemStruct->itemState == ODS_SELECTED)
- {
- rcLabel.left++;
- rcLabel.top += 2;
- rcLabel.right++;
- }
-
- // Adjust the rect further if Sort arrow is to be displayed
- if (lpDrawItemStruct->itemID == (UINT)m_nSortCol)
- rcLabel.right -= 3 * offset;
-
- rcLabel.left += offset;
- rcLabel.right -= offset;
-
- // Draw column label
- if (rcLabel.left < rcLabel.right)
- dc.DrawText(buf,-1,rcLabel, uFormat);
-
- // Draw the Sort arrow
- if (lpDrawItemStruct->itemID == (UINT)m_nSortCol)
- {
- CRect rcIcon(lpDrawItemStruct->rcItem);
-
- // Set up pens to use for drawing the triangle
- CPen penLight(PS_SOLID, 1, GetSysColor(COLOR_3DHILIGHT));
- CPen penShadow(PS_SOLID, 1, GetSysColor(COLOR_3DSHADOW));
- CPen *pOldPen = dc.SelectObject(&penLight);
-
- if (m_bSortAsc)
- {
- // Draw triangle pointing upwards
- dc.MoveTo(rcIcon.right - 2*offset, offset-1);
- dc.LineTo(rcIcon.right - 3*offset/2, rcIcon.bottom - offset);
- dc.LineTo(rcIcon.right - 5*offset/2-2, rcIcon.bottom - offset);
- dc.MoveTo(rcIcon.right - 5*offset/2-1, rcIcon.bottom - offset-1);
-
- dc.SelectObject(&penShadow);
- dc.LineTo(rcIcon.right - 2*offset, offset-2);
- }
- else
- {
- // Draw triangle pointing downwords
- dc.MoveTo(rcIcon.right - 3*offset/2, offset-1);
- dc.LineTo(rcIcon.right - 2*offset-1, rcIcon.bottom - offset + 1);
- dc.MoveTo(rcIcon.right - 2*offset-1, rcIcon.bottom - offset);
-
- dc.SelectObject(&penShadow);
- dc.LineTo(rcIcon.right - 5*offset/2-1, offset -1);
- dc.LineTo(rcIcon.right - 3*offset/2, offset -1);
- }
-
- // Restore the pen
- dc.SelectObject(pOldPen);
- }
-
- // Restore dc
- dc.RestoreDC(nSavedDC);
-
- // Detach the dc before returning
- dc.Detach();
-}
-
diff --git a/win/SortHead.h b/win/SortHead.h
deleted file mode 100755
index 3d2bc5b..0000000
--- a/win/SortHead.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#if !defined(AFX_SORTHEAD_H__56F42684_B169_11D3_A5D1_AA1A6BED9842__INCLUDED_)
-#define AFX_SORTHEAD_H__56F42684_B169_11D3_A5D1_AA1A6BED9842__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// SortHead.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CSortHeaderCtrl window
-
-class CSortHeaderCtrl : public CHeaderCtrl
-{
-// Construction
-public:
- CSortHeaderCtrl();
-
-// Attributes
-protected:
- int m_nSortCol;
- BOOL m_bSortAsc;
-
-// Operations
-public:
- int SetSortImage(int nCol, BOOL bAsc);
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CSortHeaderCtrl)
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CSortHeaderCtrl();
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CSortHeaderCtrl)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
-
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_SORTHEAD_H__56F42684_B169_11D3_A5D1_AA1A6BED9842__INCLUDED_)
diff --git a/win/Stdafx.h b/win/Stdafx.h
index 98a0915..ffc6871 100644
--- a/win/Stdafx.h
+++ b/win/Stdafx.h
@@ -49,7 +49,7 @@
// Piecebar settings
//#define PIECEBAR_PREVIEW 0x01 // Show piece preview
#define PIECEBAR_SUBPARTS 0x02 // Show subparts
-#define PIECEBAR_GROUP 0x04 // Group pieces
+//#define PIECEBAR_GROUP 0x04 // Group pieces
//#define PIECEBAR_ZOOMPREVIEW 0x08 // Zoom piece preview
//#define PIECEBAR_COMBO 0x10 // Show combobox
#define PIECEBAR_PARTNUMBERS 0x20 // Show part numbers
diff --git a/win/System.cpp b/win/System.cpp
index e80c811..aa2a267 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -1733,11 +1733,6 @@ void SystemSwapBuffers()
OpenGLSwapBuffers (pfnwglGetCurrentDC());
}
-void SystemSetGroup(int group)
-{
- AfxGetMainWnd()->PostMessage (WM_LC_UPDATE_LIST, group+2, 0);
-}
-
void SystemStartProgressBar(int nLower, int nUpper, int nStep, const char* Text)
{
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
diff --git a/win/Titletip.cpp b/win/Titletip.cpp
deleted file mode 100644
index 9a9f03c..0000000
--- a/win/Titletip.cpp
+++ /dev/null
@@ -1,253 +0,0 @@
-////////////////////////////////////////////////////////////////////////////
-// TitleTip.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "TitleTip.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CTitleTip
-
-CTitleTip::CTitleTip()
-{
- // Register the window class if it has not already been registered.
- WNDCLASS wndcls;
- HINSTANCE hInst = AfxGetInstanceHandle();
- if(!(::GetClassInfo(hInst, TITLETIP_CLASSNAME, &wndcls)))
- {
- // otherwise we need to register a new class
- wndcls.style = CS_SAVEBITS ;
- wndcls.lpfnWndProc = ::DefWindowProc;
- wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
- wndcls.hInstance = hInst;
- wndcls.hIcon = NULL;
- wndcls.hCursor = LoadCursor( hInst, IDC_ARROW );
- wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
- wndcls.lpszMenuName = NULL;
- wndcls.lpszClassName = TITLETIP_CLASSNAME;
- if (!AfxRegisterClass(&wndcls))
- AfxThrowResourceException();
- }
-}
-
-CTitleTip::~CTitleTip()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CTitleTip, CWnd)
-//{{AFX_MSG_MAP(CTitleTip)
-ON_WM_MOUSEMOVE()
- ON_WM_CAPTURECHANGED()
- ON_WM_ACTIVATEAPP()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CTitleTip message handlers
-
-BOOL CTitleTip::Create(CWnd * pParentWnd)
-{
- ASSERT_VALID(pParentWnd);
-
- DWORD dwStyle = WS_POPUP;
- DWORD dwExStyle = WS_EX_TOOLWINDOW | WS_EX_TOPMOST;
- m_pParentWnd = pParentWnd;
- return CreateEx( dwExStyle, TITLETIP_CLASSNAME, NULL, dwStyle, 0, 0, 0, 0,
- NULL, NULL, NULL );
-}
-
-
-// rectTitle - The rectangle within which the original
-// title is constrained - in client coordinates
-// lpszTitleText - The text to be displayed
-// xoffset - Number of pixel that the text is offset from
-// left border of the cell
-void CTitleTip::Show(CRect rectTitle, LPCTSTR lpszTitleText, int xoffset, BOOL bFocus)
-{
- ASSERT(::IsWindow(m_hWnd));
- ASSERT(!rectTitle.IsRectEmpty());
-
- // If titletip is already displayed, don't do anything.
- if (IsWindowVisible())
- return;
-
- // Do not display the titletip is app does not have focus
- if (GetFocus() == NULL)
- return;
-
- // Define the rectangle outside which the titletip will be hidden.
- // We add a buffer of one pixel around the rectangle
- m_rectTitle.top = -1;
- m_rectTitle.left = -xoffset-1;
- m_rectTitle.right = rectTitle.Width()-xoffset;
- m_rectTitle.bottom = rectTitle.Height()+1;
-
- // Determine the width of the text
- m_pParentWnd->ClientToScreen(rectTitle);
-
- CClientDC dc(this);
- CString strTitle(lpszTitleText);
- CFont *pFont = m_pParentWnd->GetFont(); // use same font as ctrl
- CFont *pFontDC = dc.SelectObject(pFont);
-
- CRect rectDisplay = rectTitle;
- CSize size = dc.GetTextExtent(strTitle);
- rectDisplay.left += xoffset-2;
- rectDisplay.right = rectDisplay.left + size.cx + 5;
- rectDisplay.bottom -= 1;
-
- // Do not display if the text fits within available space
- if (rectDisplay.right <= rectTitle.right-xoffset+5)
- return;
-
- int screen = GetSystemMetrics(SM_CXSCREEN) - (rectDisplay.left + rectDisplay.Width());
-
- if (screen < 0)
- {
- rectDisplay.left += screen;
- rectDisplay.right += screen;
- m_rectTitle.left -= screen;
- m_rectTitle.right -= screen;
- }
-
- // Show the titletip
- SetWindowPos(&wndTop, rectDisplay.left, rectDisplay.top+1,
- rectDisplay.Width(), rectDisplay.Height(),
- SWP_SHOWWINDOW|SWP_NOACTIVATE);
-
- if (bFocus)
- {
- dc.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
- dc.ExtTextOut(0, 0, ETO_OPAQUE, CRect(0,0,rectDisplay.Width(),rectDisplay.Height()), NULL, 0, NULL);
- dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHTTEXT));
- dc.DrawFocusRect(CRect(0,0,rectDisplay.Width(),rectDisplay.Height()));
- }
- else
- {
- FrameRect(dc.m_hDC, CRect(0,0,rectDisplay.Width(),rectDisplay.Height()),
- (HBRUSH)GetStockObject(BLACK_BRUSH));
- }
-
- dc.SetBkMode(TRANSPARENT);
- dc.TextOut(2, 0, strTitle);
- dc.SelectObject(pFontDC);
-
- SetCapture();
-}
-
-void CTitleTip::OnMouseMove(UINT nFlags, CPoint point)
-{
- if (!m_rectTitle.PtInRect(point))
- {
- ReleaseCapture();
- ShowWindow(SW_HIDE);
-
- // Forward the message
- ClientToScreen(&point);
- CWnd *pWnd = WindowFromPoint(point);
- if (pWnd == this)
- pWnd = m_pParentWnd;
- int hittest = (int)pWnd->SendMessage(WM_NCHITTEST, 0, MAKELONG(point.x,point.y));
- if (hittest == HTCLIENT)
- {
- pWnd->ScreenToClient( &point );
- pWnd->PostMessage(WM_MOUSEMOVE, nFlags, MAKELONG(point.x,point.y) );
- }
- else
- {
- pWnd->PostMessage(WM_NCMOUSEMOVE, hittest, MAKELONG(point.x,point.y));
- }
- }
-}
-
-BOOL CTitleTip::PreTranslateMessage(MSG* pMsg)
-{
- CWnd *pWnd;
- int hittest ;
- switch( pMsg->message )
- {
- case WM_LBUTTONDOWN:
- case WM_RBUTTONDOWN:
- case WM_MBUTTONDOWN:
- POINTS pts = MAKEPOINTS( pMsg->lParam );
- POINT point;
- point.x = pts.x;
- point.y = pts.y;
- ClientToScreen(&point);
- pWnd = WindowFromPoint(point);
- if (pWnd == this)
- pWnd = m_pParentWnd;
-
- hittest = (int)pWnd->SendMessage(WM_NCHITTEST, 0, MAKELONG(point.x,point.y));
- if (hittest == HTCLIENT)
- {
- pWnd->ScreenToClient( &point );
- pMsg->lParam = MAKELONG(point.x,point.y);
- }
- else
- {
- switch (pMsg->message)
- {
- case WM_LBUTTONDOWN:
- pMsg->message = WM_NCLBUTTONDOWN;
- break;
- case WM_RBUTTONDOWN:
- pMsg->message = WM_NCRBUTTONDOWN;
- break;
- case WM_MBUTTONDOWN:
- pMsg->message = WM_NCMBUTTONDOWN;
- break;
- }
- pMsg->wParam = hittest;
- pMsg->lParam = MAKELONG(point.x,point.y);
- }
- ReleaseCapture();
- ShowWindow(SW_HIDE);
- pWnd->PostMessage(pMsg->message,pMsg->wParam,pMsg->lParam);
- return TRUE;
- case WM_KEYDOWN:
- case WM_SYSKEYDOWN:
- ReleaseCapture();
- ShowWindow(SW_HIDE);
- m_pParentWnd->PostMessage(pMsg->message, pMsg->wParam, pMsg->lParam);
- return TRUE;
- }
-
- if (GetFocus() == NULL)
- {
- ReleaseCapture();
- ShowWindow(SW_HIDE);
- return TRUE;
- }
-
- return CWnd::PreTranslateMessage(pMsg);
-}
-
-void CTitleTip::OnCaptureChanged(CWnd *pWnd)
-{
- if (pWnd != this)
- {
- ShowWindow(SW_HIDE);
- }
-
- CWnd::OnCaptureChanged(pWnd);
-}
-
-void CTitleTip::OnActivateApp(BOOL bActive, HTASK hTask)
-{
- CWnd::OnActivateApp(bActive, hTask);
-
- if (!bActive)
- {
- ReleaseCapture();
- ShowWindow(SW_HIDE);
- }
-}
diff --git a/win/Transbar.cpp b/win/Transbar.cpp
deleted file mode 100644
index 1647cb9..0000000
--- a/win/Transbar.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-// TransToolBar.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "TransBar.h"
-#include "BarCmdUI.h"
-#include "leocad.h"
-#include "piecebar.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CTransToolBar
-
-CTransToolBar::CTransToolBar()
-{
-}
-
-CTransToolBar::~CTransToolBar()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CTransToolBar, CControlBar)
- //{{AFX_MSG_MAP(CTransToolBar)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- ON_UPDATE_COMMAND_UI_RANGE(ID_PIECE_GROUP01, ID_PIECE_GROUP32, OnUpdatePieceGroup)
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CTransToolBar message handlers
-
-// Doesn't work if handled by the parent. Why ?
-void CTransToolBar::OnUpdatePieceGroup(CCmdUI* pCmdUI)
-{
- CPiecesBar* pBar = (CPiecesBar*)GetParent();
- pCmdUI->SetCheck((UINT)(ID_PIECE_GROUP01 + pBar->m_nCurGroup) == pCmdUI->m_nID);
-}
-
-/////
-//
-// CreateTransparentToolbar Function
-// Creates a transparent toolbar control based upon the owner's
-// window handle an incoming style bit field that is assumed
-// to be a combination of TBSTYLE_FLAT and TBSTYLE_LIST flags.
-//
-// Accepts:
-// HWND: The handle to the parent window.
-// DWORD: Style values that are included in CreateWindowEx.
-//
-// Returns:
-// HWND to the newly created toolbar. The owner must resize it.
-//
-/////
-BOOL CTransToolBar::Create(HWND hwndOwner)
-{
- TBBUTTON tbArray[MAX_BUTTONS];
- int i, iBufferPix;
-
- // Create the toolbar control.
- if(!CWnd::CreateEx(WS_EX_TOOLWINDOW, TOOLBARCLASSNAME, NULL,
- WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS | CCS_NODIVIDER |
- CCS_NOPARENTALIGN | CCS_NORESIZE | m_ToolbarData.dwStyle,
- 0,0,0,0, // Make it zero, Let owner resize it.
- hwndOwner, (HMENU)m_ToolbarData.idControl,
- NULL)) return FALSE;
-
- SendMessage(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
- SendMessage(TB_SETMAXTEXTROWS, 1, 0L);
- SendMessage(TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG(m_ToolbarData.iButtonCX, m_ToolbarData.iButtonCY));
- SendMessage(TB_SETIMAGELIST, 0, (LPARAM)m_ToolbarData.himl);
-
- // Loop to fill the array of TBBUTTON structures.
- for(i=0; i < m_ToolbarData.iButtons; i++)
- {
- tbArray[i].iBitmap = m_ToolbarData.ButtonData[i].iBitmap;
- tbArray[i].idCommand = m_ToolbarData.ButtonData[i].idCommand;
- tbArray[i].fsState = m_ToolbarData.ButtonData[i].fsState;
- tbArray[i].fsStyle = m_ToolbarData.ButtonData[i].fsStyle;
- tbArray[i].dwData = 0;
- tbArray[i].iString = i;
- }
-
- // If this is a list style toolbar, add buffer pixels
- // to make room for button text.
- iBufferPix=LARGEBUTTON_DX;
-
- // Add the buttons, then set the minimum and maximum button widths.
- SendMessage(TB_ADDBUTTONS, (UINT)m_ToolbarData.iButtons, (LPARAM)tbArray);
-
- SendMessage(TB_SETBUTTONWIDTH, 0,
- (LPARAM)MAKELONG(m_ToolbarData.iButtonCX + iBufferPix,
- m_ToolbarData.iButtonCY + iBufferPix));
-
- return TRUE;
-
-}
-
-void CTransToolBar::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler)
-{
- CFrameWnd* pMain = (CFrameWnd*)AfxGetMainWnd();
-
- CFlatOrCoolBarCmdUI state;
- state.m_pOther = this;
-
- state.m_nIndexMax = (UINT)DefWindowProc(TB_BUTTONCOUNT, 0, 0);
- for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax; state.m_nIndex++)
- {
- // get buttons state
- TBBUTTON button;
- _GetButton(state.m_nIndex, &button);
- state.m_nID = button.idCommand;
-
- // ignore separators
- if (!(button.fsStyle & TBSTYLE_SEP))
- {
- // allow the toolbar itself to have update handlers
- if (CWnd::OnCmdMsg(state.m_nID, CN_UPDATE_COMMAND_UI, &state, NULL))
- continue;
-
- // allow the owner to process the update
- state.DoUpdate(pMain, bDisableIfNoHndler);
- }
- }
- // update the dialog controls added to the toolbar
- UpdateDialogControls(pMain, bDisableIfNoHndler);
-}
-
-void CTransToolBar::_SetButton(int nIndex, TBBUTTON* pButton)
-{
- // get original button state
- TBBUTTON button;
- VERIFY(DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)&button));
-
- // prepare for old/new button comparsion
- button.bReserved[0] = 0;
- button.bReserved[1] = 0;
- pButton->fsState ^= TBSTATE_ENABLED;
- pButton->bReserved[0] = 0;
- pButton->bReserved[1] = 0;
-
- // nothing to do if they are the same
- if (memcmp(pButton, &button, sizeof(TBBUTTON)) != 0)
- {
- // don't redraw everything while setting the button
- DWORD dwStyle = GetStyle();
- ModifyStyle(WS_VISIBLE, 0);
- VERIFY(DefWindowProc(TB_DELETEBUTTON, nIndex, 0));
- VERIFY(DefWindowProc(TB_INSERTBUTTON, nIndex, (LPARAM)pButton));
- ModifyStyle(0, dwStyle & WS_VISIBLE);
-
- // invalidate appropriate parts
- if (((pButton->fsStyle ^ button.fsStyle) & TBSTYLE_SEP) ||
- ((pButton->fsStyle & TBSTYLE_SEP) && pButton->iBitmap != button.iBitmap))
- {
- // changing a separator
- Invalidate(FALSE);
- }
- else
- {
- // invalidate just the button
- CRect rect;
- if (DefWindowProc(TB_GETITEMRECT, nIndex, (LPARAM)&rect))
- InvalidateRect(rect, TRUE); // erase background
- }
- DefWindowProc(WM_PAINT, (WPARAM)::GetDC(GetSafeHwnd()), (LPARAM)0);
- }
-}
-
-void CTransToolBar::_GetButton(int nIndex, TBBUTTON* pButton) const
-{
- CTransToolBar* pBar = (CTransToolBar*)this;
- VERIFY(pBar->DefWindowProc(TB_GETBUTTON, nIndex, (LPARAM)pButton));
- pButton->fsState ^= TBSTATE_ENABLED;
-}
-
-void CTransToolBar::SetButtonStyle(int nIndex, UINT nStyle)
-{
- ASSERT_VALID(this);
- ASSERT(::IsWindow(m_hWnd));
-
- TBBUTTON button;
- _GetButton(nIndex, &button);
- button.fsStyle = (BYTE)LOWORD(nStyle);
- button.fsState = (BYTE)HIWORD(nStyle);
- _SetButton(nIndex, &button);
-
- m_bDelayedButtonLayout = TRUE;
-}
diff --git a/win/Transbar.h b/win/Transbar.h
deleted file mode 100644
index 1e37532..0000000
--- a/win/Transbar.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// TransToolBar.h : header file
-//
-
-#ifndef _TRANSBAR_H_
-#define _TRANSBAR_H_
-
-#define MAX_BUTTONS 32
-// difference between width of button(48) and width of buttonimage(30)
-#define LARGEBUTTON_DX 18
-
-
-typedef struct _BUTTONDATA {
- int iBitmap;
- int idCommand;
- BYTE fsState;
- BYTE fsStyle; // TBSTYLE_DROPDOWN, TBSTYLE_BUTTON
- LPTSTR lpszButtonText; // string to display in button
- LPTSTR lpszTooltip;
-} BUTTONDATA, FAR* LPBUTTONDATA;
-
-typedef struct _TOOLBARDATA {
- DWORD dwStyle; // TBSTYLE_FLAT, TBSTYLE_LIST
- int idControl; // control id
- int idbDefault; // bitmapresource
- int idbHot; // bitmapresource when the mouse moves over the button
- int iButtons; // number of buttens in the toolbar
- int iButtonCX; // width of the buttons
- int iButtonCY; // heigth of the buttons
- HIMAGELIST himl;
- BUTTONDATA ButtonData[MAX_BUTTONS]; // structures describing the buttons
-} TOOLBARDATA, FAR* LPTOOLBARDATA;
-
-/////////////////////////////////////////////////////////////////////////////
-// CTransToolBar window
-
-class CTransToolBar : public CToolBar
-{
-// Construction
-public:
- void SetButtonStyle(int nIndex, UINT nStyle);
- void _GetButton(int nIndex, TBBUTTON* pButton) const;
- void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
- void _SetButton(int nIndex, TBBUTTON* pButton);
- BOOL Create(HWND hwndOwner);
- TOOLBARDATA m_ToolbarData;
- CTransToolBar();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTransToolBar)
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- virtual ~CTransToolBar();
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CTransToolBar)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- void OnUpdatePieceGroup(CCmdUI* pCmdUI);
-
- friend class CToolBar;
-};
-
-#endif // _TRANSBAR_H_
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/win/res/piecebar.bmp b/win/res/piecebar.bmp
deleted file mode 100644
index 5436f0a..0000000
--- a/win/res/piecebar.bmp
+++ /dev/null
Binary files differ
diff --git a/win/resource.h b/win/resource.h
index 974ab32..695a973 100644
--- a/win/resource.h
+++ b/win/resource.h
@@ -496,7 +496,6 @@
#define ID_FILE_EXPORT_WAVEFRONT 32833
#define ID_FILE_EXPORT_LDRAW 32834
#define ID_FILE_EXPORT_POVRAY 32835
-#define ID_PIECEBAR_GROUP 32837
#define ID_PIECEBAR_NUMBERS 32839
#define ID_PIECEBAR_SUBPARTS 32841
#define ID_PIECE_ARRAY 32842
diff --git a/win/titletip.h b/win/titletip.h
deleted file mode 100644
index dafd0da..0000000
--- a/win/titletip.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#if !defined(AFX_TITLETIP_H__FB05F243_E98F_11D0_82A3_20933B000000__INCLUDED_)
-#define AFX_TITLETIP_H__FB05F243_E98F_11D0_82A3_20933B000000__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// TitleTip.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CTitleTip window
-
-#define TITLETIP_CLASSNAME _T("LeoCADTitleTip")
-
-
-class CTitleTip : public CWnd
-{
-// Construction
-public:
- CTitleTip();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTitleTip)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- //}}AFX_VIRTUAL
-
-// Implementation
-public:
- void Show(CRect rectTitle, LPCTSTR lpszTitleText, int xoffset, BOOL bFocus);
- virtual BOOL Create(CWnd *pParentWnd);
- virtual ~CTitleTip();
-
-protected:
- CWnd *m_pParentWnd;
- CRect m_rectTitle;
-
-
- // Generated message map functions
-protected:
- //{{AFX_MSG(CTitleTip)
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnCaptureChanged(CWnd *pWnd);
- afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations
-// immediately before the previous line.
-
-#endif // !defined(AFX_TITLETIP_H__FB05F243_E98F_11D0_82A3_20933B000000__INCLUDED_)