gPrintSettings->SetPrintFrameType(nsIPrintOptions::kEachFrameSep);
gPrintSettings->SetPrintFrameType(nsIPrintSettings::kEachFrameSep);
static pascal void MyJobItems(DialogPtr aDialog, short aItemNo){short   myItem, firstItem, i, itemType;short   value;Rect    itemBox;Handle  itemH;  firstItem = prFirstItem;    myItem = aItemNo-firstItem+1;  if (myItem>0) {    switch (myItem) {      case ePrintSelectionCheckboxID:        ::GetDialogItem(aDialog, firstItem, &itemType, &itemH, &itemBox);        gPrintSelection = !gPrintSelection;        ::SetControlValue((ControlHandle)itemH, gPrintSelection);        break;      case ePrintFrameAsIsCheckboxID:      case ePrintSelectedFrameCheckboxID:      case ePrintAllFramesCheckboxID:        for (i=ePrintFrameAsIsCheckboxID; i<=ePrintAllFramesCheckboxID; i++){          ::GetDialogItem(aDialog, firstItem+i-1, &itemType, &itemH, &itemBox);          ::SetControlValue((ControlHandle)itemH, i==myItem);        }        break;              default:        break;    }  } else {    // chain to standard Item handler    CallPItemProc(prPItemProc, aDialog, aItemNo);        if (((TPPrDlg)aDialog)->fDone)    {      //nsCOMPtr<nsIPrintOptions> printOptionsService = do_GetService("@mozilla.org/gfx/printoptions;1");      // cleanup and set the print options to what we want      if (gPrintSettings)      {        // print selection        ::GetDialogItem(aDialog, firstItem+ePrintSelectionCheckboxID-1, &itemType, &itemH, &itemBox);        value = ::GetControlValue((ControlHandle)itemH);        if (1==value){          gPrintSettings->SetPrintRange(nsIPrintOptions::kRangeSelection);        } else {          gPrintSettings->SetPrintRange(nsIPrintOptions::kRangeAllPages);        }                // print frames as is        ::GetDialogItem(aDialog, firstItem+ePrintFrameAsIsCheckboxID-1, &itemType, &itemH, &itemBox);        value = ::GetControlValue((ControlHandle)itemH);        if (1==value){          gPrintSettings->SetPrintFrameType(nsIPrintOptions::kFramesAsIs);        }                // selected frame        ::GetDialogItem(aDialog, firstItem+ePrintSelectedFrameCheckboxID-1, &itemType, &itemH, &itemBox);        value = ::GetControlValue((ControlHandle)itemH);        if (1==value){          gPrintSettings->SetPrintFrameType(nsIPrintOptions::kSelectedFrame);        }                // print all frames        ::GetDialogItem(aDialog, firstItem+ePrintAllFramesCheckboxID-1, &itemType, &itemH, &itemBox);        value = ::GetControlValue((ControlHandle)itemH);        if (1==value){          gPrintSettings->SetPrintFrameType(nsIPrintOptions::kEachFrameSep);        }              }    }  }}