[RELEASE] OR v5.0.1.
Revert to the old timestamp due to the annoying bug. Rename Makefile.win to makefile. Remove throwing exception temporarily in order to fix Notepad++ launch problem under WINE. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@288 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
96299bc218
commit
8bfe2001eb
|
@ -1,3 +1,16 @@
|
||||||
|
Notepad++ v5.0.1 fixed bugs and added features (from v5) :
|
||||||
|
|
||||||
|
1. Fix tags match highlighter bug - more accurate.
|
||||||
|
2. Fix word completion doesn't display bug.
|
||||||
|
3. Fix word completion not in alphabet order.
|
||||||
|
4. Fix Notepad++ launch problem under WINE.
|
||||||
|
5. Fix crash issue due to timestamp problem.
|
||||||
|
6. Fix bug : Files not in recent list on exit and no session saved.
|
||||||
|
7. Fix bug : hide lines not working right when closing.
|
||||||
|
8. Re-enable gcc compiler environment (minGW).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Notepad++ v5 fixed bugs and added features (from v4.9.2) :
|
Notepad++ v5 fixed bugs and added features (from v4.9.2) :
|
||||||
|
|
||||||
1. Improve Notepad++ performance - on startup and on exit.
|
1. Improve Notepad++ performance - on startup and on exit.
|
||||||
|
|
|
@ -1,178 +0,0 @@
|
||||||
# Directories:
|
|
||||||
NPP_DIR = ../src
|
|
||||||
SCI_DIR = ../../scintilla/include
|
|
||||||
GCC_DIR = .
|
|
||||||
|
|
||||||
#MISC:
|
|
||||||
MISC_DIR = $(NPP_DIR)/MISC
|
|
||||||
EXCEPTION_DIR = $(MISC_DIR)/Exception
|
|
||||||
PLUGINS_DIR = $(MISC_DIR)/PluginsManager
|
|
||||||
PROCESS_DIR = $(MISC_DIR)/Process
|
|
||||||
REGEXT_DIR = $(MISC_DIR)/RegExt
|
|
||||||
SYSMSG_DIR = $(MISC_DIR)/SysMsg
|
|
||||||
|
|
||||||
#ScintillaComponent:
|
|
||||||
SCINT_DIR = $(NPP_DIR)/ScitillaComponent
|
|
||||||
|
|
||||||
#TinyXml
|
|
||||||
TIXML_DIR = $(NPP_DIR)/TinyXml
|
|
||||||
|
|
||||||
#WinControls
|
|
||||||
WIN_DIR = $(NPP_DIR)/WinControls
|
|
||||||
ABOUT_DIR = $(WIN_DIR)/AboutDlg
|
|
||||||
CONTEXT_DIR = $(WIN_DIR)/ContextMenu
|
|
||||||
COLOUR_DIR = $(WIN_DIR)/ColourPicker
|
|
||||||
DOCKING_DIR = $(WIN_DIR)/DockingWnd
|
|
||||||
GRID_DIR = $(WIN_DIR)/Grid
|
|
||||||
IMLIST_DIR = $(WIN_DIR)/ImageListSet
|
|
||||||
OPENSAVE_DIR = $(WIN_DIR)/OpenSaveFileDialog
|
|
||||||
# PANNER_DIR = $(WIN_DIR)/Panner
|
|
||||||
PREFERENCE_DIR = $(WIN_DIR)/Preference
|
|
||||||
SHORTCUT_DIR = $(WIN_DIR)/shortcut
|
|
||||||
SPLITTER_DIR = $(WIN_DIR)/SplitterContainer
|
|
||||||
STATICDLG_DIR = $(WIN_DIR)/StaticDialog
|
|
||||||
RUNDLG_DIR = $(STATICDLG_DIR)/RunDlg
|
|
||||||
STATUSBAR_DIR = $(WIN_DIR)/StatusBar
|
|
||||||
TABBAR_DIR = $(WIN_DIR)/TabBar
|
|
||||||
TASKLIST_DIR = $(WIN_DIR)/TaskList
|
|
||||||
TOOLBAR_DIR = $(WIN_DIR)/ToolBar
|
|
||||||
TOOLTIP_DIR = $(WIN_DIR)/ToolTip
|
|
||||||
TRAYICON_DIR = $(WIN_DIR)/TrayIcon
|
|
||||||
TREEVIEW_DIR = $(WIN_DIR)/TreeView
|
|
||||||
WINDOWSDLG_DIR = $(WIN_DIR)/WindowsDlg
|
|
||||||
|
|
||||||
|
|
||||||
# Sources:
|
|
||||||
SRC_NPP = $(wildcard $(NPP_DIR)/*.cpp)
|
|
||||||
|
|
||||||
#MISC
|
|
||||||
SRC_MISC = $(wildcard $(MISC_DIR)/*.cpp)
|
|
||||||
SRC_EXCEPTION = $(wildcard $(EXCEPTION_DIR)/*.cpp)
|
|
||||||
SRC_PLUGINS = $(wildcard $(PLUGINS_DIR)/*.cpp)
|
|
||||||
SRC_PROCESS = $(wildcard $(PROCESS_DIR)/*.cpp)
|
|
||||||
SRC_REGEXT = $(wildcard $(REGEXT_DIR)/*.cpp)
|
|
||||||
SRC_SYSMSG = $(wildcard $(SYSMSG_DIR)/*.cpp)
|
|
||||||
|
|
||||||
#ScintillaComponent
|
|
||||||
SRC_SCINT = $(wildcard $(SCINT_DIR)/*.cpp)
|
|
||||||
|
|
||||||
#TinyXml
|
|
||||||
SRC_TIXML = $(wildcard $(TIXML_DIR)/*.cpp)
|
|
||||||
|
|
||||||
#WinControls
|
|
||||||
SRC_WIN = $(wildcard $(WIN_DIR)/*.cpp)
|
|
||||||
SRC_ABOUT = $(wildcard $(ABOUT_DIR)/*.cpp)
|
|
||||||
SRC_CONTEXT = $(wildcard $(CONTEXT_DIR)/*.cpp)
|
|
||||||
SRC_COLOUR = $(wildcard $(COLOUR_DIR)/*.cpp)
|
|
||||||
SRC_DOCKING = $(wildcard $(DOCKING_DIR)/*.cpp)
|
|
||||||
SRC_GRID = $(wildcard $(GRID_DIR)/*.cpp)
|
|
||||||
SRC_IMLIST = $(wildcard $(IMLIST_DIR)/*.cpp)
|
|
||||||
SRC_OPENSAVE = $(wildcard $(OPENSAVE_DIR)/*.cpp)
|
|
||||||
SRC_PREFERENCE = $(wildcard $(PREFERENCE_DIR)/*.cpp)
|
|
||||||
SRC_SHORTCUT = $(wildcard $(SHORTCUT_DIR)/*.cpp)
|
|
||||||
SRC_SPLITTER = $(wildcard $(SPLITTER_DIR)/*.cpp)
|
|
||||||
SRC_STATICDLG = $(wildcard $(STATICDLG_DIR)/*.cpp)
|
|
||||||
SRC_RUNDLG = $(wildcard $(RUNDLG_DIR)/*.cpp)
|
|
||||||
SRC_STATUSBAR = $(wildcard $(STATUSBAR_DIR)/*.cpp)
|
|
||||||
SRC_TABBAR = $(wildcard $(TABBAR_DIR)/*.cpp)
|
|
||||||
SRC_TASKLIST = $(wildcard $(TASKLIST_DIR)/*.cpp)
|
|
||||||
SRC_TOOLBAR = $(wildcard $(TOOLBAR_DIR)/*.cpp)
|
|
||||||
SRC_TOOLTIP = $(wildcard $(TOOLTIP_DIR)/*.cpp)
|
|
||||||
SRC_TRAYICON = $(wildcard $(TRAYICON_DIR)/*.cpp)
|
|
||||||
SRC_TREEVIEW = $(wildcard $(TREEVIEW_DIR)/*.cpp)
|
|
||||||
SRC_WINDOWSDLG = $(wildcard $(WINDOWSDLG_DIR)/*.cpp)
|
|
||||||
|
|
||||||
# Objects:
|
|
||||||
OBJ_NPP = $(patsubst %.cpp,%.o,$(SRC_NPP))
|
|
||||||
|
|
||||||
#MISC
|
|
||||||
OBJ_MISC = $(patsubst %.cpp,%.o,$(SRC_MISC))
|
|
||||||
OBJ_EXCEPTION = $(patsubst %.cpp,%.o,$(SRC_EXCEPTION))
|
|
||||||
OBJ_PLUGINS = $(patsubst %.cpp,%.o,$(SRC_PLUGINS))
|
|
||||||
OBJ_PROCESS = $(patsubst %.cpp,%.o,$(SRC_PROCESS))
|
|
||||||
OBJ_REGEXT = $(patsubst %.cpp,%.o,$(SRC_REGEXT))
|
|
||||||
OBJ_SYSMSG = $(patsubst %.cpp,%.o,$(SRC_SYSMSG))
|
|
||||||
|
|
||||||
#ScintillaComponent
|
|
||||||
OBJ_SCINT = $(patsubst %.cpp,%.o,$(SRC_SCINT))
|
|
||||||
|
|
||||||
#TinyXml
|
|
||||||
OBJ_TIXML = $(patsubst %.cpp,%.o,$(SRC_TIXML))
|
|
||||||
|
|
||||||
#WinControls
|
|
||||||
OBJ_WIN = $(patsubst %.cpp,%.o,$(SRC_WIN))
|
|
||||||
OBJ_ABOUT = $(patsubst %.cpp,%.o,$(SRC_ABOUT))
|
|
||||||
OBJ_CONTEXT = $(patsubst %.cpp,%.o,$(SRC_CONTEXT))
|
|
||||||
OBJ_COLOUR = $(patsubst %.cpp,%.o,$(SRC_COLOUR))
|
|
||||||
OBJ_DOCKING = $(patsubst %.cpp,%.o,$(SRC_DOCKING))
|
|
||||||
OBJ_GRID = $(patsubst %.cpp,%.o,$(SRC_GRID))
|
|
||||||
OBJ_IMLIST = $(patsubst %.cpp,%.o,$(SRC_IMLIST))
|
|
||||||
OBJ_OPENSAVE = $(patsubst %.cpp,%.o,$(SRC_OPENSAVE))
|
|
||||||
OBJ_PREFERENCE = $(patsubst %.cpp,%.o,$(SRC_PREFERENCE))
|
|
||||||
OBJ_SHORTCUT = $(patsubst %.cpp,%.o,$(SRC_SHORTCUT))
|
|
||||||
OBJ_SPLITTER = $(patsubst %.cpp,%.o,$(SRC_SPLITTER))
|
|
||||||
OBJ_STATICDLG = $(patsubst %.cpp,%.o,$(SRC_STATICDLG))
|
|
||||||
OBJ_RUNDLG = $(patsubst %.cpp,%.o,$(SRC_RUNDLG))
|
|
||||||
OBJ_STATUSBAR = $(patsubst %.cpp,%.o,$(SRC_STATUSBAR))
|
|
||||||
OBJ_TABBAR = $(patsubst %.cpp,%.o,$(SRC_TABBAR))
|
|
||||||
OBJ_TASKLIST = $(patsubst %.cpp,%.o,$(SRC_TASKLIST))
|
|
||||||
OBJ_TOOLBAR = $(patsubst %.cpp,%.o,$(SRC_TOOLBAR))
|
|
||||||
OBJ_TOOLTIP = $(patsubst %.cpp,%.o,$(SRC_TOOLTIP))
|
|
||||||
OBJ_TRAYICON = $(patsubst %.cpp,%.o,$(SRC_TRAYICON))
|
|
||||||
OBJ_TREEVIEW = $(patsubst %.cpp,%.o,$(SRC_TREEVIEW))
|
|
||||||
OBJ_WINDOWSDLG = $(patsubst %.cpp,%.o,$(SRC_WINDOWSDLG))
|
|
||||||
|
|
||||||
# Collections
|
|
||||||
DIRS_WIN = $(WIN_DIR) $(ABOUT_DIR) $(CONTEXT_DIR) $(COLOUR_DIR) $(DOCKING_DIR) $(GRID_DIR) $(IMLIST_DIR) $(OPENSAVE_DIR) $(PREFERENCE_DIR) $(SHORTCUT_DIR) $(SPLITTER_DIR) $(STATICDLG_DIR) $(RUNDLG_DIR) $(STATUSBAR_DIR) $(TABBAR_DIR) $(TASKLIST_DIR) $(TOOLBAR_DIR) $(TOOLTIP_DIR) $(TRAYICON_DIR) $(TREEVIEW_DIR) $(WINDOWSDLG_DIR)
|
|
||||||
DIRS_TIXML = $(TIXML_DIR)
|
|
||||||
DIRS_SCINT = $(SCINT_DIR)
|
|
||||||
DIRS_MISC = $(MISC_DIR) $(EXCEPTION_DIR) $(PLUGINS_DIR) $(PROCESS_DIR) $(REGEXT_DIR) $(SYSMSG_DIR)
|
|
||||||
DIRS = $(NPP_DIR) $(DIRS_WIN) $(DIRS_TIXML) $(DIRS_SCINT) $(DIRS_MISC) $(SCI_DIR)
|
|
||||||
|
|
||||||
SRCS_WIN = $(SRC_WIN) $(SRC_ABOUT) $(SRC_CONTEXT) $(SRC_COLOUR) $(SRC_DOCKING) $(SRC_GRID) $(SRC_IMLIST) $(SRC_OPENSAVE) $(SRC_PREFERENCE) $(SRC_SHORTCUT) $(SRC_SPLITTER) $(SRC_STATICDLG) $(SRC_RUNDLG) $(SRC_STATUSBAR) $(SRC_TABBAR) $(SRC_TASKLIST) $(SRC_TOOLBAR) $(SRC_TOOLTIP) $(SRC_TRAYICON) $(SRC_TREEVIEW) $(SRC_WINDOWSDLG)
|
|
||||||
SRCS_TIXML = $(SRC_TIXML)
|
|
||||||
SRCS_SCINT = $(SRC_SCINT)
|
|
||||||
SRCS_MISC = $(SRC_MISC) $(SRC_EXCEPTION) $(SRC_PLUGINS) $(SRC_PROCESS) $(SRC_REGEXT) $(SRC_SYSMSG)
|
|
||||||
SRCS = $(SRC_NPP) $(SRCS_WIN) $(SRCS_TIXML) $(SRCS_SCINT) $(SRCS_MISC)
|
|
||||||
|
|
||||||
OBJS_WIN = $(OBJ_WIN) $(OBJ_ABOUT) $(OBJ_CONTEXT) $(OBJ_COLOUR) $(OBJ_DOCKING) $(OBJ_GRID) $(OBJ_IMLIST) $(OBJ_OPENSAVE) $(OBJ_PREFERENCE) $(OBJ_SHORTCUT) $(OBJ_SPLITTER) $(OBJ_STATICDLG) $(OBJ_RUNDLG) $(OBJ_STATUSBAR) $(OBJ_TABBAR) $(OBJ_TASKLIST) $(OBJ_TOOLBAR) $(OBJ_TOOLTIP) $(OBJ_TRAYICON) $(OBJ_TREEVIEW) $(OBJ_WINDOWSDLG)
|
|
||||||
OBJS_TIXML = $(OBJ_TIXML)
|
|
||||||
OBJS_SCINT = $(OBJ_SCINT)
|
|
||||||
OBJS_MISC = $(OBJ_MISC) $(OBJ_EXCEPTION) $(OBJ_PLUGINS) $(OBJ_PROCESS) $(OBJ_REGEXT) $(OBJ_SYSMSG)
|
|
||||||
OBJS = $(OBJ_NPP) $(OBJS_WIN) $(OBJS_TIXML) $(OBJS_SCINT) $(OBJS_MISC)
|
|
||||||
|
|
||||||
# Main resource file
|
|
||||||
SRC_RES = ./resources.rc
|
|
||||||
OBJ_RES = $(patsubst %.rc,%.res,$(SRC_RES))
|
|
||||||
|
|
||||||
# Parameters
|
|
||||||
INCLUDESPECIAL = -include./include/various.h
|
|
||||||
|
|
||||||
CXX = g++
|
|
||||||
#CXXFLAGS = -O2 $(INCLUDESPECIAL)
|
|
||||||
CXXFLAGS = $(INCLUDESPECIAL)
|
|
||||||
INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include
|
|
||||||
LDFLAGS = -Wl,--subsystem,windows
|
|
||||||
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi
|
|
||||||
|
|
||||||
RC = windres
|
|
||||||
|
|
||||||
OUT_NPP = NotepadPP.exe
|
|
||||||
|
|
||||||
EXEC = ../bin/$(OUT_NPP)
|
|
||||||
|
|
||||||
all: NotepadPP
|
|
||||||
|
|
||||||
# Main Notepad++ rule
|
|
||||||
NotepadPP: $(OBJS) $(OBJ_RES)
|
|
||||||
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) $(OBJS) $(OBJ_RES) -o $(EXEC) $(LIBS)
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
|
|
||||||
|
|
||||||
%.res: %.rc
|
|
||||||
$(RC) $(INCLUDES) --input=$< --output=$@ --input-format=rc --output-format=coff
|
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
clean:
|
|
||||||
@delete.bat
|
|
|
@ -1,5 +1,5 @@
|
||||||
# this file is part of notepad++
|
# this file is part of notepad++
|
||||||
# Copyright (C)2003 Don HO ( donho@altern.org )
|
# Copyright (C)2008 Harry Bruin <harrybharry@users.sourceforge.net>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
@ -15,269 +15,181 @@
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
.SUFFIXES: .cpp
|
# Directories:
|
||||||
CPP = g++
|
NPP_DIR = ../src
|
||||||
CC=gcc
|
SCI_DIR = ../../scintilla/include
|
||||||
RC = windres
|
GCC_DIR = .
|
||||||
|
|
||||||
#UserDefineDialog_res.o
|
#MISC:
|
||||||
MAINOBJS = winmain.o Parameters.o Notepad_plus.o Notepad_plus_res.o Utf8_16.o PluginsManager.o
|
MISC_DIR = $(NPP_DIR)/MISC
|
||||||
|
EXCEPTION_DIR = $(MISC_DIR)/Exception
|
||||||
SCINTILLAOBJS = ScintillaEditView.o DocTabView.o FindReplaceDlg.o UserDefineDialog.o Printer.o UserDefineDialog_res.o GoToLineDlg.o
|
PLUGINS_DIR = $(MISC_DIR)/PluginsManager
|
||||||
|
PROCESS_DIR = $(MISC_DIR)/Process
|
||||||
WINCTRLOBJS = TabBar.o ControlsTab.o ToolBar.o StatusBar.o ImageListSet.o FileDialog.o Splitter.o SplitterContainer.o StaticDialog.o \
|
REGEXT_DIR = $(MISC_DIR)/RegExt
|
||||||
URLCtrl.o AboutDlg.o RunDlg.o trayIconControler.o shortcut.o ShortcutMapper.o BabyGridWrapper.o BabyGrid.o ShortcutMapper_rc.o \
|
SYSMSG_DIR = $(MISC_DIR)/SysMsg
|
||||||
regExtDlg_res.o regExtDlg.o preference_rc.o preferenceDlg.o WindowsDlg_rc.o SizeableDlg.o WinMgr.o WinRect.o WindowsDlg.o
|
|
||||||
|
#ScintillaComponent:
|
||||||
WORDSTYLESDLG = WordStyleDlg_rc.o WordStyleDlg.o ColourPicker.o ColourPopup_rc.o ColourPopup.o
|
SCINT_DIR = $(NPP_DIR)/ScitillaComponent
|
||||||
MISCOBJS = SysMsg.o Process.o
|
|
||||||
TINYXMLOBJS = tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o
|
#TinyXml
|
||||||
|
TIXML_DIR = $(NPP_DIR)/TinyXml
|
||||||
OBJS = $(MAINOBJS) $(SCINTILLAOBJS) $(WINCTRLOBJS) $(MISCOBJS) $(TINYXMLOBJS) $(WORDSTYLESDLG)
|
|
||||||
#
|
#WinControls
|
||||||
# the paths
|
WIN_DIR = $(NPP_DIR)/WinControls
|
||||||
INCLUDEDIR = ../../scintilla/include
|
ABOUT_DIR = $(WIN_DIR)/AboutDlg
|
||||||
SRCDIR = ../src
|
CONTEXT_DIR = $(WIN_DIR)/ContextMenu
|
||||||
TARGETDIR=../bin
|
COLOUR_DIR = $(WIN_DIR)/ColourPicker
|
||||||
|
DOCKING_DIR = $(WIN_DIR)/DockingWnd
|
||||||
WINCTRLDIR = $(SRCDIR)/WinControls
|
GRID_DIR = $(WIN_DIR)/Grid
|
||||||
|
IMLIST_DIR = $(WIN_DIR)/ImageListSet
|
||||||
SCINTILLADIR = $(SRCDIR)/ScitillaComponent
|
OPENSAVE_DIR = $(WIN_DIR)/OpenSaveFileDialog
|
||||||
|
# PANNER_DIR = $(WIN_DIR)/Panner
|
||||||
TINYXMLDIR = $(SRCDIR)/TinyXml
|
PREFERENCE_DIR = $(WIN_DIR)/Preference
|
||||||
|
SHORTCUT_DIR = $(WIN_DIR)/shortcut
|
||||||
TABBARDIR = $(WINCTRLDIR)/TabBar
|
SPLITTER_DIR = $(WIN_DIR)/SplitterContainer
|
||||||
TOOLBARDIR = $(WINCTRLDIR)/ToolBar
|
STATICDLG_DIR = $(WIN_DIR)/StaticDialog
|
||||||
STATUSBARDIR = $(WINCTRLDIR)/StatusBar
|
RUNDLG_DIR = $(STATICDLG_DIR)/RunDlg
|
||||||
IMGLSTSETDIR = $(WINCTRLDIR)/ImageListSet
|
STATUSBAR_DIR = $(WIN_DIR)/StatusBar
|
||||||
FILEDIALOGDIR = $(WINCTRLDIR)/OpenSaveFileDialog
|
TABBAR_DIR = $(WIN_DIR)/TabBar
|
||||||
SPLITTERDIR = $(WINCTRLDIR)/SplitterContainer
|
TASKLIST_DIR = $(WIN_DIR)/TaskList
|
||||||
STATICDLGDIR = $(WINCTRLDIR)/StaticDialog
|
TOOLBAR_DIR = $(WIN_DIR)/ToolBar
|
||||||
ABOUTDLGDIR = $(WINCTRLDIR)/AboutDlg
|
TOOLTIP_DIR = $(WIN_DIR)/ToolTip
|
||||||
RUNDLGDIR = $(STATICDLGDIR)/RunDlg
|
TRAYICON_DIR = $(WIN_DIR)/TrayIcon
|
||||||
SHORTCUTDIR = $(WINCTRLDIR)/shortcut
|
TREEVIEW_DIR = $(WIN_DIR)/TreeView
|
||||||
MISCDIR = $(SRCDIR)/MISC
|
WINDOWSDLG_DIR = $(WIN_DIR)/WindowsDlg
|
||||||
SYSMSGDIR = $(MISCDIR)/SysMsg
|
|
||||||
PROCESSDIR = $(MISCDIR)/Process
|
|
||||||
REGEXTDIR = $(MISCDIR)/RegExt
|
# Sources:
|
||||||
PLUGINSMANAGERDIR = $(MISCDIR)/PluginsManager
|
SRC_NPP = $(wildcard $(NPP_DIR)/*.cpp)
|
||||||
WORDSTYLESDLGDIR = $(WINCTRLDIR)/ColourPicker
|
|
||||||
SYSTRAYDIR = $(WINCTRLDIR)/TrayIcon
|
#MISC
|
||||||
CONTEXTMENUDIR = $(WINCTRLDIR)/ContextMenu
|
SRC_MISC = $(wildcard $(MISC_DIR)/*.cpp)
|
||||||
SHORTCUTMAPPERDIR = $(WINCTRLDIR)/Grid
|
SRC_EXCEPTION = $(wildcard $(EXCEPTION_DIR)/*.cpp)
|
||||||
PREFERENCEDLGDIR = $(WINCTRLDIR)/Preference
|
SRC_PLUGINS = $(wildcard $(PLUGINS_DIR)/*.cpp)
|
||||||
WINDOWSDLGDIR = $(WINCTRLDIR)/WindowsDlg
|
SRC_PROCESS = $(wildcard $(PROCESS_DIR)/*.cpp)
|
||||||
|
SRC_REGEXT = $(wildcard $(REGEXT_DIR)/*.cpp)
|
||||||
PROG = $(TARGETDIR)/npp.exe
|
SRC_SYSMSG = $(wildcard $(SYSMSG_DIR)/*.cpp)
|
||||||
FONT_SRC=$(SRCDIR)/font/LINEDRAW.TTF
|
|
||||||
FONT_TARGET=$(TARGETDIR)/LINEDRAW.TTF
|
#ScintillaComponent
|
||||||
|
SRC_SCINT = $(wildcard $(SCINT_DIR)/*.cpp)
|
||||||
XMLUSERFILE_SRC=$(SRCDIR)/config.xml
|
|
||||||
XMLUSERFILE_TARGET=$(TARGETDIR)/config.xml
|
#TinyXml
|
||||||
XMLLANGFILE_SRC=$(SRCDIR)/langs.xml
|
SRC_TIXML = $(wildcard $(TIXML_DIR)/*.cpp)
|
||||||
XMLLANGFILE_TARGET=$(TARGETDIR)/langs.xml
|
|
||||||
|
#WinControls
|
||||||
INCLUDEFLAGS = -I$(INCLUDEDIR) -I$(SCINTILLADIR) -I$(WINCTRLDIR) \
|
SRC_WIN = $(wildcard $(WIN_DIR)/*.cpp)
|
||||||
-I$(TABBARDIR) -I$(TOOLBARDIR) -I$(STATUSBARDIR) -I$(IMGLSTSETDIR) \
|
SRC_ABOUT = $(wildcard $(ABOUT_DIR)/*.cpp)
|
||||||
-I$(FILEDIALOGDIR) -I$(SPLITTERDIR) -I$(STATICDLGDIR) -I$(ABOUTDLGDIR) \
|
SRC_CONTEXT = $(wildcard $(CONTEXT_DIR)/*.cpp)
|
||||||
-I$(SYSMSGDIR) -I$(PROCESSDIR) -I$(MISCDIR) -I$(RUNDLGDIR) -I$(SRCDIR) \
|
SRC_COLOUR = $(wildcard $(COLOUR_DIR)/*.cpp)
|
||||||
-I$(TINYXMLDIR) -I$(WORDSTYLESDLGDIR) -I$(REGEXTDIR) -I$(PLUGINSMANAGERDIR) \
|
SRC_DOCKING = $(wildcard $(DOCKING_DIR)/*.cpp)
|
||||||
-I$(SYSTRAYDIR) -I$(SHORTCUTDIR) -I$(CONTEXTMENUDIR) -I$(SHORTCUTMAPPERDIR) \
|
SRC_GRID = $(wildcard $(GRID_DIR)/*.cpp)
|
||||||
-I$(PREFERENCEDLGDIR) -I$(WINDOWSDLGDIR)
|
SRC_IMLIST = $(wildcard $(IMLIST_DIR)/*.cpp)
|
||||||
|
SRC_OPENSAVE = $(wildcard $(OPENSAVE_DIR)/*.cpp)
|
||||||
DEFINEFLAGS = -D_WIN32_IE=0x0600
|
SRC_PREFERENCE = $(wildcard $(PREFERENCE_DIR)/*.cpp)
|
||||||
CFLAGS = -Wall -Os -DNDEBUG
|
SRC_SHORTCUT = $(wildcard $(SHORTCUT_DIR)/*.cpp)
|
||||||
#CFLAGS = -Wall -Os -DDEBUG
|
SRC_SPLITTER = $(wildcard $(SPLITTER_DIR)/*.cpp)
|
||||||
LDFLAGS = -mwindows -Wl,-s -Wl,--gc-sections -lcomctl32 -lshlwapi -lodbc32 -lodbccp32 -Os -s
|
SRC_STATICDLG = $(wildcard $(STATICDLG_DIR)/*.cpp)
|
||||||
#LDFLAGS = -mwindows -lcomctl32 -lshlwapi -llibshell32
|
SRC_RUNDLG = $(wildcard $(RUNDLG_DIR)/*.cpp)
|
||||||
|
SRC_STATUSBAR = $(wildcard $(STATUSBAR_DIR)/*.cpp)
|
||||||
ALL: $(PROG) $(FONT_TARGET) $(XMLLANGFILE_TARGET)
|
SRC_TABBAR = $(wildcard $(TABBAR_DIR)/*.cpp)
|
||||||
|
SRC_TASKLIST = $(wildcard $(TASKLIST_DIR)/*.cpp)
|
||||||
$(PROG): $(OBJS)
|
SRC_TOOLBAR = $(wildcard $(TOOLBAR_DIR)/*.cpp)
|
||||||
$(CPP) -Xlinker --subsystem -Xlinker windows -o $@ $(OBJS) $(LDFLAGS)
|
SRC_TOOLTIP = $(wildcard $(TOOLTIP_DIR)/*.cpp)
|
||||||
|
SRC_TRAYICON = $(wildcard $(TRAYICON_DIR)/*.cpp)
|
||||||
|
SRC_TREEVIEW = $(wildcard $(TREEVIEW_DIR)/*.cpp)
|
||||||
winmain.o : $(SRCDIR)/winmain.cpp $(SRCDIR)/Notepad_plus.h $(SYSMSGDIR)/SysMsg.h $(CONTEXTMENUDIR)/ContextMenu.h
|
SRC_WINDOWSDLG = $(wildcard $(WINDOWSDLG_DIR)/*.cpp)
|
||||||
$(CPP) $(CFLAGS) -c $(SRCDIR)/winmain.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
# Objects:
|
||||||
Notepad_plus.o : $(SRCDIR)/Notepad_plus.h $(SRCDIR)/Notepad_plus.cpp $(SRCDIR)/Parameters.h \
|
OBJ_NPP = $(patsubst %.cpp,%.o,$(SRC_NPP))
|
||||||
$(SCINTILLADIR)/ScintillaEditView.h $(SCINTILLADIR)/DocTabView.h $(SCINTILLADIR)/FindReplaceDlg.h \
|
|
||||||
$(SCINTILLADIR)/UserDefineDialog.h $(SCINTILLADIR)/printer.h $(WINCTRLDIR)/Window.h \
|
#MISC
|
||||||
$(TOOLBARDIR)/ToolBar.h $(FILEDIALOGDIR)/FileDialog.h $(SRCDIR)/resource.h \
|
OBJ_MISC = $(patsubst %.cpp,%.o,$(SRC_MISC))
|
||||||
$(STATUSBARDIR)/StatusBar.h $(ABOUTDLGDIR)/AboutDlg.h $(IMGLSTSETDIR)/ImageListSet.h \
|
OBJ_EXCEPTION = $(patsubst %.cpp,%.o,$(SRC_EXCEPTION))
|
||||||
$(STATICDLGDIR)/StaticDialog.h $(SPLITTERDIR)/SplitterContainer.h $(SYSMSGDIR)/SysMsg.h \
|
OBJ_PLUGINS = $(patsubst %.cpp,%.o,$(SRC_PLUGINS))
|
||||||
$(MISCDIR)/FileNameStringSplitter.h $(SRCDIR)/lastRecentFileList.h $(SRCDIR)/lesDlgs.h $(SHORTCUTDIR)/shortcut.h $(CONTEXTMENUDIR)/ContextMenu.h
|
OBJ_PROCESS = $(patsubst %.cpp,%.o,$(SRC_PROCESS))
|
||||||
$(CPP) $(CFLAGS) $(DEFINEFLAGS) -c $(SRCDIR)/Notepad_plus.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_REGEXT = $(patsubst %.cpp,%.o,$(SRC_REGEXT))
|
||||||
#$(PROCESSDIR)/Process.h
|
OBJ_SYSMSG = $(patsubst %.cpp,%.o,$(SRC_SYSMSG))
|
||||||
Parameters.o : $(SRCDIR)/Parameters.h $(SRCDIR)/Parameters.cpp $(CONTEXTMENUDIR)/ContextMenu.h
|
|
||||||
$(CPP) $(CFLAGS) $(DEFINEFLAGS) -c $(SRCDIR)/Parameters.cpp -o $@ $(INCLUDEFLAGS)
|
#ScintillaComponent
|
||||||
|
OBJ_SCINT = $(patsubst %.cpp,%.o,$(SRC_SCINT))
|
||||||
Notepad_plus_res.o : $(SRCDIR)/resource.h $(SRCDIR)/Notepad_plus.rc $(SCINTILLADIR)/UserDefineDialog.rc \
|
|
||||||
$(RUNDLGDIR)/RunDlg.rc $(SHORTCUTDIR)/shortcut.rc
|
#TinyXml
|
||||||
$(RC) --include-dir=$(SRCDIR) -o $@ $(SRCDIR)/Notepad_plus.rc
|
OBJ_TIXML = $(patsubst %.cpp,%.o,$(SRC_TIXML))
|
||||||
|
|
||||||
Utf8_16.o : $(SRCDIR)/Utf8_16.h $(SRCDIR)/Utf8_16.cpp
|
#WinControls
|
||||||
$(CPP) $(CFLAGS) $(DEFINEFLAGS) -c $(SRCDIR)/Utf8_16.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_WIN = $(patsubst %.cpp,%.o,$(SRC_WIN))
|
||||||
|
OBJ_ABOUT = $(patsubst %.cpp,%.o,$(SRC_ABOUT))
|
||||||
ScintillaEditView.o : $(SCINTILLADIR)/ScintillaEditView.h $(SCINTILLADIR)/ScintillaEditView.cpp $(SRCDIR)/Parameters.h \
|
OBJ_CONTEXT = $(patsubst %.cpp,%.o,$(SRC_CONTEXT))
|
||||||
$(WINCTRLDIR)/Window.h $(INCLUDEDIR)/Scintilla.h $(INCLUDEDIR)/SciLexer.h $(SCINTILLADIR)/Buffer.h \
|
OBJ_COLOUR = $(patsubst %.cpp,%.o,$(SRC_COLOUR))
|
||||||
$(SCINTILLADIR)/colors.h $(SYSMSGDIR)/SysMsg.h $(STATICDLGDIR)/StaticDialog.h
|
OBJ_DOCKING = $(patsubst %.cpp,%.o,$(SRC_DOCKING))
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/ScintillaEditView.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_GRID = $(patsubst %.cpp,%.o,$(SRC_GRID))
|
||||||
|
OBJ_IMLIST = $(patsubst %.cpp,%.o,$(SRC_IMLIST))
|
||||||
DocTabView.o : $(SCINTILLADIR)/DocTabView.h $(SCINTILLADIR)/DocTabView.cpp \
|
OBJ_OPENSAVE = $(patsubst %.cpp,%.o,$(SRC_OPENSAVE))
|
||||||
$(TABBARDIR)/TabBar.h $(IMGLSTSETDIR)/ImageListSet.h $(SCINTILLADIR)/ScintillaEditView.cpp
|
OBJ_PREFERENCE = $(patsubst %.cpp,%.o,$(SRC_PREFERENCE))
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/DocTabView.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_SHORTCUT = $(patsubst %.cpp,%.o,$(SRC_SHORTCUT))
|
||||||
|
OBJ_SPLITTER = $(patsubst %.cpp,%.o,$(SRC_SPLITTER))
|
||||||
FindReplaceDlg.o : $(STATICDLGDIR)/StaticDialog.h $(SRCDIR)/resource.h \
|
OBJ_STATICDLG = $(patsubst %.cpp,%.o,$(SRC_STATICDLG))
|
||||||
$(SCINTILLADIR)/FindReplaceDlg.h $(SCINTILLADIR)/FindReplaceDlg.cpp
|
OBJ_RUNDLG = $(patsubst %.cpp,%.o,$(SRC_RUNDLG))
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/FindReplaceDlg.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_STATUSBAR = $(patsubst %.cpp,%.o,$(SRC_STATUSBAR))
|
||||||
|
OBJ_TABBAR = $(patsubst %.cpp,%.o,$(SRC_TABBAR))
|
||||||
UserDefineDialog.o : $(STATICDLGDIR)/StaticDialog.h $(SCINTILLADIR)/ScintillaEditView.h \
|
OBJ_TASKLIST = $(patsubst %.cpp,%.o,$(SRC_TASKLIST))
|
||||||
$(SCINTILLADIR)/UserDefineResource.h $(SCINTILLADIR)/UserDefineDialog.h \
|
OBJ_TOOLBAR = $(patsubst %.cpp,%.o,$(SRC_TOOLBAR))
|
||||||
$(SCINTILLADIR)/UserDefineDialog.cpp
|
OBJ_TOOLTIP = $(patsubst %.cpp,%.o,$(SRC_TOOLTIP))
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/UserDefineDialog.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_TRAYICON = $(patsubst %.cpp,%.o,$(SRC_TRAYICON))
|
||||||
|
OBJ_TREEVIEW = $(patsubst %.cpp,%.o,$(SRC_TREEVIEW))
|
||||||
Printer.o : $(SCINTILLADIR)/Printer.h $(SCINTILLADIR)/Printer.cpp $(SCINTILLADIR)/ScintillaEditView.h
|
OBJ_WINDOWSDLG = $(patsubst %.cpp,%.o,$(SRC_WINDOWSDLG))
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/Printer.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
# Collections
|
||||||
UserDefineDialog_res.o : $(SCINTILLADIR)/UserDefineDialog.rc $(SCINTILLADIR)/UserDefineResource.h
|
DIRS_WIN = $(WIN_DIR) $(ABOUT_DIR) $(CONTEXT_DIR) $(COLOUR_DIR) $(DOCKING_DIR) $(GRID_DIR) $(IMLIST_DIR) $(OPENSAVE_DIR) $(PREFERENCE_DIR) $(SHORTCUT_DIR) $(SPLITTER_DIR) $(STATICDLG_DIR) $(RUNDLG_DIR) $(STATUSBAR_DIR) $(TABBAR_DIR) $(TASKLIST_DIR) $(TOOLBAR_DIR) $(TOOLTIP_DIR) $(TRAYICON_DIR) $(TREEVIEW_DIR) $(WINDOWSDLG_DIR)
|
||||||
$(RC) -o $@ $(SCINTILLADIR)/UserDefineDialog.rc
|
DIRS_TIXML = $(TIXML_DIR)
|
||||||
|
DIRS_SCINT = $(SCINT_DIR)
|
||||||
GoToLineDlg.o : $(SCINTILLADIR)/GoToLineDlg.h
|
DIRS_MISC = $(MISC_DIR) $(EXCEPTION_DIR) $(PLUGINS_DIR) $(PROCESS_DIR) $(REGEXT_DIR) $(SYSMSG_DIR)
|
||||||
$(CPP) $(CFLAGS) -c $(SCINTILLADIR)/GoToLineDlg.cpp -o $@ $(INCLUDEFLAGS)
|
DIRS = $(NPP_DIR) $(DIRS_WIN) $(DIRS_TIXML) $(DIRS_SCINT) $(DIRS_MISC) $(SCI_DIR)
|
||||||
|
|
||||||
TabBar.o : $(WINCTRLDIR)/Window.h $(TABBARDIR)/TabBar.h $(TABBARDIR)/TabBar.cpp $(SYSMSGDIR)/SysMsg.h
|
SRCS_WIN = $(SRC_WIN) $(SRC_ABOUT) $(SRC_CONTEXT) $(SRC_COLOUR) $(SRC_DOCKING) $(SRC_GRID) $(SRC_IMLIST) $(SRC_OPENSAVE) $(SRC_PREFERENCE) $(SRC_SHORTCUT) $(SRC_SPLITTER) $(SRC_STATICDLG) $(SRC_RUNDLG) $(SRC_STATUSBAR) $(SRC_TABBAR) $(SRC_TASKLIST) $(SRC_TOOLBAR) $(SRC_TOOLTIP) $(SRC_TRAYICON) $(SRC_TREEVIEW) $(SRC_WINDOWSDLG)
|
||||||
$(CPP) $(CFLAGS) -c $(TABBARDIR)/TabBar.cpp -o $@ $(INCLUDEFLAGS)
|
SRCS_TIXML = $(SRC_TIXML)
|
||||||
|
SRCS_SCINT = $(SRC_SCINT)
|
||||||
ControlsTab.o : $(TABBARDIR)/ControlsTab.h $(TABBARDIR)/ControlsTab.cpp
|
SRCS_MISC = $(SRC_MISC) $(SRC_EXCEPTION) $(SRC_PLUGINS) $(SRC_PROCESS) $(SRC_REGEXT) $(SRC_SYSMSG)
|
||||||
$(CPP) $(CFLAGS) $(DEFINEFLAGS) -c $(TABBARDIR)/ControlsTab.cpp -o $@ $(INCLUDEFLAGS)
|
SRCS = $(SRC_NPP) $(SRCS_WIN) $(SRCS_TIXML) $(SRCS_SCINT) $(SRCS_MISC)
|
||||||
|
|
||||||
ToolBar.o: $(WINCTRLDIR)/Window.h $(TOOLBARDIR)/ToolBar.h $(TOOLBARDIR)/ToolBar.cpp \
|
OBJS_WIN = $(OBJ_WIN) $(OBJ_ABOUT) $(OBJ_CONTEXT) $(OBJ_COLOUR) $(OBJ_DOCKING) $(OBJ_GRID) $(OBJ_IMLIST) $(OBJ_OPENSAVE) $(OBJ_PREFERENCE) $(OBJ_SHORTCUT) $(OBJ_SPLITTER) $(OBJ_STATICDLG) $(OBJ_RUNDLG) $(OBJ_STATUSBAR) $(OBJ_TABBAR) $(OBJ_TASKLIST) $(OBJ_TOOLBAR) $(OBJ_TOOLTIP) $(OBJ_TRAYICON) $(OBJ_TREEVIEW) $(OBJ_WINDOWSDLG)
|
||||||
$(IMGLSTSETDIR)/ImageListSet.h $(SYSMSGDIR)/SysMsg.h
|
OBJS_TIXML = $(OBJ_TIXML)
|
||||||
$(CPP) $(CFLAGS) -c $(TOOLBARDIR)/ToolBar.cpp -o $@ $(INCLUDEFLAGS)
|
OBJS_SCINT = $(OBJ_SCINT)
|
||||||
|
OBJS_MISC = $(OBJ_MISC) $(OBJ_EXCEPTION) $(OBJ_PLUGINS) $(OBJ_PROCESS) $(OBJ_REGEXT) $(OBJ_SYSMSG)
|
||||||
StatusBar.o: $(WINCTRLDIR)/Window.h $(STATUSBARDIR)/StatusBar.h $(STATUSBARDIR)/StatusBar.cpp $(SYSMSGDIR)/SysMsg.h
|
OBJS = $(OBJ_NPP) $(OBJS_WIN) $(OBJS_TIXML) $(OBJS_SCINT) $(OBJS_MISC)
|
||||||
$(CPP) $(CFLAGS) -c $(STATUSBARDIR)/StatusBar.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
# Main resource file
|
||||||
ImageListSet.o: $(IMGLSTSETDIR)/ImageListSet.h $(IMGLSTSETDIR)/ImageListSet.cpp
|
SRC_RES = ./resources.rc
|
||||||
$(CPP) $(CFLAGS) -c $(IMGLSTSETDIR)/ImageListSet.cpp -o $@ $(INCLUDEFLAGS)
|
OBJ_RES = $(patsubst %.rc,%.res,$(SRC_RES))
|
||||||
|
|
||||||
FileDialog.o: $(FILEDIALOGDIR)/FileDialog.h $(FILEDIALOGDIR)/FileDialog.cpp
|
# Parameters
|
||||||
$(CPP) $(CFLAGS) -c $(FILEDIALOGDIR)/FileDialog.cpp -o $@ $(INCLUDEFLAGS)
|
INCLUDESPECIAL = -include./include/various.h
|
||||||
|
|
||||||
Splitter.o: $(WINCTRLDIR)/Window.h $(SPLITTERDIR)/Splitter.h $(SPLITTERDIR)/Splitter.cpp $(SYSMSGDIR)/SysMsg.h
|
CXX = g++
|
||||||
$(CPP) $(CFLAGS) -c $(SPLITTERDIR)/Splitter.cpp -o $@ $(INCLUDEFLAGS)
|
#CXXFLAGS = -O2 $(INCLUDESPECIAL)
|
||||||
|
CXXFLAGS = $(INCLUDESPECIAL)
|
||||||
SplitterContainer.o: $(WINCTRLDIR)/Window.h $(SPLITTERDIR)/SplitterContainer.h $(SPLITTERDIR)/SplitterContainer.cpp $(SPLITTERDIR)/Splitter.h $(SYSMSGDIR)/SysMsg.h
|
INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include
|
||||||
$(CPP) $(CFLAGS) -c $(SPLITTERDIR)/SplitterContainer.cpp -o $@ $(INCLUDEFLAGS)
|
LDFLAGS = -Wl,--subsystem,windows
|
||||||
|
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi
|
||||||
StaticDialog.o: $(WINCTRLDIR)/Window.h $(STATICDLGDIR)/StaticDialog.h $(STATICDLGDIR)/StaticDialog.cpp
|
|
||||||
$(CPP) $(CFLAGS) -c $(STATICDLGDIR)/StaticDialog.cpp -o $@ $(INCLUDEFLAGS)
|
RC = windres
|
||||||
|
|
||||||
URLCtrl.o: $(WINCTRLDIR)/Window.h $(ABOUTDLGDIR)/URLCtrl.h $(ABOUTDLGDIR)/URLCtrl.cpp
|
OUT_NPP = NotepadPP.exe
|
||||||
$(CPP) $(CFLAGS) -c $(ABOUTDLGDIR)/URLCtrl.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
EXEC = ../bin/$(OUT_NPP)
|
||||||
AboutDlg.o: $(WINCTRLDIR)/Window.h $(ABOUTDLGDIR)/AboutDlg.h $(ABOUTDLGDIR)/AboutDlg.cpp URLCtrl.o
|
|
||||||
$(CPP) $(CFLAGS) -c $(ABOUTDLGDIR)/AboutDlg.cpp -o $@ $(INCLUDEFLAGS)
|
all: NotepadPP
|
||||||
|
|
||||||
RunDlg.o: $(WINCTRLDIR)/Window.h $(RUNDLGDIR)/RunDlg.h $(RUNDLGDIR)/RunDlg.cpp $(RUNDLGDIR)/RunDlg.rc
|
# Main Notepad++ rule
|
||||||
$(CPP) $(CFLAGS) -c $(RUNDLGDIR)/RunDlg.cpp -o $@ $(INCLUDEFLAGS)
|
NotepadPP: $(OBJS) $(OBJ_RES)
|
||||||
|
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) $(OBJS) $(OBJ_RES) -o $(EXEC) $(LIBS)
|
||||||
shortcut.o: $(WINCTRLDIR)/Window.h $(SHORTCUTDIR)/shortcut.h $(SHORTCUTDIR)/shortcut.rc
|
|
||||||
$(CPP) $(CFLAGS) -c $(SHORTCUTDIR)/shortcut.cpp -o $@ $(INCLUDEFLAGS)
|
%.o: %.cpp
|
||||||
|
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
|
||||||
trayIconControler.o: $(SYSTRAYDIR)/trayIconControler.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(SYSTRAYDIR)/trayIconControler.cpp -o $@ $(INCLUDEFLAGS)
|
%.res: %.rc
|
||||||
|
$(RC) $(INCLUDES) --input=$< --output=$@ --input-format=rc --output-format=coff
|
||||||
RunDlg_res.o : $(RUNDLGDIR)/RunDlg_rc.h $(RUNDLGDIR)/RunDlg.rc
|
|
||||||
$(RC) --include-dir=$(SRCDIR) -o $@ $(RunDlg)/RunDlg.rc
|
# Cleanup
|
||||||
|
|
||||||
SysMsg.o: $(SYSMSGDIR)/SysMsg.h $(SYSMSGDIR)/SysMsg.cpp
|
|
||||||
$(CPP) $(CFLAGS) -c $(SYSMSGDIR)/SysMsg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
Process.o: $(PROCESSDIR)/Process.h $(PROCESSDIR)/Process.cpp
|
|
||||||
$(CPP) $(CFLAGS) -c $(PROCESSDIR)/Process.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
tinystr.o: $(TINYXMLDIR)/tinystr.h $(TINYXMLDIR)/tinyxml.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(TINYXMLDIR)/tinystr.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
tinyxml.o: $(TINYXMLDIR)/tinyxml.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(TINYXMLDIR)/tinyxml.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
tinyxmlerror.o: $(TINYXMLDIR)/tinyxml.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(TINYXMLDIR)/tinyxmlerror.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
tinyxmlparser.o: $(TINYXMLDIR)/tinyxml.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(TINYXMLDIR)/tinyxmlparser.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
#WebCtrl.o:
|
|
||||||
#WebControl.o:
|
|
||||||
WordStyleDlg_rc.o : $(WORDSTYLESDLGDIR)/wordstyledlgres.h
|
|
||||||
$(RC) --include-dir=$(SRCDIR) -o $@ $(WORDSTYLESDLGDIR)/WordStyleDlg.rc
|
|
||||||
|
|
||||||
WordStyleDlg.o : $(WORDSTYLESDLGDIR)/WordStyleDlg.h $(SYSMSGDIR)/SysMsg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WORDSTYLESDLGDIR)/WordStyleDlg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
ColourPicker.o : $(WORDSTYLESDLGDIR)/ColourPicker.h $(SYSMSGDIR)/SysMsg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WORDSTYLESDLGDIR)/ColourPicker.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
ColourPopup_rc.o : $(WORDSTYLESDLGDIR)/ColourPopupResource.h
|
|
||||||
$(RC) --include-dir=$(SRCDIR) -o $@ $(WORDSTYLESDLGDIR)/ColourPopup.rc
|
|
||||||
|
|
||||||
ColourPopup.o : $(WORDSTYLESDLGDIR)/ColourPopup.h $(SYSMSGDIR)/SysMsg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WORDSTYLESDLGDIR)/ColourPopup.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
regExtDlg_res.o : $(REGEXTDIR)/regExtDlgRc.h $(REGEXTDIR)/regExtDlg.rc
|
|
||||||
$(RC) --include-dir=$(SRCDIR) -o $@ $(SRCDIR)/Notepad_plus.rc
|
|
||||||
|
|
||||||
regExtDlg.o : $(REGEXTDIR)/regExtDlg.h $(REGEXTDIR)/regExtDlg.cpp
|
|
||||||
$(CPP) $(CFLAGS) -c $(REGEXTDIR)/regExtDlg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
PluginsManager.o : $(PLUGINSMANAGERDIR)/PluginsManager.h $(PLUGINSMANAGERDIR)/PluginInterface.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(PLUGINSMANAGERDIR)/PluginsManager.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
BabyGrid.o : $(SHORTCUTMAPPERDIR)/BabyGrid.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(SHORTCUTMAPPERDIR)/BabyGrid.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
BabyGridWrapper.o : $(SHORTCUTMAPPERDIR)/BabyGridWrapper.h $(SHORTCUTMAPPERDIR)/BabyGrid.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(SHORTCUTMAPPERDIR)/BabyGridWrapper.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
ShortcutMapper_rc.o : $(SHORTCUTMAPPERDIR)/ShortcutMapper.rc $(SHORTCUTMAPPERDIR)/ShortcutMapper_rc.h
|
|
||||||
$(RC) -o $@ $(SHORTCUTMAPPERDIR)/ShortcutMapper.rc
|
|
||||||
|
|
||||||
ShortcutMapper.o : $(SHORTCUTMAPPERDIR)/ShortcutMapper.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(SHORTCUTMAPPERDIR)/ShortcutMapper.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
preference_rc.o : $(PREFERENCEDLGDIR)/preference_rc.h $(PREFERENCEDLGDIR)/preference.rc
|
|
||||||
$(RC) -o $@ $(PREFERENCEDLGDIR)/preference.rc
|
|
||||||
|
|
||||||
preferenceDlg.o : $(PREFERENCEDLGDIR)/preferenceDlg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(PREFERENCEDLGDIR)/preferenceDlg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
WindowsDlg_rc.o : $(WINDOWSDLGDIR)/WindowsDlgRc.h $(WINDOWSDLGDIR)/WindowsDlg.rc
|
|
||||||
$(RC) -o $@ $(WINDOWSDLGDIR)/WindowsDlg.rc
|
|
||||||
|
|
||||||
SizeableDlg.o : $(WINDOWSDLGDIR)/SizeableDlg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WINDOWSDLGDIR)/SizeableDlg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
WinMgr.o : $(WINDOWSDLGDIR)/WinMgr.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WINDOWSDLGDIR)/WinMgr.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
WinRect.o : $(WINDOWSDLGDIR)/WinMgr.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WINDOWSDLGDIR)/WinRect.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
WindowsDlg.o : $(WINDOWSDLGDIR)/WindowsDlg.h
|
|
||||||
$(CPP) $(CFLAGS) -c $(WINDOWSDLGDIR)/WindowsDlg.cpp -o $@ $(INCLUDEFLAGS)
|
|
||||||
|
|
||||||
$(FONT_TARGET): $(FONT_SRC)
|
|
||||||
cp $^ $@
|
|
||||||
|
|
||||||
$(XMLUSERFILE_TARGET) : $(XMLUSERFILE_SRC)
|
|
||||||
cp $^ $@
|
|
||||||
|
|
||||||
$(XMLLANGFILE_TARGET) : $(XMLLANGFILE_SRC)
|
|
||||||
cp $^ $@
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJS) $(PROG) $(XMLLANGFILE_TARGET) $(FONT_TARGET)
|
@delete.bat
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Makefile.win was added after the v5.0 release.
|
makefile was renewed after the v5.0 release.
|
||||||
It was testing with a MingW distribution containing
|
It was testing with a MingW distribution containing
|
||||||
gcc (GCC) 3.4.5 (mingw-vista special r3)
|
gcc (GCC) 3.4.5 (mingw-vista special r3)
|
||||||
The default make rule should suffice for building Notepad++,
|
The default make rule should suffice for building Notepad++,
|
||||||
|
|
|
@ -17,16 +17,16 @@
|
||||||
|
|
||||||
; Define the application name
|
; Define the application name
|
||||||
!define APPNAME "Notepad++"
|
!define APPNAME "Notepad++"
|
||||||
!define APPNAMEANDVERSION "Notepad++ v5.0"
|
!define APPNAMEANDVERSION "Notepad++ v5.0.1"
|
||||||
|
|
||||||
!define VERSION_MAJOR 5
|
!define VERSION_MAJOR 5
|
||||||
!define VERSION_MINOR 0
|
!define VERSION_MINOR 01
|
||||||
|
|
||||||
; Main Install settings
|
; Main Install settings
|
||||||
Name "${APPNAMEANDVERSION}"
|
Name "${APPNAMEANDVERSION}"
|
||||||
InstallDir "$PROGRAMFILES\Notepad++"
|
InstallDir "$PROGRAMFILES\Notepad++"
|
||||||
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
||||||
OutFile "..\bin\npp.5.0.Installer.exe"
|
OutFile "..\bin\npp.5.0.1.Installer.exe"
|
||||||
|
|
||||||
; GetWindowsVersion
|
; GetWindowsVersion
|
||||||
;
|
;
|
||||||
|
|
|
@ -81,20 +81,10 @@ void Buffer::determinateFormat(char *data) {
|
||||||
long Buffer::_recentTagCtr = 0;
|
long Buffer::_recentTagCtr = 0;
|
||||||
|
|
||||||
void Buffer::updateTimeStamp() {
|
void Buffer::updateTimeStamp() {
|
||||||
if (isUntitled()) {
|
struct _stat buf;
|
||||||
//Cannot check the time for non-existant files
|
time_t timeStamp = (_stat(_fullPathName, &buf)==0)?buf.st_mtime:0;
|
||||||
return;
|
|
||||||
}
|
|
||||||
FILETIME timeStamp;
|
|
||||||
WIN32_FILE_ATTRIBUTE_DATA fad;
|
|
||||||
BOOL res = ::GetFileAttributesEx(_fullPathName, GetFileExInfoStandard, &fad);
|
|
||||||
timeStamp = fad.ftLastWriteTime;
|
|
||||||
if (!res) {
|
|
||||||
//Failure!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (timeStamp.dwLowDateTime != _timeStamp.dwLowDateTime || timeStamp.dwHighDateTime != _timeStamp.dwHighDateTime) {
|
if (timeStamp != _timeStamp) {
|
||||||
_timeStamp = timeStamp;
|
_timeStamp = timeStamp;
|
||||||
doNotify(BufferChangeTimestamp);
|
doNotify(BufferChangeTimestamp);
|
||||||
}
|
}
|
||||||
|
@ -153,8 +143,7 @@ void Buffer::setFileName(const char *fn, LangType defaultLang)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Buffer::checkFileState() { //returns true if the status has been changed (it can change into DOC_REGULAR too). false otherwise
|
bool Buffer::checkFileState() { //returns true if the status has been changed (it can change into DOC_REGULAR too). false otherwise
|
||||||
FILETIME timeStamp;
|
struct _stat buf;
|
||||||
WIN32_FILE_ATTRIBUTE_DATA fad;
|
|
||||||
|
|
||||||
if (_currentStatus == DOC_UNNAMED) //unsaved document cannot change by environment
|
if (_currentStatus == DOC_UNNAMED) //unsaved document cannot change by environment
|
||||||
return false;
|
return false;
|
||||||
|
@ -163,40 +152,36 @@ bool Buffer::checkFileState() { //returns true if the status has been changed (i
|
||||||
{
|
{
|
||||||
_currentStatus = DOC_DELETED;
|
_currentStatus = DOC_DELETED;
|
||||||
_isFileReadOnly = false;
|
_isFileReadOnly = false;
|
||||||
_isDirty = true; //dirty since no match with filesystem
|
_isDirty = true; //dirty sicne no match with filesystem
|
||||||
_timeStamp.dwLowDateTime = 0;
|
_timeStamp = 0;
|
||||||
_timeStamp.dwHighDateTime = 0;
|
|
||||||
doNotify(BufferChangeStatus | BufferChangeReadonly | BufferChangeTimestamp);
|
doNotify(BufferChangeStatus | BufferChangeReadonly | BufferChangeTimestamp);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL res = ::GetFileAttributesEx(_fullPathName, GetFileExInfoStandard, &fad);
|
|
||||||
timeStamp = fad.ftLastWriteTime;
|
|
||||||
bool readOnly = (fad.dwFileAttributes & FILE_ATTRIBUTE_READONLY) != 0;
|
|
||||||
|
|
||||||
if (!res) {
|
|
||||||
//Failed getting attributes, the file may have been deleted
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_currentStatus == DOC_DELETED && PathFileExists(_fullPathName))
|
if (_currentStatus == DOC_DELETED && PathFileExists(_fullPathName))
|
||||||
{ //document has returned from its grave
|
{ //document has returned from its grave
|
||||||
_isFileReadOnly = readOnly;
|
if (!_stat(_fullPathName, &buf))
|
||||||
_currentStatus = DOC_MODIFIED;
|
{
|
||||||
_timeStamp = timeStamp;
|
_isFileReadOnly = (bool)(!(buf.st_mode & _S_IWRITE));
|
||||||
doNotify(BufferChangeStatus | BufferChangeReadonly | BufferChangeTimestamp);
|
|
||||||
return true;
|
_currentStatus = DOC_MODIFIED;
|
||||||
|
_timeStamp = buf.st_mtime;
|
||||||
|
doNotify(BufferChangeStatus | BufferChangeReadonly | BufferChangeTimestamp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res)
|
if (!_stat(_fullPathName, &buf))
|
||||||
{
|
{
|
||||||
int mask = 0;
|
int mask = 0; //status always 'changes', even if from modified to modified
|
||||||
if (readOnly != _isFileReadOnly) {
|
bool isFileReadOnly = (bool)(!(buf.st_mode & _S_IWRITE));
|
||||||
_isFileReadOnly = readOnly;
|
if (isFileReadOnly != _isFileReadOnly) {
|
||||||
|
_isFileReadOnly = isFileReadOnly;
|
||||||
mask |= BufferChangeReadonly;
|
mask |= BufferChangeReadonly;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeStamp.dwLowDateTime != _timeStamp.dwLowDateTime || timeStamp.dwHighDateTime != _timeStamp.dwHighDateTime) {
|
if (_timeStamp != buf.st_mtime) {
|
||||||
_timeStamp = timeStamp;
|
_timeStamp = buf.st_mtime;
|
||||||
mask |= BufferChangeTimestamp;
|
mask |= BufferChangeTimestamp;
|
||||||
_currentStatus = DOC_MODIFIED;
|
_currentStatus = DOC_MODIFIED;
|
||||||
mask |= BufferChangeStatus; //status always 'changes', even if from modified to modified
|
mask |= BufferChangeStatus; //status always 'changes', even if from modified to modified
|
||||||
|
|
|
@ -133,7 +133,7 @@ public :
|
||||||
//Destructor makes sure its purged
|
//Destructor makes sure its purged
|
||||||
Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus type, const char *fileName) //type must be either DOC_REGULAR or DOC_UNNAMED
|
Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus type, const char *fileName) //type must be either DOC_REGULAR or DOC_UNNAMED
|
||||||
: _pManager(pManager), _id(id), _isDirty(false), _doc(doc), _isFileReadOnly(false), _isUserReadOnly(false), _recentTag(-1), _references(0),
|
: _pManager(pManager), _id(id), _isDirty(false), _doc(doc), _isFileReadOnly(false), _isUserReadOnly(false), _recentTag(-1), _references(0),
|
||||||
_canNotify(false), _needReloading(false)
|
_canNotify(false), _timeStamp(0), _needReloading(false)
|
||||||
{
|
{
|
||||||
NppParameters *pNppParamInst = NppParameters::getInstance();
|
NppParameters *pNppParamInst = NppParameters::getInstance();
|
||||||
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings();
|
const NewDocDefaultSettings & ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings();
|
||||||
|
@ -143,8 +143,6 @@ public :
|
||||||
_userLangExt[0] = 0;
|
_userLangExt[0] = 0;
|
||||||
_fullPathName[0] = 0;
|
_fullPathName[0] = 0;
|
||||||
_fileName = NULL;
|
_fileName = NULL;
|
||||||
_timeStamp.dwLowDateTime = 0;
|
|
||||||
_timeStamp.dwHighDateTime = 0;
|
|
||||||
setFileName(fileName, ndds._lang);
|
setFileName(fileName, ndds._lang);
|
||||||
updateTimeStamp();
|
updateTimeStamp();
|
||||||
checkFileState();
|
checkFileState();
|
||||||
|
@ -152,11 +150,6 @@ public :
|
||||||
_isDirty = false;
|
_isDirty = false;
|
||||||
|
|
||||||
_needLexer = false; //new buffers do not need lexing, Scintilla takes care of that
|
_needLexer = false; //new buffers do not need lexing, Scintilla takes care of that
|
||||||
|
|
||||||
/*
|
|
||||||
if (type == DOC_UNNAMED)
|
|
||||||
_needLexer = false; //empty document, no styling
|
|
||||||
*/
|
|
||||||
_canNotify = true;
|
_canNotify = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -260,10 +253,6 @@ public :
|
||||||
return _currentStatus;
|
return _currentStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
FILETIME getTimeStamp() const {
|
|
||||||
return _timeStamp;
|
|
||||||
};
|
|
||||||
|
|
||||||
Document getDocument() {
|
Document getDocument() {
|
||||||
return _doc;
|
return _doc;
|
||||||
};
|
};
|
||||||
|
@ -358,8 +347,7 @@ private :
|
||||||
|
|
||||||
//Environment properties
|
//Environment properties
|
||||||
DocFileStatus _currentStatus;
|
DocFileStatus _currentStatus;
|
||||||
//time_t _timeStamp; // 0 if it's a new doc
|
time_t _timeStamp; // 0 if it's a new doc
|
||||||
FILETIME _timeStamp; // 0 if it's a new doc
|
|
||||||
bool _isFileReadOnly;
|
bool _isFileReadOnly;
|
||||||
char _fullPathName[MAX_PATH];
|
char _fullPathName[MAX_PATH];
|
||||||
char * _fileName; //points to filename part in _fullPathName
|
char * _fileName; //points to filename part in _fullPathName
|
||||||
|
|
|
@ -1,183 +0,0 @@
|
||||||
/*
|
|
||||||
this file is part of notepad++
|
|
||||||
Copyright (C)2003 Don HO < donho@altern.org >
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void FontPreviewCombo::DrawItem(LPDRAWITEMSTRUCT lpDIS)
|
|
||||||
{
|
|
||||||
ASSERT(lpDIS->CtlType == ODT_COMBOBOX);
|
|
||||||
|
|
||||||
CRect rc = lpDIS->rcItem;
|
|
||||||
|
|
||||||
CDC dc;
|
|
||||||
dc.Attach(lpDIS->hDC);
|
|
||||||
|
|
||||||
if (lpDIS->itemState & ODS_FOCUS)
|
|
||||||
dc.DrawFocusRect(&rc);
|
|
||||||
|
|
||||||
if (lpDIS->itemID == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int nIndexDC = dc.SaveDC();
|
|
||||||
|
|
||||||
CBrush br;
|
|
||||||
|
|
||||||
COLORREF clrSample = m_clrSample;
|
|
||||||
|
|
||||||
if (lpDIS->itemState & ODS_SELECTED)
|
|
||||||
{
|
|
||||||
br.CreateSolidBrush(::GetSysColor(COLOR_HIGHLIGHT));
|
|
||||||
dc.SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
|
|
||||||
clrSample = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
br.CreateSolidBrush(dc.GetBkColor());
|
|
||||||
}
|
|
||||||
|
|
||||||
dc.SetBkMode(TRANSPARENT);
|
|
||||||
dc.FillRect(&rc, &br);
|
|
||||||
|
|
||||||
// which one are we working on?
|
|
||||||
CString csCurFontName;
|
|
||||||
GetLBText(lpDIS->itemID, csCurFontName);
|
|
||||||
|
|
||||||
// draw the cute glyph
|
|
||||||
DWORD dwData = GetItemData(lpDIS->itemID);
|
|
||||||
|
|
||||||
if (dwData & OPENTYPE_FONTTYPE)
|
|
||||||
{
|
|
||||||
m_OpenType.Draw(&dc, 0, CPoint(rc.left+5, rc.top+1),ILD_TRANSPARENT);
|
|
||||||
}
|
|
||||||
else if (dwData & TRUETYPE_FONTTYPE)
|
|
||||||
{
|
|
||||||
m_TrueType.Draw(&dc, 0, CPoint(rc.left+5, rc.top+1),ILD_TRANSPARENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
rc.left += GLYPH_WIDTH;
|
|
||||||
|
|
||||||
int iOffsetX = SPACING;
|
|
||||||
|
|
||||||
// i feel bad creating this font on each draw. but i can't think of a
|
|
||||||
// better way (other than creating ALL fonts at once and saving them - yuck)
|
|
||||||
CFont cf;
|
|
||||||
if (m_style != NAME_GUI_FONT)
|
|
||||||
{
|
|
||||||
if (!cf.CreateFont(m_iFontHeight,0,0,0,FW_NORMAL,FALSE, FALSE,
|
|
||||||
FALSE,DEFAULT_CHARSET ,OUT_DEFAULT_PRECIS,
|
|
||||||
CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY,
|
|
||||||
DEFAULT_PITCH, csCurFontName))
|
|
||||||
{
|
|
||||||
ASSERT(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw the text
|
|
||||||
CSize sz;
|
|
||||||
int iPosY = 0;
|
|
||||||
HFONT hf = NULL;
|
|
||||||
switch (m_style)
|
|
||||||
{
|
|
||||||
case NAME_GUI_FONT:
|
|
||||||
{
|
|
||||||
// font name in GUI font
|
|
||||||
sz = dc.GetTextExtent(csCurFontName);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
dc.TextOut(rc.left + iOffsetX, rc.top + iPosY, csCurFontName);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NAME_ONLY:
|
|
||||||
{
|
|
||||||
// font name in current font
|
|
||||||
hf = (HFONT)dc.SelectObject(cf);
|
|
||||||
sz = dc.GetTextExtent(csCurFontName);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
dc.TextOut(rc.left+iOffsetX, rc.top + iPosY,csCurFontName);
|
|
||||||
dc.SelectObject(hf);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NAME_THEN_SAMPLE:
|
|
||||||
{
|
|
||||||
// font name in GUI font
|
|
||||||
sz = dc.GetTextExtent(csCurFontName);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
dc.TextOut(rc.left + iOffsetX, rc.top + iPosY, csCurFontName);
|
|
||||||
|
|
||||||
// condense, for edit
|
|
||||||
int iSep = m_iMaxNameWidth;
|
|
||||||
if ((lpDIS->itemState & ODS_COMBOBOXEDIT) == ODS_COMBOBOXEDIT)
|
|
||||||
{
|
|
||||||
iSep = sz.cx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// sample in current font
|
|
||||||
hf = (HFONT)dc.SelectObject(cf);
|
|
||||||
sz = dc.GetTextExtent(m_csSample);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
COLORREF clr = dc.SetTextColor(clrSample);
|
|
||||||
dc.TextOut(rc.left + iOffsetX + iSep + iOffsetX, rc.top + iPosY,
|
|
||||||
m_csSample);
|
|
||||||
dc.SetTextColor(clr);
|
|
||||||
dc.SelectObject(hf);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SAMPLE_THEN_NAME:
|
|
||||||
{
|
|
||||||
// sample in current font
|
|
||||||
hf = (HFONT)dc.SelectObject(cf);
|
|
||||||
sz = dc.GetTextExtent(m_csSample);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
COLORREF clr = dc.SetTextColor(clrSample);
|
|
||||||
dc.TextOut(rc.left+iOffsetX, rc.top + iPosY, m_csSample);
|
|
||||||
dc.SetTextColor(clr);
|
|
||||||
dc.SelectObject(hf);
|
|
||||||
|
|
||||||
// condense, for edit
|
|
||||||
int iSep = m_iMaxSampleWidth;
|
|
||||||
if ((lpDIS->itemState & ODS_COMBOBOXEDIT) == ODS_COMBOBOXEDIT)
|
|
||||||
{
|
|
||||||
iSep = sz.cx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// font name in GUI font
|
|
||||||
sz = dc.GetTextExtent(csCurFontName);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
dc.TextOut(rc.left + iOffsetX + iSep + iOffsetX, rc.top + iPosY,
|
|
||||||
csCurFontName);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SAMPLE_ONLY:
|
|
||||||
{
|
|
||||||
// sample in current font
|
|
||||||
hf = (HFONT)dc.SelectObject(cf);
|
|
||||||
sz = dc.GetTextExtent(m_csSample);
|
|
||||||
iPosY = (rc.Height() - sz.cy) / 2;
|
|
||||||
dc.TextOut(rc.left+iOffsetX, rc.top + iPosY, m_csSample);
|
|
||||||
dc.SelectObject(hf);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
dc.RestoreDC(nIndexDC);
|
|
||||||
|
|
||||||
dc.Detach();
|
|
||||||
}
|
|
|
@ -1,608 +0,0 @@
|
||||||
/*
|
|
||||||
this file is part of notepad++
|
|
||||||
Copyright (C)2003 Don HO < donho@altern.org >
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "WordStyleDlg.h"
|
|
||||||
#include "ScintillaEditView.h"
|
|
||||||
#include "SysMsg.h"
|
|
||||||
|
|
||||||
BOOL CALLBACK ColourStaticTextHooker::colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
switch(Message)
|
|
||||||
{
|
|
||||||
case WM_PAINT:
|
|
||||||
{
|
|
||||||
|
|
||||||
RECT rect;
|
|
||||||
::GetClientRect(hwnd, &rect);
|
|
||||||
|
|
||||||
PAINTSTRUCT ps;
|
|
||||||
HDC hdc = ::BeginPaint(hwnd, &ps);
|
|
||||||
|
|
||||||
::SetTextColor(hdc, _colour);
|
|
||||||
::SetBkColor(hdc, ::GetSysColor(COLOR_3DFACE));
|
|
||||||
// Create a font
|
|
||||||
if(_hFont == 0)
|
|
||||||
{
|
|
||||||
// Get the default GUI font
|
|
||||||
LOGFONT lf;
|
|
||||||
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
|
|
||||||
|
|
||||||
// Add UNDERLINE attribute
|
|
||||||
//lf.lfUnderline = TRUE;
|
|
||||||
|
|
||||||
::GetObject(hf, sizeof lf, &lf);
|
|
||||||
|
|
||||||
// Create a new font
|
|
||||||
_hFont = ::CreateFontIndirect(&lf);
|
|
||||||
}
|
|
||||||
|
|
||||||
HANDLE hOld = SelectObject(hdc, _hFont);
|
|
||||||
|
|
||||||
// Draw the text!
|
|
||||||
char text[MAX_PATH];
|
|
||||||
::GetWindowText(hwnd, text, sizeof(text));
|
|
||||||
::DrawText(hdc, text, -1, &rect, DT_LEFT);
|
|
||||||
|
|
||||||
::SelectObject(hdc, hOld);
|
|
||||||
|
|
||||||
::EndPaint(hwnd, &ps);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ::CallWindowProc(_oldProc, hwnd, Message, wParam, lParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
switch (Message)
|
|
||||||
{
|
|
||||||
case WM_INITDIALOG :
|
|
||||||
{
|
|
||||||
_lsArray = (NppParameters::getInstance())->getLStylerArray();
|
|
||||||
_globalStyles = (NppParameters::getInstance())->getGlobalStylers();
|
|
||||||
|
|
||||||
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)"Global Styles");
|
|
||||||
// All the lexers
|
|
||||||
for (int i = 0 ; i < _lsArray.getNbLexer() ; i++)
|
|
||||||
{
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)_lsArray.getLexerDescFromIndex(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
_hStyleList = ::GetDlgItem(_hSelf, IDC_STYLES_LIST);
|
|
||||||
_hCheckBold = ::GetDlgItem(_hSelf, IDC_BOLD_CHECK);
|
|
||||||
_hCheckItalic = ::GetDlgItem(_hSelf, IDC_ITALIC_CHECK);
|
|
||||||
_hCheckUnderline = ::GetDlgItem(_hSelf, IDC_UNDERLINE_CHECK);
|
|
||||||
_hFontNameCombo = ::GetDlgItem(_hSelf, IDC_FONT_COMBO);
|
|
||||||
_hFontSizeCombo = ::GetDlgItem(_hSelf, IDC_FONTSIZE_COMBO);
|
|
||||||
|
|
||||||
_hFgColourStaticText = ::GetDlgItem(_hSelf, IDC_FG_STATIC);
|
|
||||||
_hBgColourStaticText = ::GetDlgItem(_hSelf, IDC_BG_STATIC);
|
|
||||||
_hFontNameStaticText = ::GetDlgItem(_hSelf, IDC_FONTNAME_STATIC);
|
|
||||||
_hFontSizeStaticText = ::GetDlgItem(_hSelf, IDC_FONTSIZE_STATIC);
|
|
||||||
_hStyleInfoStaticText = ::GetDlgItem(_hSelf, IDC_STYLEDEFAULT_WARNING_STATIC);
|
|
||||||
|
|
||||||
colourHooker.setColour(RGB(0xFF, 0x00, 0x00));
|
|
||||||
colourHooker.hookOn(_hStyleInfoStaticText);
|
|
||||||
|
|
||||||
for(int i = 0 ; i < sizeof(fontSizeStrs)/3 ; i++)
|
|
||||||
::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, (LPARAM)fontSizeStrs[i]);
|
|
||||||
|
|
||||||
const std::vector<std::string> & fontlist = (NppParameters::getInstance())->getFontList();
|
|
||||||
for (size_t i = 0 ; i < fontlist.size() ; i++)
|
|
||||||
{
|
|
||||||
int j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str());
|
|
||||||
::SendMessage(_hFontNameCombo, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
_pFgColour = new ColourPicker;
|
|
||||||
_pBgColour = new ColourPicker;
|
|
||||||
_pFgColour->init(_hInst, _hSelf);
|
|
||||||
_pBgColour->init(_hInst, _hSelf);
|
|
||||||
|
|
||||||
POINT p1, p2;
|
|
||||||
|
|
||||||
alignWith(_hFgColourStaticText, _pFgColour->getHSelf(), ALIGNPOS_RIGHT, p1);
|
|
||||||
alignWith(_hBgColourStaticText, _pBgColour->getHSelf(), ALIGNPOS_RIGHT, p2);
|
|
||||||
|
|
||||||
p1.x = p2.x = ((p1.x > p2.x)?p1.x:p2.x) + 10;
|
|
||||||
p1.y -= 4; p2.y -= 4;
|
|
||||||
|
|
||||||
::MoveWindow((HWND)_pFgColour->getHSelf(), p1.x, p1.y, 25, 25, TRUE);
|
|
||||||
::MoveWindow((HWND)_pBgColour->getHSelf(), p2.x, p2.y, 25, 25, TRUE);
|
|
||||||
_pFgColour->display();
|
|
||||||
_pBgColour->display();
|
|
||||||
|
|
||||||
const int index2Begin = 0;
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_SETCURSEL, 0, index2Begin);
|
|
||||||
setStyleListFromLexer(index2Begin);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDOK), _isDirty);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), !_isSync);
|
|
||||||
|
|
||||||
goToCenter();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_DESTROY:
|
|
||||||
{
|
|
||||||
_pFgColour->destroy();
|
|
||||||
_pBgColour->destroy();
|
|
||||||
delete _pFgColour;
|
|
||||||
delete _pBgColour;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
case WM_COMMAND :
|
|
||||||
{
|
|
||||||
if (HIWORD(wParam) == EN_CHANGE)
|
|
||||||
{
|
|
||||||
int editID = LOWORD(wParam);
|
|
||||||
if (editID == IDC_USER_KEYWORDS_EDIT)
|
|
||||||
{
|
|
||||||
updateUserKeywords();
|
|
||||||
notifyDataModified();
|
|
||||||
}
|
|
||||||
else if (editID == IDC_USER_EXT_EDIT)
|
|
||||||
{
|
|
||||||
updateExtension();
|
|
||||||
notifyDataModified();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (wParam)
|
|
||||||
{
|
|
||||||
case IDC_BOLD_CHECK :
|
|
||||||
updateFontStyleStatus(BOLD_STATUS);
|
|
||||||
notifyDataModified();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IDC_ITALIC_CHECK :
|
|
||||||
updateFontStyleStatus(ITALIC_STATUS);
|
|
||||||
notifyDataModified();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IDC_UNDERLINE_CHECK :
|
|
||||||
updateFontStyleStatus(UNDERLINE_STATUS);
|
|
||||||
notifyDataModified();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IDCANCEL :
|
|
||||||
if (_isDirty)
|
|
||||||
{
|
|
||||||
_lsArray = (NppParameters::getInstance())->getLStylerArray();
|
|
||||||
_globalStyles = (NppParameters::getInstance())->getGlobalStylers();
|
|
||||||
_isDirty = false;
|
|
||||||
setVisualFromStyleList();
|
|
||||||
}
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), !_isSync);
|
|
||||||
display(false);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case IDOK : //_isDirty == true;
|
|
||||||
{
|
|
||||||
LexerStylerArray & lsa = (NppParameters::getInstance())->getLStylerArray();
|
|
||||||
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
|
|
||||||
|
|
||||||
lsa = _lsArray;
|
|
||||||
globalStyles = _globalStyles;
|
|
||||||
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE);
|
|
||||||
_isDirty = false;
|
|
||||||
_isSync = false;
|
|
||||||
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDC_SAVECLOSE_BUTTON :
|
|
||||||
{
|
|
||||||
if (_isDirty)
|
|
||||||
{
|
|
||||||
LexerStylerArray & lsa = (NppParameters::getInstance())->getLStylerArray();
|
|
||||||
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
|
|
||||||
|
|
||||||
lsa = _lsArray;
|
|
||||||
globalStyles = _globalStyles;
|
|
||||||
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE);
|
|
||||||
_isDirty = false;
|
|
||||||
}
|
|
||||||
(NppParameters::getInstance())->writeStyles(_lsArray, _globalStyles);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), FALSE);
|
|
||||||
_isSync = true;
|
|
||||||
display(false);
|
|
||||||
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDC_SC_TRANSPARENT_CHECK :
|
|
||||||
{
|
|
||||||
bool isChecked = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_SC_TRANSPARENT_CHECK, BM_GETCHECK, 0, 0));
|
|
||||||
if (isChecked)
|
|
||||||
{
|
|
||||||
int percent = ::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0);
|
|
||||||
(NppParameters::getInstance())->SetTransparent(_hSelf, percent);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
(NppParameters::getInstance())->removeTransparent(_hSelf);
|
|
||||||
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SC_PERCENTAGE_SLIDER), isChecked);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
switch (HIWORD(wParam))
|
|
||||||
{
|
|
||||||
case CBN_SELCHANGE : // == case LBN_SELCHANGE :
|
|
||||||
{
|
|
||||||
switch (LOWORD(wParam))
|
|
||||||
{
|
|
||||||
case IDC_FONT_COMBO :
|
|
||||||
updateFontName();
|
|
||||||
notifyDataModified();
|
|
||||||
break;
|
|
||||||
case IDC_FONTSIZE_COMBO :
|
|
||||||
updateFontSize();
|
|
||||||
notifyDataModified();
|
|
||||||
break;
|
|
||||||
case IDC_LANGUAGES_LIST :
|
|
||||||
{
|
|
||||||
int i = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0);
|
|
||||||
if (i != LB_ERR)
|
|
||||||
setStyleListFromLexer(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case IDC_STYLES_LIST :
|
|
||||||
setVisualFromStyleList();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case CPN_COLOURPICKED:
|
|
||||||
{
|
|
||||||
if ((HWND)lParam == _pFgColour->getHSelf())
|
|
||||||
{
|
|
||||||
updateColour(C_FOREGROUND);
|
|
||||||
notifyDataModified();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else if ((HWND)lParam == _pBgColour->getHSelf())
|
|
||||||
{
|
|
||||||
updateColour(C_BACKGROUND);
|
|
||||||
notifyDataModified();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
default :
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
default :
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateColour(bool which)
|
|
||||||
{
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
if (which == C_FOREGROUND)
|
|
||||||
{
|
|
||||||
style._fgColor = _pFgColour->getColour();
|
|
||||||
}
|
|
||||||
else //(which == C_BACKGROUND)
|
|
||||||
{
|
|
||||||
style._bgColor = _pBgColour->getColour();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateFontSize()
|
|
||||||
{
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
int iFontSizeSel = ::SendMessage(_hFontSizeCombo, CB_GETCURSEL, 0, 0);
|
|
||||||
|
|
||||||
char intStr[5];
|
|
||||||
if (iFontSizeSel != 0)
|
|
||||||
{
|
|
||||||
::SendMessage(_hFontSizeCombo, CB_GETLBTEXT, iFontSizeSel, (LPARAM)intStr);
|
|
||||||
if ((!intStr) || (!intStr[0]))
|
|
||||||
style._fontSize = -1;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *finStr;
|
|
||||||
style._fontSize = strtol(intStr, &finStr, 10);
|
|
||||||
if (*finStr != '\0')
|
|
||||||
style._fontSize = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
style._fontSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateExtension()
|
|
||||||
{
|
|
||||||
const int NB_MAX = 256;
|
|
||||||
char ext[NB_MAX];
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_GETTEXT, NB_MAX, (LPARAM)ext);
|
|
||||||
_lsArray.getLexerFromIndex(_currentLexerIndex - 1).setLexerUserExt(ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateUserKeywords()
|
|
||||||
{
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
//const int NB_MAX = 2048;
|
|
||||||
//char kw[NB_MAX];
|
|
||||||
int len = ::SendDlgItemMessage(_hSelf, IDC_USER_KEYWORDS_EDIT, WM_GETTEXTLENGTH, 0, 0);
|
|
||||||
|
|
||||||
char *kw = new char[len];
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_USER_KEYWORDS_EDIT, WM_GETTEXT, len, (LPARAM)kw);
|
|
||||||
style.setKeywords(kw);
|
|
||||||
|
|
||||||
delete [] kw;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateFontName()
|
|
||||||
{
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
int iFontSel = ::SendMessage(_hFontNameCombo, CB_GETCURSEL, 0, 0);
|
|
||||||
char *fnStr = (char *)::SendMessage(_hFontNameCombo, CB_GETITEMDATA, iFontSel, 0);
|
|
||||||
style._fontName = fnStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::updateFontStyleStatus(fontStyleType whitchStyle)
|
|
||||||
{
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
if (style._fontStyle == -1)
|
|
||||||
style._fontStyle = 0;
|
|
||||||
|
|
||||||
int fontStyle = FONTSTYLE_UNDERLINE;
|
|
||||||
HWND hWnd = _hCheckUnderline;
|
|
||||||
|
|
||||||
if (whitchStyle == BOLD_STATUS)
|
|
||||||
{
|
|
||||||
fontStyle = FONTSTYLE_BOLD;
|
|
||||||
hWnd = _hCheckBold;
|
|
||||||
}
|
|
||||||
if (whitchStyle == ITALIC_STATUS)
|
|
||||||
{
|
|
||||||
fontStyle = FONTSTYLE_ITALIC;
|
|
||||||
hWnd = _hCheckItalic;
|
|
||||||
}
|
|
||||||
|
|
||||||
int isChecked = ::SendMessage(hWnd, BM_GETCHECK, 0, 0);
|
|
||||||
if (isChecked != BST_INDETERMINATE)
|
|
||||||
{
|
|
||||||
if (isChecked == BST_CHECKED)
|
|
||||||
style._fontStyle |= fontStyle;
|
|
||||||
else
|
|
||||||
style._fontStyle &= ~fontStyle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::setStyleListFromLexer(int index)
|
|
||||||
{
|
|
||||||
_currentLexerIndex = index;
|
|
||||||
|
|
||||||
// Fill out Styles listbox
|
|
||||||
// Before filling out, we clean it
|
|
||||||
::SendMessage(_hStyleList, LB_RESETCONTENT, 0, 0);
|
|
||||||
|
|
||||||
if (index)
|
|
||||||
{
|
|
||||||
const char *langName = _lsArray.getLexerNameFromIndex(index - 1);
|
|
||||||
const char *ext = NppParameters::getInstance()->getLangExtFromName(langName);
|
|
||||||
const char *userExt = (_lsArray.getLexerStylerByName(langName))->getLexerUserExt();
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_DEF_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(ext));
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_USER_EXT_EDIT, WM_SETTEXT, 0, (LPARAM)(userExt));
|
|
||||||
//::SetWindowText(::GetDlgItem(_hSelf, IDC_USER_EXT_EDIT), userExt);
|
|
||||||
}
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_EDIT), index?SW_SHOW:SW_HIDE);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_EXT_STATIC), index?SW_SHOW:SW_HIDE);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_EXT_EDIT), index?SW_SHOW:SW_HIDE);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_EXT_STATIC), index?SW_SHOW:SW_HIDE);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_PLUSSYMBOL2_STATIC), index?SW_SHOW:SW_HIDE);
|
|
||||||
|
|
||||||
StyleArray & lexerStyler = index?_lsArray.getLexerFromIndex(index-1):_globalStyles;
|
|
||||||
|
|
||||||
for (int i = 0 ; i < lexerStyler.getNbStyler() ; i++)
|
|
||||||
{
|
|
||||||
Style & style = lexerStyler.getStyler(i);
|
|
||||||
::SendMessage(_hStyleList, LB_ADDSTRING, 0, (LPARAM)style._styleDesc);
|
|
||||||
}
|
|
||||||
::SendMessage(_hStyleList, LB_SETCURSEL, 0, 0);
|
|
||||||
setVisualFromStyleList();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::setVisualFromStyleList()
|
|
||||||
{
|
|
||||||
|
|
||||||
Style & style = getCurrentStyler();
|
|
||||||
|
|
||||||
//--Warning text
|
|
||||||
bool showWarning = ((_currentLexerIndex == 0) && (style._styleID == STYLE_DEFAULT));//?SW_SHOW:SW_HIDE;
|
|
||||||
|
|
||||||
COLORREF c = RGB(0xFF, 0x00, 0x00);
|
|
||||||
char str[256];
|
|
||||||
strcpy(str, _originalWarning);
|
|
||||||
if (!showWarning)
|
|
||||||
{
|
|
||||||
if (!_originalWarning[0])
|
|
||||||
// Get the original text for the usage afterward
|
|
||||||
::GetWindowText(_hStyleInfoStaticText, _originalWarning, sizeof(_originalWarning));
|
|
||||||
|
|
||||||
str[0] = '\0';
|
|
||||||
c = RGB(0x00, 0x00, 0xFF);
|
|
||||||
int i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETCURSEL, 0, 0);
|
|
||||||
if (i == LB_ERR)
|
|
||||||
return;
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETTEXT, i, (LPARAM)str);
|
|
||||||
|
|
||||||
i = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETCURSEL, 0, 0);
|
|
||||||
if (i == LB_ERR)
|
|
||||||
return;
|
|
||||||
char styleName[64];
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETTEXT, i, (LPARAM)styleName);
|
|
||||||
|
|
||||||
strcat(strcat(str, " : "), styleName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!str[0])
|
|
||||||
{
|
|
||||||
::GetWindowText(_hStyleInfoStaticText, _originalWarning, sizeof(_originalWarning));
|
|
||||||
strcpy(str, _originalWarning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
colourHooker.setColour(c);
|
|
||||||
::SetWindowText(_hStyleInfoStaticText, str);
|
|
||||||
//::InvalidateRect(hColourTextStatic, NULL, TRUE);
|
|
||||||
//::UpdateWindow(hColourTextStatic);
|
|
||||||
|
|
||||||
//::ShowWindow(_hStyleInfoStaticText, showWarning);
|
|
||||||
|
|
||||||
//-- 2 couleurs : fg et bg
|
|
||||||
bool isEnable = false;
|
|
||||||
if (HIBYTE(HIWORD(style._fgColor)) != 0xFF)
|
|
||||||
{
|
|
||||||
_pFgColour->setColour(style._fgColor);
|
|
||||||
isEnable = true;
|
|
||||||
}
|
|
||||||
enableFg(isEnable);
|
|
||||||
|
|
||||||
isEnable = false;
|
|
||||||
if (HIBYTE(HIWORD(style._bgColor)) != 0xFF)
|
|
||||||
{
|
|
||||||
_pBgColour->setColour(style._bgColor);
|
|
||||||
isEnable = true;
|
|
||||||
}
|
|
||||||
enableBg(isEnable);
|
|
||||||
|
|
||||||
//-- font name
|
|
||||||
isEnable = false;
|
|
||||||
int iFontName;
|
|
||||||
if (style._fontName != NULL)
|
|
||||||
{
|
|
||||||
iFontName = ::SendMessage(_hFontNameCombo, CB_FINDSTRING, 1, (LPARAM)style._fontName);
|
|
||||||
if (iFontName == CB_ERR)
|
|
||||||
iFontName = 0;
|
|
||||||
isEnable = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iFontName = 0;
|
|
||||||
}
|
|
||||||
::SendMessage(_hFontNameCombo, CB_SETCURSEL, iFontName, 0);
|
|
||||||
enableFontName(isEnable);
|
|
||||||
|
|
||||||
//-- font size
|
|
||||||
isEnable = false;
|
|
||||||
char intStr[5] = "";
|
|
||||||
int iFontSize = 0;
|
|
||||||
if (style._fontSize != -1)
|
|
||||||
{
|
|
||||||
sprintf(intStr, "%d", style._fontSize);
|
|
||||||
iFontSize = ::SendMessage(_hFontSizeCombo, CB_FINDSTRING, 1, (LPARAM)intStr);
|
|
||||||
isEnable = true;
|
|
||||||
}
|
|
||||||
::SendMessage(_hFontSizeCombo, CB_SETCURSEL, iFontSize, 0);
|
|
||||||
enableFontSize(isEnable);
|
|
||||||
|
|
||||||
//-- font style : bold et italic
|
|
||||||
isEnable = false;
|
|
||||||
int isBold, isItalic, isUnderline;
|
|
||||||
if (style._fontStyle != -1)
|
|
||||||
{
|
|
||||||
isBold = (style._fontStyle & FONTSTYLE_BOLD)?BST_CHECKED:BST_UNCHECKED;
|
|
||||||
isItalic = (style._fontStyle & FONTSTYLE_ITALIC)?BST_CHECKED:BST_UNCHECKED;
|
|
||||||
isUnderline = (style._fontStyle & FONTSTYLE_UNDERLINE)?BST_CHECKED:BST_UNCHECKED;
|
|
||||||
::SendMessage(_hCheckBold, BM_SETCHECK, isBold, 0);
|
|
||||||
::SendMessage(_hCheckItalic, BM_SETCHECK, isItalic, 0);
|
|
||||||
::SendMessage(_hCheckUnderline, BM_SETCHECK, isUnderline, 0);
|
|
||||||
isEnable = true;
|
|
||||||
}
|
|
||||||
else // -1 est comme 0
|
|
||||||
{
|
|
||||||
::SendMessage(_hCheckBold, BM_SETCHECK, BST_UNCHECKED, 0);
|
|
||||||
::SendMessage(_hCheckItalic, BM_SETCHECK, BST_UNCHECKED, 0);
|
|
||||||
::SendMessage(_hCheckUnderline, BM_SETCHECK, BST_UNCHECKED, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
enableFontStyle(isEnable);
|
|
||||||
|
|
||||||
|
|
||||||
//-- Default Keywords
|
|
||||||
bool shouldBeDisplayed = style._keywordClass != -1;
|
|
||||||
if (shouldBeDisplayed)
|
|
||||||
{
|
|
||||||
LexerStyler & lexerStyler = _lsArray.getLexerFromIndex(_currentLexerIndex - 1);
|
|
||||||
|
|
||||||
NppParameters *pNppParams = NppParameters::getInstance();
|
|
||||||
LangType lType = pNppParams->getLangIDFromStr(lexerStyler.getLexerName());
|
|
||||||
if (lType == L_TXT)
|
|
||||||
{
|
|
||||||
string str = lexerStyler.getLexerName();
|
|
||||||
str += " is not defined in NppParameters::getLangIDFromStr()";
|
|
||||||
printStr(str.c_str());
|
|
||||||
}
|
|
||||||
const char *kws = pNppParams->getWordList(lType, style._keywordClass);
|
|
||||||
if (!kws)
|
|
||||||
kws = "";
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_DEF_KEYWORDS_EDIT, WM_SETTEXT, 0, (LPARAM)(kws));
|
|
||||||
|
|
||||||
const char *ckwStr = (style._keywords)?style._keywords->c_str():"";
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_USER_KEYWORDS_EDIT, WM_SETTEXT, 0, (LPARAM)(ckwStr));
|
|
||||||
}
|
|
||||||
int showOption = shouldBeDisplayed?SW_SHOW:SW_HIDE;
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_KEYWORDS_EDIT), showOption);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_KEYWORDS_EDIT),showOption);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_DEF_KEYWORDS_STATIC), showOption);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_USER_KEYWORDS_STATIC),showOption);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_PLUSSYMBOL_STATIC),showOption);
|
|
||||||
|
|
||||||
redraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void WordStyleDlg::create(tTbData * data, bool isRTL)
|
|
||||||
{
|
|
||||||
DockingDlgInterface::create(data, isRTL);
|
|
||||||
|
|
||||||
if ((NppParameters::getInstance())->isTransparentAvailable())
|
|
||||||
{
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_SC_TRANSPARENT_CHECK), SW_SHOW);
|
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_SC_PERCENTAGE_SLIDER), SW_SHOW);
|
|
||||||
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(20, 200));
|
|
||||||
::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, TBM_SETPOS, TRUE, 150);
|
|
||||||
if (!(BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_SC_PERCENTAGE_SLIDER, BM_GETCHECK, 0, 0)))
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SC_PERCENTAGE_SLIDER), FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,179 +0,0 @@
|
||||||
/*
|
|
||||||
this file is part of notepad++
|
|
||||||
Copyright (C)2003 Don HO < donho@altern.org >
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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 WORD_STYLE_H
|
|
||||||
#define WORD_STYLE_H
|
|
||||||
|
|
||||||
#include "Window.h"
|
|
||||||
#include "ColourPicker.h"
|
|
||||||
//#include "StaticDialog.h"
|
|
||||||
#include "DockingDlgInterface.h"
|
|
||||||
|
|
||||||
#include "WordStyleDlgRes.h"
|
|
||||||
#include "TabBar.h"
|
|
||||||
#include "Parameters.h"
|
|
||||||
#include "resource.h"
|
|
||||||
|
|
||||||
#define WM_UPDATESCINTILLAS (WORDSTYLE_USER + 1) //GlobalStyleDlg's msg 2 send 2 its parent
|
|
||||||
#define WM_DATA_MODIFIED (WORDSTYLE_USER + 2) //WordStyleDlg's msg 2 send 2 its parent(GlobalStyleDlg)
|
|
||||||
|
|
||||||
enum fontStyleType {BOLD_STATUS, ITALIC_STATUS, UNDERLINE_STATUS};
|
|
||||||
|
|
||||||
const bool C_FOREGROUND = false;
|
|
||||||
const bool C_BACKGROUND = true;
|
|
||||||
|
|
||||||
|
|
||||||
class ColourStaticTextHooker {
|
|
||||||
public :
|
|
||||||
ColourStaticTextHooker() : _colour(RGB(0x00, 0x00, 0x00)), _hFont(NULL) {};
|
|
||||||
|
|
||||||
COLORREF setColour(COLORREF colour2Set) {
|
|
||||||
COLORREF oldColour = _colour;
|
|
||||||
_colour = colour2Set;
|
|
||||||
return oldColour;
|
|
||||||
};
|
|
||||||
void hookOn(HWND staticHandle) {
|
|
||||||
::SetWindowLong(staticHandle, GWL_USERDATA, (LONG)this);
|
|
||||||
_oldProc = (WNDPROC)::SetWindowLong(staticHandle, GWL_WNDPROC, (LONG)staticProc);
|
|
||||||
};
|
|
||||||
private :
|
|
||||||
COLORREF _colour;
|
|
||||||
WNDPROC _oldProc;
|
|
||||||
HFONT _hFont;
|
|
||||||
|
|
||||||
static BOOL CALLBACK staticProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
|
|
||||||
ColourStaticTextHooker *pColourStaticTextHooker = reinterpret_cast<ColourStaticTextHooker *>(::GetWindowLong(hwnd, GWL_USERDATA));
|
|
||||||
return pColourStaticTextHooker->colourStaticProc(hwnd, message, wParam, lParam);
|
|
||||||
};
|
|
||||||
BOOL CALLBACK colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
|
|
||||||
};
|
|
||||||
|
|
||||||
//class WordStyleDlg : public StaticDialog
|
|
||||||
class WordStyleDlg : public DockingDlgInterface
|
|
||||||
{
|
|
||||||
public :
|
|
||||||
WordStyleDlg():DockingDlgInterface(IDD_STYLER_DLG), _isDirty(false), _isSync(true){_originalWarning[0] = '\0';};
|
|
||||||
|
|
||||||
void init(HINSTANCE hInst, HWND parent) {
|
|
||||||
Window::init(hInst, parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
void create(tTbData * data, bool isRTL = false);
|
|
||||||
/*
|
|
||||||
void doDialog(bool isRTL = false) {
|
|
||||||
if (!isCreated())
|
|
||||||
create(IDD_STYLER_DLG, isRTL);
|
|
||||||
display();
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
virtual void redraw() const {
|
|
||||||
_pFgColour->redraw();
|
|
||||||
_pBgColour->redraw();
|
|
||||||
//StaticDialog::redraw();
|
|
||||||
::InvalidateRect(_hStyleInfoStaticText, NULL, TRUE);
|
|
||||||
::UpdateWindow(_hStyleInfoStaticText);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private :
|
|
||||||
ColourPicker *_pFgColour;
|
|
||||||
ColourPicker *_pBgColour;
|
|
||||||
|
|
||||||
int _currentLexerIndex;
|
|
||||||
|
|
||||||
HWND _hStyleList;
|
|
||||||
HWND _hCheckBold;
|
|
||||||
HWND _hCheckItalic;
|
|
||||||
HWND _hCheckUnderline;
|
|
||||||
HWND _hFontNameCombo;
|
|
||||||
HWND _hFontSizeCombo;
|
|
||||||
|
|
||||||
HWND _hFgColourStaticText;
|
|
||||||
HWND _hBgColourStaticText;
|
|
||||||
HWND _hFontNameStaticText;
|
|
||||||
HWND _hFontSizeStaticText;
|
|
||||||
HWND _hStyleInfoStaticText;
|
|
||||||
char _originalWarning[256];
|
|
||||||
|
|
||||||
LexerStylerArray _lsArray;
|
|
||||||
StyleArray _globalStyles;
|
|
||||||
|
|
||||||
ColourStaticTextHooker colourHooker;
|
|
||||||
|
|
||||||
bool _isDirty;
|
|
||||||
bool _isSync;
|
|
||||||
|
|
||||||
BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
|
||||||
|
|
||||||
|
|
||||||
Style & getCurrentStyler() {
|
|
||||||
int styleIndex = int(::SendMessage(_hStyleList, LB_GETCURSEL, 0, 0));
|
|
||||||
if (_currentLexerIndex == 0)
|
|
||||||
return _globalStyles.getStyler(styleIndex);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LexerStyler & lexerStyler = _lsArray.getLexerFromIndex(_currentLexerIndex - 1);
|
|
||||||
return lexerStyler.getStyler(styleIndex);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void updateColour(bool which);
|
|
||||||
void updateFontStyleStatus(fontStyleType whitchStyle);
|
|
||||||
void updateExtension();
|
|
||||||
void updateFontName();
|
|
||||||
void updateFontSize();
|
|
||||||
void updateUserKeywords();
|
|
||||||
|
|
||||||
void enableFg(bool isEnable) {
|
|
||||||
::EnableWindow(_pFgColour->getHSelf(), isEnable);
|
|
||||||
::EnableWindow(_hFgColourStaticText, isEnable);
|
|
||||||
};
|
|
||||||
|
|
||||||
void enableBg(bool isEnable) {
|
|
||||||
::EnableWindow(_pBgColour->getHSelf(), isEnable);
|
|
||||||
::EnableWindow(_hBgColourStaticText, isEnable);
|
|
||||||
};
|
|
||||||
|
|
||||||
void enableFontName(bool isEnable) {
|
|
||||||
::EnableWindow(_hFontNameCombo, isEnable);
|
|
||||||
::EnableWindow(_hFontNameStaticText, isEnable);
|
|
||||||
};
|
|
||||||
|
|
||||||
void enableFontSize(bool isEnable) {
|
|
||||||
::EnableWindow(_hFontSizeCombo, isEnable);
|
|
||||||
::EnableWindow(_hFontSizeStaticText, isEnable);
|
|
||||||
};
|
|
||||||
|
|
||||||
void enableFontStyle(bool isEnable) {
|
|
||||||
::EnableWindow(_hCheckBold, isEnable);
|
|
||||||
::EnableWindow(_hCheckItalic, isEnable);
|
|
||||||
::EnableWindow(_hCheckUnderline, isEnable);
|
|
||||||
};
|
|
||||||
long notifyDataModified() {
|
|
||||||
_isDirty = true;
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDOK), TRUE);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), TRUE);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
void setStyleListFromLexer(int index);
|
|
||||||
void setVisualFromStyleList();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //WORD_STYLE_H
|
|
|
@ -82,11 +82,13 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
HWND getHSelf() const {
|
HWND getHSelf() const {
|
||||||
|
/*
|
||||||
if (!_hSelf)
|
if (!_hSelf)
|
||||||
{
|
{
|
||||||
::MessageBox(NULL, "_hSelf == NULL", "class Window", MB_OK);
|
::MessageBox(NULL, "_hSelf == NULL", "class Window", MB_OK);
|
||||||
throw int(999);
|
throw int(999);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return _hSelf;
|
return _hSelf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
#ifndef RESOURCE_H
|
#ifndef RESOURCE_H
|
||||||
#define RESOURCE_H
|
#define RESOURCE_H
|
||||||
|
|
||||||
#define NOTEPAD_PLUS_VERSION "Notepad++ v5.0"
|
#define NOTEPAD_PLUS_VERSION "Notepad++ v5.0.1"
|
||||||
#define VERSION_VALUE "5.0\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
#define VERSION_VALUE "5.01\0" // should be X.Y : ie. if VERSION_DIGITALVALUE == 4, 7, 1, 0 , then X = 4, Y = 71
|
||||||
#define VERSION_DIGITALVALUE 5, 0, 0, 0
|
#define VERSION_DIGITALVALUE 5, 0, 1, 0
|
||||||
|
|
||||||
#ifndef IDC_STATIC
|
#ifndef IDC_STATIC
|
||||||
#define IDC_STATIC -1
|
#define IDC_STATIC -1
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
OmitFramePointers="false"
|
OmitFramePointers="false"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception"
|
AdditionalIncludeDirectories="..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;"
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USE_32BIT_TIME_T"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="2"
|
ExceptionHandling="2"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
|
@ -607,11 +607,11 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\WinControls\Preference\resource.h"
|
RelativePath="..\src\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\resource.h"
|
RelativePath="..\src\WinControls\Preference\resource.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|
Loading…
Reference in New Issue