Vvidget Code Reference Manual

Vvidget Code > Overview > Quick Explanation

This section gives a quick explanation of what Vvidget Code does.

Goal

The Vvidget Code design criterion is based upon two goals:

One Type Of Final Result - A Cocoa Application

One type of final result is a Cocoa application. When you build a Cocoa application that uses Vvidget the result is the normal Application bundle, a directory with a .app extension that looks like a file within the Finder. When you open up that bundle and look at its contents then you will find the following directory layout:

Application Bundle File Layout
  • Contents/Frameworks

    The Vvidget Embedded Frameworks are located in the Frameworks sub-directory of your application. Other frameworks may also be present in this directory depending on your use.

  • Contents/MacOS

    The binary of your application (from the code you write) is enclosed in this directory. There is normally only one binary file with the name of your application.

  • Contents/Resources/English.lproj

    The user interface, particularly the one with the graph view in it, is located in this directory and analogous language specific directories.

  • Contents/Resources/my_templates

    If your application has graph formatting customization then it can contain multiple template directories. Those directories contain Vvidget Builder documents that relate to the static graphics of the graphic view. The my_template name is just an example and you can name the template directory anything you wish and also have multiple template directories.

Quick Explanation: How to program a graph

The following quickly explains how to program a graph using Vvidget Code. A more through explanation is given in the Cocoa Programming Tutorial section. The steps are as follows:

  1. Make a normal Cocoa application project using Xcode.

  2. Load the Vvidget Code Interface Builder plugin and drag the VvidgetCodeClientView to your application's window and hook that graph to an instance variable of a controller in your application. For demonstration sake, call that instant variable graphView.

  3. Add some code, such as the following:

    constructor = [graphView get_VC_input_string_constructor];
    [constructor VC_append_key:"chart_type" string_value:@"line"];
    [constructor VC_append_key:"chart_subtype" string_value:@"linear"];
    [constructor VC_append_key:"chart_format_type" string_value:@"default"];
    [constructor VC_append_key:"title" string_value:@"My Title"];
    [constructor VC_append_key:"x_title" string_value:@"My X Title"];
    [constructor VC_append_key:"y_title" string_value:@"My Y Title"];
    [constructor VC_append_key:"data_1" string_value:@"1 5 2 6 3 7"];
    [constructor VC_append_key:"line_color" string_value:@"0000FF"];

    That code enters the specification of the graph into the graphView in the form of a Dictionary. The specification is complete and describes a linear line graph and the graph is ready to be made and displayed.

  4. Add the following code to update the graphView and then display it:

    [graphView VCN_update_using_input_string_constructor];

    [graphView display];

  5. A benefit of Vvidget Code is to be able to access the powerful layout application Vvidget Builder right from your own application. Add the following action method to your code and hook it up to a menu item or a button.

    - (IBAction) export:(id)sender
    {
    [graphView VCN_export_to_vvidget_builder];
    }

  6. That is it really. There isn't much too it. The rest is related to different system configurations, dictionary entries and templates that define the static attributes of the graph, such as label fonts, title fonts, grid colors, etc. All of those are made with the GUI tool Vvidget Builder and no programming is involved. Vvidget Code uses default templates so you need not concern yourself with templates to begin with, but eventually you may wish to use them.

Summary

In a nutshell, Vvidget Code is designed with the following attributes:

Where Next

Now that you have a basic understanding of Vvidget Code the next step it to branch out and make an Application. I would suggest the Illustration section. If you simply want to read reference material descriptions then you can start off with any of the Dictionary sections.

Please help improve this documentation. If a section is hard to understand, there is a typo, you would like a new section added, or you detect any other improvement that can be made then please email support@vvi.com with your information.




© Copyright 1993-2011 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.