#ifndef _c_Broadcasting_Text_Edit_View_h #define _c_Broadcasting_Text_Edit_View_h #include #include // =========================================================================== // cBroadcastingTextEditView.h Version 1.1 ©1998 Joakim Braun All rights reserved. // =========================================================================== // // A subclass of LTextEditView() whose UserChangedText() function broadcasts a message // whenever called, and passes up a command to the super commander. Each of these functions // may be enabled/disabled and have its parameters set in Constructor or programmatically. // The ioParam passed when sending the message and the command may be set to either NULL, // the pane ID of the view, the "this" pointer, the view's TEHandle, // or the value of the text in the LTextEditView. // cBroadcastingTextEditView is free for any and all use. // Do not distribute modified source code under my name. // No support promised, no liability accepted. Provided "as is". // That said, I can be reached at braun@swipnet.se. // Change history: // 1.0 May 1, 1998 First release // 1.1 August 30, 1998 We call LTextEditView::UserChangedText() in our own version, after having done our stuff. // Check whether we're really broadcasting in DoSendMessage(). class cBroadcastingTextEditView: public LTextEditView, public LBroadcaster{ public: enum { class_ID = 'bTxt' }; enum ioParamEnum { eNULLIoParam = 0, ePaneIDIoParam, eThisPtrIoParam, eTEHandleIoParam, eValueIoParam } ; cBroadcastingTextEditView(void); cBroadcastingTextEditView(LStream *inStream ); virtual ~cBroadcastingTextEditView(void){} void SetMessage(MessageT newMsg, ioParamEnum ioParamEnum); void GetMessage(MessageT& outMsg, Int16& outIoParamEnum); void SetCommand(CommandT newCmd, ioParamEnum ioParamEnum); void GetCommand(CommandT& outCmd, Int16& outIoParamEnum); virtual void UserChangedText(); protected: MessageT mUserChangedTextMsg; CommandT mUserChangedTextCmd; Int16 mMsgIoParamType, mCmdIoParamType; void DefaultInit(void); void DoSendMessage(void); void DoSendCommand(void); }; #endif