home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * File: CDividedPaneDemoDir.c
- * Module: CDividedPaneDemoDir method definitions
- * System: Showcase Application
- * Evironment: MacOS 7.0/THINK C 5.0/TCL 1.1.1
- * Author: Mark Alldritt
- *
- *
- * Copyright © 1992 All Rights Reserved
- * Mark Alldritt
- * 1571 Deep Cove Road
- * N. Vancouver, B.C. CANADA
- *
- *
- * Description:
- *
- * This class implements a demonstration of the CDividedPane class. To build this demo
- * follow these steps:
- *
- * 1) Add all source files to the CSApplication project
- *
- * CDividedPane
- * CDividedPaneDemoDir [only required for the demo]
- *
- * 2) Add all the resources in "CDividedPaneDemo.rsrc" to the Showcase Application
- * resource file "CSAApplication π.rsrc".
- *
- * Edit History:
- *
- * V01-01 Mark Alldritt 11-Oct-1992
- * - Initial version of module.
- *
- */
-
-
- #include "CDividedPaneDemoDir.h"
- #include "CDividedPane.h"
-
- #include <CScrollPane.h>
- #include <CPicture.h>
- #include <CEditText.h>
- #include <CWindow.h>
- #include <CDesktop.h>
- #include <CDecorator.h>
-
-
- extern CDesktop *gDesktop;
- extern CDecorator *gDecorator;
-
-
- #define WIND_DividedPaneDemo 3000
- #define PICT_Demo 3000
- #define DIVIDER_SIZE 3
- #define MIN_TOP 70
- #define MIN_BOTTOM 50
-
- void CDividedPaneDemoDir::INewDemo( CDirectorOwner *aSupervisor)
- {
- CDividedPane *mainPane;
- CScrollPane *scrollPane;
- CPicture *pictPane;
- CEditText *textPane;
- LongRect frame;
-
- inherited::INewDemo( aSupervisor);
-
- /* Build the window were going to display all this stuff in */
-
- itsWindow = new(CWindow);
- itsWindow->IWindow( WIND_DividedPaneDemo, false, gDesktop, this);
- itsWindow->GetFrame(&frame);
-
- /* Build the divided pane. For this demo, the pane is divided horizontally, but to
- * divide it vertically change the TRUE to FALSE in the IDividedPane call.
- */
-
- mainPane = new(CDividedPane);
- mainPane->IDividedPane(itsWindow, this,
- frame.right, frame.bottom, 0, 0,
- sizELASTIC, sizELASTIC,
- TRUE, (frame.bottom - frame.top - DIVIDER_SIZE) / 2, DIVIDER_SIZE,
- MIN_TOP, MIN_BOTTOM);
-
- /* Display a picture in the top pane, within a scroll pane. */
-
- mainPane->Get1stPane()->GetFrame(&frame);
- scrollPane = new(CScrollPane);
- scrollPane->IScrollPane(mainPane->Get1stPane(), this, frame.right, frame.bottom, 0, 0,
- sizELASTIC, sizELASTIC, FALSE, TRUE, FALSE);
- scrollPane->SetSteps(30, 30);
-
- pictPane = new(CPicture);
- pictPane->IPicture(scrollPane, scrollPane, 0, 0, 0, 0, sizELASTIC, sizELASTIC);
- pictPane->FitToEnclosure(TRUE, TRUE);
- scrollPane->InstallPanorama(pictPane);
- pictPane->UsePICT(PICT_Demo);
-
- /* Display some descriptive text in the bottom pane. */
-
- mainPane->Get2ndPane()->GetFrame(&frame);
- scrollPane = new(CScrollPane);
- scrollPane->IScrollPane(mainPane->Get2ndPane(), this, frame.right, frame.bottom, 0, 0,
- sizELASTIC, sizELASTIC, TRUE, TRUE, TRUE);
- scrollPane->SetSteps(30, 30);
-
- pictPane = new(CPicture);
- pictPane->IPicture(scrollPane, scrollPane, 0, 0, 0, 0, sizELASTIC, sizELASTIC);
- pictPane->FitToEnclosure(TRUE, TRUE);
- scrollPane->InstallPanorama(pictPane);
- pictPane->UsePICT(PICT_Demo);
-
- /* Display the whole works. */
-
- gDecorator->CenterWindow(itsWindow);
- itsWindow->Select();
- }