summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorleo2005-10-23 00:35:25 +0000
committerleo2005-10-23 00:35:25 +0000
commit02cd88bb158b7a6d66ff2a662223121ecfcddbe0 (patch)
treea8d79fc1c24bef624a29e9eb3e999c5a66377d5c /win
parentf1264b9f8b6266a1153e77d8e497d58e2aad2509 (diff)
Added a new rotate camera interface,
Added an assert macro, Added support for multiple keywords to the pieces tree. git-svn-id: http://svn.leocad.org/trunk@431 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win')
-rw-r--r--win/Cadview.cpp59
-rw-r--r--win/LeoCAD.dsp8
-rw-r--r--win/LeoCAD.rc6
-rw-r--r--win/System.cpp15
-rw-r--r--win/res/rotx.curbin0 -> 326 bytes
-rw-r--r--win/res/roty.curbin0 -> 326 bytes
-rw-r--r--win/resource.h7
7 files changed, 67 insertions, 28 deletions
diff --git a/win/Cadview.cpp b/win/Cadview.cpp
index 32ae15e..58fe3ff 100644
--- a/win/Cadview.cpp
+++ b/win/Cadview.cpp
@@ -814,36 +814,40 @@ void CCADView::OnDropDown (NMHDR* pNotifyStruct, LRESULT* pResult)
LONG CCADView::OnChangeCursor(UINT lParam, LONG /*wParam*/)
{
- UINT c;
+ UINT Cursor;
- switch (lParam)
+ POINT pt;
+ GetCursorPos(&pt);
+ ScreenToClient(&pt);
+
+ switch (m_pView->GetCursor(pt.x, pt.y))
{
- case LC_ACTION_SELECT:
- if (GetKeyState (VK_CONTROL) < 0)
- c = IDC_SELECT_GROUP;
- else
- c = IDC_SELECT;
- break;
- case LC_ACTION_INSERT: c = IDC_BRICK; break;
- case LC_ACTION_LIGHT: c = IDC_LIGHT; break;
- case LC_ACTION_SPOTLIGHT: c = IDC_SPOTLIGHT; break;
- case LC_ACTION_CAMERA: c = IDC_CAMERA; break;
- case LC_ACTION_MOVE: c = IDC_MOVE; break;
- case LC_ACTION_ROTATE: c = IDC_ROTATE; break;
- case LC_ACTION_ERASER: c = IDC_ERASER; break;
- case LC_ACTION_PAINT: c = IDC_PAINT; break;
- case LC_ACTION_ZOOM: c = IDC_ZOOM; break;
- case LC_ACTION_ZOOM_REGION: c = IDC_ZOOM_REGION; break;
- case LC_ACTION_PAN: c = IDC_PAN; break;
- case LC_ACTION_ROTATE_VIEW: c = IDC_ANGLE; break;
- case LC_ACTION_ROLL: c = IDC_ROLL; break;
+ case LC_CURSOR_NONE: Cursor = NULL; break;
+ case LC_CURSOR_BRICK: Cursor = IDC_BRICK; break;
+ case LC_CURSOR_LIGHT: Cursor = IDC_LIGHT; break;
+ case LC_CURSOR_SPOTLIGHT: Cursor = IDC_SPOTLIGHT; break;
+ case LC_CURSOR_CAMERA: Cursor = IDC_CAMERA; break;
+ case LC_CURSOR_SELECT: Cursor = IDC_SELECT; break;
+ case LC_CURSOR_SELECT_GROUP: Cursor = IDC_SELECT_GROUP; break;
+ case LC_CURSOR_MOVE: Cursor = IDC_MOVE; break;
+ case LC_CURSOR_ROTATE: Cursor = IDC_ROTATE; break;
+ case LC_CURSOR_ROTATEX: Cursor = IDC_ROTX; break;
+ case LC_CURSOR_ROTATEY: Cursor = IDC_ROTY; break;
+ case LC_CURSOR_DELETE: Cursor = IDC_ERASER; break;
+ case LC_CURSOR_PAINT: Cursor = IDC_PAINT; break;
+ case LC_CURSOR_ZOOM: Cursor = IDC_ZOOM; break;
+ case LC_CURSOR_ZOOM_REGION: Cursor = IDC_ZOOM_REGION; break;
+ case LC_CURSOR_PAN: Cursor = IDC_PAN; break;
+ case LC_CURSOR_ROLL: Cursor = IDC_ROLL; break;
+ case LC_CURSOR_ROTATE_VIEW: Cursor = IDC_ANGLE; break;
+
default:
- c = NULL;
+ LC_ASSERT_FALSE("Unknown cursor type.");
}
- if (c)
+ if (Cursor)
{
- m_hCursor = theApp.LoadCursor(c);
+ m_hCursor = theApp.LoadCursor(Cursor);
SetCursor(m_hCursor);
}
else
@@ -854,13 +858,18 @@ LONG CCADView::OnChangeCursor(UINT lParam, LONG /*wParam*/)
BOOL CCADView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
+ if (CView::OnSetCursor(pWnd, nHitTest, message))
+ return TRUE;
+
+ OnChangeCursor(0, 0);
+
if (m_hCursor)
{
SetCursor(m_hCursor);
return TRUE;
}
- return CView::OnSetCursor(pWnd, nHitTest, message);
+ return FALSE;
}
BOOL CCADView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
diff --git a/win/LeoCAD.dsp b/win/LeoCAD.dsp
index c82006a..7f54c21 100644
--- a/win/LeoCAD.dsp
+++ b/win/LeoCAD.dsp
@@ -820,6 +820,14 @@ SOURCE=.\res\Rotate.cur
# End Source File
# Begin Source File
+SOURCE=.\res\rotx.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\roty.cur
+# End Source File
+# Begin Source File
+
SOURCE=.\res\SelctGrp.cur
# End Source File
# Begin Source File
diff --git a/win/LeoCAD.rc b/win/LeoCAD.rc
index fb412f6..f5dabf4 100644
--- a/win/LeoCAD.rc
+++ b/win/LeoCAD.rc
@@ -331,9 +331,10 @@ BEGIN
BEGIN
MENUITEM "Insert\tIns", ID_PIECE_INSERT
MENUITEM "Delete\tDel", ID_PIECE_DELETE
- MENUITEM "Minifig Wizard...", ID_PIECE_MINIFIGWIZARD
+ MENUITEM "Transform...", ID_PIECE_TRANSFORM
MENUITEM "Array...", ID_PIECE_ARRAY
MENUITEM "Mirror...", ID_PIECE_MIRROR
+ MENUITEM "Minifig Wizard...", ID_PIECE_MINIFIGWIZARD
MENUITEM "Copy Keys", ID_PIECE_COPYKEYS
MENUITEM SEPARATOR
MENUITEM "Group...", ID_PIECE_GROUP
@@ -1748,6 +1749,8 @@ IDC_PAN_NE CURSOR DISCARDABLE "res\\pan_ne.cur"
IDC_PAN_NW CURSOR DISCARDABLE "res\\pan_nw.cur"
IDC_PAN_SE CURSOR DISCARDABLE "res\\pan_se.cur"
IDC_PAN_SW CURSOR DISCARDABLE "res\\pan_sw.cur"
+IDC_ROTX CURSOR DISCARDABLE "res\\rotx.cur"
+IDC_ROTY CURSOR DISCARDABLE "res\\roty.cur"
/////////////////////////////////////////////////////////////////////////////
//
@@ -2116,6 +2119,7 @@ STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_IMPORTPIECE "Import a piece from LDraw"
ID_VIEW_NEWVIEW "Creates a new view window"
+ ID_PIECE_TRANSFORM "Move or rotates the selected objects."
END
#endif // English (U.S.) resources
diff --git a/win/System.cpp b/win/System.cpp
index e60bad4..f8a1780 100644
--- a/win/System.cpp
+++ b/win/System.cpp
@@ -31,6 +31,21 @@
#include "cadbar.h"
#include "mainfrm.h"
+bool lcAssert(const char* FileName, int Line, const char* Expression, const char* Description)
+{
+ char buf[1024];
+ sprintf(buf, "Assertion failed on line %d of file %s: %s", Line, FileName, Description);
+ AfxMessageBox(buf, MB_OK|MB_ICONSTOP);
+
+ // TODO: Add a real assert dialog instead of the message box.
+ // TODO: Add an option to disable all asserts.
+ // TODO: Add an option to disable only this assert.
+ // TODO: Add an option to break into the debugger.
+
+ return false;
+}
+
+
static CMenu menuPopups;
static CStepDlg* StepModeless = NULL;
static UINT ClipboardFormat = 0;
diff --git a/win/res/rotx.cur b/win/res/rotx.cur
new file mode 100644
index 0000000..74d3e22
--- /dev/null
+++ b/win/res/rotx.cur
Binary files differ
diff --git a/win/res/roty.cur b/win/res/roty.cur
new file mode 100644
index 0000000..4117336
--- /dev/null
+++ b/win/res/roty.cur
Binary files differ
diff --git a/win/resource.h b/win/resource.h
index 19f4f51..2a111e9 100644
--- a/win/resource.h
+++ b/win/resource.h
@@ -138,6 +138,8 @@
#define IDD_PREFKEYBOARD 235
#define IDD_TRANSFORM 236
#define IDD_CATEGORY 237
+#define IDC_ROTX 238
+#define IDC_ROTY 239
#define IDC_SELDLG_LIST 1000
#define IDC_SELDLG_ALL 1001
#define IDC_SELDLG_NONE 1002
@@ -671,6 +673,7 @@
#define ID_PIECEBAR_NEWCATEGORY 33159
#define ID_PIECEBAR_EDITCATEGORY 33160
#define ID_PIECEBAR_REMOVECATEGORY 33161
+#define ID_PIECE_TRANSFORM 33162
#define ID_VIEW_PIECES_BAR 59425
#define ID_VIEW_TOOLS_BAR 59426
#define ID_VIEW_ANIMATION_BAR 59427
@@ -681,8 +684,8 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 238
-#define _APS_NEXT_COMMAND_VALUE 33162
+#define _APS_NEXT_RESOURCE_VALUE 240
+#define _APS_NEXT_COMMAND_VALUE 33163
#define _APS_NEXT_CONTROL_VALUE 1247
#define _APS_NEXT_SYMED_VALUE 121
#endif