Skip to content

Commit

Permalink
[NEW_FEATURE] Make file switcher dialog accessible (in progress).
Browse files Browse the repository at this point in the history
- Notepad-plus svn trunk @ 788
  • Loading branch information
donho committed Jul 15, 2011
1 parent 9ddbbcf commit b4df6fc
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
5 changes: 5 additions & 0 deletions PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
3 changes: 1 addition & 2 deletions PowerEditor/src/NppCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void Notepad_plus::command(int id)

case IDM_FILE_OPEN:
{
//fileOpen();
launchFileSwitcherPanel();
fileOpen();
}
break;

Expand Down
23 changes: 13 additions & 10 deletions PowerEditor/src/WinControls/Preference/preference.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions PowerEditor/src/WinControls/Preference/preference_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b4df6fc

Please sign in to comment.