📄 mainwinp.c
字号:
XtVaSetValues(msgStatSetCB, XmNsubMenuId, msgStatSetPD, NULL); XtVaSetValues(msgStatClearCB, XmNsubMenuId, msgStatClearPD, NULL);//// Set initial sensitivities// XtSetSensitive(msgReplyPB, False); XtSetSensitive(msgReplyAllPB, False); XtSetSensitive(msgReplyIncPB, False); XtSetSensitive(msgReplyAllIncPB, False); XtSetSensitive(msgForwardPB, False); XtSetSensitive(msgForward822PB, False); XtSetSensitive(msgResendPB, False); XtSetSensitive(msgReadPB, False); XtSetSensitive(msgNextPB, False); XtSetSensitive(msgNextUnreadPB, False); XtSetSensitive(msgNextSenderPB, False); XtSetSensitive(msgNextSubjectPB, False); XtSetSensitive(msgPrevPB, False); XtSetSensitive(msgPrevUnreadPB, False); XtSetSensitive(msgPrevSenderPB, False); XtSetSensitive(msgPrevSubjectPB, False); XtSetSensitive(msgSavePB, False); XtSetSensitive(msgSavePatPB, False); XtSetSensitive(msgSaveSelPB, False); XtSetSensitive(msgSaveToPB, False); XtSetSensitive(msgSaveToFilePB, False); XtSetSensitive(msgSaveRecentCB, False); XtSetSensitive(msgSaveQuickCB, False); XtSetSensitive(msgPrintPB, False); XtSetSensitive(msgPipePB, False); XtSetSensitive(msgDelPB, False); XtSetSensitive(msgUndelLastPB, False); XtSetSensitive(msgUndelSelPB, False); XtSetSensitive(msgUndelListPB, False); XtSetSensitive(msgStatCB, False); XtSetSensitive(msgSelPB, False); XtSetSensitive(msgDeselPB, False); XtSetSensitive(msgFindPB, False); //AddCascading(msgSaveRecentCB, PrepareRecentMenu, this); AddCascading(msgSaveQuickCB, PrepareSaveQuickMenu, this); AddActivate(msgComposePB, DoMsgCompose, this); AddActivate(msgReplyPB, DoMsgReply, this); AddActivate(msgReplyIncPB, DoMsgReplyInc, this); AddActivate(msgReplyAllPB, DoMsgReplyAll, this); AddActivate(msgReplyAllIncPB, DoMsgReplyAllInc, this); AddActivate(msgForwardPB, DoMsgForward, this); AddActivate(msgForward822PB, DoMsgForward822, this); AddActivate(msgResendPB, DoMsgResend, this); AddActivate(msgReadPB, DoMsgRead, this); AddActivate(msgNextPB, DoMsgNext, this); AddActivate(msgNextUnreadPB, DoMsgNextUnread, this); AddActivate(msgNextSenderPB, DoMsgNextSender, this); AddActivate(msgNextSubjectPB, DoMsgNextSubject, this); AddActivate(msgPrevPB, DoMsgPrev, this); AddActivate(msgPrevUnreadPB, DoMsgPrevUnread, this); AddActivate(msgPrevSenderPB, DoMsgPrevSender, this); AddActivate(msgPrevSubjectPB, DoMsgPrevSubject, this); AddActivate(msgSavePB, DoMsgSave, this); AddActivate(msgSavePatPB, DoMsgSavePat, this); AddActivate(msgSaveSelPB, DoMsgSaveSel, this); AddActivate(msgSaveToPB, DoMsgSaveTo, this); AddActivate(msgSaveToFilePB, DoMsgSaveToFile, this); AddActivate(msgPrintPB, DoMsgPrint, this); AddActivate(msgPipePB, DoMsgPipe, this); AddActivate(msgDelPB, DoMsgDel, this); AddActivate(msgUndelLastPB, DoMsgUndelLast, this); AddActivate(msgUndelSelPB, DoMsgUndelSel, this); AddActivate(msgUndelListPB, DoMsgUndelList, this); AddActivate(msgMarkReadPB, DoMsgMarkRead, this); AddActivate(msgMarkUnreadPB, DoMsgMarkUnread, this); AddActivate(msgMarkNewPB, DoMsgMarkNew, this); AddActivate(msgSetSavedPB, DoMsgSetSaved, this); AddActivate(msgSetRepliedPB, DoMsgSetReplied, this); AddActivate(msgSetForwardedPB, DoMsgSetForwarded, this); AddActivate(msgSetResentPB, DoMsgSetResent, this); AddActivate(msgSetPrintedPB, DoMsgSetPrinted, this); AddActivate(msgSetFilteredPB, DoMsgSetFiltered, this); AddActivate(msgClearAllPB, DoMsgClearAll, this); AddActivate(msgClearSavedPB, DoMsgClearSaved, this); AddActivate(msgClearRepliedPB, DoMsgClearReplied, this); AddActivate(msgClearForwardedPB, DoMsgClearForwarded, this); AddActivate(msgClearResentPB, DoMsgClearResent, this); AddActivate(msgClearPrintedPB, DoMsgClearPrinted, this); AddActivate(msgClearFilteredPB, DoMsgClearFiltered, this); AddActivate(msgSelPB, DoMsgSel, this); AddActivate(msgDeselPB, DoMsgDesel, this); AddActivate(msgFindPB, DoMsgFind, this);} // End BuildMsgMenu/*--------------------------------------------------------------- * Method to build option menu hierarchy */voidMainWinP::BuildOptMenu(){ WArgList args; Cardinal wcount; Widget wlist[24];//// Create cascade button and pulldown menu// Widget optCB = XmCreateCascadeButton(pub->menuBar, "optCB", 0,0); Widget optPD = XmCreatePulldownMenu (pub->menuBar, "optPD", 0,0); XtVaSetValues(optCB, XmNsubMenuId, optPD, NULL); XtManageChild(optCB);//// Create optPD hierarchy//// optPD// PushButton optPrefPB// PushButton optReadPB// PushButton optSendPB// PushButton optMailPB// PushButton optSigPB// PushButton optReplyPB// Separator optSep1// PushButton optConfirmPB// PushButton optHeadPB// PushButton optAliasPB// PushButton optGroupAliasPB// PushButton optAlertPB// PushButton optIconPB// PushButton optSavePB// PushButton optAutoFilePB// Separator optSep2// PushButton optFontPB// PushButton optButtPB// PushButton optSummPB// PushButton optFolderPB// Separator optSep3// PushButton optSortPB// Widget optPrefPB = XmCreatePushButton(optPD, "optPrefPB", 0,0); Widget optReadPB = XmCreatePushButton(optPD, "optReadPB", 0,0); Widget optSendPB = XmCreatePushButton(optPD, "optSendPB", 0,0); Widget optMailPB = XmCreatePushButton(optPD, "optMailPB", 0,0); Widget optSigPB = XmCreatePushButton(optPD, "optSigPB", 0,0); Widget optReplyPB = XmCreatePushButton(optPD, "optReplyPB", 0,0); Widget optSep1 = XmCreateSeparator (optPD, "optSep1", 0,0); Widget optConfirmPB = XmCreatePushButton(optPD, "optConfirmPB", 0,0); Widget optHeadPB = XmCreatePushButton(optPD, "optHeadPB", 0,0); Widget optAliasPB = XmCreatePushButton(optPD, "optAliasPB", 0,0); Widget optGroupAliasPB = NULL; if ( access(ishApp->aliasPrefs->GroupMailrcFile(), R_OK|W_OK) == 0 ) optGroupAliasPB = XmCreatePushButton(optPD, "optGroupAliasPB",0,0); Widget optAlertPB = XmCreatePushButton(optPD, "optAlertPB", 0,0); Widget optIconPB = XmCreatePushButton(optPD, "optIconPB", 0,0); Widget optSavePB = XmCreatePushButton(optPD, "optSavePB", 0,0); Widget optAutoFilePB= XmCreatePushButton(optPD, "optAutoFilePB",0,0); Widget optSep2 = XmCreateSeparator (optPD, "optSep2", 0,0); Widget optFontPB = XmCreatePushButton(optPD, "optFontPB", 0,0); Widget optButtPB = XmCreatePushButton(optPD, "optButtPB", 0,0); Widget optSummPB = XmCreatePushButton(optPD, "optSummPB", 0,0); Widget optFolderPB = XmCreatePushButton(optPD, "optFolderPB", 0,0); Widget optSep3 = XmCreateSeparator (optPD, "optSep3", 0,0); Widget optSortPB = XmCreatePushButton(optPD, "optSortPB", 0,0); wcount = 0; wlist[wcount++] = optPrefPB; wlist[wcount++] = optReadPB; wlist[wcount++] = optSendPB; wlist[wcount++] = optMailPB; wlist[wcount++] = optSigPB; wlist[wcount++] = optReplyPB; wlist[wcount++] = optSep1; wlist[wcount++] = optConfirmPB; wlist[wcount++] = optHeadPB; wlist[wcount++] = optAliasPB; if ( optGroupAliasPB ) wlist[wcount++] = optGroupAliasPB; wlist[wcount++] = optAlertPB; wlist[wcount++] = optIconPB; wlist[wcount++] = optSavePB; wlist[wcount++] = optAutoFilePB; wlist[wcount++] = optSep2; wlist[wcount++] = optFontPB; wlist[wcount++] = optButtPB; wlist[wcount++] = optSummPB; wlist[wcount++] = optFolderPB; wlist[wcount++] = optSep3; wlist[wcount++] = optSortPB; XtManageChildren(wlist, wcount); AddActivate(optPrefPB, DoOptApp, this); AddActivate(optReadPB, DoOptRead, this); AddActivate(optSendPB, DoOptSend, this); AddActivate(optMailPB, DoOptMail, this); AddActivate(optSigPB, DoOptSig, this); AddActivate(optReplyPB, DoOptReply, this); AddActivate(optConfirmPB, DoOptConf, this); AddActivate(optHeadPB, DoOptHead, this); AddActivate(optAliasPB, DoOptAlias, this); if ( optGroupAliasPB ) AddActivate(optGroupAliasPB, DoOptGroup, this); AddActivate(optAlertPB, DoOptAlert, this); AddActivate(optIconPB, DoOptIcon, this); AddActivate(optSavePB, DoOptSave, this); AddActivate(optAutoFilePB, DoOptAuto, this); AddActivate(optFontPB, DoOptFont, this); AddActivate(optButtPB, DoOptButt, this); AddActivate(optSummPB, DoOptSumm, this); AddActivate(optFolderPB, DoOptFolder, this); AddActivate(optSortPB, DoOptSort, this);} // End BuildOptMenu/*--------------------------------------------------------------- * Method to build help menu hierarchy */voidMainWinP::BuildHelpMenu(){ pub->AddHelpMenu();//// Add buttons for getting to the user's guide and sending comments// if ( pub->helpPD) { Widget wlist[4]; Widget helpSep2 = XmCreateSeparator (pub->helpPD, "helpSep2", 0,0); Widget helpGuidePB = XmCreatePushButton(pub->helpPD, "helpGuidePB", 0,0); Widget helpSep3 = XmCreateSeparator (pub->helpPD, "helpSep3", 0,0); Widget helpCommentPB = XmCreatePushButton(pub->helpPD, "helpCommentPB", 0,0); wlist[0] = helpSep2; wlist[1] = helpGuidePB; wlist[2] = helpSep3; wlist[3] = helpCommentPB; XtManageChildren(wlist, 4); AddActivate(helpGuidePB, DoHelpGuide, this); AddActivate(helpCommentPB, DoHelpComment, this); }} // End BuildHelpMenu/*--------------------------------------------------------------- * Method to build the widgets in the main window */voidMainWinP::BuildWidgets(){ WArgList args; Widget wlist[4];//// Create appForm hierarchy//// appForm// PanedWindow panedWin// args.Reset(); args.LeftAttachment(XmATTACH_FORM); args.RightAttachment(XmATTACH_FORM); args.TopAttachment(XmATTACH_FORM); args.BottomAttachment(XmATTACH_FORM); Widget panedWin = XmCreatePanedWindow(pub->appForm, "panedWin", ARGS);//// Create panedWin hierarchy//// panedWin// Form folderForm// TBoxC msgTBox// args.Reset(); args.AllowResize(True); Widget folderForm = XmCreateForm(panedWin, "folderForm", 0,0);//// Create folderForm hierarchy//// folderForm// Label folderTitle// VBoxC folderVBox// args.Reset(); args.TopAttachment(XmATTACH_FORM); args.LeftAttachment(XmATTACH_FORM); Widget folderTitle = XmCreateLabel(folderForm, "folderTitle", ARGS); folderVBox = new VBoxC(folderForm, "folderBox"); args.Reset(); args.TopAttachment(XmATTACH_WIDGET, folderTitle); args.LeftAttachment(XmATTACH_FORM); args.RightAttachment(XmATTACH_FORM); args.BottomAttachment(XmATTACH_FORM); XtSetValues(*folderVBox, ARGS); folderVBox->DisablePopupMenu(); folderVBox->HideStatus(); folderVBox->SetSorted(ishApp->folderPrefs->SortFolders()); folderVBox->AddSelectChangeCallback((CallbackFn *)ChangeFolderSelection, this); folderVBox->AddDropCallback((CallbackFn *)FolderDrop, this); folderVBox->SetCompareFunction((CompareFn)FolderCompare);//// Register folder box as a drop site for message icons// Atom impAtoms[1]; impAtoms[0] = ishApp->msgAtom; folderVBox->DisableDrag(); folderVBox->EnableDrop(); folderVBox->SetDropAtoms(impAtoms, 1); wlist[0] = folderTitle; wlist[1] = *folderVBox; XtManageChildren(wlist, 2); // folderForm children//// Create message task box// msgTBox = new TBoxC(panedWin, "msgBox"); msgVBox = &msgTBox->VBox();#if 0 args.Reset(); args.AllowResize(True); XtSetValues(*msgTBox, ARGS);#endif msgVBox->DisablePopupMenu(); msgVBox->HideStatus(); msgVBox->EnableDrag(); msgVBox->DisableDrop(); msgVBox->SetSorted(True); msgVBox->AddSelectChangeCallback((CallbackFn *)ChangeMsgSelection, this); msgVBox->SetCompareFunction((CompareFn)MsgItemC::MsgItemCompare); msgVBox->AddDragCallback((CallbackFn *)MsgDrag, this);//// Add field view to msgTBox// fieldView = new FieldViewC(msgVBox); viewType = msgVBox->AddView(*fieldView); if ( ishApp->sumPrefs->showPixmaps) fieldView->ShowPixmaps(); else fieldView->HidePixmaps(); wlist[0] = folderForm; wlist[1] = *msgTBox; XtManageChildren(wlist, 2); // panedWin children XtManageChild(panedWin); // appForm children BuildFolderPopupMenu(); BuildMsgPopupMenu(); BuildRecentFolderMenus(); ishApp->appPrefs->AddRecentChangeCallback((CallbackFn*)RecentListChanged, this); pub->ShowInfoMsg(); pub->HandleHelp();} // End BuildWidgets/*--------------------------------------------------------------- * Method to build the widgets in the message popup menu */voidMainWinP::BuildMsgPopupMenu(){ WArgList args; Cardinal wcount; Widget wlist[16];//// Create msgPU hierarchy//// msgPU// Label msgPULabel// Separator msgPUSep1// PushButton msgPUReadPB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -