Dave Briccetti's Programming Samples

From EDM2
Jump to: navigation, search

By Dave Briccetti

Air Traffic Control Container

Last Update: 1995

This program and Freelance presentation teaches old-style (before Open Class) container and drag/drop programming, using a simple Air Traffic Control example.

DB-Samples-atccnr.jpg

Slip Canvas

Last Update: 30-Dec-1996

This program and Freelance presentation demonstrates how to use ISplitCanvas Open Class objects.

The program uses an IFrame window for the main application window. In that IFrame window it places a split canvas with a vertical split. In the left side of that canvas it places another split canvas, this time one with a horizontal split. It shows parts of the program source code in the top left and bottom left panes, and a bitmap in the right pane.

DB-Samples-SplitCanvas.gif

  • Zip file with source code and Freelance presentation (10,932 bytes) (NOTE: This file was missing from Web-Archive)

Main source code file spltsamp.cpp

/* Split Canvas sample program - Dave Briccetti (daveb@davebsoft.com), Dec. 1994

  +-------+-----+
  | MLE   | Bit |  This program shows two MLE-type windows on the top and
  |       | map |  bottom parts of the left side of the window, and a
  +-------+     |  bitmap on the right side.  It uses two split canvases:
  | MLE   |     |  one split vertically, and a smaller one split horizontally.
  +-------+-----+
*/

#include <iframe.hpp>                       // Frame
#include <isplitcv.hpp>                     // Split canvas
#include <imle.hpp>                         // Multi-line Edit
#include <ibmpctl.hpp>                      // Bitmap
#include <ifont.hpp>                        // Fonts

#include "ids.h"                            // Resources and window ids

class SourceDisplayMle : public IMultiLineEdit
{
   public:
       SourceDisplayMle (unsigned long id, IWindow* parent,
           IWindow* owner, char * pszFile);
};
 

void main()
{
   IFrameWindow frame                      // Create frame window
       ("Programming Tip -- Split Canvas");
   ISplitCanvas canvasFull                 // Create full canvas (frame child)
       (ID_CANVASFULL, &frame, &frame);
   ISplitCanvas canvasLeft                 // Create left side canvas
       (ID_CANVASLEFT, &canvasFull, &canvasFull);
   canvasLeft.setOrientation               // Make it split horizontally
       (ISplitCanvas::horizontalSplit);
   frame.setClient (&canvasFull);          // Make full canvas client of frame

   SourceDisplayMle mleSourceCode          // Create source display control
       (ID_MLESOURCECODE, &canvasLeft,     //   for C++ program
       &canvasLeft, "spltsamp.cpp");
   SourceDisplayMle mleResourceFile        // Create source display control
       (ID_MLERESOURCEFILE, &canvasLeft,   //   for resource file
       &canvasLeft, "spltsamp.rc");

   IBitmapControl bmpBookCover             // Create a bitmap control
       (ID_BITMAPCONTROL, &canvasFull,     //   with a resource bitmap
       &canvasFull, ID_BITMAPRESOURCE);

   canvasFull.setSplitWindowPercentage     // Allocate full canvas space
       (&canvasLeft, 55);                  //   for left canvas
   canvasFull.setSplitWindowPercentage     // Allocate full canvas space
       (&bmpBookCover, 45);                //   for bitmap

   canvasLeft.setSplitWindowPercentage     // Allocate left side canvas space
       (&mleSourceCode, 85);               //   for source code display
   canvasLeft.setSplitWindowPercentage     // Allocate canvas space
       (&mleResourceFile, 15);             //   for resource file display

   frame.setFocus ();                      // Set focus to the frame window
   frame.show ();                          // Show the frame

   IApplication::current().run();          // Run the application
}


SourceDisplayMle :: SourceDisplayMle        // Custom MLE window constructor
   (unsigned long id, IWindow* parent, IWindow* owner, char * pszFile) :
   IMultiLineEdit(id, parent, owner)       // Call IMle constructor
{
   disableDataUpdate ();                   // Make it read only
   disableWordWrap ();                     // Turn off word wrap
   IFont fontMono ("Courier", 8);          // Create a monospaced font
   setFont (fontMono);                     // Set monospaced font
   importFromFile (pszFile);               // Load source code into MLE
   setTop (0);                             // Set first line at top
}

Sprite Animator

Last Update: 30-Dec-1996

This program uses sprite animation and DIVE to animate sprites. It is constructed of parts, connected with the Visual Builder of IBM VisualAge C++. There is very little documentation at this point. The art was created by Steven Jones and other students.

DB-Samples-SpriteDemo.gif

DIVE DEMO 2 - Simple Animation

Last Update: 16-Jan-1996

This program contains an early version of "DBDiveParts," a set of Visual Builder parts which simplify high-speed animation. It comes with two sample renderer classes, which generate the frames of animation to be displayed.

DBDiveParts includes a part which wraps the high-resolution timer, timer0.sys, which provides to-the-millisecond precision for animation.

There is no documentation at this point. All the C++ code is generated by Visual Builder except files with extensions cppcst and hppcst. You will need HPFS, as well as the VisualAge C++ runtime DLL's. If you don't have the December 1996 CSD's applied, you will need to rebuild the demo.

DB-Samples-screen.gif