Skip to content

Commit

Permalink
Merge pull request #5 from thibmo/AboutDialog
Browse files Browse the repository at this point in the history
New feature : About dialog
  • Loading branch information
Megabyteceer authored Feb 23, 2017
2 parents 03af58d + 2b2e49a commit 708c023
Show file tree
Hide file tree
Showing 15 changed files with 700 additions and 72 deletions.
13 changes: 12 additions & 1 deletion NppTaskList.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,42 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="include\Common.h" />
<ClInclude Include="include\Docking.h" />
<ClInclude Include="include\DockingDlgInterface.h" />
<ClInclude Include="include\dockingResource.h" />
<ClInclude Include="include\menuCmdID.h" />
<ClInclude Include="include\Notepad_plus_msgs.h" />
<ClInclude Include="include\PluginDefinition.h" />
<ClInclude Include="include\PluginInterface.h" />
<ClInclude Include="include\resource.h" />
<ClInclude Include="include\Scintilla.h" />
<ClInclude Include="include\StaticDialog.h" />
<ClInclude Include="include\TaskListDlg.h" />
<ClInclude Include="include\URLCtrl.h" />
<ClInclude Include="include\Window.h" />
<ClInclude Include="resources\resource.h" />
<ClInclude Include="src\AboutDialog\AboutDlg.h" />
<ClInclude Include="src\config.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\AboutDialog\AboutDlg.cpp" />
<ClCompile Include="src\Common.cpp" />
<ClCompile Include="src\config.cpp" />
<ClCompile Include="src\NppTaskListPlugin.cpp" />
<ClCompile Include="src\PluginDefinition.cpp" />
<ClCompile Include="src\StaticDialog.cpp" />
<ClCompile Include="src\TaskListDlg.cpp" />
<ClCompile Include="src\URLCtrl.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resources\TaskList.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties RESOURCE_FILE="resources\TaskList.rc" />
</VisualStudio>
</ProjectExtensions>
</Project>
24 changes: 21 additions & 3 deletions NppTaskList.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
<ClInclude Include="include\PluginInterface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Scintilla.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -54,6 +51,18 @@
<ClInclude Include="src\config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resources\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\AboutDialog\AboutDlg.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\URLCtrl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Common.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\NppTaskListPlugin.cpp">
Expand All @@ -71,6 +80,15 @@
<ClCompile Include="src\config.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\AboutDialog\AboutDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\URLCtrl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Common.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resources\TaskList.rc">
Expand Down
40 changes: 40 additions & 0 deletions include/Common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

// NOTE : Extremely cleaned out, if you need more go to: https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/MISC/Common/Common.h

#ifndef COMMON_INCLUDED
#define COMMON_INCLUDED

#include <string>
#include <windows.h>

typedef std::basic_string<TCHAR> generic_string;

COLORREF getCtrlBgColor(HWND hWnd);

#endif // COMMON_INCLUDED
9 changes: 5 additions & 4 deletions include/PluginDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ const TCHAR NPP_PLUGIN_NAME[] = TEXT("Task List Debug");
//
// Here define the number of your plugin commands
//
const int nbFunc = 2;
const int nbFunc = 3;


//
/// Initialization of your plugin data
// It will be called while plugin loading
//
void pluginInit(HANDLE hModule);
void pluginInit(HINSTANCE hModule);

//
// Cleaning of your plugin
Expand All @@ -58,7 +58,7 @@ void pluginCleanUp();
//
//Initialization of your plugin commands
//
void commandMenuInit();
void commandMenuInit(NppData nppData);

