From cc14d0c4e31e4775f2a22c2eae3219242d1a6574 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Fri, 11 Sep 1998 18:58:50 +0000 Subject: [PATCH] Pull hackTranslations members. --- cmd/xfe/src/Frame.cpp | 168 +----------------------------------------- cmd/xfe/src/Frame.h | 3 - 2 files changed, 1 insertion(+), 170 deletions(-) diff --git a/cmd/xfe/src/Frame.cpp b/cmd/xfe/src/Frame.cpp index fce63f96c4e0..b75c0abde735 100644 --- a/cmd/xfe/src/Frame.cpp +++ b/cmd/xfe/src/Frame.cpp @@ -1897,172 +1897,6 @@ XFE_Frame::getActiveFrame() return frame; } -void -XFE_Frame::hackTranslations(Widget widget) -{ - XtTranslations global_translations = 0; - XtTranslations secondary_translations = 0; - - if (XmIsGadget (widget)) - return; - - /* To prevent focus problems, dont enable translations on the menubar - and its children. The problem was that when we had the translations - in the menubar too, we could do a translation and popup a modal - dialog when one of the menu's from the menubar was pulleddown. Now - motif gets too confused about who holds pointer and keyboard focus. - */ - - if (XmIsRowColumn(widget)) { - unsigned char type; - XtVaGetValues(widget, XmNrowColumnType, &type, 0); - if (type == XmMENU_BAR) - return; - } - - switch (m_frametype) - { - case FRAME_EDITOR: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.editor_global_translations; - break; - - case FRAME_BROWSER: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.browser_global_translations; - break; - - case FRAME_MAILNEWS_FOLDER: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.mailnews_global_translations; - break; - - case FRAME_MAILNEWS_THREAD: - case FRAME_MAILNEWS_MSG: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.messagewin_global_translations; - break; - - case FRAME_MAILNEWS_SEARCH: - global_translations = fe_globalData.mnsearch_global_translations; - break; - - case FRAME_MAILNEWS_COMPOSE: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.mailcompose_global_translations; - break; - - case FRAME_BOOKMARK: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.bm_global_translations; - break; - - case FRAME_ADDRESSBOOK: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.ab_global_translations; - break; - - case FRAME_HISTORY: - global_translations = fe_globalData.global_translations; - secondary_translations = fe_globalData.gh_global_translations; - - default: - break; - } - - if (!XP_STRCMP( XtName(widget), "editorDrawingArea" )) { - XtOverrideTranslations (widget, fe_globalData.global_translations); - XtOverrideTranslations (widget, fe_globalData.editor_global_translations); - } - else { - if (global_translations) - XtOverrideTranslations (widget, global_translations); - if (secondary_translations) - XtOverrideTranslations (widget, secondary_translations); - } - - if (XmIsTextField (widget) || XmIsText (widget) || XmIsList(widget)) - { - /* Set up the editing translations (all text fields, everywhere.) */ - if (XmIsTextField (widget) || XmIsText (widget)) - hackTextTranslations (widget); - - /* Install globalTextFieldTranslations on single-line text fields in - windows which have an HTML display area (browser, mail, news) but - not in windows which don't have one (compose, download, bookmarks, - address book...) - */ - if (m_haveHTMLDisplay && - XmIsTextField (widget) && - fe_globalData.global_text_field_translations) - XtOverrideTranslations (widget, - fe_globalData.global_text_field_translations); - } - else - { - Widget *kids = 0; - Cardinal nkids = 0; - - /* Not a Text or TextField. - */ - /* Install globalNonTextTranslations on non-text widgets in windows which - have an HTML display area (browser, mail, news, view source) but not - in windows which don't have one (compose, download, bookmarks, - address book...) - */ - - /* Install globalNonTextTranslations on non-text widgets in windows - which have an HTML display area (browser, mail, news, view source) - but not in windows which either don't have one (download, - bookmarks, address book...) or have one that is editable. - */ - if (m_haveHTMLDisplay - && m_frametype != FRAME_EDITOR - && m_frametype != FRAME_MAILNEWS_COMPOSE - && fe_globalData.global_nontext_translations) - XtOverrideTranslations (widget, - fe_globalData.global_nontext_translations); - - /* Now recurse on the children. - */ - XtVaGetValues (widget, XmNchildren, &kids, XmNnumChildren, &nkids, 0); - while (nkids--) - hackTranslations (kids [nkids]); - } -} - -void -XFE_Frame::hackTextTranslations(Widget widget) -{ - Widget parent = widget; - - for (parent=widget; parent && !XtIsWMShell (parent); parent=XtParent(parent)) - if (XmLIsGrid(parent)) - /* We shouldn't be messing with Grid widget and its children */ - return; - - if (XmIsTextField(widget)) - { - if (fe_globalData.editing_translations) - XtOverrideTranslations (widget, fe_globalData.editing_translations); - if (fe_globalData.single_line_editing_translations) - XtOverrideTranslations (widget, - fe_globalData.single_line_editing_translations); - } - else if (XmIsText(widget)) - { - if (fe_globalData.editing_translations) - XtOverrideTranslations (widget, fe_globalData.editing_translations); - if (fe_globalData.multi_line_editing_translations) - XtOverrideTranslations (widget, - fe_globalData.multi_line_editing_translations); - } - else - { - XP_ASSERT(0); - } -} - EFrameType XFE_Frame::getType() { @@ -2334,7 +2168,7 @@ XFE_Frame::realize() (void*)False); // XX assumes that the m_chromparent is the child of the shell - hackTranslations(m_chrome); + fe_HackTranslations(m_context, m_chrome); notifyInterested(XFE_Component::afterRealizeCallback); diff --git a/cmd/xfe/src/Frame.h b/cmd/xfe/src/Frame.h index a3d7f545bf06..9d503310ddad 100644 --- a/cmd/xfe/src/Frame.h +++ b/cmd/xfe/src/Frame.h @@ -284,9 +284,6 @@ protected: MWContext *m_context; void initializeMWContext(EFrameType frame_type, MWContext *context_to_copy = NULL); - void hackTranslations(Widget widget); - void hackTextTranslations(Widget widget); - // Add Z order support void zaxis_AddSupport();