Example #1
0
XFE_Dialog::XFE_Dialog(Widget   parent,      // dialog parent
					   char    *name,        // dialog name
					   Boolean  ok,          // show OK button?
					   Boolean  cancel,      // show cancel button?
					   Boolean  help,        // show help button?
					   Boolean  apply,       // show apply button?
					   Boolean  separator,   // show separator?
					   Boolean  modal,       // modal dialog?
					   Widget chrome_widget)
	: XFE_Component()
{
	m_wParent = parent;

	// Create the chrome

	if (chrome_widget == NULL)
	  m_chrome = createDialogChromeWidget(parent, name, ok, cancel,
										  help, apply, separator, modal);
	else
	  m_chrome = chrome_widget;

	// Register base widget and parent widget

	setBaseWidget(XtParent(m_chrome));
	installDestroyHandler();
}
Example #2
0
XFE_ComposeAddressView::XFE_ComposeAddressView(XFE_View *parent_view,
			XFE_Component *toplevel_component,
			MSG_Pane *p) : XFE_MNView(toplevel_component, p)
{

  Widget w;
  setParent(parent_view);
  /* Create Widgets */
  w= fe_MailComposeWin_Create((MWContext*)(parent_view->getContext()), 
			parent_view->getBaseWidget());
  setBaseWidget(w);
}
Example #3
0
// constructor
XFE_AddrBookView::XFE_AddrBookView(XFE_Component *toplevel_component, 
								   Widget         parent, 
								   XFE_View      *parent_view,
								   MWContext     *context,
								   XP_List       *directories):
	XFE_ABListSearchView(toplevel_component, 
						 parent,
						 parent_view, 
						 context,
						 directories){

  /* For outliner
   */
  int num_columns = OUTLINER_COLUMN_LAST;
  static int column_widths[] = {3, 25, 25, 8, 8, 10, 12};
  m_outliner = new XFE_Outliner("addressBookList",
								this,
								toplevel_component,
								parent,
								False, // constantSize
								True,  // hasHeadings
								num_columns,
								num_columns-2,// num_visible 
								column_widths,
								ADDRESS_OUTLINER_GEOMETRY_PREF);

  m_outliner->setMultiSelectAllowed(True);
  m_outliner->setHideColumnsAllowed(True);

  /* BEGIN_3P: XmLGrid
   */
  XtVaSetValues(m_outliner->getBaseWidget(),
				XmNselectionPolicy, XmSELECT_MULTIPLE_ROW,
                XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
				XmNvisibleRows, 15,
				NULL);
  XtVaSetValues(m_outliner->getBaseWidget(),
				XmNcellDefaults, True,
                XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
				NULL);
  /* END_3P: XmLGrid
   */
  // layout
  layout();

  setBaseWidget(m_outliner->getBaseWidget());

  /* For property
   */
  CONTEXT_DATA(m_contextData)->abdata->outline = m_outliner->getBaseWidget();
}
Example #4
0
void
InvAnnotationEditor::show()
{
    // init local vars
    setClassName("InvAnnotationEditor");

    // Build the widget tree, and let SoXtComponent know about our base widget.
    if (buildNow_)
    {
        Widget w = buildWidget(getParentWidget());
        setBaseWidget(w);
    }
    switchTag = VIS;
    SoXtComponent::show();
}
Example #5
0
XFE_PropertyTabView::XFE_PropertyTabView(XFE_Component *top,
			       XFE_View *view, /* the parent view */
			       int       tab_string_id): XFE_View(top, view)
{
  m_labelWidth = 0;

  /* Create tab
   */
  XmString xmstr;
  xmstr = XmStringCreate(XP_GetString(tab_string_id ), 
			 XmFONTLIST_DEFAULT_TAG);
  Widget form = XmLFolderAddTabForm(view->getBaseWidget(), xmstr);
  XmStringFree(xmstr);

  setBaseWidget(form);
}
Example #6
0
//=========================================================================
//
// Called by the constructors
//
// Use: protected
//
//=========================================================================
void InvPartEditor::show()
{

    // init local vars
    setClassName("InvPartEditor");

    // Build the widget tree, and let SoXtComponent know about our base widget.
    if (buildNow_)
    {
        Widget w = buildWidget(getParentWidget());
        setBaseWidget(w);
    }
    switchTag = VIS;
    referenceTag = false;
    transTag = UNDIS;
    SoXtComponent::show();
}
Example #7
0
void XFE_ComposeAttachFolderView::createWidgets(Widget parent)
{
    // create attachment folder form
    Widget form=XmCreateForm(parent,"attachForm",NULL,0);

    // create attachment panel
    _attachPanel=new XFE_ComposeAttachPanel(this,_context);
    _attachPanel->createWidgets(form);
    _attachPanel->show();
    XtVaSetValues(_attachPanel->getBaseWidget(),
                  XmNleftAttachment,XmATTACH_FORM,
                  XmNrightAttachment,XmATTACH_FORM,
                  XmNtopAttachment,XmATTACH_FORM,
                  XmNbottomAttachment,XmATTACH_FORM,
                  NULL);

#if !defined(USE_MOTIF_DND)
    // create drop site for internal drop (message,news etc.)
    fe_dnd_CreateDrop(_attachPanel->getBaseWidget(),AttachDropCb,this);
#endif /* USE_MOTIF_DND */

    // create popup menu
    _xfePopup = new XFE_PopupMenu("popup",(XFE_Frame*)m_toplevel,_attachPanel->pane(),NULL);
    _xfePopup->addMenuSpec(attachPopupMenuSpec);

	// Remove the osfLeft and osfRight translations of the popup's children.
	// For bug 71620.  See the bug description for details.  Basically, for
	// some strange reason, motif assumes that either a left or a right 
	// naviation widget exists for this popup menu and core dumps trying 
	// to dereference a NULL widget.
    _xfePopup->removeLeftRightTranslations();

    setBaseWidget(form);

    // Register this widget to have a tooltip.
    fe_WidgetAddToolTips(form);
    
    // add existing attachments to the panel (e.g. for Forward)
    addExistingAttachments();
}
Example #8
0
XFE_ABDirListView::XFE_ABDirListView(XFE_Component *toplevel_component,
									 Widget         parent, 
									 XFE_View      *parent_view, 
									 MWContext     *context,
									 XP_List       *directories):
	XFE_MNListView(toplevel_component, 
				   parent_view,
				   context, 
				   (MSG_Pane *)NULL),
