[NEW_FEATURE] Make file switcher dialog accessible (in progress).

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@788 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 2011-07-15 01:00:05 +00:00
parent 5aad3ba823
commit bd28e3bfa7
7 changed files with 49 additions and 17 deletions

View File

@ -347,6 +347,11 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV
// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
// by passing allocated buffer as argument langDesc
#define NPPM_SHOWDOCSWITCHER (NPPMSG + 85)
#define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86)
#define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)

View File

@ -1809,6 +1809,19 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return langDesc.length();
}
case NPPM_SHOWDOCSWITCHER:
{
launchFileSwitcherPanel();
return TRUE;
}
case NPPM_ISDOCSWITCHERSHOWN:
{
if (!_pFileSwitcherPanel)
return FALSE;
return _pFileSwitcherPanel->isVisible();
}
//
// These are sent by Preferences Dialog
//

View File

@ -50,8 +50,7 @@ void Notepad_plus::command(int id)
case IDM_FILE_OPEN:
{
//fileOpen();
launchFileSwitcherPanel();
fileOpen();
}
break;

View File

@ -42,24 +42,27 @@ BEGIN
CONTROL "Small icons",IDC_RADIO_SMALLICON,"Button",BS_AUTORADIOBUTTON,64,69,114,10
CONTROL "Big icons",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,64,83,109,10
CONTROL "Standard icons",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,64,97,119,10
GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,6,176,151,BS_CENTER
CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,16,108,10
CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,30,134,10
CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,44,134,10
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,59,108,10
CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,73,134,10
CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,88,134,10
CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,103,137,10
GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,36,176,142,BS_CENTER
CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,45,108,10
CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,59,134,10
CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,73,134,10
CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,88,108,10
CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,102,134,10
CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,117,134,10
CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,132,137,10
CONTROL "Show close button on each tab",IDC_CHECK_ENABLETABCLOSE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,118,133,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,147,133,10
CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,133,133,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,162,133,10
CONTROL "Show status bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,58,163,130,10
GROUPBOX "Menu Bar",IDC_MENUBAR_GB_STATIC,57,117,147,40,BS_CENTER
CONTROL "Hide (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR,
"Button",BS_AUTOCHECKBOX | BS_MULTILINE,64,127,135,25
GROUPBOX "Localization",IDC_LOCALIZATION_GB_STATIC,57,6,147,35,BS_CENTER
COMBOBOX IDC_COMBO_LOCALIZATION,68,20,119,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Document Switcher",IDC_DOCSWITCH_GB_STATIC,223,6,176,27,BS_CENTER
CONTROL "Show",IDC_CHECK_DOCSWITCH,"Button",BS_AUTOCHECKBOX | BS_MULTILINE,230,15,89,14
END
IDD_PREFERENCE_MARGEIN_BOX DIALOGEX 0, 0, 455, 185

View File

@ -218,6 +218,9 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHOWSTATUSBAR, BM_SETCHECK, showStatus, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_HIDEMENUBAR, BM_SETCHECK, !showMenu, 0);
bool showDocSwitcher = ::SendMessage(::GetParent(_hParent), NPPM_ISDOCSWITCHERSHOWN, 0, 0) == TRUE;
::SendDlgItemMessage(_hSelf, IDC_CHECK_DOCSWITCH, BM_SETCHECK, !showDocSwitcher, 0);
#ifndef UNICODE
::EnableWindow(::GetDlgItem(_hSelf, IDC_LOCALIZATION_GB_STATIC), FALSE);
::EnableWindow(::GetDlgItem(_hSelf, IDC_COMBO_LOCALIZATION), FALSE);
@ -267,6 +270,13 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
}
return TRUE;
case IDC_CHECK_DOCSWITCH :
{
bool isChecked = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_DOCSWITCH, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_SHOWDOCSWITCHER, 0, isChecked?FALSE:TRUE);
}
return TRUE;
case IDC_CHECK_TAB_HIDE :
{
bool toBeHidden = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_TAB_HIDE), BM_GETCHECK, 0, 0));

View File

@ -49,6 +49,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#define IDC_CHECK_HIDEMENUBAR (IDD_PREFERENCE_BAR_BOX + 22)
#define IDC_LOCALIZATION_GB_STATIC (IDD_PREFERENCE_BAR_BOX + 23)
#define IDC_COMBO_LOCALIZATION (IDD_PREFERENCE_BAR_BOX + 24)
#define IDC_DOCSWITCH_GB_STATIC (IDD_PREFERENCE_BAR_BOX + 25)
#define IDC_CHECK_DOCSWITCH (IDD_PREFERENCE_BAR_BOX + 26)
#define IDD_PREFERENCE_MARGEIN_BOX 6200 //(IDD_PREFERENCE_BOX + 200)
#define IDC_FMS_GB_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 1)

View File

@ -35,15 +35,15 @@ void VerticalFileSwitcherListView::init(HINSTANCE hInst, HWND parent, HIMAGELIST
| LVS_SINGLESEL | LVS_AUTOARRANGE\
| LVS_SHAREIMAGELISTS | LVS_SHOWSELALWAYS;
_hSelf = ::CreateWindow(WC_LISTVIEW,
TEXT(""),
_hSelf = ::CreateWindow(WC_LISTVIEW,
TEXT(""),
WS_CHILD | listViewStyles,
0,
0,
0,
0,
_hParent,
(HMENU) NULL,
0,
_hParent,
(HMENU) NULL,
hInst,
NULL);
if (!_hSelf)