diff --git a/mozilla/cmd/macfe/Composer/meditor.cp b/mozilla/cmd/macfe/Composer/meditor.cp index dcbeefed34c..886d10ee3d7 100644 --- a/mozilla/cmd/macfe/Composer/meditor.cp +++ b/mozilla/cmd/macfe/Composer/meditor.cp @@ -19,6 +19,7 @@ #include "meditor.h" // HandleModalDialog #include "StBlockingDialogHandler.h" #include "CEditView.h" +#include "mforms.h" // CFormHTMLArea #include "macgui.h" // UGraphics::MakeLOColor #include "CPaneEnabler.h" #include "resgui.h" // EDITDLG_AUTOSAVE @@ -167,9 +168,14 @@ void FE_EditorDocumentLoaded( MWContext *pContext ) return; CEditView *editView = (CEditView *)ExtractHyperView(pContext); - + CFormHTMLArea *editForm = dynamic_cast(editView); int32 iSave; - if ( pContext->bIsComposeWindow ) + + if ( editForm != NULL) // are we an embedded composer form? + { + iSave = 0; // no auto-save + } + else if ( pContext->bIsComposeWindow ) { iSave = 0; // auto-save @@ -202,7 +208,7 @@ void FE_EditorDocumentLoaded( MWContext *pContext ) editView->mEditorDoneLoading = true; // set color popup control to show correct default color (now that we have an mwcontext) - editView->mColorPopup->InitializeCurrentColor(); + if (editView->mColorPopup) editView->mColorPopup->InitializeCurrentColor(); } InitCursor(); diff --git a/mozilla/cmd/macfe/central/mforms.cp b/mozilla/cmd/macfe/central/mforms.cp index 0bd8c63be80..2536f29c527 100644 --- a/mozilla/cmd/macfe/central/mforms.cp +++ b/mozilla/cmd/macfe/central/mforms.cp @@ -44,6 +44,7 @@ #include "layers.h" // mjc #include "prefapi.h" #include "intl_csi.h" +#include "edt.h" // PP //#include @@ -728,6 +729,22 @@ Boolean CFormBigText::HandleKeyPress(const EventRecord& inKeyEvent) return handled; } +#pragma mark == CFormHTMLArea == + +//--------------------------------------------------------------------------- +// class CFormHTMLArea +//--------------------------------------------------------------------------- + +CFormHTMLArea::CFormHTMLArea(LStream *inStream) + : CEditView(inStream), + LFormElement() +{ + +} + +CFormHTMLArea::~CFormHTMLArea() +{ +} #pragma mark == CFormList == @@ -2744,6 +2761,20 @@ FE_SelectInputElement( MWContext * window, textEdit->SelectAll(); break; + +#ifdef ENDER + // embedded composer - select all + case FORM_TYPE_HTMLAREA: + if ( !GetFEData( formElement ) ) + return; + if ( !GetFEDataPane( formElement ) ) + return; + + LPane *scroller2 = GetFEDataPane(formElement); + CFormHTMLArea *htmlEdit = (CFormHTMLArea*) scroller2->FindPaneByID(formHTMLAreaID); Assert_(htmlEdit != NULL); + EDT_SelectAll(((LFormElement*)htmlEdit)->GetContext()); + break; +#endif /*ENDER*/ /* These are not selectable @@ -2898,6 +2929,7 @@ FE_ClickInputElement( MWContext * window, case FORM_TYPE_PASSWORD: case FORM_TYPE_ISINDEX: case FORM_TYPE_TEXTAREA: + case FORM_TYPE_HTMLAREA: case FORM_TYPE_FILE: case FORM_TYPE_SELECT_ONE: case FORM_TYPE_SELECT_MULT: @@ -3153,6 +3185,9 @@ LFormElement::MochaChanged() LO_FormElementData* data = fLayoutElement->lo_form.element_data; if (data != NULL && (data->type == FORM_TYPE_TEXTAREA || +#ifdef ENDER + data->type == FORM_TYPE_HTMLAREA || +#endif /*ENDER*/ data->type == FORM_TYPE_TEXT || data->type == FORM_TYPE_PASSWORD) && (fLayoutElement->lo_form.event_handler_present || HasKeyEventCapture(fContext))) diff --git a/mozilla/cmd/macfe/central/mforms.h b/mozilla/cmd/macfe/central/mforms.h index affe5ffc69d..a84f929cef1 100644 --- a/mozilla/cmd/macfe/central/mforms.h +++ b/mozilla/cmd/macfe/central/mforms.h @@ -34,6 +34,7 @@ #include "CSimpleTextView.h" // For CFormBigText //#include "VEditField.h" #include "CTSMEditField.h" +#include "CEditView.h" // for CFormHTMLArea #include "CKeyUpReceiver.h" // mixin for forms that need to receive key up events @@ -314,6 +315,22 @@ protected: void DrawSelf();// Draws background to white }; +/***************************************************************************** + * class CFormHTMLArea + * Large edit html field. + *****************************************************************************/ + +class CFormHTMLArea : public CEditView, public LFormElement { +public: + enum { class_ID = 'fhtm' }; + +// ее Constructors/destructors + CFormHTMLArea(LStream *inStream); + + virtual ~CFormHTMLArea(); +}; + + /***************************************************************************** * class CFormList * List used in forms. diff --git a/mozilla/cmd/macfe/include/resgui.h b/mozilla/cmd/macfe/include/resgui.h index 4390a2ce642..6e0e6c5d4c7 100644 --- a/mozilla/cmd/macfe/include/resgui.h +++ b/mozilla/cmd/macfe/include/resgui.h @@ -870,9 +870,11 @@ #define formGAResetButton 4016 #define formGAPlainButton 4017 #define formBigTextScroll 4018 +#define formHTMLArea 4019 #define formScrollingListID 'list' // ID of the subview that is the list withing the scroller #define formBigTextID 'text' // ID of the subview that is the TEXT withing the scroller +#define formHTMLAreaID 'ehtm' // ID of the subview that is the HTML within the scroller #define formPopupChosen 2003 diff --git a/mozilla/cmd/macfe/rsrc/communicator/Forms.cnst b/mozilla/cmd/macfe/rsrc/communicator/Forms.cnst index f38667b42e3..7521a1f69eb 100644 Binary files a/mozilla/cmd/macfe/rsrc/communicator/Forms.cnst and b/mozilla/cmd/macfe/rsrc/communicator/Forms.cnst differ