From b1e3ca6abaf3afcd33ffabb8ad211fd752e5bd1c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 15 Jul 2011 01:25:59 +0000 Subject: [PATCH] [BUG_FIXED] Fix Doc Switcher logic bug. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@789 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/NppBigSwitch.cpp | 13 ++++++++++++- .../src/WinControls/Preference/preferenceDlg.cpp | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 3964b34af..7799641d1 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -20,6 +20,7 @@ #include "TaskListDlg.h" #include "ImageListSet.h" #include "ShortcutMapper.h" +#include "VerticalFileSwitcher.h" struct SortTaskListPred { @@ -1811,7 +1812,17 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa case NPPM_SHOWDOCSWITCHER: { - launchFileSwitcherPanel(); + BOOL toShow = lParam; + if (toShow) + { + if (!_pFileSwitcherPanel || !_pFileSwitcherPanel->isVisible()) + launchFileSwitcherPanel(); + } + else + { + if (_pFileSwitcherPanel) + _pFileSwitcherPanel->display(false); + } return TRUE; } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 8479ace89..8e5ab471a 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -219,7 +219,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) ::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); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_DOCSWITCH, BM_SETCHECK, showDocSwitcher, 0); #ifndef UNICODE ::EnableWindow(::GetDlgItem(_hSelf, IDC_LOCALIZATION_GB_STATIC), FALSE); @@ -273,7 +273,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) 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); + ::SendMessage(::GetParent(_hParent), NPPM_SHOWDOCSWITCHER, 0, isChecked?TRUE:FALSE); } return TRUE;