From bd28e3bfa703acfeb65d0e3ac98cf01421450798 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 15 Jul 2011 01:00:05 +0000 Subject: [PATCH] [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 --- .../MISC/PluginsManager/Notepad_plus_msgs.h | 5 ++++ PowerEditor/src/NppBigSwitch.cpp | 13 +++++++++++ PowerEditor/src/NppCommands.cpp | 3 +-- .../src/WinControls/Preference/preference.rc | 23 +++++++++++-------- .../WinControls/Preference/preferenceDlg.cpp | 10 ++++++++ .../WinControls/Preference/preference_rc.h | 2 ++ .../VerticalFileSwitcherListView.cpp | 10 ++++---- 7 files changed, 49 insertions(+), 17 deletions(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index b5d47e66f..b9bf468d2 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -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) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index c007eefdb..3964b34af 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -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 // diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index d4a2bb458..d860e87e6 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -50,8 +50,7 @@ void Notepad_plus::command(int id) case IDM_FILE_OPEN: { - //fileOpen(); - launchFileSwitcherPanel(); + fileOpen(); } break; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index c42fd6361..9570cb163 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -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 diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 235adf9d8..8479ace89 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -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)); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index ffd829b9d..eb695a701 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -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) diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp index d13a210ba..7d3132e3e 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp @@ -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)