Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

ScriptEditorView.h

Go to the documentation of this file.
00001 /* QuestDesigner - Open Zelda's Project
00002    Copyright (C) 2003 Kronuz
00003    Copyright (C) 2001/2003 Open Zelda's Project
00004  
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 */
00020 
00025 #pragma once
00026 
00027 #include <codemax.h>
00028 #include "cmaxwtl.h"
00029 #define CMLANG_ZES _T("OZ Script file")
00030 
00032 // Forward declarations
00033 class CScriptEditorFrame;
00034 
00035 class CScriptEditorView:
00036     public CWindowImpl<CScriptEditorView, CodeMaxControl>,
00037     public CodeMaxControlNotifications<CScriptEditorView>,
00038     public CodeMaxControlCommands<CScriptEditorView>
00039 {
00040 private:
00041     // Pointer to parent frame
00042     CScriptEditorFrame *m_pParentFrame;
00043     // The view's file name
00044     CString m_sFileName;
00045     // The view's title
00046     CString m_sTitle;
00047 
00048 public:
00049     // Construction/Destruction
00050     CScriptEditorView(CScriptEditorFrame *pParentFrame);
00051 
00052     DECLARE_WND_SUPERCLASS(NULL, CodeMaxControl::GetWndClassName())
00053 
00054     // Called to translate window messages before they are dispatched 
00055     BOOL PreTranslateMessage(MSG * pMsg);
00056     // Called to do idle processing
00057     virtual BOOL OnIdle();
00058     // Called to clean up after window is destroyed
00059     virtual void OnFinalMessage(HWND /*hWnd*/);
00060 
00061     BEGIN_MSG_MAP(CScriptEditorView)
00062         
00063         MESSAGE_HANDLER(WM_CREATE, OnCreate)
00064         MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
00065 
00066         COMMAND_ID_HANDLER(ID_FILE_RELOAD, OnFileReload)
00067         COMMAND_ID_HANDLER(ID_FILE_SAVE, OnFileSave)
00068         COMMAND_ID_HANDLER(ID_FILE_SAVE_AS, OnFileSaveAs)
00069         
00070         COMMAND_ID_HANDLER(ID_EDIT_TAB, OnEditTab)
00071         COMMAND_ID_HANDLER(ID_EDIT_UNTAB, OnEditUntab)
00072         
00073         COMMAND_ID_HANDLER(ID_EDIT_FIND_NEXT, OnEditFindNext)
00074         COMMAND_ID_HANDLER(ID_EDIT_FIND_PREV, OnEditFindPrev)
00075         COMMAND_ID_HANDLER(ID_EDIT_FIND_SELECTION, OnEditFindSelection)
00076 
00077         COMMAND_ID_HANDLER(ID_EDIT_GOTO_LINE, OnEditGotoLine)
00078         COMMAND_ID_HANDLER(ID_EDIT_MATCH_BRACE, OnEditMatchBrace)
00079         
00080         COMMAND_ID_HANDLER(ID_EDIT_READ_ONLY, OnEditReadOnly)
00081 
00082         COMMAND_ID_HANDLER(ID_EDIT_UPPERCASE, OnEditUppercase)
00083         COMMAND_ID_HANDLER(ID_EDIT_LOWERCASE, OnEditLowercase)
00084         COMMAND_ID_HANDLER(ID_EDIT_TABIFY, OnEditTabify)
00085         COMMAND_ID_HANDLER(ID_EDIT_UNTABIFY, OnEditUntabify)
00086         COMMAND_ID_HANDLER(ID_EDIT_SHOW_WHITE_SPACE, OnShowWhiteSpace)
00087         
00088         COMMAND_ID_HANDLER(ID_EDIT_TOGGLE_BOOKMARK, OnEditToggleBookmark)
00089         COMMAND_ID_HANDLER(ID_EDIT_GOTO_NEXT_BOOKMARK, OnEditGotoNextBookmark)
00090         COMMAND_ID_HANDLER(ID_EDIT_GOTO_PREV_BOOKMARK, OnUpdateEditGotoPrevBookmark)
00091         COMMAND_ID_HANDLER(ID_EDIT_CLEAR_ALL_BOOKMARKS, OnEditClearAllBookmarks)
00092 
00093         // Make sure that the notification and default message handlers get a crack at the messages
00094         CHAIN_MSG_MAP_ALT(CodeMaxControlNotifications<CScriptEditorView>, CMAX_REFLECTED_NOTIFY_CODE_HANDLERS)
00095         CHAIN_MSG_MAP_ALT(CodeMaxControlCommands<CScriptEditorView>, CMAX_BASIC_COMMAND_ID_HANDLERS)
00096 
00097     END_MSG_MAP()
00098 
00099 // Handler prototypes (uncomment arguments if needed):
00100 //  LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
00101 //  LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
00102 //  LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
00103 
00104     LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &bHandled);
00105     LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL &bHandled);
00106 
00110 public:
00111 
00112     LRESULT OnFileReload(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00113 
00114     // Save handlers
00115     LRESULT OnFileSave(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00116     LRESULT OnFileSaveAs(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00117 
00118     // Indent/Unindent the current selection
00119     LRESULT OnEditTab(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00120     LRESULT OnEditUntab(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00121 
00122     // Find next/previous search match in the buffer
00123     LRESULT OnEditFindNext(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00124     LRESULT OnEditFindPrev(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00125 
00126     // Searches the buffer using the current selection as the search parameter
00127     LRESULT OnEditFindSelection(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00128     // Jump to the desired line
00129     LRESULT OnEditGotoLine(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00130 
00131     // Find the current brace's 'sibling'
00132     LRESULT OnEditMatchBrace(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00133     
00134     // Set buffer to read-only
00135     LRESULT OnEditReadOnly(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00136 
00137     // Advanced edit commands
00138     LRESULT OnEditUppercase(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00139     LRESULT OnEditLowercase(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00140     LRESULT OnEditTabify(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00141     LRESULT OnEditUntabify(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00142     LRESULT OnShowWhiteSpace(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00143     
00144     // Bookmark functions
00145     LRESULT OnEditToggleBookmark(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00146     LRESULT OnEditGotoNextBookmark(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00147     LRESULT OnUpdateEditGotoPrevBookmark(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00148     LRESULT OnEditClearAllBookmarks(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
00149 
00150     // Open a file
00151     BOOL DoFileOpen(LPCTSTR , LPCTSTR=_T("Untitled"));
00152 
00153     // Save the file
00154     BOOL DoFileSave(const CString &);
00155     BOOL DoFileSaveAs();
00156 
00157     // Reload a file
00158     BOOL DoReload ();
00159 
00160 };

Generated on Wed Apr 16 19:12:22 2003 for QuestDesigner by doxygen1.2.18