Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

WhipExamples/Url.cpp

#include "whiptk/whip_toolkit.h"

extern WT_File whip_file; //Assume this has been opened for writing elsewhere.

WT_Result Url()
{
    //Define some polylines.
    int x=0,y=0;
    WT_Logical_Point vP[4];
    vP[0] = WT_Logical_Point(x,y);
    vP[1] = WT_Logical_Point(x+50,y);
    vP[2] = WT_Logical_Point(x,y+100);
    vP[3] = WT_Logical_Point(x+50,y+100);
    //Create the polylines.
    WT_Polyline p1 (2, vP, WD_True);
    WT_Polyline p2 (2, &vP[2], WD_True);
    //Create a few of hyperlinks
    WT_URL_Item             url1(0, "?docType=ePlot&view='Text'", "Jump to Text view");
    WT_URL_Item             url2(1, "?docType=ePlot&view='Images'", "Jump to Images view");
    WT_URL_Item             url3(2, "http://www.autodesk.com/viewers", "Autodesk Viewers Page");

    //Serialize line 1, with one associated hyperlinks.
    whip_file.desired_rendition().url().add_url_optimized(url1, whip_file);
    WD_CHECK(p1.serialize (whip_file));
    whip_file.desired_rendition().url().clear();

    //Serialize line 2, with two associated hyperlinks.
    whip_file.desired_rendition().url().add_url_optimized(url2, whip_file);
    whip_file.desired_rendition().url().add_url_optimized(url3, whip_file);
    WD_CHECK(p2.serialize (whip_file));
    whip_file.desired_rendition().url().clear();

    return WT_Result::Success;
}

Generated on Tue May 17 12:07:43 2005 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.1