#if !defined(USE_ABCOM)
	m_directories(directories)
#else
	m_containerLine(NULL),
	m_activeContainer(NULL)
#endif /* USE_ABCOM */
{
	/* initialize 
	 */
	m_dir = 0;
	m_dirLine = 0;
	m_ancestorInfo = 0;
	m_deleted_directories = NULL;

	/* For outliner
	 */
	int num_columns = OUTLINER_COLUMN_LAST;
	static int column_widths[] = {23};
	m_outliner = new XFE_Outliner("dirList",
								  this,
								  toplevel_component,
								  parent,
								  False, // constantSize
								  True,  // hasHeadings
								  num_columns,
								  num_columns,// num_visible 
								  column_widths,
								  AB_DIR_OUTLINER_GEOMETRY_PREF);
	m_outliner->setHideColumnsAllowed(False);
	m_outliner->setPipeColumn(OUTLINER_COLUMN_NAME);

	/* BEGIN_3P: XmLGrid
	 */
	XtVaSetValues(m_outliner->getBaseWidget(),
				  XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
				  // XmNselectionPolicy, XmSELECT_MULTIPLE_ROW,
				  XmNvisibleRows, 15,
				  NULL);
	XtVaSetValues(m_outliner->getBaseWidget(),
				  XmNcellDefaults, True,
				  XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
				  NULL);
	/* END_3P: XmLGrid
	 */

#if defined(USE_ABCOM)
	// todo: check return val
	int error = AB_CreateContainerPane(&m_pane,
									   context,
									   fe_getMNMaster());


	error = 
		AB_SetShowPropertySheetForDirFunc(m_pane, 
		   &XFE_ABDirListView::ShowPropertySheetForDirFunc);

	error = AB_InitializeContainerPane(m_pane);
	m_nDirs = MSG_GetNumLines(m_pane);
#if defined(DEBUG_tao)
	printf("\n MSG_GetNumLines, m_nDirs=%d\n", m_nDirs);
#endif

#else
	/* XFE_Outliner constructor does not allocate any content row
	 * XFE_Outliner::change(int first, int length, int newnumrows)
	 */
	if (directories) {
		m_nDirs = XP_ListCount(directories);
	}/* if */
#endif /* USE_ABCOM */

	m_outliner->change(0, m_nDirs, m_nDirs);
	m_outliner->show();
	if (m_nDirs)
		m_outliner->selectItemExclusive(0);
	setBaseWidget(m_outliner->getBaseWidget());
    XtVaSetValues(getBaseWidget(),
                  XmNpaneMinimum, 1,
                  XmNpaneMaximum, 10000,
                  NULL);
	/* initialize the icons if they haven't already been
	 */
	Pixel bg_pixel;
	XtVaGetValues(m_outliner->getBaseWidget(), XmNbackground, &bg_pixel, 0);

	if (!m_openParentIcon.pixmap)
		fe_NewMakeIcon(getToplevel()->getBaseWidget(),
					   /* umm. fix me
						*/
					   BlackPixelOfScreen(XtScreen(m_outliner->getBaseWidget())),
					   bg_pixel,
					   &m_openParentIcon,
					   NULL, 
					   oparent.width, 
					   oparent.height,
					   oparent.mono_bits, 
					   oparent.color_bits, 
					   oparent.mask_bits, 
					   FALSE);
  
	if (!m_closedParentIcon.pixmap)
		fe_NewMakeIcon(getToplevel()->getBaseWidget(),
					   /* umm. fix me
						*/
					   BlackPixelOfScreen(XtScreen(m_outliner->getBaseWidget())),
					   bg_pixel,
					   &m_closedParentIcon,
					   NULL, 
					   cparent.width, 
					   cparent.height,
					   cparent.mono_bits, 
					   cparent.color_bits, 
					   cparent.mask_bits, 
					   FALSE);
  

	if (!m_pabIcon.pixmap)
		fe_NewMakeIcon(getToplevel()->getBaseWidget(),
					   /* umm. fix me
						*/
					   BlackPixelOfScreen(XtScreen(m_outliner->getBaseWidget())),
					   bg_pixel,
					   &m_pabIcon,
					   NULL, 
					   MNC_AddressSmall.width, 
					   MNC_AddressSmall.height,
					   MNC_AddressSmall.mono_bits, 
					   MNC_AddressSmall.color_bits, 
					   MNC_AddressSmall.mask_bits, 
					   FALSE);
  

	if (!m_ldapDirIcon.pixmap)
		fe_NewMakeIcon(getToplevel()->getBaseWidget(),
					   /* umm. fix me
						*/
					   BlackPixelOfScreen(XtScreen(m_outliner->getBaseWidget())),
					   bg_pixel,
					   &m_ldapDirIcon,
					   NULL, 
					   MN_FolderServer.width, 
					   MN_FolderServer.height,
					   MN_FolderServer.mono_bits, 
					   MN_FolderServer.color_bits, 
					   MN_FolderServer.mask_bits, 
					   FALSE);
  

	if (!m_mListIcon.pixmap)
		fe_NewMakeIcon(getToplevel()->getBaseWidget(),
					   /* umm. fix me
						*/
					   BlackPixelOfScreen(XtScreen(m_outliner->getBaseWidget())),
					   bg_pixel,
					   &m_mListIcon,
					   NULL, 
					   MN_People.width, 
					   MN_People.height,
					   MN_People.mono_bits, 
					   MN_People.color_bits, 
					   MN_People.mask_bits, 
					   FALSE);
  

}

