home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-30 | 4.4 KB | 132 lines | [TEXT/CWIE] |
- // ===========================================================================
- // LAGADialogBox.cp
- // ===========================================================================
- // “Apple Grayscale Appearance” compliant dialog box content
- // Copyright © 1996 Chrisoft (Christophe ANDRES) All rights reserved.
- //
- // You may use this source code in any application (commercial, shareware, freeware,
- // postcardware, etc), but not remove this notice (no need to acknowledge the use of
- // this class in the about box)
- // You may not sell this source code in any form. This source code may be placed on
- // publicly accessable archive sites and source code disks. It may not be placed on
- // profit archive sites and source code disks without the permission of the author,
- // Christophe ANDRES.
- //
- // This source code is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- //
- // If you make any change or improvement on this class, please send the improved/changed
- // version to : chrisoft@calva.net or Christophe ANDRES
- // 20, rue Prosper Mérimée
- // 67100 STRASBOURG
- // FRANCE
- //
- // ===========================================================================
- // LAGADialogBox.h <- double-click + Command-D to see class declaration
- //
- // LAGADialogBox is my implementation of the “Apple Grayscale Appearance for System 7.5”
- // dialog box content. This class set the background color to 0xDDDD (color 2) for all
- // three RGB components and uses the LAGADefaultOutline to put an outline arund the
- // default button This default button should be of LAGAPushButton to achieve the desired
- // result.
- //
- // This class requires LAGADefaultOutline.cp to be present in your project
- //
- // Version : 1.2
- //
- // Change History (most recent first, date in US form : mm/dd/yy):
- //
- // 06/30/96 ca Public release of version 1.2
- // 06/05/96 ca Added RegisterClass method to ease registry
- // Increased version to 1.2
- // Added change history
- // 04/22/96 ca class made available by Christophe ANDRES <chrisoft@calva.net>
- // (version 1.0)
- //
- // To Do:
- //
-
- #include "LAGADialogBox.h"
- #include "LAGADefaultOutline.h"
-
- // begin <06/05/96 ca>
- void LAGADialogBox::RegisterClass ()
-
- {
- URegistrar::RegisterClass(LAGADialogBox::class_ID, (ClassCreatorFunc)LAGADialogBox::CreateAGADialogBoxStream);
- }
- // end <06/05/96 ca>
-
- LAGADialogBox* LAGADialogBox::CreateAGADialogBoxStream (LStream *inStream)
-
- {
- return (new LAGADialogBox(inStream));
- }
-
- //-------Constructors-------------------------------------------------------------------------------------------------
-
- LAGADialogBox::LAGADialogBox ()
-
- {
- InitAGADialogBox();
- }
-
- LAGADialogBox::LAGADialogBox (LStream *inStream) : LDialogBox(inStream)
-
- {
- InitAGADialogBox();
- }
-
- void LAGADialogBox::InitAGADialogBox ()
-
- {
- mBackColor.red = mBackColor.green = mBackColor.blue = 0xDDDD;
- }
-
- void LAGADialogBox::FinishCreateSelf ()
-
- {
- LControl *theControl; // Link DialogBox as a Listener to the
- // Default and Cancel Buttons
-
- theControl = (LControl*) FindPaneByID(mDefaultButtonID);
- if (theControl != nil)
- {
- theControl->AddListener(this);
- mDefaultOutline = new LAGADefaultOutline(theControl);
- }
-
- theControl = (LControl*) FindPaneByID(mCancelButtonID);
- if (theControl != nil)
- {
- theControl->AddListener(this);
- }
- }
-
- void LAGADialogBox::FindCommandStatus (CommandT inCommand, Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName)
- {
- // Don't enable any commands except cmd_About, which will keep
- // the Apple menu enabled. This function purposely does not
- // call the inherited FindCommandStatus, thereby suppressing
- // commands that are handled by SuperCommanders. Only those
- // commands enabled by SubCommanders will be active.
- //
- // This is usually what you want for a movable modal dialog.
- // Commands such as "New", "Open" and "Quit" that are handled
- // by the Application are disabled, but items within the dialog
- // can enable commands. For example, an edit field would enable
- // items in the "Edit" menu.
-
- // Disable all commands.
- outEnabled = false;
-
- if (inCommand == cmd_About)
- {
- // Enable the about command.
- outEnabled = true;
- }
- }
-
-