Back to index

lightning-sunbird  0.9+nobinonly
Functions
EvtHandlers.c File Reference
#include "MacInstallWizard.h"

Go to the source code of this file.

Functions

void HandleNextEvent (EventRecord *nextEvt)
void HandleMouseDown (EventRecord *evt)
void HandleKeyDown (EventRecord *evt)
void HandleMenuChoice (SInt32 aChoice)
void HandleUpdateEvt (EventRecord *evt)
void HandleActivateEvt (EventRecord *evt)
void HandleOSEvt (EventRecord *evt)
void React2InContent (EventRecord *evt, WindowPtr wCurrPtr)
Boolean DidUserCancel (EventRecord *evt)

Function Documentation

Boolean DidUserCancel ( EventRecord *  evt)

Definition at line 391 of file EvtHandlers.c.

{
    GrafPtr oldPort;
    Boolean bUserCancelled = false;
    Point localPt;
    Rect r;
    ControlPartCode  part;

    GetPort(&oldPort);
       SetPort(gWPtr);
       localPt = evt->where;
       GlobalToLocal(&localPt);
       
    HLock((Handle)gControls->cancelB);
       r = (**(gControls->cancelB)).contrlRect;
       HUnlock((Handle)gControls->cancelB);
       if (PtInRect(localPt, &r))
       {
           if (gControls->state == eInstallNotStarted)
           {
              part = TrackControl(gControls->cancelB, evt->where, NULL);
              if (part)
              {
                  gDone = true;  
                bUserCancelled = true;
           }
       }
       }
       
    SetPort(oldPort);
    return bUserCancelled;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HandleActivateEvt ( EventRecord *  evt)

Definition at line 283 of file EvtHandlers.c.

{
       // TO DO
}

Here is the caller graph for this function:

void HandleKeyDown ( EventRecord *  evt)

Definition at line 121 of file EvtHandlers.c.

{
       char                 keyPressed;
       unsigned long        finalTicks;
              
       keyPressed = evt->message & charCodeMask;
#ifdef MIW_DEBUG
       if ( (keyPressed == 'z') || (keyPressed == 'Z'))
              gDone = true; // backdoor exit
#endif
       switch(keyPressed)                   //dougt: what about tab, esc, arrows, doublebyte?
       {             
              case '\r':
              case '\3':
                     if (gControls->nextB && !gInstallStarted)
                     {
                            HiliteControl(gControls->nextB, 1);
                            Delay(8, &finalTicks);
                            HiliteControl(gControls->nextB, 0);
                     }

                     switch(gCurrWin)
                     {
                case kWelcomeID:                        
                                   KillControls(gWPtr);
                                   ShowLicenseWin();
                                   return;
                            case kLicenseID:
                                   KillControls(gWPtr);
                                   ShowSetupTypeWin();
                                   return;
                            case kSetupTypeID:
                                   ClearDiskSpaceMsgs();
                                   KillControls(gWPtr); 
                                   /* treat last setup type selection as custom */
                                   if (gControls->opt->instChoice == gControls->cfg->numSetupTypes)
                                          ShowComponentsWin();
                                   else
                                          ShowTerminalWin();
                                   return;                            
                            case kComponentsID:         
                    gControls->cw->compListBox.top = 0;
                    EraseRect(&gControls->cw->compListBox);                  
                                   ClearDiskSpaceMsgs();
                                   KillControls(gWPtr);
                                   if (gControls->cfg->bAdditionsExist)
                                          ShowAdditionsWin();
                                   else
                                          ShowTerminalWin();
                                   return;
                            case kAdditionsID:
                                   KillControls(gWPtr);                             
                    gControls->aw->compListBox.top = 0;
                    EraseRect(&gControls->aw->compListBox);                                
                                   ClearDiskSpaceMsgs();
                                   ShowTerminalWin();
                                   return;
                            case kTerminalID:
                                   if (!gInstallStarted)
                                   {      
                        BeginInstall();
                                   }
                                   return;
                            default:
                                   break; // never reached
                     }
              break;
              
              default:
                     break; 
       }
       
       if ( (evt->modifiers & cmdKey) != 0 )
       {
              switch(keyPressed)
              {
                     case 'Q':
                     case 'q':
                     case '.':
                            gDone = true;
                            break;
                            
                     default:
                            break;
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HandleMenuChoice ( SInt32  aChoice)

Definition at line 209 of file EvtHandlers.c.

{
       long menuID = HiWord(aChoice);
       long menuItem = LoWord(aChoice);
       
       switch(menuID)
       {
              case mApple:
                     if (menuItem == iAbout)
                     {
                            Alert(rAboutBox, nil);
                     }
                     break;
              
              case mFile:
                     if (menuItem == iQuit)
                            gDone = true;        
                     break;
                            
              default:
                     break;
       }
}

Here is the caller graph for this function:

void HandleMouseDown ( EventRecord *  evt)

Definition at line 84 of file EvtHandlers.c.

{
       WindowPtr                   wCurrPtr;
       SInt16                      cntlPartCode;
       SInt32                      menuChoice;
       
       cntlPartCode = FindWindow(evt->where, &wCurrPtr);
       
       switch(cntlPartCode)
       {
              case inMenuBar:
                     menuChoice = MenuSelect(evt->where);
                     HandleMenuChoice(menuChoice);
                     InvalMenuBar();
                     break;
              
              case inContent:
                     if (wCurrPtr != FrontWindow())
                     {
                            /* InvalRect(&qd.screenBits.bounds); */
                            SelectWindow(wCurrPtr);
                     }
                     else
                            React2InContent(evt, wCurrPtr);
                     break;
              
              case inDrag:
                     DragWindow(wCurrPtr, evt->where, &qd.screenBits.bounds);
                     InvalRect(&qd.screenBits.bounds);
                     break;
                     
              case inGoAway:
                     // TO DO
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HandleNextEvent ( EventRecord *  nextEvt)

Definition at line 46 of file EvtHandlers.c.

{
       switch(nextEvt->what)
       {
              case mouseDown:
                     HandleMouseDown(nextEvt);
                     break;
                     
              case mouseUp:
                     if (gCurrWin == kComponentsID)
                            InComponentsContent(nextEvt, gWPtr);
                     else if (gCurrWin == kAdditionsID)
                            InAdditionsContent(nextEvt, gWPtr);
                     break;
                     

              case keyDown:
                     HandleKeyDown(nextEvt);
                     break;
                     
              case updateEvt:
                     HandleUpdateEvt(nextEvt);
                     break;
                     
              case activateEvt:
                     HandleActivateEvt(nextEvt);
                     break;
                     
              case osEvt:
                     HandleOSEvt(nextEvt);
                     break;
              
              case nullEvent:
                     TEIdle(gControls->lw->licTxt);
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HandleOSEvt ( EventRecord *  evt)

Definition at line 288 of file EvtHandlers.c.

{
       HiliteMenu(0);
       
       switch ( (evt->message >> 24) & 0x000000FF)
       {
              case suspendResumeMessage:
                     if ((evt->message & resumeFlag) == 1)
                     {
                            switch(gCurrWin)
                            {
                                   case kLicenseID:
                                          EnableLicenseWin();
                                          break;
                                   case kWelcomeID:
                                          EnableWelcomeWin();
                                          break;
                                   case kSetupTypeID:
                                          EnableSetupTypeWin();
                                          break;
                                   case kComponentsID:
                                          EnableComponentsWin();
                                          break;
                                   case kAdditionsID:
                                          EnableAdditionsWin();
                                          break;
                                   case kTerminalID:
                                          EnableTerminalWin();
                                          break;
                            }
                            
                            InvalRect(&gWPtr->portRect);
                     }
                     else
                     {
                            switch(gCurrWin)
                            {
                                   case kLicenseID:
                                          DisableLicenseWin();
                                          break;
                                   case kWelcomeID:
                                          DisableWelcomeWin();
                                          break;
                                   case kSetupTypeID:
                                          DisableSetupTypeWin();
                                          break;
                                   case kComponentsID:
                                          DisableComponentsWin();
                                          break;
                                   case kAdditionsID:
                                          DisableAdditionsWin();
                                          break;
                                   case kTerminalID:
                                          DisableTerminalWin();
                                          break;
                            }
                            
                            InvalRect(&gWPtr->portRect);
                     }      
       
              default:
                     break;                             
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HandleUpdateEvt ( EventRecord *  evt)

Definition at line 233 of file EvtHandlers.c.

{
    Boolean bDefault = true;
       
       GrafPtr       oldPort;
       GetPort(&oldPort);
       
       SetPort( gWPtr );

       if (gWPtr != NULL)
       {
              BeginUpdate( gWPtr );
              DrawControls( gWPtr );
              ShowLogo(false);
       
              switch(gCurrWin)
              {
                     case kWelcomeID:
                         break;
            case kLicenseID:
                            ShowTxt();
                            break;
                     case kSetupTypeID:
                            ShowSetupDescTxt();
                            break;
                     case kComponentsID:
                            UpdateCompWin();
                            break;
                     case kAdditionsID:
                            UpdateAdditionsWin();
                            break;
                     case kTerminalID:
                            UpdateTerminalWin();
                            break;
                     default:
                            break;
              }
              
              if (gControls->nextB)
              {
            SetControlData(gControls->nextB, kControlNoPart, 
                kControlPushButtonDefaultTag, sizeof(bDefault),(Ptr) &bDefault);
              }
       
              EndUpdate( gWPtr );
       }
       
       SetPort(oldPort);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void React2InContent ( EventRecord *  evt,
WindowPtr  wCurrPtr 
)

Definition at line 353 of file EvtHandlers.c.

{      
    if (DidUserCancel(evt))
        return;
        
       switch (gCurrWin)
       {
              case kLicenseID:
                     InLicenseContent(evt, gWPtr);
                     break;
                     
              case kWelcomeID:
                     InWelcomeContent(evt, gWPtr);
                     break;
                     
              case kSetupTypeID:
                     InSetupTypeContent(evt, gWPtr);
                     break;
                     
              case kComponentsID:
                     InComponentsContent(evt, gWPtr);
                     break;
              
              case kAdditionsID:
                     InAdditionsContent(evt, gWPtr);
                     break;
                     
              case kTerminalID:
                     InTerminalContent(evt, gWPtr);
                     break;
                     
              default:
                     gDone = true;
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function: