add C++ example code for document, graphics view