home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / ABNameSecuTab.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.7 KB  |  142 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.    ABNameSecuTabView.cpp -- class definition for ABNameSecuTabView
  20.    Created: Tao Cheng <tao@netscape.com>, 12-nov-96
  21.  */
  22.  
  23. #include "ABNameSecuTab.h"
  24.  
  25. #include <Xm/Form.h>
  26. #include <Xm/PushB.h>
  27. #include <Xm/LabelG.h> 
  28.  
  29. #include "xfe.h"
  30. #include "xpgetstr.h"
  31.  
  32. extern int XFE_AB_NAME_SECURITY_TAB;
  33. extern int XFE_AB_SECUR_YES;
  34. extern int XFE_AB_SECUR_NO;
  35. extern int XFE_AB_SECUR_EXPIRED;
  36. extern int XFE_AB_SECUR_REVOKED;
  37. extern int XFE_AB_SECUR_YOU_YES;
  38. extern int XFE_AB_SECUR_YOU_NO;
  39. extern int XFE_AB_SECUR_YOU_EXPIRED;
  40. extern int XFE_AB_SECUR_YOU_REVOKED;
  41. extern int XFE_AB_SECUR_SHOW;
  42. extern int XFE_AB_SECUR_GET;
  43.  
  44. XFE_ABNameSecuTabView::XFE_ABNameSecuTabView(XFE_Component *top,
  45.                          XFE_View *view):
  46.   XFE_PropertyTabView(top, view, XFE_AB_NAME_SECURITY_TAB)
  47. {
  48.   Widget topForm = getBaseWidget();
  49.  
  50.   /* m_securityLabel
  51.    */
  52.   m_securLabel = XtVaCreateManagedWidget("securLabel",
  53.                                          xmLabelGadgetClass, topForm,
  54.                                          XmNalignment, XmALIGNMENT_BEGINNING, 
  55.                                          NULL);
  56.   XmString info = XmStringCreateLtoR(XP_GetString(XFE_AB_SECUR_YES),
  57.                                      XmFONTLIST_DEFAULT_TAG);
  58.  
  59.   XtVaSetValues(m_securLabel,
  60.                 XmNlabelString, info,
  61.                 XmNleftAttachment, XmATTACH_FORM,
  62.                 XmNtopAttachment, XmATTACH_FORM,
  63.                 XmNrightAttachment, XmATTACH_FORM,
  64.                 XmNbottomAttachment, XmATTACH_NONE,
  65.                 XmNtopOffset, 10,
  66.                 XmNrightOffset, 10,
  67.                 XmNbottomOffset, 10,
  68.                 XmNleftOffset, 10,
  69.                 0);
  70.  
  71.   /* Show Certificate button
  72.    */
  73.   Arg    av[20];
  74.   int    ac = 0;
  75.  
  76.   XtSetArg (av[ac], XmNwidth, 120); ac++;
  77.   //XtSetArg (av[ac], XmNrecomputeSize, False); ac++;
  78.   m_showCertiBtn = XmCreatePushButton(topForm, 
  79.                       "showSecurBtn", 
  80.                       av, ac);
  81.   fe_SetString(m_showCertiBtn, 
  82.                XmNlabelString, XP_GetString(XFE_AB_SECUR_SHOW));
  83.  
  84.   Dimension widthF;
  85.   XtVaGetValues(m_securLabel, 
  86.                 XmNwidth, &widthF,
  87.                 0);
  88.   Dimension widthp;
  89.   XtVaGetValues(m_showCertiBtn, 
  90.                 XmNwidth, &widthp,
  91.                 0);
  92.  
  93.   int leftoffset = (widthF-widthp)/2;
  94.   XtVaSetValues(m_showCertiBtn,
  95.                 XmNleftAttachment, XmATTACH_FORM,
  96.                 XmNleftOffset, leftoffset, 
  97.                 XmNtopAttachment, XmATTACH_WIDGET,
  98.                 XmNtopWidget, m_securLabel,
  99.                 XmNtopOffset, 50, 
  100.                 XmNrightAttachment, XmATTACH_NONE,
  101.                 XmNbottomAttachment, XmATTACH_NONE,
  102.                 NULL);
  103.   XtManageChild(m_showCertiBtn);
  104.  
  105.   XtAddCallback(m_showCertiBtn,
  106.                 XmNactivateCallback, 
  107.                 XFE_ABNameSecuTabView::showCallback, 
  108.                 this);
  109. }
  110.  
  111. XFE_ABNameSecuTabView::~XFE_ABNameSecuTabView()
  112. {
  113. }
  114.  
  115. void XFE_ABNameSecuTabView::setDlgValues()
  116. {
  117. }
  118.  
  119. void XFE_ABNameSecuTabView::apply()
  120. {
  121. }
  122.  
  123. void XFE_ABNameSecuTabView::getDlgValues()
  124. {
  125. }
  126.  
  127. /*
  128.  * Callbacks for outside world
  129.  */
  130. void
  131. XFE_ABNameSecuTabView::showCallback(Widget w, 
  132.                    XtPointer clientData, 
  133.                    XtPointer callData)
  134. {
  135.   XFE_ABNameSecuTabView *obj = (XFE_ABNameSecuTabView *) clientData;
  136.   obj->showCB(w, callData);
  137. }
  138.  
  139. void XFE_ABNameSecuTabView::showCB(Widget, XtPointer)
  140. {
  141. }
  142.