[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-dev] Commit Complete
Commit by : alex
Repository : xara
Revision : 704
Date : Wed Mar 22 10:49:48 GMT 2006
Changed paths:
M /Trunk/XaraLX/Kernel/Makefile.am
M /Trunk/XaraLX/Kernel/penedit.cpp
M /Trunk/XaraLX/Scripts/barconverter
M /Trunk/XaraLX/Scripts/makebars.sh
M /Trunk/XaraLX/tools/Makefile.am
M /Trunk/XaraLX/tools/pentool.cpp
M /Trunk/XaraLX/tools/pentool.h
M /Trunk/XaraLX/tools/viewmod.cpp
M /Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
A /Trunk/XaraLX/wxOil/xrc/IDC_PENADJUSTCURSOR.cur
A /Trunk/XaraLX/wxOil/xrc/barsource/penbar.ini
Added pen tool. I think it works but I never understood how this tool was meant to work anyway. Absence of an info bar appears deliberate.
Diff:
Index: Trunk/XaraLX/tools/pentool.cpp
===================================================================
--- Trunk/XaraLX/tools/pentool.cpp (revision 703)
+++ Trunk/XaraLX/tools/pentool.cpp (revision 704)
@@ -117,7 +117,7 @@
#include "docview.h"
//#include "markn.h"
#include "nodepath.h"
-#include "mainfrm.h"
+//#include "mainfrm.h"
#include "osrndrgn.h"
#include "penedit.h"
#include "ops.h"
@@ -132,10 +132,10 @@
//#include "will2.h"
// These are still char* while we wait for resource technology to be developed for modules
-char* PenTool::FamilyName = "Drawing Tools";
-char* PenTool::ToolName = "Pen Tool";
-char* PenTool::Purpose = "To draw lines and curves";
-char* PenTool::Author = "Mike";
+TCHAR* PenTool::FamilyName = _T("Drawing Tools");
+TCHAR* PenTool::ToolName = _T("Pen Tool");
+TCHAR* PenTool::Purpose = _T("To draw lines and curves");
+TCHAR* PenTool::Author = _T("Mike");
CC_IMPLEMENT_MEMDUMP( PenTool, Tool_v1 )
@@ -214,6 +214,11 @@
// initially, no cursor
pcPenCursor = 0;
+ pPenInfoBarOp = new PenToolInfoBarOp();
+ ok = (pPenInfoBarOp != NULL);
+ if (ok) pPenInfoBarOp->pPenTool = this; // Set a pointer from the op to this tool
+
+#if 0
ok = file.open(_R(IDM_PENTOOL_BAR), _R(IDT_INFO_BAR_RES)); // Open resource
if (ok) ok = DialogBarOp::ReadBarsFromFile(file,BarCreate); // Read and create info bar
if (ok) file.close(); // Close resource.
@@ -233,6 +238,7 @@
ENSURE(ok,"Failed to create PENTOOL info bar");
}
+#endif
if (ok) ok = EditPath.Initialise(12,24); // create the edit path buffers please
@@ -545,14 +551,16 @@
else if (MESSAGE_IS_A(Message,DocChangingMsg)) // Check for changes in the doc system
{
DocChangingMsg* pDocChangingMsg = (DocChangingMsg*)Message;
- Document* pDoc = pDocChangingMsg->pChangingDoc;
+// Document* pDoc = pDocChangingMsg->pChangingDoc;
switch (pDocChangingMsg->State)
{
- case DocChangingMsg::DocState::SELCHANGED:
- case DocChangingMsg::DocState::KILLED:
+ case DocChangingMsg::SELCHANGED:
+ case DocChangingMsg::KILLED:
pPenTool->ClearInternalState();
break;
+ default:
+ break;
}
}
@@ -709,9 +717,14 @@
if (pNodePath)
ClickOnEndPoint(Click, ClickMods, pSpread, pNodePath);
break;
+
+ default:
+ break;
}
break;
+ default:
+ break;
}
}
@@ -954,7 +967,8 @@
if (Verbs[Pos] == PT_MOVETO)
{
// This for loop will find either the end of the path, or the next moveto
- for (INT32 j=Pos+1;j<NumCoords && Verbs[j] != PT_MOVETO;j++); // ; is intentional!
+ INT32 j;
+ for (j=Pos+1;j<NumCoords && Verbs[j] != PT_MOVETO;j++); // ; is intentional!
j--;
if (Verbs[j] & PT_CLOSEFIGURE)
{
@@ -1425,27 +1439,31 @@
break;
case IS_DragTo:
- pRegion = DocView::RenderOnTop(pClipRect, pSpread, ClippedEOR);
- DocCoord OtherDrag;
- OtherDrag.x = LastMove.x - (LastDrag.x - LastMove.x);
- OtherDrag.y = LastMove.y - (LastDrag.y - LastMove.y);
-
- while (pRegion)
{
- // Draw three end blobs and an eor'd dotted line
- pRegion->SetLineColour(COLOUR_BEZIERLINE);
- pRegion->DrawLine(OtherDrag,LastDrag);
- pRegion->SetLineColour(COLOUR_BEZIERBLOB);
- pRegion->SetFillColour(COLOUR_TRANS);
- pRegion->DrawBlob(LastMove,BT_SELECTED);
- pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
- pRegion->SetLineColour(COLOUR_TRANS);
- pRegion->DrawBlob(LastDrag,BT_UNSELECTED);
- pRegion->DrawBlob(OtherDrag,BT_UNSELECTED);
-
- // Get the next region in the list
- pRegion = DocView::GetNextOnTop(pClipRect);
+ pRegion = DocView::RenderOnTop(pClipRect, pSpread, ClippedEOR);
+ DocCoord OtherDrag;
+ OtherDrag.x = LastMove.x - (LastDrag.x - LastMove.x);
+ OtherDrag.y = LastMove.y - (LastDrag.y - LastMove.y);
+
+ while (pRegion)
+ {
+ // Draw three end blobs and an eor'd dotted line
+ pRegion->SetLineColour(COLOUR_BEZIERLINE);
+ pRegion->DrawLine(OtherDrag,LastDrag);
+ pRegion->SetLineColour(COLOUR_BEZIERBLOB);
+ pRegion->SetFillColour(COLOUR_TRANS);
+ pRegion->DrawBlob(LastMove,BT_SELECTED);
+ pRegion->SetFillColour(COLOUR_UNSELECTEDBLOB);
+ pRegion->SetLineColour(COLOUR_TRANS);
+ pRegion->DrawBlob(LastDrag,BT_UNSELECTED);
+ pRegion->DrawBlob(OtherDrag,BT_UNSELECTED);
+
+ // Get the next region in the list
+ pRegion = DocView::GetNextOnTop(pClipRect);
+ }
+ break;
}
+ default:
break;
}
}
Index: Trunk/XaraLX/tools/viewmod.cpp
===================================================================
--- Trunk/XaraLX/tools/viewmod.cpp (revision 703)
+++ Trunk/XaraLX/tools/viewmod.cpp (revision 704)
@@ -108,7 +108,7 @@
#include "pushtool.h"
#include "zoomtool.h"
#include "freehand.h"
-//#include "pentool.h"
+#include "pentool.h"
#include "blndtool.h"
#include "beztool.h"
#include "filltool.h"
@@ -274,11 +274,8 @@
return IN_DLL(GradFillTool);
#ifndef WEBSTER //Martin
-PORTNOTE("other","Removed pen tool usage")
-#ifndef EXCLUDE_FROM_XARALX
case 10:
return IN_DLL(PenTool);
-#endif
case 11:
return IN_DLL(BlendTool);
Index: Trunk/XaraLX/tools/pentool.h
===================================================================
--- Trunk/XaraLX/tools/pentool.h (revision 703)
+++ Trunk/XaraLX/tools/pentool.h (revision 704)
@@ -197,10 +197,10 @@
void DeletePenCursors();
private:
- static char* FamilyName; // The Tools Family Name
- static char* ToolName; // The Tool Name
- static char* Purpose; // What the tool is for
- static char* Author; // Who wrote it
+ static TCHAR* FamilyName; // The Tools Family Name
+ static TCHAR* ToolName; // The Tool Name
+ static TCHAR* Purpose; // What the tool is for
+ static TCHAR* Author; // Who wrote it
penstate CurrPenState; // current internal tool state
penopstate CurrPenOpState; // current internal tool op state
@@ -243,7 +243,7 @@
{
CC_DECLARE_DYNCREATE(PenToolInfoBarOp)
public:
- PenToolInfoBarOp() {}; // Dummy default constructor for DYNCREATE
+ PenToolInfoBarOp() {DlgResID = _R(IDD_PENTOOLBAR);}; // Dummy default constructor for DYNCREATE
MsgResult Message(Msg*); // All messages to the info bar come through here
// void InitControls(); // Initialises the controls in the info bar
// void EnableControls(); // Enables/disables the controls in the info bar
Index: Trunk/XaraLX/tools/Makefile.am
===================================================================
--- Trunk/XaraLX/tools/Makefile.am (revision 703)
+++ Trunk/XaraLX/tools/Makefile.am (revision 704)
@@ -11,5 +11,6 @@
opscale.cpp opshear.cpp opsquash.cpp opflip.cpp pushtool.cpp \
rectangl.cpp regshape.cpp eliptool.cpp oprshape.cpp filltool.cpp beztool.cpp \
opbezier.cpp opshadow.cpp shadtool.cpp shadinfo.cpp freeinfo.cpp opfree.cpp opdrbrsh.cpp \
- freehand.cpp opretro.cpp moldtool.cpp bevinfo.cpp bevtool.cpp cntrtool.cpp opcntr.cpp
+ freehand.cpp opretro.cpp moldtool.cpp bevinfo.cpp bevtool.cpp cntrtool.cpp opcntr.cpp \
+ pentool.cpp
AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am (revision 703)
+++ Trunk/XaraLX/Kernel/Makefile.am (revision 704)
@@ -56,5 +56,6 @@
opsmpshp.cpp snapops.cpp oppull.cpp fitcurve.cpp cpyact.cpp groupops.cpp \
zordops.cpp fillndge.cpp pathndge.cpp opbreak.cpp cmdctrl.cpp opsmooth.cpp \
combshps.cpp mkshapes.cpp mkstroke.cpp mrhbits.cpp ndmldink.cpp opfeathr.cpp \
- linwthop.cpp sgmenu.cpp draginfo.cpp filelist.cpp statline.cpp pressure.cpp
+ linwthop.cpp sgmenu.cpp draginfo.cpp filelist.cpp statline.cpp pressure.cpp \
+ penedit.cpp
AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/penedit.cpp
===================================================================
--- Trunk/XaraLX/Kernel/penedit.cpp (revision 703)
+++ Trunk/XaraLX/Kernel/penedit.cpp (revision 704)
@@ -585,12 +585,12 @@
void OpPenHandles::RenderTestRect( DocRect Rect, Spread* pSpread, StockColour colour )
{
- if (IsUserName("Mike"))
+ if (Error::IsUserName("Mike"))
{
- TRACE( _T("RectLox=%d
"),Rect.lox);
- TRACE( _T("RectLoy=%d
"),Rect.loy);
- TRACE( _T("RectHix=%d
"),Rect.hix);
- TRACE( _T("RectHiy=%d
"),Rect.hiy);
+ TRACE( _T("RectLox=%d
"),Rect.lo.x);
+ TRACE( _T("RectLoy=%d
"),Rect.lo.y);
+ TRACE( _T("RectHix=%d
"),Rect.hi.x);
+ TRACE( _T("RectHiy=%d
"),Rect.hi.y);
}
RenderRegion* pRegion = DocView::RenderOnTop( &Rect, pSpread, ClippedEOR );
@@ -3129,7 +3129,8 @@
// go and count the number of elements given to us in the edit path
INT32 ind = 0;
- for (INT32 i=0; pEditPath->FindNext(&ind); i++);
+ INT32 i;
+ for (i=0; pEditPath->FindNext(&ind); i++);
ENSURE(i<3, "There are two many elements in the edit path when closing a path" );
if (i<1 || i>2)
Index: Trunk/XaraLX/Scripts/barconverter
===================================================================
--- Trunk/XaraLX/Scripts/barconverter (revision 703)
+++ Trunk/XaraLX/Scripts/barconverter (revision 704)
@@ -72,7 +72,8 @@
"IDD_MOULDTOOLBAR" => "Mould tool info bar",
"IDD_BEVELINFOBAR" => "Bevel tool info bar",
"IDD_CONTOURINFOBAR" => "Contour tool info bar",
- "IDD_TEXT_INFO_BAR" => "Text tool info bar"
+ "IDD_TEXT_INFO_BAR" => "Text tool info bar",
+ "IDD_PENTOOLBAR" => "Pen tool info bar",
);
return $namemap{ $resname } || "This bar should not be called $resname";
}
@@ -96,7 +97,8 @@
"\"Mould" => "IDD_MOULDTOOLBAR",
"\"Bevel" => "IDD_BEVELINFOBAR",
"\"Contour" => "IDD_CONTOURINFOBAR",
- "\"Text" => "IDD_TEXT_INFO_BAR"
+ "\"Text" => "IDD_TEXT_INFO_BAR",
+ "\"Pen" => "IDD_PENTOOLBAR"
);
return $qnamemap{ $qname } || $qname;
Index: Trunk/XaraLX/Scripts/makebars.sh
===================================================================
--- Trunk/XaraLX/Scripts/makebars.sh (revision 703)
+++ Trunk/XaraLX/Scripts/makebars.sh (revision 704)
@@ -1,2 +1,2 @@
#!/bin/sh
-Scripts/barconverter wxOil/xrc/barsource/bars.ini wxOil/xrc/barsource/pushbar.ini wxOil/xrc/barsource/zoombar.ini wxOil/xrc/barsource/rshapbar.ini wxOil/xrc/barsource/rectangl.ini wxOil/xrc/barsource/ellipse.ini wxOil/xrc/barsource/gradbar.ini wxOil/xrc/barsource/transbar.ini wxOil/xrc/barsource/bezbar.ini wxOil/xrc/barsource/selector.ini wxOil/xrc/barsource/freehand.ini wxOil/xrc/barsource/blendbar.ini wxOil/xrc/barsource/mouldbar.ini wxOil/xrc/barsource/cntrbar.ini wxOil/xrc/barsource/bevbar.ini wxOil/xrc/barsource/textbar.ini > wxOil/xrc/EN/xaralx-bars.xrc
+Scripts/barconverter wxOil/xrc/barsource/bars.ini wxOil/xrc/barsource/pushbar.ini wxOil/xrc/barsource/zoombar.ini wxOil/xrc/barsource/rshapbar.ini wxOil/xrc/barsource/rectangl.ini wxOil/xrc/barsource/ellipse.ini wxOil/xrc/barsource/gradbar.ini wxOil/xrc/barsource/transbar.ini wxOil/xrc/barsource/bezbar.ini wxOil/xrc/barsource/selector.ini wxOil/xrc/barsource/freehand.ini wxOil/xrc/barsource/blendbar.ini wxOil/xrc/barsource/mouldbar.ini wxOil/xrc/barsource/cntrbar.ini wxOil/xrc/barsource/bevbar.ini wxOil/xrc/barsource/textbar.ini wxOil/xrc/barsource/penbar.ini > wxOil/xrc/EN/xaralx-bars.xrc
Index: Trunk/XaraLX/wxOil/xrc/barsource/penbar.ini
===================================================================
--- Trunk/XaraLX/wxOil/xrc/barsource/penbar.ini (revision 0)
+++ Trunk/XaraLX/wxOil/xrc/barsource/penbar.ini (revision 704)
@@ -0,0 +1,8 @@
+// $Header: c:\RCSdir\winoil/penbar.ini 1.3 1995/04/10 17:58:04 Neville Exp $
+
+INC_BEGIN
+#include "bars.h"
+INC_END
+
+Bar "Pen tool infobar" Top DEFAULT_TOOL_INFOBAR_SLOT 1
+EndBar
Index: Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc (revision 703)
+++ Trunk/XaraLX/wxOil/xrc/EN/xaralx-bars.xrc (revision 704)
@@ -4775,4 +4775,11 @@
</object>
</object>
</object>
+ <object class="wxPanel" name="IDD_PENTOOLBAR">
+ <label>Pen tool info bar</label>
+ <title>Pen tool info bar</title>
+ <object class="wxBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+ </object>
+ </object>
</resource>
Index: Trunk/XaraLX/wxOil/xrc/IDC_PENADJUSTCURSOR.cur
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: Trunk/XaraLX/wxOil/xrc/IDC_PENADJUSTCURSOR.cur
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Xara