Skip to content

Commit e17dee1

Browse files
committed
Console and menus working
- Console working including prompts & multiline statements - Menus working, and loading from file - Scripts menu populated, including subdirs - Ctrl-click to edit functionality working ToDo: Scintilla events Editor for menu scripts Toolbar commands register Iterators for buffer.lines & buffer.chars
1 parent f05f9e3 commit e17dee1

33 files changed

Lines changed: 4468 additions & 142 deletions

NppPlugin/include/Docking.h

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
this file is part of Function List Plugin for Notepad++
3+
Copyright (C)2005 Jens Lorenz <jens.plugin.npp@gmx.de>
4+
5+
This program is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU General Public License
7+
as published by the Free Software Foundation; either
8+
version 2 of the License, or (at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program; if not, write to the Free Software
17+
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18+
*/
19+
20+
#ifndef DOCKING_H
21+
#define DOCKING_H
22+
23+
// ATTENTION : It's a part of interface header, so don't include the others header here
24+
25+
// styles for containers
26+
#define CAPTION_TOP TRUE
27+
#define CAPTION_BOTTOM FALSE
28+
29+
// defines for docking manager
30+
#define CONT_LEFT 0
31+
#define CONT_RIGHT 1
32+
#define CONT_TOP 2
33+
#define CONT_BOTTOM 3
34+
#define DOCKCONT_MAX 4
35+
36+
// mask params for plugins of internal dialogs
37+
#define DWS_ICONTAB 0x00000001 // Icon for tabs are available
38+
#define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported)
39+
#define DWS_ADDINFO 0x00000004 // Additional information are in use
40+
#define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO)
41+
42+
// default docking values for first call of plugin
43+
#define DWS_DF_CONT_LEFT (CONT_LEFT << 28) // default docking on left
44+
#define DWS_DF_CONT_RIGHT (CONT_RIGHT << 28) // default docking on right
45+
#define DWS_DF_CONT_TOP (CONT_TOP << 28) // default docking on top
46+
#define DWS_DF_CONT_BOTTOM (CONT_BOTTOM << 28) // default docking on bottom
47+
#define DWS_DF_FLOATING 0x80000000 // default state is floating
48+
49+
50+
typedef struct {
51+
HWND hClient; // client Window Handle
52+
TCHAR *pszName; // name of plugin (shown in window)
53+
int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID
54+
55+
// user modifications
56+
UINT uMask; // mask params: look to above defines
57+
HICON hIconTab; // icon for tabs
58+
TCHAR *pszAddInfo; // for plugin to display additional informations
59+
60+
// internal data, do not use !!!
61+
RECT rcFloat; // floating position
62+
int iPrevCont; // stores the privious container (toggling between float and dock)
63+
const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin
64+
} tTbData;
65+
66+
67+
typedef struct {
68+
HWND hWnd; // the docking manager wnd
69+
RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs
70+
} tDockMgr;
71+
72+
73+
#define HIT_TEST_THICKNESS 20
74+
#define SPLITTER_WIDTH 4
75+
76+
77+
#endif // DOCKING_H
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*
2+
this file is part of Function List Plugin for Notepad++
3+
Copyright (C)2005 Jens Lorenz <jens.plugin.npp@gmx.de>
4+
5+
This program is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU General Public License
7+
as published by the Free Software Foundation; either
8+
version 2 of the License, or (at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program; if not, write to the Free Software
17+
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18+
*/
19+
20+
#ifndef DOCKINGDLGINTERFACE_H
21+
#define DOCKINGDLGINTERFACE_H
22+
23+
#include "stdafx.h"
24+
25+
#ifndef DOCKING_RESOURCE_H
26+
#include "dockingResource.h"
27+
#endif //DOCKING_RESOURCE_H
28+
29+
#ifndef DOCKING_H
30+
#include "Docking.h"
31+
#endif //DOCKING_H
32+
33+
#include "StaticDialog.h"
34+
35+
class DockingDlgInterface : public StaticDialog
36+
{
37+
public:
38+
DockingDlgInterface(): StaticDialog(), _HSource(NULL), _data(NULL),\
39+
_dlgID(-1), _isFloating(TRUE), _iDockedPos(0), _pluginName(TEXT("")) {};
40+
41+
DockingDlgInterface(int dlgID): StaticDialog(), _HSource(NULL), _data(NULL),\
42+
_dlgID(dlgID), _isFloating(TRUE), _iDockedPos(0), _pluginName(TEXT("")) {};
43+
44+
virtual void init(HINSTANCE hInst, HWND parent) {
45+
StaticDialog::init(hInst, parent);
46+
TCHAR temp[MAX_PATH];
47+
::GetModuleFileName((HMODULE)hInst, temp, MAX_PATH);
48+
_moduleName = PathFindFileName(temp);
49+
};
50+
51+
void create(tTbData * data, bool isRTL = false){
52+
StaticDialog::create(_dlgID, isRTL);
53+
TCHAR temp[MAX_PATH];
54+
::GetWindowText(_hSelf, temp, MAX_PATH);
55+
_pluginName = temp;
56+
// user information
57+
data->hClient = _hSelf;
58+
data->pszName = (TCHAR *)_pluginName.c_str();
59+
60+
// supported features by plugin
61+
data->uMask = 0;
62+
63+
// additional info
64+
data->pszAddInfo = NULL;
65+
66+
_data = data;
67+
68+
};
69+
70+
virtual void updateDockingDlg() {
71+
::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, (LPARAM)_hSelf);
72+
}
73+
74+
virtual void destroy() {
75+
};
76+
77+
virtual void display(bool toShow = true) const {
78+
::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf);
79+
};
80+
81+
const TCHAR * getPluginFileName() const {
82+
return _moduleName.c_str();
83+
};
84+
85+
protected :
86+
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam)
87+
{
88+
switch (message)
89+
{
90+
91+
case WM_NOTIFY:
92+
{
93+
LPNMHDR pnmh = (LPNMHDR)lParam;
94+
95+
if (pnmh->hwndFrom == _hParent)
96+
{
97+
switch (LOWORD(pnmh->code))
98+
{
99+
case DMN_CLOSE:
100+
{
101+
break;
102+
}
103+
case DMN_FLOAT:
104+
{
105+
_isFloating = true;
106+
break;
107+
}
108+
case DMN_DOCK:
109+
{
110+
_iDockedPos = HIWORD(pnmh->code);
111+
_isFloating = false;
112+
break;
113+
}
114+
default:
115+
break;
116+
}
117+
}
118+
break;
119+
}
120+
default:
121+
break;
122+
}
123+
return FALSE;
124+
};
125+
126+
// Handles
127+
HWND _HSource;
128+
tTbData* _data;
129+
int _dlgID;
130+
bool _isFloating;
131+
int _iDockedPos;
132+
tstring _moduleName;
133+
tstring _pluginName;
134+
};
135+
136+
#endif // DOCKINGDLGINTERFACE_H
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//this file is part of docking functionality for Notepad++
2+
//Copyright (C)2006 Jens Lorenz <jens.plugin.npp@gmx.de>
3+
//
4+
//This program is free software; you can redistribute it and/or
5+
//modify it under the terms of the GNU General Public License
6+
//as published by the Free Software Foundation; either
7+
//version 2 of the License, or (at your option) any later version.
8+
//
9+
//This program is distributed in the hope that it will be useful,
10+
//but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
//GNU General Public License for more details.
13+
//
14+
//You should have received a copy of the GNU General Public License
15+
//along with this program; if not, write to the Free Software
16+
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17+
18+
#ifndef DOCKING_RESOURCE_H
19+
#define DOCKING_RESOURCE_H
20+
21+
#define IDD_PLUGIN_DLG 103
22+
#define IDC_EDIT1 1000
23+
24+
25+
#define IDB_CLOSE_DOWN 137
26+
#define IDB_CLOSE_UP 138
27+
#define IDD_CONTAINER_DLG 139
28+
29+
#define IDC_TAB_CONT 1027
30+
#define IDC_CLIENT_TAB 1028
31+
#define IDC_BTN_CAPTION 1050
32+
33+
#define DMM_MSG 0x5000
34+
#define DMM_CLOSE (DMM_MSG + 1)
35+
#define DMM_DOCK (DMM_MSG + 2)
36+
#define DMM_FLOAT (DMM_MSG + 3)
37+
#define DMM_DOCKALL (DMM_MSG + 4)
38+
#define DMM_FLOATALL (DMM_MSG + 5)
39+
#define DMM_MOVE (DMM_MSG + 6)
40+
#define DMM_UPDATEDISPINFO (DMM_MSG + 7)
41+
#define DMM_GETIMAGELIST (DMM_MSG + 8)
42+
#define DMM_GETICONPOS (DMM_MSG + 9)
43+
#define DMM_DROPDATA (DMM_MSG + 10)
44+
#define DMM_MOVE_SPLITTER (DMM_MSG + 11)
45+
#define DMM_CANCEL_MOVE (DMM_MSG + 12)
46+
#define DMM_LBUTTONUP (DMM_MSG + 13)
47+
48+
#define DMN_FIRST 1050
49+
#define DMN_CLOSE (DMN_FIRST + 1)
50+
//nmhdr.code = DWORD(DMN_CLOSE, 0));
51+
//nmhdr.hwndFrom = hwndNpp;
52+
//nmhdr.idFrom = ctrlIdNpp;
53+
54+
#define DMN_DOCK (DMN_FIRST + 2)
55+
#define DMN_FLOAT (DMN_FIRST + 3)
56+
//nmhdr.code = DWORD(DMN_XXX, int newContainer);
57+
//nmhdr.hwndFrom = hwndNpp;
58+
//nmhdr.idFrom = ctrlIdNpp;
59+
60+
61+
62+
#endif //DOCKING_RESOURCE_H
63+

0 commit comments

Comments
 (0)