//
//Clean up your plugin commands allocation (if any)
Expand All @@ -75,6 +75,7 @@ bool setCommand(size_t index, TCHAR *cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey
// Your plugin command functions
//
void displayDialog();
void displayAboutDialog();

// Helper functions

Expand All @@ -84,6 +85,6 @@ bool CharToWideChar( const char* _inString, BSTR* _out );

void findTasks();

void DockableDlgDemo();
void OpenTaskListDockableDlg();

#endif //PLUGINDEFINITION_H
4 changes: 2 additions & 2 deletions include/TaskListDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define GOTILINE_DLG_H

#include "DockingDlgInterface.h"
#include "resource.h"
#include "../resources/resource.h"

typedef struct
{
Expand All @@ -34,7 +34,7 @@ typedef struct
class TaskListDlg : public DockingDlgInterface
{
public :
TaskListDlg() : DockingDlgInterface(IDD_PLUGINGOLINE_DEMO){};
TaskListDlg() : DockingDlgInterface(IDD_TODOLIST_DIALOG){};

virtual void display(bool toShow = true) const {
DockingDlgInterface::display(toShow);
Expand Down
68 changes: 68 additions & 0 deletions include/URLCtrl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef URLCTRL_INCLUDED
#define URLCTRL_INCLUDED

#include "Window.h"
#include "Common.h"

class URLCtrl : public Window {
public:
URLCtrl() :_hfUnderlined(0), _hCursor(0), _msgDest(NULL), _cmdID(0), _oldproc(NULL), \
_linkColor(), _visitedColor(), _clicking(false), _URL(TEXT("")){};

void create(HWND itemHandle, TCHAR * link, COLORREF linkColor = RGB(0, 0, 255));

void create(HWND itemHandle, int cmd, HWND msgDest = NULL);

void destroy();

private:
void action();

protected:
generic_string _URL;
HFONT _hfUnderlined;
HCURSOR _hCursor;

HWND _msgDest;
unsigned long _cmdID;

WNDPROC _oldproc;
COLORREF _linkColor;
COLORREF _visitedColor;
bool _clicking;

static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam){
return ((URLCtrl *)(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam);
};

LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
};

#endif //URLCTRL_INCLUDED
32 changes: 0 additions & 32 deletions include/resource.h

This file was deleted.

88 changes: 67 additions & 21 deletions resources/TaskList.rc
Original file line number Diff line number Diff line change
@@ -1,31 +1,77 @@
/*
this file is part of notepad++
Copyright (C)2003 Don HO ( [email protected] )

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
// Neutral resources

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#pragma code_page(1252)

#include <windows.h>
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_PLUGINGOLINE_DEMO DIALOGEX 0, 0, 137, 283
IDD_TODOLIST_DIALOG DIALOGEX 0, 0, 137, 283
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Task List"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
LISTBOX ID_TODO_LIST,8,8,123,269, WS_VSCROLL | WS_TABSTOP | LBS_NOTIFY
LISTBOX ID_TODO_LIST,8,8,123,269,WS_VSCROLL | WS_TABSTOP
END

IDD_ABOUT_DIALOG DIALOGEX 0, 0, 272, 138
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "&Ok",1,110,120,50,14
CTEXT "Task List v1.0.4",IDC_ABOUT_TITLE,7,7,257,17,SS_CENTERIMAGE,WS_EX_DLGMODALFRAME | WS_EX_TRANSPARENT
LTEXT "Url:",IDC_ABOUT_URL_PREFIX,12,34,27,9
LTEXT "https://github.com/Megabyteceer/npp-task-list",IDC_ABOUT_URL,39,34,220,9
LTEXT "Contributors:",IDC_ABOUT_CONTRIBUTORS,12,50,247,9
LTEXT "\t- blitowitz",IDC_ABOUT_CONTRIBUTOR1,12,61,247,9
LTEXT "\t- Megabyteceer",IDC_ABOUT_CONTRIBUTOR2,12,72,247,9
LTEXT "\t- chcg",IDC_ABOUT_CONTRIBUTOR3,12,83,247,9
LTEXT "\t- Thibmo",IDC_ABOUT_CONTRIBUTOR4,12,94,247,9
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_TODOLIST_DIALOG, DIALOG
BEGIN
END

IDD_ABOUT_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 264
TOPMARGIN, 7
BOTTOMMARGIN, 134
END
END
#endif // APSTUDIO_INVOKED

#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////


#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Loading

0 comments on commit 708c023

Please sign in to comment.