wxart2d-users_dev Mailing List for wxArt2D (Page 2)
Status: Beta
Brought to you by:
titato
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(26) |
Aug
(28) |
Sep
(58) |
Oct
(164) |
Nov
(201) |
Dec
(179) |
| 2004 |
Jan
(165) |
Feb
(124) |
Mar
(106) |
Apr
(166) |
May
(203) |
Jun
(213) |
Jul
(102) |
Aug
(110) |
Sep
(61) |
Oct
(51) |
Nov
(54) |
Dec
(4) |
| 2005 |
Jan
(133) |
Feb
(47) |
Mar
(2) |
Apr
(22) |
May
(112) |
Jun
(193) |
Jul
(20) |
Aug
(8) |
Sep
(58) |
Oct
(6) |
Nov
(16) |
Dec
(14) |
| 2006 |
Jan
(50) |
Feb
(73) |
Mar
(18) |
Apr
(29) |
May
(42) |
Jun
(56) |
Jul
(19) |
Aug
(32) |
Sep
(45) |
Oct
(94) |
Nov
(30) |
Dec
(6) |
| 2007 |
Jan
(26) |
Feb
(31) |
Mar
(112) |
Apr
(48) |
May
(15) |
Jun
(15) |
Jul
(85) |
Aug
(94) |
Sep
(10) |
Oct
(26) |
Nov
(32) |
Dec
(9) |
| 2008 |
Jan
(100) |
Feb
(79) |
Mar
(59) |
Apr
(48) |
May
(13) |
Jun
(3) |
Jul
(26) |
Aug
(44) |
Sep
(30) |
Oct
(51) |
Nov
(6) |
Dec
(1) |
| 2009 |
Jan
|
Feb
(12) |
Mar
(1) |
Apr
(14) |
May
(3) |
Jun
(26) |
Jul
(39) |
Aug
(6) |
Sep
(11) |
Oct
(26) |
Nov
(3) |
Dec
(1) |
| 2010 |
Jan
(1) |
Feb
|
Mar
(14) |
Apr
(34) |
May
(4) |
Jun
(3) |
Jul
(11) |
Aug
(11) |
Sep
(19) |
Oct
(19) |
Nov
(31) |
Dec
|
| 2011 |
Jan
(13) |
Feb
(19) |
Mar
|
Apr
(28) |
May
(7) |
Jun
(1) |
Jul
(24) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
| 2012 |
Jan
|
Feb
(6) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
(10) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(22) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(13) |
Dec
(7) |
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(6) |
Oct
|
Nov
|
Dec
(1) |
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: 刘加权 jiaquan.l. <he...@gm...> - 2019-03-21 04:47:20
|
such as FAQ websit? |
|
From: 刘加权 jiaquan.l. <he...@gm...> - 2019-03-21 04:45:41
|
for example move a rectangle A top of rectangle B when A and B are overlapping. |
|
From: Ryan T. <ry...@th...> - 2017-09-11 05:29:11
|
Update on this - I ran the configure script with certain options and got
the build to work. Freetype fails with errors, and removing the
"FindFreetype" Cmake script and rerunning it seems to fix the issue.
--------------------
I'm using GCC 6.3.0 for this, and am getting these errors.
these errors:
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp: In
member function ‘virtual wxBitmap& a2dArtProvider::GetImage(a2dImageId)’:
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
};
^
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
/home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/canglob.cpp:501:9:
error: narrowing conversion of ‘128’ from ‘int’ to ‘char’ inside { }
[-Wnarrowing]
---------------------------
The fix I found for those was to recast the values, such as "(char)0xFF"
instead of just "OxFF" at the lines.
----------------------------
More errors:
from /home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/cameleon.cpp:21:
/home/ryan/Downloads/wxart/packages/wxart2d/include/wx/canvas/canobj1.h:2566:54:
error: ‘a2dIOHandlerXmlSerIn’ has not been declared
bool ParseCvgTransForm( a2dAffineMatrix& result,
a2dIOHandlerXmlSerIn& parser );
from /home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/cameleon.cpp:21:
/home/ryan/Downloads/wxart/packages/wxart2d/include/wx/canvas/drawing.h:749:101:
error: invalid use of incomplete type ‘class a2dIOHandlerCVGIn’
from /home/ryan/Downloads/wxart/packages/wxart2d/canvas/src/cameleon.cpp:21:
/home/ryan/Downloads/wxart/packages/wxart2d/include/wx/canvas/drawing.h:752:102:
error: invalid use of incomplete type ‘class a2dIOHandlerCVGOut’
bool SaveToFile( const wxString& filename, a2dIOHandlerStrOut*
handler = new a2dIOHandlerCVGOut() ) const;
--------------------------------------
The samples won't build, with the error:
"undefined reference to symbol 'gdk_pixbuf_get_pixels'"
//usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0: error adding symbols:
DSO missing from command line
On 09/11/2017 12:33 AM, Ryan Thoryk wrote:
> Hi, I'm having trouble building wxArt2D from SVN. The first issue is
> that the wxWidgets library can't be found; this can be possibly fixed by
> removing the wxWidgets CMake scripts and having it use the system ones.
>
> "CMake Error at share/wxwidgets/FindwxWidgets.cmake:1368 (MESSAGE):
> wxWidgets required, please specify it's location.
> Call Stack (most recent call first):
> CMakeLists.txt:115 (find_package)
> "
>
> These errors pop up afterwards when running cmake in the wxart2d directory:
> "CMake Error at CMakeLists.txt:663 (string):
> string no output variable specified
> CMake Error at CMakeLists.txt:664 (string):
> string no output variable specified"
>
> I get this when running cmake on the wxartbase folder:
> Unknown CMake command "GENERATE_POT".
>
> I get these errors when trying to build the wxdocview folder:
> "c++: error: _FILE_OFFSET_BITS=64: No such file or directory
> c++: error: WXUSINGDLL: No such file or directory
> c++: error: __WXGTK__: No such file or directory
> "
>
> Any help would be greatly appreciated. I'm building on Debian 9.0/Stretch.
>
--
Ryan Thoryk
ry...@th...
ry...@tl...
|
|
From: Ryan T. <ry...@th...> - 2017-09-11 04:50:12
|
Hi, I'm having trouble building wxArt2D from SVN. The first issue is that the wxWidgets library can't be found; this can be possibly fixed by removing the wxWidgets CMake scripts and having it use the system ones. "CMake Error at share/wxwidgets/FindwxWidgets.cmake:1368 (MESSAGE): wxWidgets required, please specify it's location. Call Stack (most recent call first): CMakeLists.txt:115 (find_package) " These errors pop up afterwards when running cmake in the wxart2d directory: "CMake Error at CMakeLists.txt:663 (string): string no output variable specified CMake Error at CMakeLists.txt:664 (string): string no output variable specified" I get this when running cmake on the wxartbase folder: Unknown CMake command "GENERATE_POT". I get these errors when trying to build the wxdocview folder: "c++: error: _FILE_OFFSET_BITS=64: No such file or directory c++: error: WXUSINGDLL: No such file or directory c++: error: __WXGTK__: No such file or directory " Any help would be greatly appreciated. I'm building on Debian 9.0/Stretch. -- Ryan Thoryk ry...@th... ry...@tl... |
|
From: Mike G. <mik...@da...> - 2016-12-13 22:01:50
|
I'll give a2dText a try. I saw in the online documentation that the a2dText was described as an "abstract base class", so I assumed that I would not be able to instantiate an instance of one. - Mike On 12/13/2016 4:44 PM, klaas.holwerda wrote: > Hi, > > The normal text object is a2dText, and you can set an a2dFont based on wxFont, samples enough to > find how to that I think. > Unless you want to use ttf fonts, which really need a file, same as the chr fonts. > > If you want that you need to push the executable directory to the FontPathList (see e.g. vdraws.cpp.) > > Regards, > > Klaas > > On 12/13/2016 04:42 PM, Mike Gibson wrote: >> ello, >> >> I'm trying to simply put text on a canvas, and have found the class >> a2dTextGDS. But to use the class, I had to put mem.chr into my root >> directory (c:\) or i would receive errors and the class would not work. >> I couldn't find another directory into which I could drop mem.chr to >> make the class work. >> >> Is there another method for putting text on a canvas that doesn't >> require copying a file onto my computer? If not, is there another place >> to put mem.chr? The executable directory doesn't work. > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Wxart2d-users_dev mailing list > Wxa...@li... > https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev |
|
From: klaas.holwerda <ng...@kl...> - 2016-12-13 20:45:07
|
Hi, The normal text object is a2dText, and you can set an a2dFont based on wxFont, samples enough to find how to that I think. Unless you want to use ttf fonts, which really need a file, same as the chr fonts. If you want that you need to push the executable directory to the FontPathList (see e.g. vdraws.cpp.) Regards, Klaas On 12/13/2016 04:42 PM, Mike Gibson wrote: > ello, > > I'm trying to simply put text on a canvas, and have found the class > a2dTextGDS. But to use the class, I had to put mem.chr into my root > directory (c:\) or i would receive errors and the class would not work. > I couldn't find another directory into which I could drop mem.chr to > make the class work. > > Is there another method for putting text on a canvas that doesn't > require copying a file onto my computer? If not, is there another place > to put mem.chr? The executable directory doesn't work. |
|
From: Mike G. <mik...@da...> - 2016-12-13 16:04:27
|
Hello, I'm trying to simply put text on a canvas, and have found the class a2dTextGDS. But to use the class, I had to put mem.chr into my root directory (c:\) or i would receive errors and the class would not work. I couldn't find another directory into which I could drop mem.chr to make the class work. Is there another method for putting text on a canvas that doesn't require copying a file onto my computer? If not, is there another place to put mem.chr? The executable directory doesn't work. Thanks, - Mike |
|
From: klaas.holwerda <ng...@kl...> - 2016-12-08 17:18:22
|
Hi,
I did add something to the simple example to show how to do it.
I think you forgot to set the display window, see this code:
MyDrawingPart* part = new MyDrawingPart( size.GetWidth(),size.GetHeight() );
part->SetShowObject( m_canvas->GetDrawing()->GetRootObject() );
part->SetDisplayWindow( m_canvas );
m_canvas->SetDrawingPart( part )
On 12/07/2016 11:32 PM, Mike Gibson wrote:
> Hi Klaas,
>
> I followed your suggestion and created a class: MyDrawingPart : public a2dDrawingPart.
>
> I redefined a2dDrawingPart::UpdateArea with my own MyDrawingPart::UpdateArea. I then copied the
> code for that function verbatim out of drawer.cpp.
>
> I created an a2dSmrtPtr<MyDrawingPart> m_DrawingPart, and created a new one.
>
> I then assigned the drawing part to my a2dCanvas: CieDiagram->SetDrawingPart(m_DrawingPart).
>
> Now whenever I pull up the canvas, it is always blank. It never displays the image or anything.
>
> If I comment out the assignment (CieDiagram->SetDrawingPart(m_DrawingPart)), and use the
> a2dCanvas' default drawing part, everything works fine. Is there another step I need to perform?
>
> - Mike
|
|
From: Mike G. <mik...@da...> - 2016-12-07 22:59:50
|
Hi Klaas,
I followed your suggestion and created a class: MyDrawingPart : public
a2dDrawingPart.
I redefined a2dDrawingPart::UpdateArea with my own
MyDrawingPart::UpdateArea. I then copied the code for that function
verbatim out of drawer.cpp.
I created an a2dSmrtPtr<MyDrawingPart> m_DrawingPart, and created a new one.
I then assigned the drawing part to my a2dCanvas:
CieDiagram->SetDrawingPart(m_DrawingPart).
Now whenever I pull up the canvas, it is always blank. It never displays
the image or anything.
If I comment out the assignment
(CieDiagram->SetDrawingPart(m_DrawingPart)), and use the a2dCanvas'
default drawing part, everything works fine. Is there another step I
need to perform?
- Mike
On 12/6/2016 1:10 PM, klaas.holwerda wrote:
>
> Hi,
>
> You mixing two different concepts.
>
> One is direct drawing to a canvas using a drawing context. See
> artbase_directdraw example.
>
> The other is filling a a2dDrawing with objects, and have
> a2dDrawingPart display this on a a2dCanvas.
>
> Every change to the object in the drawing are automatically redrawn on
> the canvas in idle time.
>
> See the canvas_simple example.
>
> If you want to combine direct drawing and drawing based drawing
> objects, as you do, you need to derive from a2dDrawingPart.
>
> And redefine:
>
> virtualvoidUpdateArea( intx, inty, intwidth, intheight, wxUint8 id = 0 );
>
> In here:
>
> voida2dDrawingPart::UpdateArea( intx, inty, intwidth, intheight,
> wxUint8 id )
>
> there you see for instance PaintGrid( x, y, width, height ).
>
> But in your own version you can add extra stuff, to draw what you want
> besides what is already coming from the drawing.
>
> The drawing itself is drawn with the call to RenderTopObject(
> m_documentDrawStyle, id ) there.
>
> So to draw on top of your image, do add you stuff after that.
>
> This way you can combine static drawing (your points), with dynamic
> editable drawing objects.
>
> (If for some reason you also want to be able to edit your point, the
> story is different.)
>
> For speed have a look in the canvas_simple example at
> menu->DemoScreen->doc7
>
> If you change voidMyFrame::FillDoc7( a2dCanvasObject* root )
>
> to have the quantity and type of objects you expect, is it fast
> enough? Zoomin/out with the mouse wheel.
>
> VERY important, to test speed, you need to work with the release
> version of art2d and you app, and test outside of VCstudio.
>
> Debug version is always much slower, and inside VC, the release
> version is also slow.
>
> If after this experiment, you still think it is slow. You are against
> the limits of what wxDC drawing can do for you.
>
> For that problem I recently started to develop a OpenGl drawing
> context, which works but is also still in its youth.
>
> Both samples mentioned above can be used to test that.
>
> You need to enable wxART2D_USE_OPENGL in cmake.
>
> And search these lines to enable it.
>
> #ifwxUSE_GLCANVAS && wxART2D_USE_OPENGL
>
> #define with_GLCANVASdraw 1
>
> #endif
>
> #ifwxUSE_GLCANVAS && wxART2D_USE_OPENGL
>
> #definewith_GLCANVAS 1
>
> #endif
>
> This gives you speed you can not even dream of with plain wxWidgets
> based wxDc drawing functions.
>
> Regards,
>
> Klaas
>
>
>
> On 12/05/2016 11:59 PM, Mike Gibson wrote:
>>
>> Hello,
>>
>> I'm attempting to draw to an a2dCanvas, and am having some
>> difficulty. Usually when I draw something simple like a line on a
>> canvas, I just add an a2dSLine. However, I'm going to be adding
>> hundreds, if not thousands of points to a canvas, and using an
>> a2dSLine slows the software down tremendously.
>>
>> I assume that the software would perform faster if I were to actually
>> just draw lines on the canvas, but I'm having problems getting that
>> functionality to work.
>>
>>
>> I have an a2dCanvas in a wxDialog, and the a2dCanvas is called
>> CieDiagram. Here is what code I'm using to attempt to draw to the
>> CieDiagram:
>>
>> int TDlgCieDiagram::Execute(double x, double y, double Radius,
>> TCieVect *Points)
>> {
>> m_Drawing = new a2dDrawing();
>> CieDiagram->SetDrawing(m_Drawing);
>>
>> CieDiagram->GetDrawingPart()->SetDrawer2D( new a2dMemDcDrawer(
>> CieDiagram->GetSize() ) );
>> CieDiagram->GetDrawer2D()->SetDisplay(CieDiagram);
>> CieDiagram->GetDrawer2D()->Init();
>> CieDiagram->GetDrawer2D()->SetMappingWidthHeight(-.05, -.05, .8, .9);
>>
>> CieDiagram->GetDrawingPart()->Update( a2dCANVIEW_UPDATE_ALL );
>>
>> InitCanvas();
>>
>> AddPoints(Points);
>>
>> return ShowModal();
>> }
>>
>>
>> void TDlgCieDiagram::AddPoints(TCieVect *Points)
>> {
>> TCieVectIter Iter;
>>
>> if (Points == NULL)
>> return;
>>
>> CieDiagram->GetDrawer2D()->BeginDraw();
>>
>> CieDiagram->GetDrawer2D()->PushIdentityTransform();
>>
>> CieDiagram->GetDrawer2D()->SetDrawStyle(a2dFILLED);
>> CieDiagram->GetDrawer2D()->SetDrawerFill( a2dFill( wxColour( 12,
>> 134, 228 ), a2dFILL_SOLID ) );
>> CieDiagram->GetDrawer2D()->SetDrawerStroke(a2dStroke(
>> wxColour(0,0,0), a2dSTROKE_NORMAL));
>>
>> CieDiagram->GetDrawer2D()->SetDisableDrawing(false);
>>
>>
>> for (Iter = Points->begin(); Iter != Points->end(); ++Iter)
>> {
>> CieDiagram->GetDrawer2D()->DrawLine(Iter->x - TICK_LENGTH/4,
>> Iter->y,
>> Iter->x + TICK_LENGTH/2, Iter->y);
>> }
>>
>> CieDiagram->GetDrawer2D()->PopTransform();
>> CieDiagram->GetDrawer2D()->EndDraw();
>> }
>>
>> void TDlgCieDiagram::InitCanvas(void)
>> {
>> a2dSmrtPtr<a2dImage> Img;
>> wxFileName ExeFileName;
>>
>> // Unfix scroll max so mapping changes will work correctly. We'll
>> fix it
>> // again later.
>> CieDiagram->FixScrollMaximum( false );
>>
>> // Set Y axis positive up.
>> CieDiagram->SetYaxis( true );
>>
>> // Don't show the origin.
>> CieDiagram->SetShowOrigin( false );
>>
>> CieDiagram->SetMappingWidthHeight( -.05, -.05, .8, .9, true );
>>
>> // Define the number of world units moved when scroll.
>> CieDiagram->SetScrollStepX( 0.001 );
>> CieDiagram->SetScrollStepY( 0.001 );
>>
>> // Don't allow scrolling outside the scroll maximum.
>> CieDiagram->FixScrollMaximum( true );
>>
>>
>> Img = new a2dImage();
>> Img->SetFill( *a2dTRANSPARENT_FILL );
>> Img->SetStroke( *a2dTRANSPARENT_STROKE );
>>
>> Img->SetWidth( 0.8 );
>> Img->SetHeight( 0.9 );
>>
>> // This, annoying, wants you to set the middle position of the image.
>> // Why?! Of course it isn't documented, so it was fun figuring
>> that out.
>> Img->SetPosXY( 0.8/2, 0.9/2 );
>>
>>
>> CieDiagram->GetDrawing()->Append( Img );
>>
>>
>> ExeFileName = wxStandardPaths::Get().GetExecutablePath();
>>
>> Img->GetImage().LoadFile( ExeFileName.GetPath() +
>> _T("\\art\\cie\\") + _T("cie_532_598.bmp") );
>>
>> Img->SetDraggable(false);
>> Img->SetEditable(false);
>>
>> return;
>> }
>>
>>
>> No points ever appear on the canvas. I have attempted using the
>> Identity transform, as well as the standard tranform. I have also
>> tried adding points programmatically, and can never get any lines to
>> appear. What am I missing?
>>
>>
>> Thanks,
>> - Mike
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>>
>>
>> _______________________________________________
>> Wxart2d-users_dev mailing list
>> Wxa...@li...
>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
>
>
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxa...@li...
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
|
|
From: klaas.holwerda <ng...@kl...> - 2016-12-06 17:10:50
|
Hi,
You mixing two different concepts.
One is direct drawing to a canvas using a drawing context. See artbase_directdraw example.
The other is filling a a2dDrawing with objects, and have a2dDrawingPart display this on a a2dCanvas.
Every change to the object in the drawing are automatically redrawn on the canvas in idle time.
See the canvas_simple example.
If you want to combine direct drawing and drawing based drawing objects, as you do, you need to
derive from a2dDrawingPart.
And redefine:
virtualvoidUpdateArea( intx, inty, intwidth, intheight, wxUint8 id = 0 );
In here:
voida2dDrawingPart::UpdateArea( intx, inty, intwidth, intheight, wxUint8 id )
there you see for instance PaintGrid( x, y, width, height ).
But in your own version you can add extra stuff, to draw what you want besides what is already
coming from the drawing.
The drawing itself is drawn with the call to RenderTopObject( m_documentDrawStyle, id ) there.
So to draw on top of your image, do add you stuff after that.
This way you can combine static drawing (your points), with dynamic editable drawing objects.
(If for some reason you also want to be able to edit your point, the story is different.)
For speed have a look in the canvas_simple example at menu->DemoScreen->doc7
If you change voidMyFrame::FillDoc7( a2dCanvasObject* root )
to have the quantity and type of objects you expect, is it fast enough? Zoomin/out with the mouse wheel.
VERY important, to test speed, you need to work with the release version of art2d and you app, and
test outside of VCstudio.
Debug version is always much slower, and inside VC, the release version is also slow.
If after this experiment, you still think it is slow. You are against the limits of what wxDC
drawing can do for you.
For that problem I recently started to develop a OpenGl drawing context, which works but is also
still in its youth.
Both samples mentioned above can be used to test that.
You need to enable wxART2D_USE_OPENGL in cmake.
And search these lines to enable it.
#ifwxUSE_GLCANVAS && wxART2D_USE_OPENGL
#define with_GLCANVASdraw 1
#endif
#ifwxUSE_GLCANVAS && wxART2D_USE_OPENGL
#definewith_GLCANVAS 1
#endif
This gives you speed you can not even dream of with plain wxWidgets based wxDc drawing functions.
Regards,
Klaas
On 12/05/2016 11:59 PM, Mike Gibson wrote:
>
> Hello,
>
> I'm attempting to draw to an a2dCanvas, and am having some difficulty. Usually when I draw
> something simple like a line on a canvas, I just add an a2dSLine. However, I'm going to be adding
> hundreds, if not thousands of points to a canvas, and using an a2dSLine slows the software down
> tremendously.
>
> I assume that the software would perform faster if I were to actually just draw lines on the
> canvas, but I'm having problems getting that functionality to work.
>
>
> I have an a2dCanvas in a wxDialog, and the a2dCanvas is called CieDiagram. Here is what code I'm
> using to attempt to draw to the CieDiagram:
>
> int TDlgCieDiagram::Execute(double x, double y, double Radius, TCieVect *Points)
> {
> m_Drawing = new a2dDrawing();
> CieDiagram->SetDrawing(m_Drawing);
>
> CieDiagram->GetDrawingPart()->SetDrawer2D( new a2dMemDcDrawer( CieDiagram->GetSize() ) );
> CieDiagram->GetDrawer2D()->SetDisplay(CieDiagram);
> CieDiagram->GetDrawer2D()->Init();
> CieDiagram->GetDrawer2D()->SetMappingWidthHeight(-.05, -.05, .8, .9);
>
> CieDiagram->GetDrawingPart()->Update( a2dCANVIEW_UPDATE_ALL );
>
> InitCanvas();
>
> AddPoints(Points);
>
> return ShowModal();
> }
>
>
> void TDlgCieDiagram::AddPoints(TCieVect *Points)
> {
> TCieVectIter Iter;
>
> if (Points == NULL)
> return;
>
> CieDiagram->GetDrawer2D()->BeginDraw();
>
> CieDiagram->GetDrawer2D()->PushIdentityTransform();
>
> CieDiagram->GetDrawer2D()->SetDrawStyle(a2dFILLED);
> CieDiagram->GetDrawer2D()->SetDrawerFill( a2dFill( wxColour( 12, 134, 228 ), a2dFILL_SOLID ) );
> CieDiagram->GetDrawer2D()->SetDrawerStroke(a2dStroke( wxColour(0,0,0), a2dSTROKE_NORMAL));
>
> CieDiagram->GetDrawer2D()->SetDisableDrawing(false);
>
>
> for (Iter = Points->begin(); Iter != Points->end(); ++Iter)
> {
> CieDiagram->GetDrawer2D()->DrawLine(Iter->x - TICK_LENGTH/4, Iter->y,
> Iter->x + TICK_LENGTH/2, Iter->y);
> }
>
> CieDiagram->GetDrawer2D()->PopTransform();
> CieDiagram->GetDrawer2D()->EndDraw();
> }
>
> void TDlgCieDiagram::InitCanvas(void)
> {
> a2dSmrtPtr<a2dImage> Img;
> wxFileName ExeFileName;
>
> // Unfix scroll max so mapping changes will work correctly. We'll fix it
> // again later.
> CieDiagram->FixScrollMaximum( false );
>
> // Set Y axis positive up.
> CieDiagram->SetYaxis( true );
>
> // Don't show the origin.
> CieDiagram->SetShowOrigin( false );
>
> CieDiagram->SetMappingWidthHeight( -.05, -.05, .8, .9, true );
>
> // Define the number of world units moved when scroll.
> CieDiagram->SetScrollStepX( 0.001 );
> CieDiagram->SetScrollStepY( 0.001 );
>
> // Don't allow scrolling outside the scroll maximum.
> CieDiagram->FixScrollMaximum( true );
>
>
> Img = new a2dImage();
> Img->SetFill( *a2dTRANSPARENT_FILL );
> Img->SetStroke( *a2dTRANSPARENT_STROKE );
>
> Img->SetWidth( 0.8 );
> Img->SetHeight( 0.9 );
>
> // This, annoying, wants you to set the middle position of the image.
> // Why?! Of course it isn't documented, so it was fun figuring that out.
> Img->SetPosXY( 0.8/2, 0.9/2 );
>
>
> CieDiagram->GetDrawing()->Append( Img );
>
>
> ExeFileName = wxStandardPaths::Get().GetExecutablePath();
>
> Img->GetImage().LoadFile( ExeFileName.GetPath() +
> _T("\\art\\cie\\") + _T("cie_532_598.bmp") );
>
> Img->SetDraggable(false);
> Img->SetEditable(false);
>
> return;
> }
>
>
> No points ever appear on the canvas. I have attempted using the Identity transform, as well as the
> standard tranform. I have also tried adding points programmatically, and can never get any lines
> to appear. What am I missing?
>
>
> Thanks,
> - Mike
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/xeonphi
>
>
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxa...@li...
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
|
|
From: Mike G. <mik...@da...> - 2016-12-05 22:59:38
|
Hello,
I'm attempting to draw to an a2dCanvas, and am having some difficulty.
Usually when I draw something simple like a line on a canvas, I just add
an a2dSLine. However, I'm going to be adding hundreds, if not thousands
of points to a canvas, and using an a2dSLine slows the software down
tremendously.
I assume that the software would perform faster if I were to actually
just draw lines on the canvas, but I'm having problems getting that
functionality to work.
I have an a2dCanvas in a wxDialog, and the a2dCanvas is called
CieDiagram. Here is what code I'm using to attempt to draw to the
CieDiagram:
int TDlgCieDiagram::Execute(double x, double y, double Radius, TCieVect
*Points)
{
m_Drawing = new a2dDrawing();
CieDiagram->SetDrawing(m_Drawing);
CieDiagram->GetDrawingPart()->SetDrawer2D( new a2dMemDcDrawer(
CieDiagram->GetSize() ) );
CieDiagram->GetDrawer2D()->SetDisplay(CieDiagram);
CieDiagram->GetDrawer2D()->Init();
CieDiagram->GetDrawer2D()->SetMappingWidthHeight(-.05, -.05, .8, .9);
CieDiagram->GetDrawingPart()->Update( a2dCANVIEW_UPDATE_ALL );
InitCanvas();
AddPoints(Points);
return ShowModal();
}
void TDlgCieDiagram::AddPoints(TCieVect *Points)
{
TCieVectIter Iter;
if (Points == NULL)
return;
CieDiagram->GetDrawer2D()->BeginDraw();
CieDiagram->GetDrawer2D()->PushIdentityTransform();
CieDiagram->GetDrawer2D()->SetDrawStyle(a2dFILLED);
CieDiagram->GetDrawer2D()->SetDrawerFill( a2dFill( wxColour( 12,
134, 228 ), a2dFILL_SOLID ) );
CieDiagram->GetDrawer2D()->SetDrawerStroke(a2dStroke(
wxColour(0,0,0), a2dSTROKE_NORMAL));
CieDiagram->GetDrawer2D()->SetDisableDrawing(false);
for (Iter = Points->begin(); Iter != Points->end(); ++Iter)
{
CieDiagram->GetDrawer2D()->DrawLine(Iter->x - TICK_LENGTH/4,
Iter->y,
Iter->x + TICK_LENGTH/2, Iter->y);
}
CieDiagram->GetDrawer2D()->PopTransform();
CieDiagram->GetDrawer2D()->EndDraw();
}
void TDlgCieDiagram::InitCanvas(void)
{
a2dSmrtPtr<a2dImage> Img;
wxFileName ExeFileName;
// Unfix scroll max so mapping changes will work correctly. We'll
fix it
// again later.
CieDiagram->FixScrollMaximum( false );
// Set Y axis positive up.
CieDiagram->SetYaxis( true );
// Don't show the origin.
CieDiagram->SetShowOrigin( false );
CieDiagram->SetMappingWidthHeight( -.05, -.05, .8, .9, true );
// Define the number of world units moved when scroll.
CieDiagram->SetScrollStepX( 0.001 );
CieDiagram->SetScrollStepY( 0.001 );
// Don't allow scrolling outside the scroll maximum.
CieDiagram->FixScrollMaximum( true );
Img = new a2dImage();
Img->SetFill( *a2dTRANSPARENT_FILL );
Img->SetStroke( *a2dTRANSPARENT_STROKE );
Img->SetWidth( 0.8 );
Img->SetHeight( 0.9 );
// This, annoying, wants you to set the middle position of the image.
// Why?! Of course it isn't documented, so it was fun figuring that
out.
Img->SetPosXY( 0.8/2, 0.9/2 );
CieDiagram->GetDrawing()->Append( Img );
ExeFileName = wxStandardPaths::Get().GetExecutablePath();
Img->GetImage().LoadFile( ExeFileName.GetPath() +
_T("\\art\\cie\\") + _T("cie_532_598.bmp") );
Img->SetDraggable(false);
Img->SetEditable(false);
return;
}
No points ever appear on the canvas. I have attempted using the Identity
transform, as well as the standard tranform. I have also tried adding
points programmatically, and can never get any lines to appear. What am
I missing?
Thanks,
- Mike
|
|
From: klaas.holwerda <ng...@kl...> - 2016-11-22 19:38:10
|
Hi, On 11/21/2016 09:19 PM, Mike Gibson wrote: > Hello, > > I have a dialog that creates an a2dCanvas and has an a2dStToolContr, and > the a2dStToolContr has a a2dRecursiveEditTool pushed onto it. When the > dialog is created, an a2dCircle is drawn onto the canvas. Beter use a2dObjectEditTool I think. > > The point of this dialog is for the user to simply edit the size and > position of that circle, and then save off the new xy position and radius. > > After the circle is edited, calling m_Circle->GetRadius() is ALWAYS > returning the original radius, and not the edited radius. How do I get > the new radius? Well what do you see when editing is finished? Did the radius change on screen? I think only matrix was changed not the radius, but with the change below, radius is changed now. > > Also, is there a way to restrict the circle so that resizing MUST be xy > synced (ie, the circle can be resized to a circle, but cannot be resized > to an ellipse. X and Y must maintain a 1:1 ratio)? You lucky, implemented that a few days ago, just update. Regards, Klaas |
|
From: Mike G. <mik...@da...> - 2016-11-21 20:40:59
|
Hello, I have a dialog that creates an a2dCanvas and has an a2dStToolContr, and the a2dStToolContr has a a2dRecursiveEditTool pushed onto it. When the dialog is created, an a2dCircle is drawn onto the canvas. The point of this dialog is for the user to simply edit the size and position of that circle, and then save off the new xy position and radius. After the circle is edited, calling m_Circle->GetRadius() is ALWAYS returning the original radius, and not the edited radius. How do I get the new radius? Also, is there a way to restrict the circle so that resizing MUST be xy synced (ie, the circle can be resized to a circle, but cannot be resized to an ellipse. X and Y must maintain a 1:1 ratio)? Thanks! - Mike |
|
From: Mike G. <mik...@da...> - 2016-11-09 20:48:40
|
I moved StopAllTools() from the a2dStToolContr::~a2dStToolContr to the main dialog's destructor, and that seems to have made all the difference. Thank you for your help. This solved all the crashing and weird memory errors I've been writing you about. -Mike On 11/9/2016 2:54 PM, klaas.holwerda wrote: > Well no idea, without more insight in what you do. > > Is e.g. a2dCanvasObject::EndEdit() called when closing the dialog, > when do you call StopAllTools? > > I see for instance: > > a2dObjectEditTool::~a2dObjectEditTool() > > > Tapps2.exe!a2dCanvasObject::EndEdit() Line 1851 C++ > Tapps2.exe!a2dObjectEditTool::CleanupToolObjects() Line 1813 + > 0x23 bytes C++ > Tapps2.exe!a2dStTool::AbortBusyMode() Line 1217 + 0x12 bytes C++ > Tapps2.exe!a2dObjectEditTool::AbortBusyMode() Line 1587 C++ > Tapps2.exe!a2dBaseTool::DoStopTool(bool abort) Line 809 + 0x12 > bytes C++ > Tapps2.exe!a2dObjectEditTool::DoStopTool(bool abort) Line > 1528 C++ > Tapps2.exe!a2dBaseTool::StopTool(bool abort) Line 798 + 0x17 > bytes C++ > Tapps2.exe!a2dToolContr::PopTool(a2dSmrtPtr<a2dBaseTool> & poped, bool > abort) Line 371 C++ > Tapps2.exe!a2dToolContr::StopAllTools(bool abort) Line 127 C++ > Tapps2.exe!TaDrawingEditorModal::OnCloseWindow(wxCloseEvent & > event) Line 1671 C++ > > Is this one called also: > > a2dObjectEditTool::~a2dObjectEditTool() > > Your double click does end the editing in action. > But deleting the tool first, will not help, so calling StopAllTools > needs to happen first. > > Else prepare an example, to demo you problem, and I will have a look. > > Regards, > > Klaas > > > On 11/09/2016 06:04 PM, Mike Gibson wrote: >> This does not fix the issue. The only thing that works for me is >> making sure I double-click whenever I am done with the edit tool. If >> I switch to a different tool before double-clicking, the memory issue >> occurs. If I close the dialog with StopAllTools(), the memory issue >> occurs. >> >> >> >> >> On 11/9/2016 11:53 AM, klaas.holwerda wrote: >>> How about StopAllTools(), just do a search on the code, I think it >>> is clear how to use it. >>> >>> But a2dStToolContr does the same at destruction?? >>> >>> I do remember this in an application as being the same problem, and >>> the solution was StopAllTools. >>> >>> Klaas >>> >>> >>> >>> On 11/08/2016 11:45 PM, Mike Gibson wrote: >>>> So I've further tracked down what may be causing this issue. If the >>>> user selects "edit" (which uses an a2dRecursiveEditTool), the >>>> problem does not appear to occur if the user double-clicks to end >>>> the tool before closing the dialog box. >>>> >>>> However, I cannot expect the user to remember to do this. If the >>>> user leaves the edit tool open, I need to close the edit tool to >>>> prevent issues. However, I have not discovered the correct way to >>>> do this. I have tried to call StopTool() on the >>>> a2dRecursiveEditTool on destruction, but it does not solve the >>>> problem in every case. >>>> >>>> Is there a way to go through an a2dStToolContr class on >>>> destruction, and make sure that every tool is popped from the stack >>>> and deactivated? >>>> >>>> - Mike >>>> >>>> >>>> On 11/5/2016 12:04 PM, klaas.holwerda wrote: >>>>> On 11/04/2016 11:03 PM, Mike Gibson wrote: >>>>>> I switched back to a normal a2dDrawing. After editing, I close >>>>>> the dialog. When I reopen and try to edit, I get this error: >>>>> >>>>> Editing what with a dialog? >>>>> Are do you mean the canvas as part of a dialog? >>>>> I don't know what you do and how you do it. >>>>> >>>>> You can send me a stack when this happens? And what is the object >>>>> (obj) in question? >>>>> >>>>> If you can reproduce it in a sample, I can check what is going on, >>>>> but with just this I don't know. >>>>> >>>>> Regards, >>>>> >>>>> Klaas >>>>> >>>>> >>>>>> >>>>>> >>>>>> I also get odd behavior like malfunctioning controls in the UI as >>>>>> if there is some underlying memory issue. >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Developer Access Program for Intel Xeon Phi Processors >>>>> Access to Intel Xeon Phi processor-based developer platforms. >>>>> With one year of Intel Parallel Studio XE. >>>>> Training and support from Colfax. >>>>> Order your platform today.http://sdm.link/xeonphi >>>>> >>>>> >>>>> _______________________________________________ >>>>> Wxart2d-users_dev mailing list >>>>> Wxa...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Developer Access Program for Intel Xeon Phi Processors >>>> Access to Intel Xeon Phi processor-based developer platforms. >>>> With one year of Intel Parallel Studio XE. >>>> Training and support from Colfax. >>>> Order your platform today.http://sdm.link/xeonphi >>>> >>>> >>>> _______________________________________________ >>>> Wxart2d-users_dev mailing list >>>> Wxa...@li... >>>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Developer Access Program for Intel Xeon Phi Processors >>> Access to Intel Xeon Phi processor-based developer platforms. >>> With one year of Intel Parallel Studio XE. >>> Training and support from Colfax. >>> Order your platform today.http://sdm.link/xeonphi >>> >>> >>> _______________________________________________ >>> Wxart2d-users_dev mailing list >>> Wxa...@li... >>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev >> >> >> >> >> ------------------------------------------------------------------------------ >> Developer Access Program for Intel Xeon Phi Processors >> Access to Intel Xeon Phi processor-based developer platforms. >> With one year of Intel Parallel Studio XE. >> Training and support from Colfax. >> Order your platform today.http://sdm.link/xeonphi >> >> >> _______________________________________________ >> Wxart2d-users_dev mailing list >> Wxa...@li... >> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev > > > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > > > _______________________________________________ > Wxart2d-users_dev mailing list > Wxa...@li... > https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev |
|
From: klaas.holwerda <ng...@kl...> - 2016-11-09 19:54:35
|
Well no idea, without more insight in what you do.
Is e.g. a2dCanvasObject::EndEdit() called when closing the dialog, when do you call StopAllTools?
I see for instance:
a2dObjectEditTool::~a2dObjectEditTool()
> Tapps2.exe!a2dCanvasObject::EndEdit() Line 1851 C++
Tapps2.exe!a2dObjectEditTool::CleanupToolObjects() Line 1813 + 0x23 bytes C++
Tapps2.exe!a2dStTool::AbortBusyMode() Line 1217 + 0x12 bytes C++
Tapps2.exe!a2dObjectEditTool::AbortBusyMode() Line 1587 C++
Tapps2.exe!a2dBaseTool::DoStopTool(bool abort) Line 809 + 0x12 bytes C++
Tapps2.exe!a2dObjectEditTool::DoStopTool(bool abort) Line 1528 C++
Tapps2.exe!a2dBaseTool::StopTool(bool abort) Line 798 + 0x17 bytes C++
Tapps2.exe!a2dToolContr::PopTool(a2dSmrtPtr<a2dBaseTool> & poped, bool abort) Line 371 C++
Tapps2.exe!a2dToolContr::StopAllTools(bool abort) Line 127 C++
Tapps2.exe!TaDrawingEditorModal::OnCloseWindow(wxCloseEvent & event) Line 1671 C++
Is this one called also:
a2dObjectEditTool::~a2dObjectEditTool()
Your double click does end the editing in action.
But deleting the tool first, will not help, so calling StopAllTools needs to happen first.
Else prepare an example, to demo you problem, and I will have a look.
Regards,
Klaas
On 11/09/2016 06:04 PM, Mike Gibson wrote:
> This does not fix the issue. The only thing that works for me is making sure I double-click
> whenever I am done with the edit tool. If I switch to a different tool before double-clicking, the
> memory issue occurs. If I close the dialog with StopAllTools(), the memory issue occurs.
>
>
>
>
> On 11/9/2016 11:53 AM, klaas.holwerda wrote:
>> How about StopAllTools(), just do a search on the code, I think it is clear how to use it.
>>
>> But a2dStToolContr does the same at destruction??
>>
>> I do remember this in an application as being the same problem, and the solution was StopAllTools.
>>
>> Klaas
>>
>>
>>
>> On 11/08/2016 11:45 PM, Mike Gibson wrote:
>>> So I've further tracked down what may be causing this issue. If the user selects "edit" (which
>>> uses an a2dRecursiveEditTool), the problem does not appear to occur if the user double-clicks to
>>> end the tool before closing the dialog box.
>>>
>>> However, I cannot expect the user to remember to do this. If the user leaves the edit tool open,
>>> I need to close the edit tool to prevent issues. However, I have not discovered the correct way
>>> to do this. I have tried to call StopTool() on the a2dRecursiveEditTool on destruction, but it
>>> does not solve the problem in every case.
>>>
>>> Is there a way to go through an a2dStToolContr class on destruction, and make sure that every
>>> tool is popped from the stack and deactivated?
>>>
>>> - Mike
>>>
>>>
>>> On 11/5/2016 12:04 PM, klaas.holwerda wrote:
>>>> On 11/04/2016 11:03 PM, Mike Gibson wrote:
>>>>> I switched back to a normal a2dDrawing. After editing, I close the dialog. When I reopen and
>>>>> try to edit, I get this error:
>>>>
>>>> Editing what with a dialog?
>>>> Are do you mean the canvas as part of a dialog?
>>>> I don't know what you do and how you do it.
>>>>
>>>> You can send me a stack when this happens? And what is the object (obj) in question?
>>>>
>>>> If you can reproduce it in a sample, I can check what is going on, but with just this I don't know.
>>>>
>>>> Regards,
>>>>
>>>> Klaas
>>>>
>>>>
>>>>>
>>>>>
>>>>> I also get odd behavior like malfunctioning controls in the UI as if there is some underlying
>>>>> memory issue.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Developer Access Program for Intel Xeon Phi Processors
>>>> Access to Intel Xeon Phi processor-based developer platforms.
>>>> With one year of Intel Parallel Studio XE.
>>>> Training and support from Colfax.
>>>> Order your platform today.http://sdm.link/xeonphi
>>>>
>>>>
>>>> _______________________________________________
>>>> Wxart2d-users_dev mailing list
>>>> Wxa...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Developer Access Program for Intel Xeon Phi Processors
>>> Access to Intel Xeon Phi processor-based developer platforms.
>>> With one year of Intel Parallel Studio XE.
>>> Training and support from Colfax.
>>> Order your platform today.http://sdm.link/xeonphi
>>>
>>>
>>> _______________________________________________
>>> Wxart2d-users_dev mailing list
>>> Wxa...@li...
>>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>>
>>
>> _______________________________________________
>> Wxart2d-users_dev mailing list
>> Wxa...@li...
>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
>
>
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxa...@li...
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
|
|
From: Mike G. <mik...@da...> - 2016-11-09 17:37:11
|
This does not fix the issue. The only thing that works for me is making sure I double-click whenever I am done with the edit tool. If I switch to a different tool before double-clicking, the memory issue occurs. If I close the dialog with StopAllTools(), the memory issue occurs. On 11/9/2016 11:53 AM, klaas.holwerda wrote: > How about StopAllTools(), just do a search on the code, I think it is > clear how to use it. > > But a2dStToolContr does the same at destruction?? > > I do remember this in an application as being the same problem, and > the solution was StopAllTools. > > Klaas > > > > On 11/08/2016 11:45 PM, Mike Gibson wrote: >> So I've further tracked down what may be causing this issue. If the >> user selects "edit" (which uses an a2dRecursiveEditTool), the problem >> does not appear to occur if the user double-clicks to end the tool >> before closing the dialog box. >> >> However, I cannot expect the user to remember to do this. If the user >> leaves the edit tool open, I need to close the edit tool to prevent >> issues. However, I have not discovered the correct way to do this. I >> have tried to call StopTool() on the a2dRecursiveEditTool on >> destruction, but it does not solve the problem in every case. >> >> Is there a way to go through an a2dStToolContr class on destruction, >> and make sure that every tool is popped from the stack and deactivated? >> >> - Mike >> >> >> On 11/5/2016 12:04 PM, klaas.holwerda wrote: >>> On 11/04/2016 11:03 PM, Mike Gibson wrote: >>>> I switched back to a normal a2dDrawing. After editing, I close the >>>> dialog. When I reopen and try to edit, I get this error: >>> >>> Editing what with a dialog? >>> Are do you mean the canvas as part of a dialog? >>> I don't know what you do and how you do it. >>> >>> You can send me a stack when this happens? And what is the object >>> (obj) in question? >>> >>> If you can reproduce it in a sample, I can check what is going on, >>> but with just this I don't know. >>> >>> Regards, >>> >>> Klaas >>> >>> >>>> >>>> >>>> I also get odd behavior like malfunctioning controls in the UI as >>>> if there is some underlying memory issue. >>>> >>>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Developer Access Program for Intel Xeon Phi Processors >>> Access to Intel Xeon Phi processor-based developer platforms. >>> With one year of Intel Parallel Studio XE. >>> Training and support from Colfax. >>> Order your platform today.http://sdm.link/xeonphi >>> >>> >>> _______________________________________________ >>> Wxart2d-users_dev mailing list >>> Wxa...@li... >>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev >> >> >> >> >> ------------------------------------------------------------------------------ >> Developer Access Program for Intel Xeon Phi Processors >> Access to Intel Xeon Phi processor-based developer platforms. >> With one year of Intel Parallel Studio XE. >> Training and support from Colfax. >> Order your platform today.http://sdm.link/xeonphi >> >> >> _______________________________________________ >> Wxart2d-users_dev mailing list >> Wxa...@li... >> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev > > > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > > > _______________________________________________ > Wxart2d-users_dev mailing list > Wxa...@li... > https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev |
|
From: klaas.holwerda <ng...@kl...> - 2016-11-09 16:54:09
|
How about StopAllTools(), just do a search on the code, I think it is clear how to use it. But a2dStToolContr does the same at destruction?? I do remember this in an application as being the same problem, and the solution was StopAllTools. Klaas On 11/08/2016 11:45 PM, Mike Gibson wrote: > So I've further tracked down what may be causing this issue. If the user selects "edit" (which > uses an a2dRecursiveEditTool), the problem does not appear to occur if the user double-clicks to > end the tool before closing the dialog box. > > However, I cannot expect the user to remember to do this. If the user leaves the edit tool open, I > need to close the edit tool to prevent issues. However, I have not discovered the correct way to > do this. I have tried to call StopTool() on the a2dRecursiveEditTool on destruction, but it does > not solve the problem in every case. > > Is there a way to go through an a2dStToolContr class on destruction, and make sure that every tool > is popped from the stack and deactivated? > > - Mike > > > On 11/5/2016 12:04 PM, klaas.holwerda wrote: >> On 11/04/2016 11:03 PM, Mike Gibson wrote: >>> I switched back to a normal a2dDrawing. After editing, I close the dialog. When I reopen and try >>> to edit, I get this error: >> >> Editing what with a dialog? >> Are do you mean the canvas as part of a dialog? >> I don't know what you do and how you do it. >> >> You can send me a stack when this happens? And what is the object (obj) in question? >> >> If you can reproduce it in a sample, I can check what is going on, but with just this I don't know. >> >> Regards, >> >> Klaas >> >> >>> >>> >>> I also get odd behavior like malfunctioning controls in the UI as if there is some underlying >>> memory issue. >>> >>> >> >> >> >> ------------------------------------------------------------------------------ >> Developer Access Program for Intel Xeon Phi Processors >> Access to Intel Xeon Phi processor-based developer platforms. >> With one year of Intel Parallel Studio XE. >> Training and support from Colfax. >> Order your platform today.http://sdm.link/xeonphi >> >> >> _______________________________________________ >> Wxart2d-users_dev mailing list >> Wxa...@li... >> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev > > > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today.http://sdm.link/xeonphi > > > _______________________________________________ > Wxart2d-users_dev mailing list > Wxa...@li... > https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev |
|
From: klaas.holwerda <ng...@kl...> - 2016-11-08 23:19:18
|
On 11/08/2016 09:59 PM, Mike Gibson wrote:
> So what is the new equivalent of the old
> a2dCanvas::GetRoot()->DeleteContents()?
a2dCanvas now has just an a2dDrawing. So no a2dDocument involved anymore
You could even do without anything dealing with the docview stuff, in your case.
a2dDrawing::GetRootObject()->ReleaseChildObjects();
Don't know how you create the a2dCanvas, but the drawing is available.
Klaas
|
|
From: Mike G. <mik...@da...> - 2016-11-08 22:51:02
|
So I've further tracked down what may be causing this issue. If the user selects "edit" (which uses an a2dRecursiveEditTool), the problem does not appear to occur if the user double-clicks to end the tool before closing the dialog box. However, I cannot expect the user to remember to do this. If the user leaves the edit tool open, I need to close the edit tool to prevent issues. However, I have not discovered the correct way to do this. I have tried to call StopTool() on the a2dRecursiveEditTool on destruction, but it does not solve the problem in every case. Is there a way to go through an a2dStToolContr class on destruction, and make sure that every tool is popped from the stack and deactivated? - Mike On 11/5/2016 12:04 PM, klaas.holwerda wrote: > On 11/04/2016 11:03 PM, Mike Gibson wrote: >> I switched back to a normal a2dDrawing. After editing, I close the >> dialog. When I reopen and try to edit, I get this error: > > Editing what with a dialog? > Are do you mean the canvas as part of a dialog? > I don't know what you do and how you do it. > > You can send me a stack when this happens? And what is the object > (obj) in question? > > If you can reproduce it in a sample, I can check what is going on, but > with just this I don't know. > > Regards, > > Klaas > > >> >> >> I also get odd behavior like malfunctioning controls in the UI as if >> there is some underlying memory issue. >> >> > > > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > > > _______________________________________________ > Wxart2d-users_dev mailing list > Wxa...@li... > https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev |
|
From: Mike G. <mik...@da...> - 2016-11-08 21:19:51
|
How do you delete all the objects off an a2dCanvas? In previous builds, we used to do this simply by requesting the root from the a2dCanvas (which at that time returned an a2dCanvasDocument), and then calling DeleteContents(). But now a2dCanvas does not have a method for that. Now, I don't see ANY way to get an a2dCanvasDocument, except through an a2dCanvasView. But you can only get an a2dCanvasView from an a2dViewCanvas. And to construct an a2dViewCanvas, you have to have an a2dCanvasView! So what is the new equivalent of the old a2dCanvas::GetRoot()->DeleteContents()? |
|
From: klaas.holwerda <ng...@kl...> - 2016-11-05 16:04:32
|
On 11/04/2016 11:03 PM, Mike Gibson wrote: > I switched back to a normal a2dDrawing. After editing, I close the dialog. When I reopen and try > to edit, I get this error: Editing what with a dialog? Are do you mean the canvas as part of a dialog? I don't know what you do and how you do it. You can send me a stack when this happens? And what is the object (obj) in question? If you can reproduce it in a sample, I can check what is going on, but with just this I don't know. Regards, Klaas > > > I also get odd behavior like malfunctioning controls in the UI as if there is some underlying > memory issue. > > |
|
From: Mike G. <mik...@da...> - 2016-11-04 22:30:47
|
I switched back to a normal a2dDrawing. After editing, I close the
dialog. When I reopen and try to edit, I get this error:
I also get odd behavior like malfunctioning controls in the UI as if
there is some underlying memory issue.
On 11/4/2016 4:35 PM, klaas.holwerda wrote:
> Hi,
>
> I do not see these functions in your drawing class, so why are they
> there? Maybe not the issue but strange.
>
> EVT_IDLE( MyDrawing::OnIdle )
> EVT_COM_EVENT( MyDrawing::OnComEvent )
> EVT_NEW_CAMELEON( MyDrawing::OnAddCameleon )
> EVT_UNDO( MyDrawing::OnUndoEvent )
> EVT_REDO( MyDrawing::OnRedoEvent )
> EVT_CHANGEDMODIFY_DRAWING( MyDrawing::OnChangeDrawings )
>
> For the rest I see nothing wrong.
> How do you set this drawing to the canvas?
> If you do not do your extra stuff, is it functioning as before?
> Meaning with the normal a2dDrawing, it behaves correctly, if nothing
> extra done in you drawing class, it should behave the same.
>
> I do not push event handlers, but do connect dynamic events .
> So no idea what is causing the error you get.
>
> Regards,
>
> Klaas
>
>
>
> On 11/04/2016 06:33 PM, Mike Gibson wrote:
>>
>> Hello,
>>
>> I have my own class derived from an a2dDrawing that is giving me some
>> issues that appear to be caused by invalid memory access. I've
>> created my own class so that I can handle some a2dCanvasObject
>> editing events. When an object is edited via mouse on the canvas, I
>> record the changes in a wxPropertyGrid. However, the editing on the
>> canvas can get glitchy (the shape, while being edited can jump
>> around), and I've found that after I'm done editing and return to my
>> program's main UI, that various elements can be affected (such as
>> another unrelated property grid will become uneditable, or I am
>> unable to re-open my canvas editing window).
>>
>> Any time this issue occurs, when I close my program, I get the
>> following error message TWICE (which does not appear if I do not use
>> the editor):
>>
>>
>> Here is my a2dDrawing in the header:
>>
>> class MyDrawing: public a2dDrawing
>> {
>> DECLARE_EVENT_TABLE()
>> public:
>> MyDrawing(const wxString &name=wxT(""), a2dHabitat *habitat=NULL)
>> : a2dDrawing(name, habitat){ m_Owner = NULL; }
>>
>> void SetOwner(TDlgPhotoAreas *Owner) { m_Owner = Owner; }
>>
>> MyDrawing(const a2dDrawing &other, CloneOptions options,
>> a2dRefMap *refs)
>> : a2dDrawing(other, options, refs){ m_Owner = NULL; }
>>
>> ~MyDrawing(){}
>>
>> virtual void OnDoEvent( a2dCommandProcessorEvent &event);
>>
>> private:
>> TDlgPhotoAreas *m_Owner;
>> };
>>
>>
>> and the entire cpp code for the a2dDrawing class:
>>
>> BEGIN_EVENT_TABLE( MyDrawing, a2dDrawing )
>> EVT_IDLE( MyDrawing::OnIdle )
>> EVT_COM_EVENT( MyDrawing::OnComEvent )
>> EVT_NEW_CAMELEON( MyDrawing::OnAddCameleon )
>> EVT_DO( MyDrawing::OnDoEvent )
>> EVT_UNDO( MyDrawing::OnUndoEvent )
>> EVT_REDO( MyDrawing::OnRedoEvent )
>> EVT_CHANGEDMODIFY_DRAWING( MyDrawing::OnChangeDrawings )
>> END_EVENT_TABLE()
>>
>>
>> void MyDrawing::OnDoEvent( a2dCommandProcessorEvent &event)
>> {
>> a2dCommand *Command = event.GetCommand();
>> const a2dCommandId *ComId = Command->GetCommandId();
>>
>> a2dCanvasObject *Obj =
>> wxDynamicCast(Command,
>> a2dCommand_AddObject)->GetCanvasObject();
>>
>> if ( ComId == &a2dCommand_SetProperty::Id)
>> {
>>
>> if (Obj)
>> {
>> a2dRect *Rect = wxDynamicCast(Obj, a2dRect);
>>
>> if (m_Owner)
>> m_Owner->EditRectangleFromCanvas(Rect);
>> }
>>
>>
>>
>> }
>>
>> if (event.GetCommand()->Modifies())
>> Modify(true);
>>
>> }
>>
>> Any idea what is causing the issue?
>>
>>
>> Thanks,
>>
>> - Mike
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today.http://sdm.link/xeonphi
>>
>>
>> _______________________________________________
>> Wxart2d-users_dev mailing list
>> Wxa...@li...
>> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
>
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
>
>
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxa...@li...
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
|
|
From: klaas.holwerda <ng...@kl...> - 2016-11-04 20:35:27
|
Hi,
I do not see these functions in your drawing class, so why are they there? Maybe not the issue but
strange.
EVT_IDLE( MyDrawing::OnIdle )
EVT_COM_EVENT( MyDrawing::OnComEvent )
EVT_NEW_CAMELEON( MyDrawing::OnAddCameleon )
EVT_UNDO( MyDrawing::OnUndoEvent )
EVT_REDO( MyDrawing::OnRedoEvent )
EVT_CHANGEDMODIFY_DRAWING( MyDrawing::OnChangeDrawings )
For the rest I see nothing wrong.
How do you set this drawing to the canvas?
If you do not do your extra stuff, is it functioning as before?
Meaning with the normal a2dDrawing, it behaves correctly, if nothing extra done in you drawing
class, it should behave the same.
I do not push event handlers, but do connect dynamic events .
So no idea what is causing the error you get.
Regards,
Klaas
On 11/04/2016 06:33 PM, Mike Gibson wrote:
>
> Hello,
>
> I have my own class derived from an a2dDrawing that is giving me some issues that appear to be
> caused by invalid memory access. I've created my own class so that I can handle some
> a2dCanvasObject editing events. When an object is edited via mouse on the canvas, I record the
> changes in a wxPropertyGrid. However, the editing on the canvas can get glitchy (the shape, while
> being edited can jump around), and I've found that after I'm done editing and return to my
> program's main UI, that various elements can be affected (such as another unrelated property grid
> will become uneditable, or I am unable to re-open my canvas editing window).
>
> Any time this issue occurs, when I close my program, I get the following error message TWICE
> (which does not appear if I do not use the editor):
>
>
> Here is my a2dDrawing in the header:
>
> class MyDrawing: public a2dDrawing
> {
> DECLARE_EVENT_TABLE()
> public:
> MyDrawing(const wxString &name=wxT(""), a2dHabitat *habitat=NULL)
> : a2dDrawing(name, habitat){ m_Owner = NULL; }
>
> void SetOwner(TDlgPhotoAreas *Owner) { m_Owner = Owner; }
>
> MyDrawing(const a2dDrawing &other, CloneOptions options, a2dRefMap *refs)
> : a2dDrawing(other, options, refs){ m_Owner = NULL; }
>
> ~MyDrawing(){}
>
> virtual void OnDoEvent( a2dCommandProcessorEvent &event);
>
> private:
> TDlgPhotoAreas *m_Owner;
> };
>
>
> and the entire cpp code for the a2dDrawing class:
>
> BEGIN_EVENT_TABLE( MyDrawing, a2dDrawing )
> EVT_IDLE( MyDrawing::OnIdle )
> EVT_COM_EVENT( MyDrawing::OnComEvent )
> EVT_NEW_CAMELEON( MyDrawing::OnAddCameleon )
> EVT_DO( MyDrawing::OnDoEvent )
> EVT_UNDO( MyDrawing::OnUndoEvent )
> EVT_REDO( MyDrawing::OnRedoEvent )
> EVT_CHANGEDMODIFY_DRAWING( MyDrawing::OnChangeDrawings )
> END_EVENT_TABLE()
>
>
> void MyDrawing::OnDoEvent( a2dCommandProcessorEvent &event)
> {
> a2dCommand *Command = event.GetCommand();
> const a2dCommandId *ComId = Command->GetCommandId();
>
> a2dCanvasObject *Obj =
> wxDynamicCast(Command, a2dCommand_AddObject)->GetCanvasObject();
>
> if ( ComId == &a2dCommand_SetProperty::Id)
> {
>
> if (Obj)
> {
> a2dRect *Rect = wxDynamicCast(Obj, a2dRect);
>
> if (m_Owner)
> m_Owner->EditRectangleFromCanvas(Rect);
> }
>
>
>
> }
>
> if (event.GetCommand()->Modifies())
> Modify(true);
>
> }
>
> Any idea what is causing the issue?
>
>
> Thanks,
>
> - Mike
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
>
>
> _______________________________________________
> Wxart2d-users_dev mailing list
> Wxa...@li...
> https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev
|
|
From: Mike G. <mik...@da...> - 2016-11-04 17:33:30
|
Hello,
I have my own class derived from an a2dDrawing that is giving me some
issues that appear to be caused by invalid memory access. I've created
my own class so that I can handle some a2dCanvasObject editing events.
When an object is edited via mouse on the canvas, I record the changes
in a wxPropertyGrid. However, the editing on the canvas can get glitchy
(the shape, while being edited can jump around), and I've found that
after I'm done editing and return to my program's main UI, that various
elements can be affected (such as another unrelated property grid will
become uneditable, or I am unable to re-open my canvas editing window).
Any time this issue occurs, when I close my program, I get the following
error message TWICE (which does not appear if I do not use the editor):
Here is my a2dDrawing in the header:
class MyDrawing: public a2dDrawing
{
DECLARE_EVENT_TABLE()
public:
MyDrawing(const wxString &name=wxT(""), a2dHabitat *habitat=NULL)
: a2dDrawing(name, habitat){ m_Owner = NULL; }
void SetOwner(TDlgPhotoAreas *Owner) { m_Owner = Owner; }
MyDrawing(const a2dDrawing &other, CloneOptions options,
a2dRefMap *refs)
: a2dDrawing(other, options, refs){ m_Owner = NULL; }
~MyDrawing(){}
virtual void OnDoEvent( a2dCommandProcessorEvent &event);
private:
TDlgPhotoAreas *m_Owner;
};
and the entire cpp code for the a2dDrawing class:
BEGIN_EVENT_TABLE( MyDrawing, a2dDrawing )
EVT_IDLE( MyDrawing::OnIdle )
EVT_COM_EVENT( MyDrawing::OnComEvent )
EVT_NEW_CAMELEON( MyDrawing::OnAddCameleon )
EVT_DO( MyDrawing::OnDoEvent )
EVT_UNDO( MyDrawing::OnUndoEvent )
EVT_REDO( MyDrawing::OnRedoEvent )
EVT_CHANGEDMODIFY_DRAWING( MyDrawing::OnChangeDrawings )
END_EVENT_TABLE()
void MyDrawing::OnDoEvent( a2dCommandProcessorEvent &event)
{
a2dCommand *Command = event.GetCommand();
const a2dCommandId *ComId = Command->GetCommandId();
a2dCanvasObject *Obj =
wxDynamicCast(Command,
a2dCommand_AddObject)->GetCanvasObject();
if ( ComId == &a2dCommand_SetProperty::Id)
{
if (Obj)
{
a2dRect *Rect = wxDynamicCast(Obj, a2dRect);
if (m_Owner)
m_Owner->EditRectangleFromCanvas(Rect);
}
}
if (event.GetCommand()->Modifies())
Modify(true);
}
Any idea what is causing the issue?
Thanks,
- Mike
|
|
From: klaas.holwerda <ng...@kl...> - 2016-10-28 20:42:19
|
Hi,
Can you give me an example of using the rectangle to determine when the creation of the rectangle is complete? What I mean is, with the code you sent me, I get an "object added" event when the user clicks the mouse the first time to indicate the first of the rectangle's corners. What I need is the 2nd click which completes the rectangle. Basically, I want to be able to show the dimensions of the rectangle once it has been completed.
[Klaas] I think you need to make your own derived rectangle, o achieve that, and also a the tool to draw it.
Don't know right now if there is an event to intercept exactly at that moment.
Also, I see that when a rectangle is resized, that I get 4 a2dCommandProcessorEvent "SetProperty" events, and 4 a2dDrawingEvents.
Is there a way to see what property is set?
{Klaas] Very likely generated from here indirectly (see stack at that point):
void a2dRect::OnHandleEvent( a2dHandleMouseEvent& event )
else if ( event.GetMouseEvent().LeftUp() )
{
a2dCommandProcessor* cmd = m_root->GetCommandProcessor();
a2dCommandGroup* commandgroup = cmd->CommandGroupBegin( wxT( "rectangle edit" ) );
cmd->Submit( new a2dCommand_SetCanvasProperty( original, PROPID_TransformMatrix, m_lworld ) );
cmd->Submit( new a2dCommand_SetCanvasProperty( original, PROPID_Width, m_width ) );
cmd->Submit( new a2dCommand_SetCanvasProperty( original, PROPID_Height, m_height ) );
cmd->Submit( new a2dCommand_SetCanvasProperty( original, PROPID_Radius, m_radius ) );
cmd->CommandGroupEnd( commandgroup );
}
So when editing is finished, you could test for that in:
void a2dDrawing::OnDoEvent( a2dCommandProcessorEvent& event )
{
if ( event.GetCommand()->Modifies() )
Modify( true );
}
There the event says the command is a2dCommand_SetCanvasProperty and gives you a pointer to it, which has a pointer the m_property and m_id, and from the m_id, you can find the name.
>From the m_property you can find also the m_value.
So yes, you can see much at that stage.
I had previously emailed you about restricting the rectangle so that the user cannot do skew and rotate, but now I see that a "reshape" has been added. How do we block that?
[Klaas]
Did add a property for that now, also rectangle tool, can now work with a template object. See single2 example on how to use it.
If I make my own rectangle class, do I need to make my own rectangle tool class so that the editor knows to use my rectangles instead of the a2dRect?
[Klaas]
Now not anymore, because of the template object, but must be derived from a2dRect.
I've tried to find a lot of these answers in the documentation, but I have been unsuccessful. Is there somewhere in the documentation that covers which events each class handles and emits?
[Klaas] not enough if any. So really need to read the source.
I myself love this one, you can easily find what event are generated where, by setting a break point when needed. And look at the stack.
#if wxUSE_EXCEPTIONS
void
MyApp::HandleEvent(wxEvtHandler *handler,
wxEventFunction func,
wxEvent& event) const
{
// by default, simply call the handler
(handler->*func)(event);
}
#endif
At last, I could add a signal to be emitted at the right moment.
For instance search for these, in the code, such a signal I could add when finishing an action in a tool.
const a2dSignal a2dStTool::sig_toolComEventAddObject = wxNewId();
const a2dSignal a2dStTool::sig_toolComEventSetEditObject = wxNewId();
Regards,
Klaas
|