XFE_ABDirListView::~XFE_ABDirListView()
{
}

#if defined(USE_ABCOM)
int
XFE_ABDirListView::ShowPropertySheetForDirFunc(DIR_Server *server, 
											   MWContext  *context, 
											   MSG_Pane   *pane,
											   XP_Bool     newDirectory)
{
#if defined(DEBUG_tao)
	printf("\n XFE_ABDirListView::ShowPropertySheetForDirFunc, newDirectory=%d\n",
		   newDirectory);
#endif
	XFE_ABDirPropertyDlg* Dlg = 
		new XFE_ABDirPropertyDlg(CONTEXT_WIDGET(context),
								 "abDirProperties", 
								 True, 
								 context);
	Dlg->setDlgValues(server);
	Dlg->setPane(pane);
	Dlg->show();
	return 1;
}
Example #9
0
XFE_MailDownloadView::XFE_MailDownloadView(XFE_Component *toplevel_component, 
										   Widget parent, 
										   XFE_View *parent_view, 
										   MWContext *context, 
										   MSG_Pane *parent_pane,
										   MSG_Pane *p)
	: XFE_MNView(toplevel_component, parent_view, context, p)
{
	Widget form;
	XmString xmstr = XmStringCreate(XP_GetString(XFE_DOWNLOADING_NEW_MESSAGES), XmFONTLIST_DEFAULT_TAG);
	XmFontList fontList;

	form = XtCreateWidget("topArea",
						  xmFormWidgetClass,
						  parent,
						  NULL, 0);

	m_label = XtVaCreateManagedWidget("label",
									xmLabelWidgetClass,
									form,
									XmNlabelString, xmstr,
									NULL);

	m_logo = new XFE_Logo((XFE_Frame*)toplevel_component, form, "logo");

	XtVaGetValues(m_label,
				  XmNfontList, &fontList,
				  NULL);

	// we need more space, or else the window is *tiny*
	XtVaSetValues(m_label,
				  XmNwidth, XmStringWidth(fontList, xmstr) * 2,
				  NULL);

	XmStringFree(xmstr);

	/* now do the attachments. */

	XtVaSetValues(m_label,
				  XmNleftAttachment, XmATTACH_FORM,
				  XmNrightAttachment, XmATTACH_WIDGET,
				  XmNrightWidget, m_logo->getBaseWidget(),
				  XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET,
				  XmNtopWidget, m_logo->getBaseWidget(),
				  XmNbottomAttachment, XmATTACH_OPPOSITE_WIDGET,
				  XmNbottomWidget, m_logo->getBaseWidget(),
				  NULL);

	XtVaSetValues(m_logo->getBaseWidget(),
				  XmNleftAttachment, XmATTACH_NONE,
				  XmNrightAttachment, XmATTACH_FORM,
				  XmNbottomAttachment, XmATTACH_NONE,
				  XmNtopAttachment, XmATTACH_FORM,
				  NULL);

	m_logo->show();

	if (!p)
		setPane(MSG_CreateProgressPane(m_contextData, XFE_MNView::getMaster(), parent_pane));

	setBaseWidget(form);
}
Example #10
0
XFE_FolderDropdown::XFE_FolderDropdown(XFE_Component *toplevel_component,
									   Widget parent,
									   XP_Bool allowServerSelection,
									   XP_Bool showNewsgroups,
									   XP_Bool boldWithNew)
	: XFE_Component(toplevel_component)
{
	m_popupServer = True;

	Widget combo;
	Colormap cmap;
	Cardinal depth;
	Visual *v;

	XtVaGetValues(getToplevel()->getBaseWidget(),
				  XmNvisual, &v,
				  XmNcolormap, &cmap,
				  XmNdepth, &depth,
				  NULL);

	m_allowServerSelection = allowServerSelection;
	m_showNewsgroups = showNewsgroups;
	m_boldWithNew = boldWithNew;
	m_foldersHaveChanged = FALSE;

	combo = XtVaCreateWidget("folderDropdown",
							 dtComboBoxWidgetClass,
							 parent,
							 XmNshadowThickness, 1,
							 XmNmarginWidth, 0,
							 XmNmarginHeight, 0,
							 XmNarrowType, XmMOTIF,
							 XmNtype, XmDROP_DOWN_LIST_BOX,
							 XmNcolumns, 30,
							 XmNvisibleItemCount, 20,
							 XmNvisual, v,
							 XmNcolormap, cmap,
							 XmNdepth, depth,
							 NULL);

	m_lastSelectedPosition = 0;
	m_numNewsHosts = 0;
	m_numinfos = 0;
	m_infos = 0;

	XFE_MozillaApp::theApp()->registerInterest(XFE_MNView::foldersHaveChanged,
											   this,
											   (XFE_FunctionNotification)rebuildFolderDropdown_cb);
	XFE_MozillaApp::theApp()->registerInterest(XFE_MNView::newsgroupsHaveChanged,
											   this,
											   (XFE_FunctionNotification)rebuildFolderDropdown_cb);
	if (m_boldWithNew)
		XFE_MozillaApp::theApp()->registerInterest(XFE_MNView::folderChromeNeedsUpdating,
												   this,
												   (XFE_FunctionNotification)boldFolderInfo_cb);

	XtAddCallback(combo, XmNselectionCallback, folderSelect_cb, this);
	XtAddCallback(combo, XmNmenuPostCallback, folderMenuPost_cb, this);

	setBaseWidget(combo);
	installDestroyHandler();

	resyncDropdown();
}
Example #11
0
XFE_MNBanner::XFE_MNBanner(XFE_Frame *parent_frame,
						   XFE_Toolbox * parent_toolbox,
						   char *title, char *subtitle,
						   char *info) 
	: XFE_ToolboxItem(parent_frame,parent_toolbox)
{
  Widget tool_item;

  m_parentFrame = parent_frame;

  // Create the base widget - a tool item
  tool_item = XtVaCreateWidget("bannerItem",
							   xfeToolItemWidgetClass,
							   parent_toolbox->getBaseWidget(),
							   XmNuserData,				this,
							   NULL);
	
  m_form = XtVaCreateManagedWidget("banner",
								   xmFormWidgetClass,
								   tool_item,
								   NULL);
  
  // no proxy icon yet -- you must call setProxyIcon.
  
  m_titlelabel = XtVaCreateManagedWidget("title",
										 xmLabelWidgetClass,
										 m_form,
										 XmNleftAttachment, XmATTACH_FORM,
										 XmNrightAttachment, XmATTACH_NONE,
										 XmNtopAttachment, XmATTACH_FORM,
										 XmNbottomAttachment, XmATTACH_FORM,
										 NULL);

  m_subtitlelabel = XtVaCreateManagedWidget("subtitle",
											xmLabelWidgetClass,
											m_form,
											XmNleftAttachment, XmATTACH_WIDGET,
											XmNleftWidget, m_titlelabel,
											XmNrightAttachment, XmATTACH_NONE,
											XmNtopAttachment, XmATTACH_FORM,
											XmNbottomAttachment, XmATTACH_FORM,
											NULL);

  m_infolabel = XtVaCreateManagedWidget("info",
										xmLabelWidgetClass,
										m_form,
										XmNalignment, XmALIGNMENT_END,
										XmNleftAttachment, XmATTACH_WIDGET,
										XmNleftWidget, m_subtitlelabel,
										XmNrightAttachment, XmATTACH_FORM,
										XmNtopAttachment, XmATTACH_FORM,
										XmNbottomAttachment, XmATTACH_FORM,
										NULL);

  // Register banner widgets for dragging
  addDragWidget(m_form);
  addDragWidget(m_titlelabel);
  addDragWidget(m_subtitlelabel);
  addDragWidget(m_infolabel);

  // Create the logo
  m_logo = new XFE_Logo(m_parentFrame,tool_item,"logo");

  // It will always be small for this component
  m_logo->setSize(XFE_ANIMATION_SMALL);
										
  setBaseWidget(tool_item);

  m_proxyicon = NULL;
  m_mommyButton = NULL;
  m_titleComponent = NULL;
  m_arrowButton = NULL;

  setTitle(title);
  setSubtitle(subtitle);
  setInfo(info);
}
Example #12
0
XFE_SubscribeView::XFE_SubscribeView(XFE_Component *toplevel_component, 
									 Widget parent,
									 XFE_View *parent_view,
									 MWContext *context,
									 MSG_Host *host,
									 MSG_Pane *p)
	: XFE_MNView(toplevel_component, parent_view, context, p)
{
	Widget folder;
	XFE_SubAllView *suballview;
	XFE_SubSearchView *subsearchview;
	XFE_SubNewView *subnewview;
	int all_buttons_maxwidth, search_buttons_maxwidth, new_buttons_maxwidth;
	int max_button_width;

	if (!p)
		{
            setPane(MSG_CreateSubscribePaneForHost(m_contextData,
                                                   XFE_MNView::m_master,
                                                   host));
            XP_ASSERT(m_pane != 0);
		}

	getToplevel()->registerInterest(XFE_View::chromeNeedsUpdating,
									this,
									(XFE_FunctionNotification)updateButtons_cb);

	folder = XtVaCreateWidget("subscribeFolder",
							  xmlFolderWidgetClass,
							  parent,
							  NULL);

	setBaseWidget(folder);

	XtAddCallback(folder, XmNactivateCallback, tab_activate_callback, this);

	suballview = new XFE_SubAllView(toplevel_component, folder, this, m_contextData, m_pane);
	subsearchview = new XFE_SubSearchView(toplevel_component, folder, this, m_contextData, m_pane);  
	subnewview = new XFE_SubNewView(toplevel_component, folder, this, m_contextData, m_pane);

	addView(suballview);
	addView(subsearchview);
	addView(subnewview);

	all_buttons_maxwidth = suballview->getButtonsMaxWidth();
	search_buttons_maxwidth = subsearchview->getButtonsMaxWidth();
	new_buttons_maxwidth = subnewview->getButtonsMaxWidth();

	max_button_width = all_buttons_maxwidth;
	if (search_buttons_maxwidth > max_button_width)
	  max_button_width = search_buttons_maxwidth;
	if (new_buttons_maxwidth > max_button_width)
	  max_button_width = new_buttons_maxwidth;

	suballview->setButtonsWidth(max_button_width);
	subsearchview->setButtonsWidth(max_button_width);
	subnewview->setButtonsWidth(max_button_width);

	suballview->show();
	subsearchview->show();
	subnewview->show();

	// make the subtabview generate the list of of servers.
	XFE_SubTabView::syncServerList();

	static MSG_SubscribeCallbacks subscribe_callbacks = {
	  XFE_SubscribeView::do_fetch_group,
	  XFE_SubscribeView::fetch_completed
	};

	// since the all tab is the visible one when we start.
	tab_activate(0);

	MSG_SubscribeSetCallbacks(m_pane, &subscribe_callbacks, this);
}