📄 sendwinp.c
字号:
SendWinP::BuildEditMenu(){ Cardinal wcount; Widget wlist[24]; WArgList args; editCB = XmCreateCascadeButton(pub->menuBar, "editCB", 0,0); editPD = XmCreatePulldownMenu (pub->menuBar, "editPD", 0,0); XtVaSetValues(editCB, XmNsubMenuId, editPD, NULL); XtManageChild(editCB);//// Create editPD hierarchy//// editPD// PushButton editUndeletePB// Separator editSep1// PushButton editPlainPB// PushButton editBoldPB// PushButton editItalicPB// PushButton editFixedPB// PushButton editUnderPB// Separator editSep2// PushButton editBiggerPB// PushButton editSmallerPB// CascadeButton editColorCB// Separator editSep3// PushButton editLeftPB// PushButton editRightPB// PushButton editBothPB// PushButton editCenterPB// PushButton editNoFillPB// Separator editSep4// PushButton editExcerptMorePB// PushButton editExcerptLessPB// PushButton editLeftInPB// PushButton editLeftOutPB// PushButton editRightInPB// PushButton editRightOutPB// editUndeletePB = XmCreatePushButton(editPD, "editUndeletePB", 0,0); Widget editSep1 = XmCreateSeparator (editPD, "editSep1", 0,0); editPlainPB = XmCreatePushButton(editPD, "editPlainPB", 0,0); editBoldPB = XmCreatePushButton(editPD, "editBoldPB", 0,0); editItalicPB = XmCreatePushButton(editPD, "editItalicPB", 0,0); editFixedPB = XmCreatePushButton(editPD, "editFixedPB", 0,0); editUnderPB = XmCreatePushButton(editPD, "editUnderPB", 0,0); Widget editSep2 = XmCreateSeparator (editPD, "editSep2", 0,0); editBiggerPB = XmCreatePushButton(editPD, "editBiggerPB", 0,0); editSmallerPB = XmCreatePushButton(editPD, "editSmallerPB", 0,0); editColorCB = XmCreateCascadeButton(editPD, "editColorCB", 0,0); Widget editSep3 = XmCreateSeparator (editPD, "editSep3", 0,0); editLeftPB = XmCreatePushButton(editPD, "editFlushLeftPB", 0,0); editRightPB = XmCreatePushButton(editPD, "editFlushRightPB", 0,0); editBothPB = XmCreatePushButton(editPD, "editFlushBothPB", 0,0); editCenterPB = XmCreatePushButton(editPD, "editCenterPB", 0,0); editNoFillPB = XmCreatePushButton(editPD, "editNoFillPB", 0,0); Widget editSep4 = XmCreateSeparator (editPD, "editSep4", 0,0); editExcMorePB = XmCreatePushButton(editPD, "editExcerptMorePB", 0,0); editExcLessPB = XmCreatePushButton(editPD, "editExcerptLessPB", 0,0); editLeftInPB = XmCreatePushButton(editPD, "editLeftMarginInPB", 0,0); editLeftOutPB = XmCreatePushButton(editPD, "editLeftMarginOutPB", 0,0); editRightInPB = XmCreatePushButton(editPD, "editRightMarginInPB", 0,0); editRightOutPB = XmCreatePushButton(editPD, "editRightMarginOutPB", 0,0); wcount = 0; wlist[wcount++] = editUndeletePB; wlist[wcount++] = editSep1; wlist[wcount++] = editPlainPB; wlist[wcount++] = editBoldPB; wlist[wcount++] = editItalicPB; wlist[wcount++] = editFixedPB; wlist[wcount++] = editUnderPB; wlist[wcount++] = editSep2; wlist[wcount++] = editBiggerPB; wlist[wcount++] = editSmallerPB; wlist[wcount++] = editColorCB; wlist[wcount++] = editSep3; wlist[wcount++] = editLeftPB; wlist[wcount++] = editRightPB; wlist[wcount++] = editBothPB; wlist[wcount++] = editCenterPB; wlist[wcount++] = editNoFillPB; wlist[wcount++] = editSep4; wlist[wcount++] = editExcMorePB; wlist[wcount++] = editExcLessPB; wlist[wcount++] = editLeftInPB; wlist[wcount++] = editLeftOutPB; wlist[wcount++] = editRightInPB; wlist[wcount++] = editRightOutPB; XtManageChildren(wlist, wcount); // editPD children AddActivate(editUndeletePB, DoUndelete, this); AddActivate(editPlainPB, DoPlain, this); AddActivate(editBoldPB, DoBold, this); AddActivate(editItalicPB, DoItalic, this); AddActivate(editFixedPB, DoFixed, this); AddActivate(editUnderPB, DoUnderline, this); AddActivate(editBiggerPB, DoBigger, this); AddActivate(editSmallerPB, DoSmaller, this); AddActivate(editLeftPB, DoFlushLeft, this); AddActivate(editRightPB, DoFlushRight, this); AddActivate(editBothPB, DoFlushBoth, this); AddActivate(editCenterPB, DoCenter, this); AddActivate(editNoFillPB, DoNoFill, this); AddActivate(editExcMorePB, DoExcerptMore, this); AddActivate(editExcLessPB, DoExcerptLess, this); AddActivate(editLeftInPB, DoLeftMarginIn, this); AddActivate(editLeftOutPB, DoLeftMarginOut, this); AddActivate(editRightInPB, DoRightMarginIn, this); AddActivate(editRightOutPB, DoRightMarginOut, this);//// Display accelerators depending on edit mode// Boolean emacs = get_boolean(*pub, "emacsMode", False); if ( emacs ) { WXmString wstr;// XtVaSetValues(editCB, XmNmnemonic, (KeySym)XK_d, NULL); wstr = "Ctrl + Y"; XtVaSetValues(editUndeletePB, XmNacceleratorText, (XmString)wstr,0); wstr = "Ctrl + 0"; XtVaSetValues(editPlainPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 1"; XtVaSetValues(editBoldPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 2"; XtVaSetValues(editItalicPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 3"; XtVaSetValues(editFixedPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + -"; XtVaSetValues(editUnderPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 4"; XtVaSetValues(editBiggerPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + 4"; XtVaSetValues(editSmallerPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 5"; XtVaSetValues(editLeftPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + 5"; XtVaSetValues(editRightPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ="; XtVaSetValues(editCenterPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 6"; XtVaSetValues(editLeftInPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + 6"; XtVaSetValues(editLeftOutPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 7"; XtVaSetValues(editRightInPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + 7"; XtVaSetValues(editRightOutPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + 8"; XtVaSetValues(editExcMorePB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + 8"; XtVaSetValues(editExcLessPB, XmNacceleratorText, (XmString)wstr, NULL); } // End if editing in Emacs mode else { WXmString wstr;// XtVaSetValues(editCB, XmNmnemonic, (KeySym)XK_E, NULL); wstr = "Ctrl + Z"; XtVaSetValues(editUndeletePB, XmNacceleratorText, (XmString)wstr,0); wstr = "Ctrl + P"; XtVaSetValues(editPlainPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + B"; XtVaSetValues(editBoldPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + I"; XtVaSetValues(editItalicPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + F"; XtVaSetValues(editFixedPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + -"; XtVaSetValues(editUnderPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ."; XtVaSetValues(editBiggerPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ,"; XtVaSetValues(editSmallerPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ["; XtVaSetValues(editLeftPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ]"; XtVaSetValues(editRightPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + ="; XtVaSetValues(editCenterPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + Shift + ."; XtVaSetValues(editLeftInPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Ctrl + Shift + ,"; XtVaSetValues(editLeftOutPB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + ."; XtVaSetValues(editExcMorePB, XmNacceleratorText, (XmString)wstr, NULL); wstr = "Meta + ,"; XtVaSetValues(editExcLessPB, XmNacceleratorText, (XmString)wstr, NULL); } // End if editing in Motif mode//// Create editColorPD hierarchy//// editColorPD// PushButton colorRedPB// PushButton colorGreenPB// PushButton colorBluePB// PushButton colorYellowPB// PushButton colorMagentaPB// PushButton colorCyanPB// PushButton colorBlackPB// PushButton colorWhitePB// PushButton colorOtherPB// Widget editColorPD = XmCreatePulldownMenu(editPD, "editColorPD", 0,0); XtVaSetValues(editColorCB, XmNsubMenuId, editColorPD, NULL); Widget colorRedPB = XmCreatePushButton(editColorPD,"colorRedPB", 0,0); Widget colorGreenPB = XmCreatePushButton(editColorPD,"colorGreenPB", 0,0); Widget colorBluePB = XmCreatePushButton(editColorPD,"colorBluePB", 0,0); Widget colorYellowPB = XmCreatePushButton(editColorPD,"colorYellowPB", 0,0); Widget colorMagentaPB = XmCreatePushButton(editColorPD,"colorMagentaPB",0,0); Widget colorCyanPB = XmCreatePushButton(editColorPD,"colorCyanPB", 0,0); Widget colorBlackPB = XmCreatePushButton(editColorPD,"colorBlackPB", 0,0); Widget colorWhitePB = XmCreatePushButton(editColorPD,"colorWhitePB", 0,0); Widget colorOtherPB = XmCreatePushButton(editColorPD,"colorOtherPB", 0,0); Widget colorSep1 = XmCreateSeparator (editColorPD,"colorSep1", 0,0); Widget colorNonePB = XmCreatePushButton(editColorPD,"colorNonePB", 0,0); wcount = 0; wlist[wcount++] = colorRedPB; wlist[wcount++] = colorGreenPB; wlist[wcount++] = colorBluePB; wlist[wcount++] = colorYellowPB; wlist[wcount++] = colorMagentaPB; wlist[wcount++] = colorCyanPB; wlist[wcount++] = colorBlackPB; wlist[wcount++] = colorWhitePB;// wlist[wcount++] = colorOtherPB; wlist[wcount++] = colorSep1; wlist[wcount++] = colorNonePB; XtManageChildren(wlist, wcount); // editColorPD children AddActivate(colorRedPB, DoColorRed, this); AddActivate(colorGreenPB, DoColorGreen, this); AddActivate(colorBluePB, DoColorBlue, this); AddActivate(colorYellowPB, DoColorYellow, this); AddActivate(colorMagentaPB, DoColorMagenta, this); AddActivate(colorCyanPB, DoColorCyan, this); AddActivate(colorBlackPB, DoColorBlack, this); AddActivate(colorWhitePB, DoColorWhite, this); AddActivate(colorOtherPB, DoColorOther, this); AddActivate(colorNonePB, DoColorNone, this);} // End BuildEditMenu/*--------------------------------------------------------------- * Method to build option menu hierarchy */voidSendWinP::BuildOptMenu(){ Cardinal wcount; Widget wlist[24]; WArgList args; 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 optMailPB// PushButton optReplyPB// PushButton optSigPB// PushButton optButtPB// Separator optSep1// ToggleButton optCcTB// ToggleButton optBccTB// ToggleButton optFccTB// ToggleButton optOtherTB#if 0// ToggleButton optWrapTB// ToggleButton optAddSigTB// ToggleButton optDigSignTB// ToggleButton optEncryptTB#endif// ToggleButton optCheckAddrTB// CascadeButton optMsgTypeCB// CascadeButton optTextTypeCB// wcount = 0; if ( !pub->IsEditOnly() ) { Widget optPrefPB = XmCreatePushButton (optPD, "optPrefPB", 0,0); Widget optMailPB = XmCreatePushButton (optPD, "optMailPB", 0,0); Widget optReplyPB = XmCreatePushButton (optPD, "optReplyPB", 0,0); Widget optSigPB = XmCreatePushButton (optPD, "optSigPB", 0,0); Widget optButtPB = XmCreatePushButton (optPD, "optButtPB", 0,0); Widget optSep1 = XmCreateSeparator (optPD, "optSep1", 0,0); optCcTB = XmCreateToggleButton (optPD, "optCcTB", 0,0); optBccTB = XmCreateToggleButton (optPD, "optBccTB", 0,0); optFccTB = XmCreateToggleButton (optPD, "optFccTB", 0,0); optOtherTB = XmCreateToggleButton (optPD, "optOtherTB", 0,0); wlist[wcount++] = optPrefPB; wlist[wcount++] = optMailPB; wlist[wcount++] = optSigPB; wlist[wcount++] = optReplyPB; wlist[wcount++] = optButtPB; wlist[wcount++] = optSep1; wlist[wcount++] = optCcTB; wlist[wcount++] = optBccTB; wlist[wcount++] = optFccTB; wlist[wcount++] = optOtherTB; XtManageChildren(wlist, wcount); AddActivate (optPrefPB, DoWinPrefs, this); AddActivate (optMailPB, DoMailPrefs, this); AddActivate (optReplyPB, DoReplyPrefs, this); AddActivate (optSigPB, DoSigPrefs, this); AddActivate (optButtPB, DoButtons, this); AddValueChanged(optCcTB, ToggleCc, this); AddValueChanged(optBccTB, ToggleBcc, this); AddValueChanged(optFccTB, ToggleFcc, this); AddValueChanged(optOtherTB, ToggleOther, this); XmToggleButtonSetState(optCcTB, ishApp->compPrefs->showCc, False); XmToggleButtonSetState(optBccTB, ishApp->compPrefs->showBcc, False); XmToggleButtonSetState(optFccTB, ishApp->compPrefs->showFcc, False); XmToggleButtonSetState(optOtherTB, ishApp->compPrefs->showOther, False); } if ( pub->IsEditOnly() ) { optWrapTB = XmCreateToggleButton (optPD, "optWrapTB", 0,0); XtManageChild(optWrapTB); AddValueChanged(optWrapTB, ToggleWrap, this); } if ( !pub->IsEditOnly() ) { #if 0 optAddSigTB = XmCreateToggleButton (optPD, "optAddSigTB", 0,0); optDigSignTB = XmCreateToggleButton (optPD, "optDigSignTB", 0,0); optEncryptTB = XmCreateToggleButton (optPD, "optEncryptTB", 0,0);#endif optCheckAddrTB = XmCreateToggleButton (optPD, "optCheckAddrTB", 0,0); optMsgTypeCB = XmCreateCascadeButton(optPD, "optMsgTypeCB", 0,0); optTextTypeCB = XmCreateCascadeButton(optPD, "optTextTypeCB", 0,0); wcount = 0;#if 0 wlist[wcount++] = optAddSigTB; wlist[wcount++] = optDigSignTB; wlist[wcount++] = optEncryptTB;#endif wlist[wcount++] = optCheckAddrTB; wlist[wcount++] = optMsgTypeCB; wlist[wcount++] = optTextTypeCB; XtManageChildren(wlist, wcount);//// Create optMsgTypePD hierarchy//// optMsgTypePD// ToggleButton optMsgPlainTB// ToggleButton optMsgMimeTB// ToggleButton optMsgAltTB// Widget optMsgTypePD = XmCreatePulldownMenu(optPD, "optMsgTypePD", 0,0); XtVaSetValues(optMsgTypeCB, XmNsubMenuId, optMsgTypePD, NULL); XtVaSetValues(optMsgTypePD, XmNradioBehavior, True, NULL); optMsgPlainTB = XmCreateToggleButton(optMsgTypePD, "optMsgPlainTB", 0,0); optMsgMimeTB = XmCreateToggleButton(optMsgTypePD, "optMsgMimeTB", 0,0); optMsgAltTB = XmCreateToggleButton(optMsgTypePD, "optMsgAltTB", 0,0); wcount = 0; wlist[wcount++] = optMsgPlainTB; wlist[wcount++] = optMsgMimeTB; wlist[wcount++] = optMsgAltTB; XtManageChildren(wlist, wcount); AddValueChanged(optMsgPlainTB, ToggleMsgPlain, this);//// Create optTextTypePD hierarchy//// optTextTypePD// ToggleButton optTextPlainTB// ToggleButton optTextRichTB// Widget optTextTypePD = XmCreatePulldownMenu(optPD, "optTextTypePD", 0,0); XtVaSetValues(optTextTypeCB, XmNsubMenuId, optTextTypePD, NULL); XtVaSetValues(optTextTypePD, XmNradioBehavior, True, NULL); optTextPlainTB = XmCreateToggleButton(optTextTypePD,"optTextPlainTB",0,0); optTextRichTB = XmCreateToggleButton(optTextTypePD,"optTextRichTB", 0,0); wcount = 0; wlist[wcount++] = optTextPlainTB; wlist[wcount++] = optTextRichTB; XtManageChildren(wlist, wcount); AddValueChanged(optTextPlainTB, ToggleTextPlain, this); } // End if not edit-only} // End BuildOptMenu/*--------------------------------------------------------------- * Method to build widgets */voidSendWinP::BuildWidgets(){ WArgList args;//// Create appForm hierarchy//// appForm// PanedWin appPanes args.Reset(); args.LeftAttachment(XmATTACH_FORM); args.RightAttachment(XmATTACH_FORM);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -