Browse Source

[BUG_FIXED] Crash bug while the shortcut command is absent in shortcut.xml is fixed.

Add a new message NPPM_MSGTOPLUGIN for the communication between 2 plugins.


git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@8 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 18 years ago
parent
commit
5357c64049
  1. 7
      PowerEditor/bin/change.log
  2. 10
      PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
  3. 16
      PowerEditor/src/MISC/PluginsManager/PluginsManager.h
  4. 5
      PowerEditor/src/Notepad_plus.cpp
  5. 6
      PowerEditor/src/Parameters.cpp
  6. 2
      PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc

7
PowerEditor/bin/change.log

@ -1,4 +1,4 @@
v4.2.1 fixed bugs and added features (from v4.1.2) :
v4.2.2 fixed bugs and added features (from v4.1.2) :
1. Fix the dockable dialog drag and drop problem under vista.
2. Add Column mode edition feature (Menu "Edit->Column Editor...").
@ -10,8 +10,11 @@ v4.2.1 fixed bugs and added features (from v4.1.2) :
8. Add a menu entry to access to notepad++ plugins project page.
9. Enhance file open dialog (add all supported extensions in the filters list).
10. Fix bug of Run macro until EOF.
11. Add the filters in Find in files dialog.
12. Add a new transparency feature for Find dialog : Transparency on loss focus.
Plugins included in v4.2 :
Plugins included in v4.2.2 :
1. TexFX v0.24a
2. Function list v1.2

10
PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h

@ -152,6 +152,16 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
#define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
//void NPPM_GETPLUGINSCONFIGDIR(int strLen, char *str)
#define NPPM_MSGTOPLUGIN (NPPMSG + 47)
//BOOL NPPM_MSGTOPLUGIN(char *destModuleName, CommunicationInfo *info)
// return value is TRUE when the message arrive to the destination plugins.
// if destModule or info is NULL, then return value is FALSE
struct CommunicationInfo {
long internalMsg;
const char * srcModuleName;
void * info; // defined by plugin
};
#define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)

16
PowerEditor/src/MISC/PluginsManager/PluginsManager.h

@ -105,6 +105,22 @@ public:
}
};
bool relayPluginMessages(UINT Message, WPARAM wParam, LPARAM lParam) {
const char * moduleName = (const char *)wParam;
if (!moduleName || !moduleName[0] || !lParam)
return false;
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
{
if (stricmp(_pluginInfos[i]->_moduleName, moduleName) == 0)
{
_pluginInfos[i]->_pMessageProc(Message, wParam, lParam);
return true;
}
}
return false;
};
HMENU getMenuHandle() {
return _hPluginsMenu;
};

5
PowerEditor/src/Notepad_plus.cpp

@ -6828,6 +6828,11 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return TRUE;
}
case NPPM_MSGTOPLUGIN :
{
return _pluginsManager.relayPluginMessages(Message, wParam, lParam);
}
default:
{
if (Message == WDN_NOTIFY)

6
PowerEditor/src/Parameters.cpp

@ -752,11 +752,15 @@ void NppParameters::feedUserCmds(TiXmlNode *node)
if (getShortcuts(childNode, sc) && sc.isValid())
{
UserCommand uc(sc);
uc._cmd = (childNode->FirstChild())->Value();
TiXmlNode *aNode = childNode->FirstChild();
if (aNode)
{
uc._cmd = aNode->Value();
if (uc.isValid())
_userCommands.push_back(uc);
}
}
}
}
void NppParameters::feedPluginCustomizedCmds(TiXmlNode *node)

2
PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc

@ -73,7 +73,7 @@ BEGIN
GROUPBOX "Transparency",IDC_TRANSPARENT_GRPBOX,227,123,83,49
CONTROL "",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,223,123,9,10
CONTROL "On loss focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,135,69,10
CONTROL "On lose focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,135,69,10
CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,147,63,10
CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,240,161,53,10
END

Loading…
Cancel
Save