⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendwinp.c

📁 linux下的E_MAIL客户端源码
💻 C
📖 第 1 页 / 共 5 页
字号:
   args.TopAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_FORM);   appPanes = XmCreatePanedWindow(pub->appForm, "appPanes", ARGS);//// Create appPanes hierarchy//// appPanes//    Form		oldHeadPane.headForm	(Used if main window)//    Form		newHeadPane.headForm	(Used if main window)//    MimeRichTextC	headText		(Used if edit window)//    Form		bodyForm//    RowCol		optRC			(Used if main window)////// Create header fields//   int	row = 0;   toRow    = row++;   ccRow    = row++;   bccRow   = row++;   fccRow   = row++;   otherRow = row++;   if ( !pub->IsEditOnly() ) {      oldHeadPane = new HeaderPaneT;      newHeadPane = new HeaderPaneT;      InitHeaderPane(oldHeadPane);      InitHeaderPane(newHeadPane);      args.Reset();      args.AllowResize(True);      oldHeadPane->headForm = XmCreateForm(appPanes, "headForm", ARGS);      newHeadPane->headForm = XmCreateForm(appPanes, "headForm", ARGS);      BuildOldHeadPane();      BuildNewHeadPane();      PlaceHeaderFields();   } // End if header form needed//// Create header text if necessary//   if ( pub->IsEditOnly() ) {      args.Reset();      args.AllowResize(True);      headText = new MimeRichTextC(appPanes, "headerText", ARGS);      headText->SetEditable(True);      headText->ResizeWidth(False);      headText->AddTextChangeCallback((CallbackFn*)TextChanged, this);   }//// Create bodyForm hierarchy//// bodyForm//    Form		bodyTitleForm//       Label		bodyTitle//       Text		bodyStateTF//    ScrolledWindow	bodyWin//   args.Reset();   args.AllowResize(True);   bodyForm = XmCreateForm(appPanes, "bodyForm", ARGS);   args.Reset();   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_FORM);   args.TopAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_NONE);   Widget	bodyTitleForm = XmCreateForm(bodyForm, "bodyTitleForm", ARGS);   args.Reset();   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_NONE);   args.TopAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_FORM);   Widget	bodyTitle = XmCreateLabel(bodyTitleForm, "bodyTitle", ARGS);   args.Reset();   args.LeftAttachment(XmATTACH_WIDGET, bodyTitle);   args.TopAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_FORM);   args.ShadowThickness(0);   args.Editable(False);   args.CursorPositionVisible(False);   args.TraversalOn(False);   args.NavigationType(XmNONE);   bodyStateTF = CreateTextField(bodyTitleForm, "bodyStateTF", ARGS);   args.Reset();   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_FORM);   args.TopAttachment(XmATTACH_WIDGET, bodyTitleForm);   args.BottomAttachment(XmATTACH_FORM);   args.UserData(this);   args.Rows(ishApp->compPrefs->bodyRows);   args.Columns(ishApp->compPrefs->bodyCols);   bodyText = new MimeRichTextC(bodyForm, "bodyText", ARGS);   bodyText->SetEditable(True);   bodyText->ResizeWidth(!ishApp->compPrefs->wrap);   bodyText->SetTextType(TT_ENRICHED);   bodyText->SetExcerptString(ishApp->replyPrefs->indentPrefix);   bodyText->ForceFixed(ishApp->mailPrefs->mailType == MAIL_PLAIN ||			ishApp->mailPrefs->textType == CT_PLAIN);   bodyText->AddStateChangeCallback((CallbackFn*)BodyStateChanged, this);   bodyText->AddTextChangeCallback ((CallbackFn*)TextChanged,      this);   XtManageChild(bodyTitle);   XtManageChild(bodyStateTF);   XtManageChild(bodyTitleForm);   XtManageChild(bodyText->MainWidget());//// Allow message drops here//   XmDropSiteUnregister(bodyText->TextArea());   if ( !graphicAtom )      graphicAtom = XmInternAtom(halApp->display, "IshmailGraphic", False);   Atom impAtoms[2];   impAtoms[0] = ishApp->msgAtom;   impAtoms[1] = graphicAtom;   args.Reset();   args.ImportTargets(impAtoms);   args.NumImportTargets(2);   args.DragProc((XtCallbackProc)HandleDragOver);   args.DropProc((XtCallbackProc)HandleDrop);   XmDropSiteRegister(bodyText->TextArea(), ARGS);   XtManageChild(bodyForm);   if ( headText ) XtManageChild(headText->MainWidget());//// Create optRC if necessary//   optRC = NULL;   if ( !pub->IsEditOnly() ) {      args.Reset();      args.AllowResize(True);      optRC = new RowColC(appPanes, "optRC", ARGS);//// Set up optRC for 1 row with equal sized columns//      optRC->Defer(True);      optRC->SetOrientation(RcCOL_MAJOR);      optRC->SetRowCount(1);      optRC->SetColAlignment(XmALIGNMENT_BEGINNING);      optRC->SetColWidthAdjust(RcADJUST_NONE);      optRC->SetColResize(True);      //optRC->SetUniformCols(True);      optRC->SetUniformCols(False);//// Create optRC hierarchy//// optRC//    ToggleButton	optMimeTB//    ToggleButton	optWrapTB//    ToggleButton	optAddSigTB//    ToggleButton	optDigSignTB//    ToggleButton	optEncryptTB//      optMimeTB    = XmCreateToggleButton(*optRC, "optMimeTB",    0,0);      optWrapTB	   = XmCreateToggleButton(*optRC, "optWrapTB",    0,0);      optAddSigTB  = XmCreateToggleButton(*optRC, "optAddSigTB",  0,0);      optDigSignTB = XmCreateToggleButton(*optRC, "optDigSignTB", 0,0);      optEncryptTB = XmCreateToggleButton(*optRC, "optEncryptTB", 0,0);      Widget	wlist[5];      Cardinal	wcount = 0;      wlist[wcount++] = optMimeTB;      wlist[wcount++] = optWrapTB;      wlist[wcount++] = optAddSigTB;      wlist[wcount++] = optDigSignTB;      wlist[wcount++] = optEncryptTB;      optRC->SetChildren(wlist, wcount);      optRC->Defer(False);      AddValueChanged(optMimeTB, ToggleMime, this);      AddValueChanged(optWrapTB, ToggleWrap, this);      XtManageChild(*optRC);   } // End if need options panel   XtManageChild(appPanes);	// appForm children//// Add other stuff//   BuildMimePopupMenu();   pub->AddButtonBox();   pub->ShowInfoMsg();	// Show this hidden widget   pub->HandleHelp();//// Add actions if necessary//   static Boolean	actionsAdded = False;   if ( !actionsAdded ) {      XtAppAddActions(halApp->context, actions, XtNumber(actions));      actionsAdded = True;   }//// Create the button preferences object//   StringC	buttonStr = ishApp->sendButtPrefs->buttonStr;   if ( pub->IsEditOnly() ) buttonStr += " fileCancelPB";	// Force this on   buttMgr = new ButtonMgrC(pub, pub->menuBar, pub->buttonRC, buttonStr);//// Create pixmap for this window's icon//   compIcon = new PixmapC(composition_xpm, (Window)*halApp,			  XDefaultColormapOfScreen(halApp->screen));   if ( compIcon->reg )      XtVaSetValues(*pub, XmNiconPixmap, compIcon->reg,                          XmNiconMask, compIcon->mask,                          NULL);} // End BuildWidgets/*--------------------------------------------------------------- *  Routine to initialize header pane structure */voidSendWinP::InitHeaderPane(HeaderPaneT *pane){   pane->headForm	= NULL;   pane->toForm		= NULL;   pane->ccForm		= NULL;   pane->bccForm	= NULL;   pane->fccForm	= NULL;   pane->otherForm	= NULL;   pane->toLabel	= NULL;   pane->ccLabel	= NULL;   pane->bccLabel	= NULL;   pane->fccLabel	= NULL;   pane->otherLabel	= NULL;   pane->toText		= NULL;   pane->ccText		= NULL;   pane->bccText	= NULL;   pane->fccText	= NULL;   pane->otherText	= NULL;   pane->toAliasPB	= NULL;   pane->ccAliasPB	= NULL;   pane->bccAliasPB	= NULL;} // End InitHeaderPane/*--------------------------------------------------------------- *  Routine to create the old-style header pane */voidSendWinP::BuildOldHeadPane(){   WArgList	args;   Widget	wlist[6];   Cardinal	wcount;   HeaderPaneT	*p = oldHeadPane;//// Create headForm hierarchy//// headForm//    Form	labelForm//    Form	textForm//    Form	buttonForm//   args.Reset();   args.TopAttachment(XmATTACH_FORM);   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_NONE);   args.BottomAttachment(XmATTACH_FORM);   Widget labelForm  = XmCreateForm(p->headForm, "labelForm",  ARGS);   args.LeftAttachment(XmATTACH_NONE);   args.RightAttachment(XmATTACH_FORM);   Widget buttonForm = XmCreateForm(p->headForm, "buttonForm", ARGS);   args.LeftAttachment(XmATTACH_WIDGET, labelForm);   args.RightAttachment(XmATTACH_WIDGET, buttonForm);   Widget textForm   = XmCreateForm(p->headForm, "textForm",   ARGS);//// Create labelForm hierarchy//// labelForm//    Label		toLabel//    Label		subLabel//    Label		ccLabel//    Label		bccLabel//    Label		fccLabel//    Label		otherLabel//   args.Reset();   args.TopAttachment(XmATTACH_FORM);   args.LeftAttachment(XmATTACH_NONE);   args.RightAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_NONE);   p->toLabel    = XmCreateLabel(labelForm, "toLabel",      ARGS);   p->subLabel   = XmCreateLabel(labelForm, "subjectLabel", ARGS);   p->ccLabel    = XmCreateLabel(labelForm, "ccLabel",      ARGS);   p->bccLabel   = XmCreateLabel(labelForm, "bccLabel",     ARGS);   p->fccLabel   = XmCreateLabel(labelForm, "fccLabel",     ARGS);   p->otherLabel = XmCreateLabel(labelForm, "otherLabel",   ARGS);   wcount = 0;   wlist[wcount++] = p->toLabel;   wlist[wcount++] = p->subLabel;   wlist[wcount++] = p->ccLabel;   wlist[wcount++] = p->bccLabel;   wlist[wcount++] = p->fccLabel;   wlist[wcount++] = p->otherLabel;   XtManageChildren(wlist, wcount);//// Create textForm hierarchy//// textForm//    MimeRichTextC	toText//    MimeRichTextC	subText//    MimeRichTextC	ccText//    MimeRichTextC	bccText//    MimeRichTextC	fccText//    MimeRichTextC	otherText//   args.Reset();   args.TopAttachment(XmATTACH_FORM);   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_FORM);   args.BottomAttachment(XmATTACH_NONE);   p->toText    = new MimeRichTextC(textForm, "toText",      ARGS);   p->subText   = new MimeRichTextC(textForm, "subjectText", ARGS);   p->ccText    = new MimeRichTextC(textForm, "ccText",      ARGS);   p->bccText   = new MimeRichTextC(textForm, "bccText",     ARGS);   p->fccText   = new MimeRichTextC(textForm, "fccText",     ARGS);   p->otherText = new MimeRichTextC(textForm, "otherText",   ARGS);   p->toText->Defer(True);   p->toText->SetEditable(True);   p->toText->ResizeWidth(True);   p->toText->Defer(False);   p->subText->Defer(True);   p->subText->SetEditable(True);   p->subText->ResizeWidth(True);   p->subText->Defer(False);   p->ccText->Defer(True);   p->ccText->SetEditable(True);   p->ccText->ResizeWidth(True);   p->ccText->Defer(False);   p->bccText->Defer(True);   p->bccText->SetEditable(True);   p->bccText->ResizeWidth(True);   p->bccText->Defer(False);   p->fccText->Defer(True);   p->fccText->SetEditable(True);   p->fccText->ResizeWidth(False);   p->fccText->Defer(False);   p->otherText->Defer(True);   p->otherText->SetEditable(True);   p->otherText->ResizeWidth(True);   p->otherText->Defer(False);//// Add callbacks to look for changes//   p->toText->AddTextChangeCallback   ((CallbackFn*)TextChanged, this);   p->subText->AddTextChangeCallback  ((CallbackFn*)TextChanged, this);   p->ccText->AddTextChangeCallback   ((CallbackFn*)TextChanged, this);   p->bccText->AddTextChangeCallback  ((CallbackFn*)TextChanged, this);   p->otherText->AddTextChangeCallback((CallbackFn*)TextChanged, this);   p->fccText->AddTextChangeCallback  ((CallbackFn*)TextChanged, this);   wcount = 0;   wlist[wcount++] = p->toText->MainWidget();   wlist[wcount++] = p->subText->MainWidget();   wlist[wcount++] = p->ccText->MainWidget();   wlist[wcount++] = p->bccText->MainWidget();   wlist[wcount++] = p->fccText->MainWidget();   wlist[wcount++] = p->otherText->MainWidget();   XtManageChildren(wlist, wcount);//// Create buttonForm hierarchy//// buttonForm//    PushButton	   toAliasPB//    PushButton	   ccAliasPB//    PushButton	   bccAliasPB//   args.Reset();   args.TopAttachment(XmATTACH_FORM);   args.LeftAttachment(XmATTACH_FORM);   args.RightAttachment(XmATTACH_NONE);   args.BottomAttachment(XmATTACH_NONE);   p->toAliasPB    = XmCreatePushButton(buttonForm,  "toAliasPB",   ARGS);   p->subDummyPB   = XmCreatePushButton(buttonForm, "subAliasPB",   ARGS);   p->ccAliasPB    = XmCreatePushButton(buttonForm,  "ccAliasPB",   ARGS);   p->bccAliasPB   = XmCreatePushButton(buttonForm, "bccAliasPB",   ARGS);   p->fccDummyPB   = XmCreatePushButton(buttonForm, "fccAliasPB",   ARGS);   p->otherDummyPB = XmCreatePushButton(buttonForm, "otherAliasPB", ARGS);//// These buttons are present to simplify the layout code

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -