Added "Clear Log" command. "Clear Log" and "Edit Script" are now under a new "Tools" menu. Removed some unused resources.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1171 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
165564227d
commit
9ebe478bba
7 changed files with 32 additions and 30 deletions
|
@ -39,6 +39,7 @@ Ctrl+F: Find text
|
|||
Ctrl+L: Load a script
|
||||
Ctrl+R: Recompiles the script
|
||||
Ctrl+T: Tests the installer
|
||||
Ctrl+W: Clears Log Window
|
||||
Alt+X: Exits the application
|
||||
F1: View Documentation
|
||||
|
||||
|
@ -159,6 +160,7 @@ Version History
|
|||
- Added Context Menu in log window
|
||||
- Added resize gripper
|
||||
- Ctrl+L loads a script
|
||||
- Added Clear Log (Ctrl+W)
|
||||
- Bunch of other stuff not worth mentioning
|
||||
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ UINT uFindReplaceMsg=0;
|
|||
HWND hwndFind=0;
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) {
|
||||
MSG msg;
|
||||
int status;
|
||||
HACCEL haccel;
|
||||
g_hInstance=GetModuleHandle(0);
|
||||
g_script=GetCommandLine();
|
||||
|
@ -53,12 +55,10 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
|
|||
ResetObjects();
|
||||
HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
|
||||
if (!hDialog) {
|
||||
MessageBox(0, DLGERROR, "Error", MB_ICONEXCLAMATION|MB_OK);
|
||||
MessageBox(0,DLGERROR,"Error",MB_ICONEXCLAMATION|MB_OK);
|
||||
return 1;
|
||||
}
|
||||
haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
||||
MSG msg;
|
||||
int status;
|
||||
while ((status=GetMessage(&msg,0,0,0))!=0) {
|
||||
if (status==-1) return -1;
|
||||
if (!IsDialogMessage(hwndFind, &msg)) {
|
||||
|
@ -86,6 +86,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
SetClassLong(hwndDlg,GCL_HICON,(long)hIcon);
|
||||
DragAcceptFiles(g_hwnd,FALSE);
|
||||
InitTooltips(g_hwnd);
|
||||
SetBranding(g_hwnd);
|
||||
HFONT hFont = CreateFont(14,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH|FF_DONTCARE,"Courier New");
|
||||
SendDlgItemMessage(hwndDlg,IDC_LOGWIN,WM_SETFONT,(WPARAM)hFont,0);
|
||||
SendDlgItemMessage(hwndDlg,IDC_LOGWIN,EM_SETBKGNDCOLOR,0,GetSysColor(COLOR_BTNFACE));
|
||||
|
@ -124,8 +125,8 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
{
|
||||
if ((HWND)wParam==GetDlgItem(g_hwnd,IDC_LOGWIN)) {
|
||||
if (!hmnu) {
|
||||
hmnu = LoadMenu(g_hInstance,MAKEINTRESOURCE(IDM_LOGWIN));
|
||||
if (hmnu) hmnu = GetSubMenu(hmnu,0);
|
||||
hmnu = LoadMenu(g_hInstance,MAKEINTRESOURCE(IDM_MENU));
|
||||
if (hmnu) hmnu = GetSubMenu(hmnu,1);
|
||||
}
|
||||
if (hmnu) {
|
||||
TrackPopupMenu(hmnu,NULL,(int)(short)LOWORD(lParam),(int)(short)HIWORD(lParam),0,g_hwnd,0);
|
||||
|
@ -251,6 +252,14 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_CLEARLOG:
|
||||
{
|
||||
if (!g_hThread) {
|
||||
ClearLog(g_hwnd);
|
||||
LogMessage(g_hwnd,USAGE);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_RECOMPILE:
|
||||
{
|
||||
CompileNSISScript();
|
||||
|
|
|
@ -53,8 +53,8 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"WinMain" /subsystem:windows /machine:I386 /nodefaultlib /out:"../../makensisw.exe" /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"WinMain" /subsystem:windows /machine:I386 /out:"../../makensisw.exe" /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "makensisw - Win32 Debug"
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
// Defines
|
||||
#define NSIS_URL "http://nsis.sourceforge.net/"
|
||||
#define USAGE "Usage:\r\n\r\n - File | Load Script...\r\n - Drag the .nsi file into this window\r\n - Right click the .nsi file and choose \"Compile NSI\""
|
||||
#define COPYRIGHT "Copyright (c) 2002 Robert Rainwater"
|
||||
#define COPYRIGHT "Copyright © 2002 Robert Rainwater"
|
||||
#define DOCPATH "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/nsis/NSIS/docs/index.html?rev=HEAD"
|
||||
#define LOCALDOCS "\\docs\\index.html"
|
||||
#define NSISERROR "Unable to intialize MakeNSIS. Please verify that makensis.exe is in the same directory as makensisw.exe."
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
#define DLG_ABOUT 103
|
||||
#define IDM_MENU 104
|
||||
#define IDK_ACCEL 105
|
||||
#define IDR_DEFAULT1 108
|
||||
#define IDI_ABOUT 110
|
||||
#define IDM_LOGWIN 111
|
||||
#define IDI_SHELL 112
|
||||
#define DLG_ABOUTNSIS 113
|
||||
#define IDC_LOGWIN 402
|
||||
|
@ -36,13 +33,14 @@
|
|||
#define IDM_FIND 40006
|
||||
#define IDM_SELECTALL 40007
|
||||
#define IDM_ABOUTNSIS 40008
|
||||
#define IDM_CLEARLOG 40009
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 114
|
||||
#define _APS_NEXT_COMMAND_VALUE 40009
|
||||
#define _APS_NEXT_COMMAND_VALUE 40011
|
||||
#define _APS_NEXT_CONTROL_VALUE 1013
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
|
@ -76,8 +76,6 @@ BEGIN
|
|||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "Edit Script\tCtrl+E", IDM_EDITSCRIPT
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Copy\tCtrl+C", IDM_COPYSELECTED
|
||||
MENUITEM "Copy &All", IDM_COPY
|
||||
MENUITEM SEPARATOR
|
||||
|
@ -85,6 +83,12 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Select All\tCtrl+A", IDM_SELECTALL
|
||||
END
|
||||
POPUP "&Tools"
|
||||
BEGIN
|
||||
MENUITEM "Edit Script\tCtrl+E", IDM_EDITSCRIPT
|
||||
MENUITEM "", 1
|
||||
MENUITEM "Clear &Log\tCtrl+W", IDM_CLEARLOG
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "NSIS Home", IDM_NSISHOME
|
||||
|
@ -95,19 +99,6 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
IDM_LOGWIN MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Edit"
|
||||
BEGIN
|
||||
MENUITEM "&Copy", IDM_COPYSELECTED
|
||||
MENUITEM "Copy &All", IDM_COPY
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Find...", IDM_FIND
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Select All", IDM_SELECTALL
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -124,6 +115,7 @@ BEGIN
|
|||
"R", IDM_RECOMPILE, VIRTKEY, CONTROL, NOINVERT
|
||||
"T", IDM_TEST, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_F1, IDM_DOCS, VIRTKEY, NOINVERT
|
||||
"W", IDM_CLEARLOG, VIRTKEY, CONTROL, NOINVERT
|
||||
"X", IDM_EXIT, VIRTKEY, ALT, NOINVERT
|
||||
END
|
||||
|
||||
|
@ -172,7 +164,7 @@ STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION |
|
|||
CAPTION "About NSIS"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&Close",IDOK,235,140,50,14
|
||||
DEFPUSHBUTTON "&Close",IDOK,235,140,50,15
|
||||
ICON IDI_ICON,IDC_STATIC,7,7,21,20
|
||||
LTEXT "NSIS",IDC_NSISVER,38,13,90,11
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,133,278,1
|
||||
|
|
|
@ -69,7 +69,7 @@ void ClearLog(HWND hwnd) {
|
|||
}
|
||||
|
||||
void LogMessage(HWND hwnd,const char *str) {
|
||||
DWORD dwLength = SendDlgItemMessage(hwnd, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
|
||||
DWORD dwLength = SendDlgItemMessage(hwnd, IDC_LOGWIN, WM_GETTEXTLENGTH, 0, 0);
|
||||
SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_SETSEL, dwLength, dwLength);
|
||||
SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_REPLACESEL, 0, (WPARAM)str);
|
||||
SendDlgItemMessage(hwnd, IDC_LOGWIN, EM_SCROLLCARET, 0, 0);
|
||||
|
@ -94,6 +94,7 @@ void DisableItems(HWND hwnd) {
|
|||
EnableMenuItem(m,IDM_COPY,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_COPYSELECTED,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_EDITSCRIPT,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_CLEARLOG,MF_ENABLED);
|
||||
}
|
||||
|
||||
void EnableItems(HWND hwnd) {
|
||||
|
@ -151,6 +152,7 @@ void EnableItems(HWND hwnd) {
|
|||
EnableMenuItem(m,IDM_COPY,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_COPYSELECTED,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_EDITSCRIPT,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_CLEARLOG,MF_ENABLED);
|
||||
}
|
||||
|
||||
void CompileNSISScript() {
|
||||
|
@ -158,7 +160,6 @@ void CompileNSISScript() {
|
|||
DragAcceptFiles(g_hwnd,FALSE);
|
||||
ClearLog(g_hwnd);
|
||||
SetTitle(g_hwnd,NULL);
|
||||
SetBranding(g_hwnd);
|
||||
if (lstrlen(g_script)==0) {
|
||||
HMENU m = GetMenu(g_hwnd);
|
||||
LogMessage(g_hwnd,USAGE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue