home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / HTMLDialogFrame.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  92 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.    HTMLDialogFrame.cpp -- class definition for HTML dialogs
  20.    Created: Chris Toshok <toshok@netscape.com>, 7-Mar-97
  21.  */
  22.  
  23.  
  24.  
  25. #include "HTMLDialogFrame.h"
  26.  
  27. #ifdef DEBUG_toshok
  28. #define D(x) x
  29. #else
  30. #define D(x)
  31. #endif
  32.  
  33. extern "C" {
  34.     void fe_set_scrolled_default_size(MWContext *context);
  35. }
  36.  
  37. XFE_HTMLDialogFrame::XFE_HTMLDialogFrame(Widget toplevel,
  38.                                          XFE_Frame *parent_frame,
  39.                                          Chrome *chrome_spec)
  40.     : XFE_Frame("Dialog", toplevel,
  41.                 parent_frame, 
  42.                 FRAME_HTML_DIALOG,
  43.                 chrome_spec,
  44.                 True, /* haveHTMLDisplay */
  45.                 False, /* haveMenuBar */
  46.                 False, /* haveToolbars */
  47.                 False, /* haveDashboard */
  48.                 True /* destroyOnClose */)
  49. {
  50.     XFE_HTMLView *htmlview;
  51.  
  52.     D(printf ("in XFE_HTMLDialogFrame::XFE_HTMLDialogFrame()\n");)
  53.  
  54.     htmlview = new XFE_HTMLView(this, getViewParent(), NULL, m_context);
  55.  
  56.     setView(htmlview);
  57.  
  58.     fe_set_scrolled_default_size(m_context);
  59.  
  60.     XtVaSetValues(htmlview->getBaseWidget(),
  61.                   XmNleftAttachment, XmATTACH_FORM,
  62.                   XmNrightAttachment, XmATTACH_FORM,
  63.                   XmNtopAttachment, XmATTACH_FORM,
  64.                   XmNbottomAttachment, XmATTACH_FORM,
  65.                   NULL);
  66.  
  67.     htmlview->show();
  68.  
  69.     respectChrome(chrome_spec);
  70. }
  71.  
  72. XFE_HTMLDialogFrame::~XFE_HTMLDialogFrame()
  73. {
  74.     D(printf ("in XFE_HTMLDialogFrame::~XFE_HTMLDialogFrame()\n");)
  75. }
  76.  
  77. MWContext*
  78. fe_showHTMLDialog(Widget parent,
  79.                   XFE_Frame *parent_frame,
  80.                   Chrome *chromespec)
  81. {
  82.     XFE_HTMLDialogFrame *dialog = new XFE_HTMLDialogFrame(parent,
  83.                                                           parent_frame,
  84.                                                           chromespec);
  85.  
  86.     dialog->show();
  87.  
  88.     D(printf ("After calling dialog->show()\n");)
  89.  
  90.     return dialog->getContext();
  91. }
  92.