On 3 October 2017 at 18:00, Alan W. Irwin <ir...@beluga.phys.uvic.ca> wrote: > On 2017-10-03 11:24+0100 Phil Rosenberg wrote: > >> Hi Alan >> It may be possible to do as you said with a clip region and an affine >> transform. I did consider this but I am not sure if the gradient gets >> transformed or just the polygon shape. I would have to check. >> >> Regarding inheritance, you have the correct syntax. wxDC and >> wxGraphicsContext are pretty close to top level classes so only >> inherit from wxObject, which many wxWidgets classes inherit from and I >> think it basically allows conversion between classes and strings which >> specify the class name. If you look in the docs, >> e.g.http://docs.wxwidgets.org/3.1/classwx_d_c.html, there is usually >> an inheritance diagram. You have access to all the functions towards >> the base of the tree, but the magic of C++ is that the behaviour of >> some of the functions can be redefined towards the branches of a tree >> by using the virtual specifier. So for example wxDC has a virtual >> function DrawLines. So if I have a pointer to a wxDC I can always call >> myDcPointer->DrawLines(/*params*/). But then if that pointer actually >> points to an inherited class then the inherited class's version of >> that function is called, so a wxPostscriptDC would write the vector to >> the file, a wxMemoryDC would work out which pixels need shading and >> shade them, etc. > > > Hi Phil: > > I don't claim to understand everything you have said above in your > second paragraph, but if the upshot is there are C++ ways to give us > access to all wxWidget library methods regardless of the class they > are in, then I suggest the most promising way forward (since the > documentation does not mention any limitations on this brush) is > likely to be to use wxGraphicsContext::CreateLinearGradientBrush > rather than wxDC::GradientFillLinear (which does have many documented > limitations).
No, sadly it does not. I can only access functions that are in wxDC. wxGraphicsContext is neither a parent nor a child class to wxDC, it is totally unrelated. The wxGCDC class is a child of wxDC. It takes wxDC commands and then calls equivalent wxGraphicsContext commands. This is how we make use of the wxGraphicsContexts rendering. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel