Index: CompleteWordDlg.cpp =================================================================== RCS file: /cvs/mushclient/CompleteWordDlg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** CompleteWordDlg.cpp 11 Jun 2008 02:15:37 -0000 1.4 --- CompleteWordDlg.cpp 27 Jun 2008 21:35:50 -0000 1.5 *************** *** 25,30 **** --- 25,32 ---- //}}AFX_DATA_INIT m_bLua = false; + m_bFunctions = true; + m_extraItems = NULL; } *************** *** 68,110 **** int iCount = 0; ! for (int i = 0; sFunctions [i] [0]; i++) { ! strFunction = sFunctions [i]; ! strFunction.MakeLower (); ! strFunction = strFunction.Left (iFilterLength); ! ! if (m_strFilter == strFunction) { ! m_ctlFunctions.AddString (sFunctions [i]); ! iCount++; ! } ! } ! // add Lua functions ! if (m_bLua) { set::const_iterator it; ! for (it = LuaFunctionsSet.begin (); ! it != LuaFunctionsSet.end (); ! it++) ! ! { ! strFunction = it->c_str (); ! strFunction.MakeLower (); ! strFunction = strFunction.Left (iFilterLength); ! ! if (m_strFilter == strFunction) ! { ! m_ctlFunctions.AddString (it->c_str ()); ! iCount++; ! } ! } // end of doing each Lua function ! ! for (it = LuaTablesSet.begin (); ! it != LuaTablesSet.end (); it++) { --- 70,137 ---- int iCount = 0; ! if (m_bFunctions) { ! for (int i = 0; sFunctions [i] [0]; i++) { ! strFunction = sFunctions [i]; ! strFunction.MakeLower (); ! strFunction = strFunction.Left (iFilterLength); ! ! if (m_strFilter == strFunction) ! { ! m_ctlFunctions.AddString (sFunctions [i]); ! iCount++; ! } ! } ! // add Lua functions ! if (m_bLua) ! { ! set::const_iterator it; ! ! for (it = LuaFunctionsSet.begin (); ! it != LuaFunctionsSet.end (); ! it++) ! ! { ! strFunction = it->c_str (); ! strFunction.MakeLower (); ! strFunction = strFunction.Left (iFilterLength); ! ! if (m_strFilter == strFunction) ! { ! m_ctlFunctions.AddString (it->c_str ()); ! iCount++; ! } ! } // end of doing each Lua function ! ! for (it = LuaTablesSet.begin (); ! it != LuaTablesSet.end (); ! it++) ! ! { ! strFunction = it->c_str (); ! strFunction.MakeLower (); ! strFunction = strFunction.Left (iFilterLength); ! ! if (m_strFilter == strFunction) ! { ! m_ctlFunctions.AddString (it->c_str ()); ! iCount++; ! } ! } // end of doing each Lua function ! ! } // if Lua wanted ! } // end of functions wanted ! ! if (m_extraItems) { set::const_iterator it; ! for (it = m_extraItems->begin (); ! it != m_extraItems->end (); it++) { *************** *** 118,125 **** iCount++; } } // end of doing each Lua function ! ! } // if Lua wanted // select the exact match, if any (so, if they highlight world.Note then it is selected) --- 145,151 ---- iCount++; } } // end of doing each Lua function ! } // select the exact match, if any (so, if they highlight world.Note then it is selected) Index: CompleteWordDlg.h =================================================================== RCS file: /cvs/mushclient/CompleteWordDlg.h,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** CompleteWordDlg.h 26 Apr 2007 02:55:45 -0000 1.2 --- CompleteWordDlg.h 27 Jun 2008 21:35:50 -0000 1.3 *************** *** 29,34 **** --- 29,36 ---- CPoint m_pt; // where to put it bool m_bLua; + bool m_bFunctions; + set * m_extraItems; // Overrides // ClassWizard generated virtual function overrides Index: MDITabs.cpp =================================================================== RCS file: /cvs/mushclient/MDITabs.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** MDITabs.cpp 3 Jun 2008 03:50:02 -0000 1.5 --- MDITabs.cpp 30 Jun 2008 03:50:50 -0000 1.6 *************** *** 117,123 **** CTextDocument * pDoc = pNotepadFrame->m_pDoc; if (!pDoc->m_strTitle.IsEmpty ()) strName = pDoc->m_strTitle; ! if (pDoc->IsModified ()) strName += " *"; } --- 117,123 ---- CTextDocument * pDoc = pNotepadFrame->m_pDoc; if (!pDoc->m_strTitle.IsEmpty ()) strName = pDoc->m_strTitle; ! if (pDoc->IsModified () && !pDoc->m_bReadOnly) strName += " *"; } Index: MUSHclient.cpp =================================================================== RCS file: /cvs/mushclient/MUSHclient.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -c -r1.90 -r1.91 *** MUSHclient.cpp 23 Jun 2008 23:32:17 -0000 1.90 --- MUSHclient.cpp 27 Jun 2008 21:35:50 -0000 1.91 *************** *** 493,504 **** if (!bWine) CoInitialize (NULL); ! // try to set up for DirectSound ! if (FAILED (DirectSoundCreate (NULL, &m_pDirectSoundObject, NULL))) ! m_pDirectSoundObject = NULL; ! // set sound cooperation level ! if (FAILED (m_pDirectSoundObject->SetCooperativeLevel (pMainFrame->m_hWnd, DSSCL_NORMAL))) ! m_pDirectSoundObject = NULL; // no DirectSound DSBUFFERDESC bd; --- 493,514 ---- if (!bWine) CoInitialize (NULL); ! // check direct sound available ! FARPROC pDirectSoundCreate = NULL; ! ! HMODULE hDLL = LoadLibrary ("dsound"); ! if (hDLL) ! pDirectSoundCreate = GetProcAddress(hDLL, "DirectSoundCreate"); ! ! if (pDirectSoundCreate) ! { ! // try to set up for DirectSound ! if (FAILED (DirectSoundCreate (NULL, &m_pDirectSoundObject, NULL))) ! m_pDirectSoundObject = NULL; ! // set sound cooperation level ! if (FAILED (m_pDirectSoundObject->SetCooperativeLevel (pMainFrame->m_hWnd, DSSCL_NORMAL))) ! m_pDirectSoundObject = NULL; // no DirectSound ! } DSBUFFERDESC bd; Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.220 retrieving revision 1.221 diff -c -r1.220 -r1.221 *** MUSHclient.rc 22 Jun 2008 04:59:25 -0000 1.220 --- MUSHclient.rc 27 Jun 2008 21:35:50 -0000 1.221 *************** *** 75,82 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,29,0 ! PRODUCTVERSION 4,0,29,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 75,82 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,30,0 ! PRODUCTVERSION 4,0,30,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L *************** *** 94,107 **** VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.29\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.29\0" VALUE "SpecialBuild", "\0" END END --- 94,107 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.30\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.30\0" VALUE "SpecialBuild", "\0" END END Index: PluginsDlg.cpp =================================================================== RCS file: /cvs/mushclient/PluginsDlg.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** PluginsDlg.cpp 13 Jun 2007 06:16:04 -0000 1.21 --- PluginsDlg.cpp 27 Jun 2008 21:35:50 -0000 1.22 *************** *** 504,516 **** return; } // end of using inbuilt notepad ! if ((long) ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL) <= 32) ::UMessageBox(TFormat ("Unable to edit the plugin file %s.", (LPCTSTR) strName), MB_ICONEXCLAMATION); } // end of CPluginsDlg::EditPlugin --- 504,525 ---- return; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! { ::UMessageBox(TFormat ("Unable to edit the plugin file %s.", (LPCTSTR) strName), MB_ICONEXCLAMATION); + return; + } + + // bring editor to the front + if (m_pDoc && !m_pDoc->m_strEditorWindowName.IsEmpty ()) + SendToFront (m_pDoc->m_strEditorWindowName); } // end of CPluginsDlg::EditPlugin *************** *** 673,684 **** continue; } // end of using inbuilt notepad ! if ((long) ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL) <= 32) ::UMessageBox(TFormat ("Unable to edit the plugin state file %s.", (LPCTSTR) strName), ! MB_ICONEXCLAMATION); } // end of loop *pResult = 0; --- 682,702 ---- continue; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_pDoc->m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) strName), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ::UMessageBox(TFormat ("Unable to edit the plugin state file %s.", (LPCTSTR) strName), ! MB_ICONEXCLAMATION); ! else ! { ! // bring editor to the front ! if (m_pDoc && !m_pDoc->m_strEditorWindowName.IsEmpty ()) ! SendToFront (m_pDoc->m_strEditorWindowName); ! } ! } // end of loop *pResult = 0; Index: TextDocument.cpp =================================================================== RCS file: /cvs/mushclient/TextDocument.cpp,v retrieving revision 1.19 retrieving revision 1.21 diff -c -r1.19 -r1.21 *** TextDocument.cpp 11 Jun 2008 01:13:03 -0000 1.19 --- TextDocument.cpp 30 Jun 2008 03:50:50 -0000 1.21 *************** *** 53,58 **** --- 53,59 ---- m_bOutput = false; m_bNotes = false; m_iLines = false; + m_bReadOnly = FALSE; // save method m_iSaveOnChange = eNotepadSaveDefault; *************** *** 498,504 **** return CDocument::SaveModified(); ! } void CTextDocument::OnEditConvertclipboardforumcodes() --- 499,505 ---- return CDocument::SaveModified(); ! } // end of CTextDocument::SaveModified void CTextDocument::OnEditConvertclipboardforumcodes() *************** *** 510,513 **** putontoclipboard (QuoteForumCodes (strContents)); ! } --- 511,529 ---- putontoclipboard (QuoteForumCodes (strContents)); ! } // end of CTextDocument::OnEditConvertclipboardforumcodes ! ! ! void CTextDocument::SetReadOnly (BOOL bReadOnly) ! { ! // don't bother asking if they want to save an empty document ! CTextView* pView = (CTextView*) m_viewList.GetHead(); ! ! if (GetText (pView->GetEditCtrl ()).IsEmpty ()) ! return; ! ! if (pView) ! pView->GetEditCtrl ().SetReadOnly (bReadOnly); ! ! m_bReadOnly = bReadOnly; ! } // end of CTextDocument::SetReadOnly Index: TextDocument.h =================================================================== RCS file: /cvs/mushclient/TextDocument.h,v retrieving revision 1.8 retrieving revision 1.10 diff -c -r1.8 -r1.10 *** TextDocument.h 8 Oct 2006 02:52:26 -0000 1.8 --- TextDocument.h 30 Jun 2008 03:50:50 -0000 1.10 *************** *** 61,66 **** --- 61,68 ---- int m_iLines; int m_iNotepadType; // "type" of notepad window - see enum in doc.h + BOOL m_bReadOnly; + // Operations public: *************** *** 89,94 **** --- 91,97 ---- virtual BOOL DoSave (LPCTSTR lpszPathName, BOOL bReplace = TRUE); void CreateMonitoringThread(const char * sName); void SetTheFont (void); + void SetReadOnly (BOOL bReadOnly); // Generated message map functions protected: Index: Utilities.cpp =================================================================== RCS file: /cvs/mushclient/Utilities.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -c -r1.77 -r1.78 *** Utilities.cpp 18 Mar 2008 06:02:13 -0000 1.77 --- Utilities.cpp 27 Jun 2008 21:35:50 -0000 1.78 *************** *** 2928,2930 **** --- 2928,2972 ---- } + + /* callback function for EnumWindows */ + + static BOOL CALLBACK EnumWindowsProc (HWND hwnd, LPARAM lParam) + { + const char * name = (const char *) lParam; /* wanted title */ + char buf [1024]; + + /* find title of this window */ + + if (GetWindowText (hwnd, buf, sizeof buf) == 0) + return TRUE; /* keep going */ + + /* if title shorter than our string, can't match */ + if (strlen (buf) < strlen (name)) + return TRUE; /* keep going */ + + /* see if leading part of title matches */ + if (memcmp (buf, name, strlen (name)) == 0) + { + SetForegroundWindow (hwnd); /* bring to foreground */ + return FALSE; + } /* found match */ + + return TRUE; + + } /* end of EnumWindowsProc */ + + /* sends the nominated window to the front, based on the + leading characters in its name (first match) + + Example: + + SendToFront ("Crimson Editor") + + */ + + void SendToFront (const char * name) + { + EnumWindows (&EnumWindowsProc, (int) name); + } /* end of send_to_front */ + Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.230 retrieving revision 1.232 diff -c -r1.230 -r1.232 *** doc.cpp 23 Jun 2008 06:27:54 -0000 1.230 --- doc.cpp 29 Jun 2008 00:04:23 -0000 1.232 *************** *** 508,513 **** --- 508,515 ---- DISP_FUNCTION(CMUSHclientDoc, "PlaySound", PlaySound, VT_I4, VTS_I2 VTS_BSTR VTS_BOOL VTS_R8 VTS_R8) DISP_FUNCTION(CMUSHclientDoc, "SetCommandWindowHeight", SetCommandWindowHeight, VT_I4, VTS_I2) DISP_FUNCTION(CMUSHclientDoc, "SetToolBarPosition", SetToolBarPosition, VT_I4, VTS_I2 VTS_BOOL VTS_I2 VTS_I4 VTS_I4) + DISP_FUNCTION(CMUSHclientDoc, "ShiftTabCompleteItem", ShiftTabCompleteItem, VT_I4, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "NotepadReadOnly", NotepadReadOnly, VT_I4, VTS_BSTR VTS_BOOL) DISP_PROPERTY_PARAM(CMUSHclientDoc, "NormalColour", GetNormalColour, SetNormalColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "BoldColour", GetBoldColour, SetBoldColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "CustomColourText", GetCustomColourText, SetCustomColourText, VT_I4, VTS_I2) *************** *** 7833,7836 **** --- 7835,7839 ---- putontoclipboard (QuoteForumCodes (strContents)); } + Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.244 retrieving revision 1.247 diff -c -r1.244 -r1.247 *** doc.h 23 Jun 2008 06:27:54 -0000 1.244 --- doc.h 30 Jun 2008 03:50:50 -0000 1.247 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 429 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.29"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT --- 21,28 ---- // New versions - things to change ! #define THISVERSION 430 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.30"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 817,822 **** --- 817,826 ---- unsigned short m_bScriptErrorsToOutputWindow; // write script errors in window unsigned short m_bAutoResizeCommandWindow; // change command window height automatically + CString m_strEditorWindowName; // What window to bring to the front after editing a text file + unsigned short m_iAutoResizeMinimumLines; // command window minimum number of lines + unsigned short m_iAutoResizeMaximumLines; // command window maximum number of lines + unsigned short m_bDoNotAddMacrosToCommandHistory; // macros not into command history // end of stuff saved to disk ************************************************************** *************** *** 1075,1080 **** --- 1079,1087 ---- unsigned short m_iLastOutgoingChatPort; CString m_strLastOutgoingChatAddress; + set m_ExtraShiftTabCompleteItems; // for Shift+Tab completion + bool m_bTabCompleteFunctions; + // scripting CScriptEngine * m_ScriptEngine; *************** *** 1374,1379 **** --- 1381,1388 ---- bool PlaySoundFile (CString strSound); void CancelSound (void); + CChildFrame * GetChildFrame (void); + void ChangeFont ( const int nHeight, const char * lpszFacename, const int nWeight, *************** *** 2422,2427 **** --- 2431,2438 ---- afx_msg long PlaySound(short Buffer, LPCTSTR FileName, BOOL Loop, double Volume, double Pan); afx_msg long SetCommandWindowHeight(short Height); afx_msg long SetToolBarPosition(short Which, BOOL Float, short Side, long Top, long Left); + afx_msg long ShiftTabCompleteItem(LPCTSTR Item); + afx_msg long NotepadReadOnly(LPCTSTR Title, BOOL ReadOnly); afx_msg long GetNormalColour(short WhichColour); afx_msg void SetNormalColour(short WhichColour, long nNewValue); afx_msg long GetBoldColour(short WhichColour); Index: doc_construct.cpp =================================================================== RCS file: /cvs/mushclient/doc_construct.cpp,v retrieving revision 1.28 retrieving revision 1.30 diff -c -r1.28 -r1.30 *** doc_construct.cpp 22 Jun 2008 04:59:25 -0000 1.28 --- doc_construct.cpp 29 Jun 2008 00:04:24 -0000 1.30 *************** *** 49,54 **** --- 49,55 ---- m_iCurrentActionSource = eUnknownActionSource; m_nBytesIn = 0; m_nBytesOut = 0; + m_bTabCompleteFunctions = true; m_iTriggersEvaluatedCount = 0; m_iTriggersMatchedCount = 0; *************** *** 94,99 **** --- 95,103 ---- m_bDoNotShowOutstandingLines = false; m_bDoNotTranslateIACtoIACIAC = false; m_bAutoResizeCommandWindow = false; + m_iAutoResizeMinimumLines = 1; + m_iAutoResizeMaximumLines = 20; + m_bDoNotAddMacrosToCommandHistory = false; m_bCopySelectionToClipboard = false; m_bCarriageReturnClearsLine = false; m_bConvertGAtoNewline = false; Index: functionlist.cpp =================================================================== RCS file: /cvs/mushclient/functionlist.cpp,v retrieving revision 1.33 retrieving revision 1.35 diff -c -r1.33 -r1.35 *** functionlist.cpp 23 Jun 2008 06:27:54 -0000 1.33 --- functionlist.cpp 29 Jun 2008 00:04:24 -0000 1.35 *************** *** 259,264 **** --- 259,265 ---- "NoteHr", "NotepadColour", "NotepadFont", + "NotepadReadOnly", "NotepadSaveMethod", "NoteStyle", "Open", *************** *** 315,321 **** "SetTriggerOption", "SetVariable", "SetWorldWindowStatus", ! "ShowInfoBar", "Simulate", "Sound", "SpeedWalkDelay", --- 316,323 ---- "SetTriggerOption", "SetVariable", "SetWorldWindowStatus", ! "ShowInfoBar", ! "ShiftTabCompleteItem", "Simulate", "Sound", "SpeedWalkDelay", *************** *** 364,369 **** --- 366,372 ---- strWord.GetLength () < 20 && (isalnum (strSelection [nStartChar]) || strSelection [nStartChar] == '.' || + strSelection [nStartChar] == '-' || strSelection [nStartChar] == '_') ) { *************** *** 378,383 **** --- 381,387 ---- strWord.GetLength () < 20 && (isalnum (strSelection [nEndChar]) || strSelection [nEndChar] == '.' || + strSelection [nEndChar] == '-' || strSelection [nEndChar] == '_') ) { *************** *** 473,479 **** } // end of ShowHelp ! void FunctionMenu (CEdit & editctrl, const bool bLua) { int nStartChar, --- 477,483 ---- } // end of ShowHelp ! void FunctionMenu (CEdit & editctrl, const bool bLua, set * extraItems, const bool bFunctions) { int nStartChar, *************** *** 497,502 **** --- 501,508 ---- CCompleteWordDlg dlg; dlg.m_bLua = bLua; + dlg.m_extraItems = extraItems; + dlg.m_bFunctions = bFunctions; dlg.m_pt = editctrl.PosFromChar (nEndChar - 1); // strangely doesn't work at end of line dlg.m_pt.x += 10; // small gap Index: lua_methods.cpp =================================================================== RCS file: /cvs/mushclient/lua_methods.cpp,v retrieving revision 1.88 retrieving revision 1.90 diff -c -r1.88 -r1.90 *** lua_methods.cpp 23 Jun 2008 06:27:54 -0000 1.88 --- lua_methods.cpp 29 Jun 2008 00:04:24 -0000 1.90 *************** *** 2885,2891 **** { case ACTION_NONE: iAction = 0; break; case ACTION_SEND: iAction = 1; break; ! case ACTION_HYPERLINK: iAction = 2; break; case ACTION_PROMPT: iAction = 3; break; } // end of switch --- 2885,2891 ---- { case ACTION_NONE: iAction = 0; break; case ACTION_SEND: iAction = 1; break; ! case ACTION_HYPERLINK: iAction = 2; break; case ACTION_PROMPT: iAction = 3; break; } // end of switch *************** *** 3900,3905 **** --- 3900,3920 ---- return 1; // number of result fields } // end of L_NotepadFont + + //---------------------------------------- + // world.NotepadReadOnly + //---------------------------------------- + static int L_NotepadReadOnly (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->NotepadReadOnly ( + my_checkstring (L, 1), // Title + optboolean (L, 2, 1) // true or false + )); + return 1; // number of result fields + } // end of L_NotepadReadOnly + + //---------------------------------------- // world.NotepadSaveMethod //---------------------------------------- *************** *** 4602,4607 **** --- 4617,4631 ---- return 0; // number of result fields } // end of L_SetWorldWindowStatus + //---------------------------------------- + // world.ShiftTabCompleteItem + //---------------------------------------- + static int L_ShiftTabCompleteItem (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L,pDoc->ShiftTabCompleteItem (my_checkstring (L, 1))); + return 1; // number of result fields + } // end of L_ShiftTabCompleteItem //---------------------------------------- // world.ShowInfoBar *************** *** 5157,5162 **** --- 5181,5187 ---- {"NoteColourRGB", L_NoteColourRGB}, {"NotepadColour", L_NotepadColour}, {"NotepadFont", L_NotepadFont}, + {"NotepadReadOnly", L_NotepadReadOnly}, {"NotepadSaveMethod", L_NotepadSaveMethod}, {"NoteStyle", L_NoteStyle}, {"Open", L_Open}, *************** *** 5214,5219 **** --- 5239,5245 ---- {"SetTriggerOption", L_SetTriggerOption}, {"SetVariable", L_SetVariable}, {"SetWorldWindowStatus", L_SetWorldWindowStatus}, + {"ShiftTabCompleteItem", L_ShiftTabCompleteItem}, {"ShowInfoBar", L_ShowInfoBar}, {"Simulate", L_Simulate}, {"Sound", L_Sound}, Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.217 retrieving revision 1.220 diff -c -r1.217 -r1.220 *** methods.cpp 23 Jun 2008 23:32:17 -0000 1.217 --- methods.cpp 30 Jun 2008 03:50:50 -0000 1.220 *************** *** 1338,1349 **** return; } // end of using inbuilt notepad ! if ((long) ShellExecute (Frame, _T("open"), m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL) <= 32) ::TMessageBox("Unable to edit the script file.", MB_ICONEXCLAMATION); } --- 1338,1358 ---- return; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! { ::TMessageBox("Unable to edit the script file.", MB_ICONEXCLAMATION); + return; + } + // bring editor to the front + if (!m_strEditorWindowName.IsEmpty ()) + SendToFront (m_strEditorWindowName); + } *************** *** 4201,4206 **** --- 4210,4231 ---- { 246, "Count of aliases evaluated" }, { 247, "Count of aliases matched" }, { 248, "Count of timers fired" }, + { 249, "Main frame window height" }, + { 250, "Main frame window width" }, + { 251, "Main toolbar window height" }, + { 252, "Main toolbar window width" }, + { 253, "Game toolbar window height" }, + { 254, "Game toolbar window width" }, + { 255, "Activity toolbar window height" }, + { 256, "Activity toolbar window width" }, + { 257, "Info bar window height" }, + { 258, "Info bar window width" }, + { 259, "Status bar window height" }, + { 260, "Status bar window width" }, + { 261, "World window non-client height" }, + { 262, "World window non-client width" }, + { 263, "World window client height" }, + { 264, "World window client width" }, // (dates - calculated at runtime) *************** *** 4215,4220 **** --- 4240,4284 ---- }; + static void GetWindowWidth (CWnd * pWnd, VARIANT & vaResult, const bool client = false ) + { + RECT rect; + if (pWnd->m_hWnd) + { + if (client) + pWnd->GetClientRect(&rect); + else + { + pWnd->GetWindowRect(&rect); + pWnd->ScreenToClient (&rect); + } + } + else + rect.right = -1; + VariantClear (&vaResult); + vaResult.vt = VT_I4; + vaResult.lVal = rect.right; + } // end of GetWindowWidth + + static void GetWindowHeight (CWnd * pWnd, VARIANT & vaResult, const bool client = false ) + { + RECT rect; + if (pWnd->m_hWnd) + { + if (client) + pWnd->GetClientRect(&rect); + else + { + pWnd->GetWindowRect(&rect); + pWnd->ScreenToClient (&rect); + } + } + else + rect.right = -1; + VariantClear (&vaResult); + vaResult.vt = VT_I4; + vaResult.lVal = rect.bottom; + } // end of GetWindowHeight VARIANT CMUSHclientDoc::GetInfo(long InfoType) { *************** *** 4602,4607 **** --- 4666,4729 ---- SetUpVariantLong (vaResult, m_iTimersFiredCount); break; + case 249: + { + RECT rect; + Frame.GetClientRect(&rect); + SetUpVariantLong (vaResult, rect.bottom); + } + break; + + case 250: + { + RECT rect; + Frame.GetClientRect(&rect); + SetUpVariantLong (vaResult, rect.right); + } + break; + + case 251: GetWindowHeight (&Frame.m_wndToolBar, vaResult); break; + case 252: GetWindowWidth (&Frame.m_wndToolBar, vaResult); break; + case 253: GetWindowHeight (&Frame.m_wndGameToolBar, vaResult); break; + case 254: GetWindowWidth (&Frame.m_wndGameToolBar, vaResult); break; + case 255: GetWindowHeight (&Frame.m_wndActivityToolBar, vaResult); break; + case 256: GetWindowWidth (&Frame.m_wndActivityToolBar, vaResult); break; + case 257: GetWindowHeight (&Frame.m_wndInfoBar, vaResult); break; + case 258: GetWindowWidth (&Frame.m_wndInfoBar, vaResult); break; + case 259: GetWindowHeight (&Frame.m_wndStatusBar, vaResult); break; + case 260: GetWindowWidth (&Frame.m_wndStatusBar, vaResult); break; + case 261: + { + CChildFrame * pFrame = GetChildFrame (); + if (pFrame) + GetWindowHeight (pFrame, vaResult); break; // non-client height + break; + } + + case 262: + { + CChildFrame * pFrame = GetChildFrame (); + if (pFrame) + GetWindowWidth (pFrame, vaResult); // non-client width + break; + } + + case 263: + { + CChildFrame * pFrame = GetChildFrame (); + if (pFrame) + GetWindowHeight (pFrame, vaResult, true); break; // client height + break; + } + + case 264: + { + CChildFrame * pFrame = GetChildFrame (); + if (pFrame) + GetWindowWidth (pFrame, vaResult, true); // client width + break; + } + case 301: if (m_tConnectTime.GetTime ()) // only if non-zero, otherwise return empty SetUpVariantDate (vaResult, COleDateTime (m_tConnectTime.GetTime ())); *************** *** 11943,11954 **** return 0; // not playing } ! long CMUSHclientDoc::SetCommandWindowHeight(short Height) ! { ! ! if (Height < 0) ! return eBadParameter; ! CChildFrame * pFrame = NULL; // find the child frame --- 12065,12072 ---- return 0; // not playing } ! CChildFrame * CMUSHclientDoc::GetChildFrame (void) ! { CChildFrame * pFrame = NULL; // find the child frame *************** *** 11964,11969 **** --- 12082,12099 ---- break; } // end of being a CSendView } + + return pFrame; + + } // end of CMUSHclientDoc::GetChildFrame + + long CMUSHclientDoc::SetCommandWindowHeight(short Height) + { + + if (Height < 0) + return eBadParameter; + + CChildFrame * pFrame = GetChildFrame (); // fail if we can't find one if (pFrame == NULL) *************** *** 12054,12060 **** return eOK; } ! /* ====================================================================== --- 12184,12225 ---- return eOK; } ! ! ! long CMUSHclientDoc::ShiftTabCompleteItem(LPCTSTR Item) ! { ! if (strlen (Item) <= 0 || strlen (Item) > 30) ! return eBadParameter; // need a string ! ! if (strcmp (Item, "") == 0) ! m_ExtraShiftTabCompleteItems.clear (); ! else if (strcmp (Item, "") == 0) ! m_bTabCompleteFunctions = true; ! else if (strcmp (Item, "") == 0) ! m_bTabCompleteFunctions = false; ! else ! { ! if (!IsValidName (Item)) // must be alphanumeric, dot, hyphen, underscore ! return eBadParameter; // need a string ! m_ExtraShiftTabCompleteItems.insert (Item); ! } ! ! return eOK; ! } ! ! long CMUSHclientDoc::NotepadReadOnly(LPCTSTR Title, BOOL ReadOnly) ! { ! CTextDocument * pTextDoc = FindNotepad (Title); ! ! if (!pTextDoc) ! return false; ! ! pTextDoc->SetReadOnly (ReadOnly); ! ! return true; ! } ! ! /* ====================================================================== Index: mushclient.cnt =================================================================== RCS file: /cvs/mushclient/mushclient.cnt,v retrieving revision 1.35 retrieving revision 1.37 diff -c -r1.35 -r1.37 *** mushclient.cnt 23 Jun 2008 06:27:54 -0000 1.35 --- mushclient.cnt 29 Jun 2008 00:04:24 -0000 1.37 *************** *** 405,410 **** --- 405,411 ---- 3 NoteHr=FNC_NoteHr 3 NotepadColour=FNC_NotepadColour 3 NotepadFont=FNC_NotepadFont + 3 NotepadReadOnly=FNC_NotepadReadOnly 3 NotepadSaveMethod=FNC_NotepadSaveMethod 3 NoteStyle=FNC_NoteStyle 3 Open=FNC_Open *************** *** 462,467 **** --- 463,469 ---- 3 SetVariable=FNC_SetVariable 3 SetWorldWindowStatus=FNC_SetWorldWindowStatus 3 ShowInfoBar=FNC_ShowInfoBar + 3 ShiftTabCompleteItem=FNC_ShiftTabCompleteItem 3 Simulate=FNC_Simulate 3 Sound=FNC_Sound 3 SpeedWalkDelay=FNC_SpeedWalkDelay Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.95 retrieving revision 1.96 diff -c -r1.95 -r1.96 Binary files /tmp/cvsxV5e9Y and /tmp/cvskhhMmq differ Index: mushclient.odl =================================================================== RCS file: /cvs/mushclient/mushclient.odl,v retrieving revision 1.114 retrieving revision 1.116 diff -c -r1.114 -r1.116 *** mushclient.odl 23 Jun 2008 06:27:54 -0000 1.114 --- mushclient.odl 29 Jun 2008 00:04:24 -0000 1.116 *************** *** 70,83 **** [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(324), propget] long NormalColour(short WhichColour); ! [id(324), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(325), propget] long BoldColour(short WhichColour); ! [id(325), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(326), propget] long CustomColourText(short WhichColour); ! [id(326), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(327), propget] long CustomColourBackground(short WhichColour); ! [id(327), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); --- 70,83 ---- [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(326), propget] long NormalColour(short WhichColour); ! [id(326), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(327), propget] long BoldColour(short WhichColour); ! [id(327), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(328), propget] long CustomColourText(short WhichColour); ! [id(328), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(329), propget] long CustomColourBackground(short WhichColour); ! [id(329), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); *************** *** 355,360 **** --- 355,362 ---- [id(321)] long PlaySound(short Buffer, BSTR FileName, BOOL Loop, double Volume, double Pan); [id(322)] long SetCommandWindowHeight(short Height); [id(323)] long SetToolBarPosition(short Which, BOOL Float, short Side, long Top, long Left); + [id(324)] long ShiftTabCompleteItem(BSTR Item); + [id(325)] long NotepadReadOnly(BSTR Title, BOOL ReadOnly); //}}AFX_ODL_METHOD }; Index: mushview.cpp =================================================================== RCS file: /cvs/mushclient/mushview.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -c -r1.91 -r1.92 *** mushview.cpp 23 Jun 2008 23:32:29 -0000 1.91 --- mushview.cpp 30 Jun 2008 03:50:58 -0000 1.92 *************** *** 526,533 **** } // end of CMUSHView::display_text ! void CMUSHView::OnDraw(CDC* pDC) { int startline, endline, line, --- 526,608 ---- } // end of CMUSHView::display_text ! // see: http://www.codeguru.com/Cpp/misc/misc/flickerfreedrawing/article.php/c389 ! ! ////////////////////////////////////////////////// ! // CMemDC - memory DC ! // ! // Author: Keith Rule ! // Email: keithr@europa.com ! // Copyright 1996-1997, Keith Rule ! // ! // You may freely use or modify this code provided this ! // Copyright is included in all derived versions. ! // ! // History - 10/3/97 Fixed scrolling bug. ! // Added print support. ! // ! // This class implements a memory Device Context ! ! class CMyMemDC : public CDC { ! private: ! CBitmap m_bitmap; // Offscreen bitmap ! CBitmap* m_oldBitmap; // bitmap originally found in CMyMemDC ! CDC* m_pDC; // Saves CDC passed in constructor ! CRect m_rect; // Rectangle of drawing area. ! BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. ! public: ! CMyMemDC(CDC* pDC, RECT rect) : CDC(), m_oldBitmap(NULL), m_pDC(pDC), m_rect (rect) ! { ! ASSERT(m_pDC != NULL); // If you asserted here, you passed in a NULL CDC. ! ! m_bMemDC = !pDC->IsPrinting(); ! ! if (m_bMemDC){ ! // Create a Memory DC ! CreateCompatibleDC(pDC); ! m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); ! m_oldBitmap = SelectObject(&m_bitmap); ! SetWindowOrg(m_rect.left, m_rect.top); ! } else { ! // Make a copy of the relevent parts of the current DC for printing ! m_bPrinting = pDC->m_bPrinting; ! m_hDC = pDC->m_hDC; ! m_hAttribDC = pDC->m_hAttribDC; ! } ! } ! ! ~CMyMemDC() ! { ! if (m_bMemDC) { ! // Copy the offscreen bitmap onto the screen. ! m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), ! this, m_rect.left, m_rect.top, SRCCOPY); ! //Swap back the original bitmap. ! SelectObject(m_oldBitmap); ! } else { ! // All we need to do is replace the DC with an illegal value, ! // this keeps us from accidently deleting the handles associated with ! // the CDC that was passed to the constructor. ! m_hDC = m_hAttribDC = NULL; ! } ! } ! ! // Allow usage as a pointer ! CMyMemDC* operator->() {return this;} ! ! // Allow usage as a pointer ! operator CMyMemDC*() {return this;} ! }; ! ! ! void CMUSHView::OnDraw(CDC* dc) { + + // this stuff stops the flicker when redawing stuff that is almost identical to last time + CRect rcBounds; + GetClientRect(&rcBounds); + CMyMemDC pDC(dc, rcBounds); + int startline, endline, line, *************** *** 543,548 **** --- 618,637 ---- if (!pDoc->m_FontHeight) return; + CBrush backbr; + CRect rect; + + if (pDoc->m_bCustom16isDefaultColour) + backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_customback [15])); + else + backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_normalcolour [BLACK])); + + pDC->GetClipBox (&rect); + + pDC->SetBkMode (OPAQUE); + pDC->FillRect (&rect, &backbr); + + /* *************** *** 817,823 **** FixupTitle (); } - } void CMUSHView::OnInitialUpdate() --- 906,911 ---- *************** *** 2359,2378 **** CMUSHclientDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); - CBrush backbr; - CRect rect; - - if (pDoc->m_bCustom16isDefaultColour) - backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_customback [15])); - else - backbr.CreateSolidBrush (pDoc->TranslateColour (pDoc->m_normalcolour [BLACK])); - - pDC->GetClipBox (&rect); - - pDC->SetBkMode (OPAQUE); - pDC->FillRect (&rect, &backbr); ! return TRUE; } void CMUSHView::OnKeysActivatecommandview() --- 2447,2454 ---- CMUSHclientDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); ! return FALSE; } void CMUSHView::OnKeysActivatecommandview() Index: prefspropertypages.cpp =================================================================== RCS file: /cvs/mushclient/prefspropertypages.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -c -r1.108 -r1.109 *** prefspropertypages.cpp 22 Jun 2008 04:59:25 -0000 1.108 --- prefspropertypages.cpp 27 Jun 2008 21:35:51 -0000 1.109 *************** *** 6808,6818 **** return; } // end of using inbuilt notepad ! if ((long) ShellExecute (Frame, _T("open"), m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL) <= 32) ::TMessageBox("Unable to edit the script file.", MB_ICONEXCLAMATION); } --- 6808,6827 ---- return; } // end of using inbuilt notepad ! HINSTANCE hInst = ShellExecute (Frame, _T("open"), m_strScriptEditor, CFormat ("\"%s\"", (LPCTSTR) m_strScriptFilename), ! NULL, SW_SHOWNORMAL); ! ! if ((long) hInst <= 32) ! { ::TMessageBox("Unable to edit the script file.", MB_ICONEXCLAMATION); + return; + } + + // bring editor to the front + if (m_doc && !m_doc->m_strEditorWindowName.IsEmpty ()) + SendToFront (m_doc->m_strEditorWindowName); } Index: resource.h =================================================================== RCS file: /cvs/mushclient/resource.h,v retrieving revision 1.130 retrieving revision 1.131 diff -c -r1.130 -r1.131 *** resource.h 23 Jun 2008 06:27:54 -0000 1.130 --- resource.h 27 Jun 2008 21:35:51 -0000 1.131 *************** *** 1562,1568 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 351 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 --- 1562,1568 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 352 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 Index: scriptingoptions.cpp =================================================================== RCS file: /cvs/mushclient/scriptingoptions.cpp,v retrieving revision 1.54 retrieving revision 1.56 diff -c -r1.54 -r1.56 *** scriptingoptions.cpp 22 Jun 2008 04:59:25 -0000 1.54 --- scriptingoptions.cpp 29 Jun 2008 00:04:24 -0000 1.56 *************** *** 54,59 **** --- 54,61 ---- {"auto_pause", true, O(m_bAutoFreeze)}, {"auto_repeat", false, O(m_bAutoRepeat)}, {"auto_resize_command_window", false, O(m_bAutoResizeCommandWindow)}, + {"auto_resize_minimum_lines", 1, O(m_iAutoResizeMinimumLines), 1, 100}, + {"auto_resize_maximum_lines", 20, O(m_iAutoResizeMaximumLines), 1, 100}, {"auto_wrap_window_width", false, O(m_bAutoWrapWindowWidth)}, {"carriage_return_clears_line", false, O(m_bCarriageReturnClearsLine)}, {"chat_foreground_colour", RGB (255, 0, 0), O(m_cChatForegroundColour), 0, 0xFFFFFF, OPT_RGB_COLOUR }, *************** *** 73,78 **** --- 75,81 ---- {"ctrl_z_goes_to_end_of_buffer", false, O(m_bCtrlZGoesToEndOfBuffer)}, {"custom_16_is_default_colour", false, O(m_bCustom16isDefaultColour), 0, 0, OPT_UPDATE_VIEWS}, {"detect_pueblo", true, O(m_bPueblo)}, + {"do_not_add_macros_to_command_history",false, O(m_bDoNotAddMacrosToCommandHistory)}, {"do_not_show_outstanding_lines", false, O(m_bDoNotShowOutstandingLines)}, {"do_not_translate_iac_to_iac_iac", false, O(m_bDoNotTranslateIACtoIACIAC)}, {"disable_compression", false, O(m_bDisableCompression)}, *************** *** 199,204 **** --- 202,208 ---- {"chat_message_prefix", "", A(m_strChatMessagePrefix), OPT_KEEP_SPACES}, {"command_stack_character", ";", A(m_strCommandStackCharacter), OPT_COMMAND_STACK}, {"connect_text", "", A(m_connect_text), OPT_MULTLINE}, + {"editor_window_name", "", A(m_strEditorWindowName) }, {"filter_aliases", "", A(m_strAliasesFilter), OPT_MULTLINE}, {"filter_timers", "", A(m_strTimersFilter), OPT_MULTLINE}, {"filter_triggers", "", A(m_strTriggersFilter), OPT_MULTLINE}, Index: sendvw.cpp =================================================================== RCS file: /cvs/mushclient/sendvw.cpp,v retrieving revision 1.85 retrieving revision 1.87 diff -c -r1.85 -r1.87 *** sendvw.cpp 22 Jun 2008 04:59:25 -0000 1.85 --- sendvw.cpp 29 Jun 2008 00:04:24 -0000 1.87 *************** *** 775,783 **** case SEND_NOW: pDoc->m_iCurrentActionSource = eUserMacro; ! SendCommand (pDoc->m_macros [whichone], TRUE); pDoc->m_iCurrentActionSource = eUnknownActionSource; - break; case ADD_TO_COMMAND: --- 775,782 ---- case SEND_NOW: pDoc->m_iCurrentActionSource = eUserMacro; ! SendCommand (pDoc->m_macros [whichone], TRUE, ! pDoc->m_bDoNotAddMacrosToCommandHistory); pDoc->m_iCurrentActionSource = eUnknownActionSource; break; case ADD_TO_COMMAND: *************** *** 2777,2783 **** if (pDoc->GetScriptEngine () && pDoc->GetScriptEngine ()->L) bLua = true; ! FunctionMenu (GetEditCtrl(), bLua); } void CSendView::OnUpdateCompleteFunction(CCmdUI* pCmdUI) --- 2776,2782 ---- if (pDoc->GetScriptEngine () && pDoc->GetScriptEngine ()->L) bLua = true; ! FunctionMenu (GetEditCtrl(), bLua, &pDoc->m_ExtraShiftTabCompleteItems, pDoc->m_bTabCompleteFunctions); } void CSendView::OnUpdateCompleteFunction(CCmdUI* pCmdUI) *************** *** 2826,2833 **** // find how many lines in command window int iLines = GetEditCtrl().GetLineCount (); // if very large, let them manage it ! if (iLines > 20) return; // resize - seem to need an extra 4 pixels or things go a bit strange --- 2825,2836 ---- // find how many lines in command window int iLines = GetEditCtrl().GetLineCount (); + // if too small, make the minimum + if (iLines < pDoc->m_iAutoResizeMinimumLines) + iLines = pDoc->m_iAutoResizeMinimumLines; + // if very large, let them manage it ! if (iLines > pDoc->m_iAutoResizeMaximumLines) return; // resize - seem to need an extra 4 pixels or things go a bit strange Index: stdafx.h =================================================================== RCS file: /cvs/mushclient/stdafx.h,v retrieving revision 1.106 retrieving revision 1.107 diff -c -r1.106 -r1.107 *** stdafx.h 11 Jun 2008 01:13:04 -0000 1.106 --- stdafx.h 27 Jun 2008 21:35:51 -0000 1.107 *************** *** 711,717 **** void ShowFunctionslist (CString & strSelection, int nStartChar = 0, int nEndChar = 0, const bool bLua = false); CString GetSelectedFunction (CString & strSelection, int & nStartChar, int & nEndChar); ! void FunctionMenu (CEdit & editctrl, const bool bLua); void ShowHelp (const CString strPrefix, const CString strTopic); string tolower (const string & s); --- 711,717 ---- void ShowFunctionslist (CString & strSelection, int nStartChar = 0, int nEndChar = 0, const bool bLua = false); CString GetSelectedFunction (CString & strSelection, int & nStartChar, int & nEndChar); ! void FunctionMenu (CEdit & editctrl, const bool bLua, set * extraItems = NULL, const bool bFunctions = true); void ShowHelp (const CString strPrefix, const CString strTopic); string tolower (const string & s); *************** *** 727,732 **** --- 727,735 ---- const char * Convert_PCRE_Runtime_Error (const int iError); lua_State *MakeLuaState (void); + + // send a window to the front + void SendToFront (const char * name); // 1 = invert, 2 = lighter, 3 = darker, 4 = less colour, 5 = more colour Index: xml_load_world.cpp =================================================================== RCS file: /cvs/mushclient/xml_load_world.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -c -r1.91 -r1.92 *** xml_load_world.cpp 3 Jun 2008 03:50:03 -0000 1.91 --- xml_load_world.cpp 29 Jun 2008 00:04:24 -0000 1.92 *************** *** 920,929 **** if (Get_XML_number (parent, OptionsTable [i].pName, iValue, ! bUseDefault || m_NumericConfiguration [i]->bInclude, OptionsTable [i].iMinimum, OptionsTable [i].iMaximum)) SetOptionItem (i, iValue, true, (iFlags & LOAD_INCLUDE) != 0); else // not found, use default? if (!(bUseDefault || m_NumericConfiguration [i]->bInclude)) { // then take zero, if we can --- 920,931 ---- if (Get_XML_number (parent, OptionsTable [i].pName, iValue, ! // version 4.30 bUseDefault || m_NumericConfiguration [i]->bInclude, ! TRUE, // version 4.30 OptionsTable [i].iMinimum, OptionsTable [i].iMaximum)) SetOptionItem (i, iValue, true, (iFlags & LOAD_INCLUDE) != 0); + /* version 4.30 else // not found, use default? if (!(bUseDefault || m_NumericConfiguration [i]->bInclude)) { // then take zero, if we can *************** *** 934,939 **** --- 936,942 ---- SetOptionItem (i, 0, true, false); } // end of taking zero for unspecified variables + */ } // end of not RGB colour or boolean } Index: install/mushclient.nsi =================================================================== RCS file: /cvs/mushclient/install/mushclient.nsi,v retrieving revision 1.61 retrieving revision 1.63 diff -c -r1.61 -r1.63 *** install/mushclient.nsi 21 Jun 2008 05:53:01 -0000 1.61 --- install/mushclient.nsi 30 Jun 2008 03:50:58 -0000 1.63 *************** *** 304,309 **** --- 304,310 ---- File "..\lua\strict.lua" File "..\lua\commas.lua" File "..\lua\getworld.lua" + File "..\lua\checkplugin.lua" ; Set output path to the scripts subdirectory. SetOutPath $INSTDIR\scripts *************** *** 432,438 **** Delete "$INSTDIR\lua\strict.lua" Delete "$INSTDIR\lua\commas.lua" Delete "$INSTDIR\lua\getworld.lua" ! ; spell checker stuff Delete "$INSTDIR\spellchecker.lua" Delete "$INSTDIR\spell\english-words.10" --- 433,440 ---- Delete "$INSTDIR\lua\strict.lua" Delete "$INSTDIR\lua\commas.lua" Delete "$INSTDIR\lua\getworld.lua" ! Delete "$INSTDIR\lua\checkplugin.lua" ! ; spell checker stuff Delete "$INSTDIR\spellchecker.lua" Delete "$INSTDIR\spell\english-words.10" *************** *** 538,543 **** --- 540,548 ---- Delete "$INSTDIR\names\orc.nam" Delete "$INSTDIR\names\sparhawk.nam" + RMDir "$INSTDIR\names" + RMDir "$INSTDIR\sounds" + ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe Index: install/readme.txt =================================================================== RCS file: /cvs/mushclient/install/readme.txt,v retrieving revision 1.170 retrieving revision 1.172 diff -c -r1.170 -r1.172 *** install/readme.txt 23 Jun 2008 23:32:29 -0000 1.170 --- install/readme.txt 30 Jun 2008 03:50:58 -0000 1.172 *************** *** 1,7 **** ! MUSHclient version 4.29 ======================= ! Tuesday, 24th June 2008 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ --- 1,7 ---- ! MUSHclient version 4.30 ======================= ! Monday, 30th June 2008 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ Index: lua/commas.lua =================================================================== RCS file: /cvs/mushclient/lua/commas.lua,v retrieving revision 1.1 retrieving revision 1.3 diff -c -r1.1 -r1.3 *** lua/commas.lua 11 May 2008 05:00:57 -0000 1.1 --- lua/commas.lua 30 Jun 2008 03:50:58 -0000 1.3 *************** *** 127,129 **** --- 127,135 ---- return sign .. before .. result .. after end -- function commas + + + -- trim leading and trailing spaces from a string + function trim (s) + return (string.gsub (s, "^%s*(.-)%s*$", "%1")) + end -- trim Index: lua/getworld.lua =================================================================== RCS file: /cvs/mushclient/lua/getworld.lua,v retrieving revision 1.1 retrieving revision 1.3 diff -c -r1.1 -r1.3 *** lua/getworld.lua 21 Jun 2008 00:55:24 -0000 1.1 --- lua/getworld.lua 30 Jun 2008 03:50:58 -0000 1.3 *************** *** 17,24 **** --]] -- open a world by name, return world object or nil if cannot ! function get_a_world (name) -- try to find world local w = GetWorld (name) -- get world --- 17,68 ---- --]] + + -- make the named world, if necessary - adds "extra" lines to the world file (eg. plugins) + function make_world (name, extra, folder) + + local filename = GetInfo (57) + if folder then + filename = filename .. folder .. "\\" + end -- if folder wanted + + filename = filename .. name .. ".mcl" + local f = io.open (filename, "r") + + if f then + f:close () + return + end -- world file exists + + f = io.output (filename) -- create world file + + assert (f:write ([[ + + + + + + + + + ]] .. extra .. [[ + + + ]])) + + f:close () -- close world file now + + -- and open the file ;P + Open (filename) + + end -- make_world + -- open a world by name, return world object or nil if cannot ! function get_a_world (name, folder) -- try to find world local w = GetWorld (name) -- get world *************** *** 26,32 **** -- if not found, try to open it in worlds directory if not cannot_open_world [name] and not w then ! local filename = GetInfo (67) .. name .. ".mcl" Open (filename) -- get MUSHclient to open it Activate () -- make our original world active again w = GetWorld (name) -- try again to get the world object --- 70,81 ---- -- if not found, try to open it in worlds directory if not cannot_open_world [name] and not w then ! local filename = GetInfo (57) ! if folder then ! filename = filename .. folder .. "\\" ! end -- if folder wanted ! ! filename = filename .. name .. ".mcl" Open (filename) -- get MUSHclient to open it Activate () -- make our original world active again w = GetWorld (name) -- try again to get the world object Index: lua/wait.lua =================================================================== RCS file: /cvs/mushclient/lua/wait.lua,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** lua/wait.lua 20 Jun 2008 05:44:22 -0000 1.4 --- lua/wait.lua 30 Jun 2008 03:50:58 -0000 1.5 *************** *** 57,64 **** -- wait.trigger_resume: called by a trigger to resume a thread -- ---------------------------------------------------------- function trigger_resume (name, line, wildcards, styles) - EnableTrigger (name, false) -- don't want it to fire again - DoAfterSpecial (1, "DeleteTrigger ('" .. name .. "')", 12) -- delete it local thread = threads [name] if thread then threads [name] = nil --- 57,62 ---- *************** *** 109,115 **** check (AddTriggerEx (id, regexp, "-- added by wait.regexp", trigger_flag.Enabled + trigger_flag.RegularExpression + ! trigger_flag.Temporary + trigger_flag.Replace, custom_colour.NoChange, 0, "", -- wildcard number, sound file name "wait.trigger_resume", --- 107,114 ---- check (AddTriggerEx (id, regexp, "-- added by wait.regexp", trigger_flag.Enabled + trigger_flag.RegularExpression + ! trigger_flag.Temporary + trigger_flag.Replace + ! trigger_flag.OneShot, custom_colour.NoChange, 0, "", -- wildcard number, sound file name "wait.trigger_resume", *************** *** 152,155 **** assert (GetOption ("enable_timers") == 1, "Timers not enabled") assert (GetOption ("enable_triggers") == 1, "Triggers not enabled") coroutine.wrap (f) () -- make coroutine, resume it ! end -- make --- 151,154 ---- assert (GetOption ("enable_timers") == 1, "Timers not enabled") assert (GetOption ("enable_triggers") == 1, "Triggers not enabled") coroutine.wrap (f) () -- make coroutine, resume it ! end -- make \ No newline at end of file