UI holder source code
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@881 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
7905335fc4
commit
aa6e0e15f9
5 changed files with 439 additions and 0 deletions
63
Contrib/UIs/UI Holder/resource.h
Normal file
63
Contrib/UIs/UI Holder/resource.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by resource.rc
|
||||
//
|
||||
#define IDC_BACK 3
|
||||
#define IDD_DIALOG1 101
|
||||
#define IDI_ICON1 102
|
||||
#define IDD_DIALOG2 102
|
||||
#define IDD_LICENSE 102
|
||||
#define IDI_ICON2 103
|
||||
#define IDD_DIR 103
|
||||
#define IDD_SELCOM 104
|
||||
#define IDD_INST 105
|
||||
#define IDD_INSTFILES 106
|
||||
#define IDD_UNINST 107
|
||||
#define IDB_BITMAP1 109
|
||||
#define IDB_BITMAP2 110
|
||||
#define IDI_ICON3 110
|
||||
#define IDD_VERIFY 111
|
||||
#define IDB_BITMAP3 111
|
||||
#define IDC_EDIT1 1000
|
||||
#define IDC_BROWSE 1001
|
||||
#define IDC_COPYRIGHT 1003
|
||||
#define IDC_PROGRESS1 1004
|
||||
#define IDC_PROGRESS2 1005
|
||||
#define IDC_INTROTEXT 1006
|
||||
#define IDC_WMA 1007
|
||||
#define IDC_CHECK1 1008
|
||||
#define IDC_MJF 1008
|
||||
#define IDC_VERSION 1009
|
||||
#define IDC_DIRCAPTION 1011
|
||||
#define IDC_STATUSTEXT 1014
|
||||
#define IDC_LICTEXT 1015
|
||||
#define IDC_LIST1 1016
|
||||
#define IDC_COMBO1 1017
|
||||
#define IDC_CHILDRECT 1018
|
||||
#define IDC_DIR 1019
|
||||
#define IDC_SELDIRTEXT 1020
|
||||
#define IDC_TEXT1 1021
|
||||
#define IDC_TEXT2 1022
|
||||
#define IDC_SPACEREQUIRED 1023
|
||||
#define IDC_SPACEAVAILABLE 1024
|
||||
#define IDC_INSTVER 1024
|
||||
#define IDC_UNINSTTEXT 1025
|
||||
#define IDC_PROGRESSTEXT 1026
|
||||
#define IDC_SHOWDETAILS 1027
|
||||
#define IDC_VERSTR 1028
|
||||
#define IDC_UNINSTFROM 1029
|
||||
#define IDC_STR 1030
|
||||
#define IDC_ULICON 1031
|
||||
#define IDC_TREE1 1032
|
||||
#define IDC_BRANDIMAGE 1033
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 112
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1034
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
162
Contrib/UIs/UI Holder/resource.rc
Normal file
162
Contrib/UIs/UI Holder/resource.rc
Normal file
|
@ -0,0 +1,162 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Unknown language: 0xD, 0x1 resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HEB)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 0xD, 0x1
|
||||
#pragma code_page(1255)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_LICENSE DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,23
|
||||
CONTROL "",IDC_EDIT1,"RICHEDIT",ES_MULTILINE | ES_READONLY |
|
||||
WS_BORDER | WS_VSCROLL,0,24,266,105
|
||||
END
|
||||
|
||||
IDD_DIR DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
EDITTEXT IDC_DIR,11,49,188,12,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "",IDC_BROWSE,203,48,50,14
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
CONTROL "",IDC_SELDIRTEXT,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,
|
||||
0,36,265,8
|
||||
CONTROL "",IDC_SPACEAVAILABLE,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,0,122,265,8
|
||||
CONTROL "",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE |
|
||||
WS_TABSTOP,12,65,118,10
|
||||
CONTROL "",IDC_SPACEREQUIRED,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,0,111,265,8
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,34
|
||||
END
|
||||
|
||||
IDD_SELCOM DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
COMBOBOX IDC_COMBO1,114,25,152,102,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,21,20
|
||||
LTEXT "",IDC_TEXT2,0,40,108,21
|
||||
CONTROL "",IDC_TEXT1,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,0,27,
|
||||
108,8
|
||||
CONTROL "",IDC_SPACEREQUIRED,"Static",SS_LEFTNOWORDWRAP |
|
||||
WS_GROUP,0,111,111,8
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,25
|
||||
CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS |
|
||||
TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP |
|
||||
WS_BORDER | WS_TABSTOP,114,39,151,90
|
||||
END
|
||||
|
||||
IDD_INST DIALOG DISCARDABLE 0, 0, 280, 162
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "",IDOK,223,142,50,14
|
||||
PUSHBUTTON "",IDCANCEL,7,142,50,14
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,138,267,1
|
||||
CONTROL "",IDC_CHILDRECT,"Static",SS_BLACKRECT | NOT WS_VISIBLE,
|
||||
7,6,266,130
|
||||
PUSHBUTTON "",IDC_BACK,171,142,50,14,NOT WS_VISIBLE
|
||||
CTEXT "",IDC_VERSTR,59,145,108,8,WS_DISABLED
|
||||
END
|
||||
|
||||
IDD_INSTFILES DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "",IDC_PROGRESS1,"msctls_progress32",NOT WS_VISIBLE |
|
||||
WS_BORDER,24,10,241,11
|
||||
CONTROL "",IDC_PROGRESS2,"msctls_progress32",PBS_SMOOTH | NOT
|
||||
WS_VISIBLE | WS_BORDER,24,10,241,11
|
||||
CONTROL "",IDC_INTROTEXT,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,
|
||||
24,0,241,8
|
||||
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SINGLESEL |
|
||||
LVS_NOCOLUMNHEADER | NOT WS_VISIBLE | WS_BORDER |
|
||||
WS_TABSTOP,0,25,265,104
|
||||
ICON IDI_ICON2,IDC_ULICON,0,0,20,20
|
||||
PUSHBUTTON "",IDC_SHOWDETAILS,0,28,50,14,NOT WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_UNINST DIALOG DISCARDABLE 0, 0, 266, 130
|
||||
STYLE DS_CONTROL | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDI_ICON2,IDC_ULICON,0,1,20,20
|
||||
LTEXT "",IDC_UNINSTFROM,0,45,55,8
|
||||
EDITTEXT IDC_EDIT1,56,43,209,12,ES_AUTOHSCROLL | ES_READONLY
|
||||
LTEXT "",IDC_INTROTEXT,25,0,241,34
|
||||
END
|
||||
|
||||
IDD_VERIFY DIALOG DISCARDABLE 0, 0, 162, 22
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "",IDC_STR,7,7,148,8
|
||||
END
|
||||
|
||||
#endif // Unknown language: 0xD, 0x1 resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
98
Contrib/UIs/UI Holder/ui.cpp
Normal file
98
Contrib/UIs/UI Holder/ui.cpp
Normal file
|
@ -0,0 +1,98 @@
|
|||
// ui.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include <Windows.h>
|
||||
#include <CommCtrl.h>
|
||||
#include "resource.h"
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
HWND m_curwnd;
|
||||
|
||||
char* windows[] = {
|
||||
MAKEINTRESOURCE(IDD_LICENSE),
|
||||
MAKEINTRESOURCE(IDD_SELCOM),
|
||||
MAKEINTRESOURCE(IDD_DIR),
|
||||
MAKEINTRESOURCE(IDD_INSTFILES),
|
||||
MAKEINTRESOURCE(IDD_UNINST)
|
||||
};
|
||||
|
||||
BOOL CALLBACK GenericProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
|
||||
static LOGBRUSH b = {BS_SOLID, RGB(255,0,0), 0};
|
||||
static HBRUSH red = CreateBrushIndirect(&b);
|
||||
switch (uMsg) {
|
||||
case WM_CTLCOLORSTATIC:
|
||||
return (int)red;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
|
||||
static int i = -1;
|
||||
switch (uMsg) {
|
||||
case WM_INITDIALOG:
|
||||
SetWindowText(hwndDlg, "NSIS User Interface - Testing");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_VERSTR), "NSIS version");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDC_BACK), "< Back");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDOK), "Next >");
|
||||
SetWindowText(GetDlgItem(hwndDlg, IDCANCEL), "Cancel");
|
||||
ShowWindow(GetDlgItem(hwndDlg, IDC_BACK), SW_SHOW);
|
||||
ShowWindow(GetDlgItem(hwndDlg, IDC_CHILDRECT), SW_SHOW);
|
||||
SendMessage(hwndDlg, WM_COMMAND, MAKEWORD(IDOK, 0), 0);
|
||||
ShowWindow(hwndDlg, SW_SHOW);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
case IDC_BACK:
|
||||
i+=(LOWORD(wParam)==IDOK)?1:-1;
|
||||
if (i < 0) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
if (i >= (int)sizeof(windows)/sizeof(char*)) {
|
||||
i--;
|
||||
break;
|
||||
}
|
||||
if (m_curwnd) DestroyWindow(m_curwnd);
|
||||
m_curwnd=CreateDialog(g_hInstance,windows[i],hwndDlg,GenericProc);
|
||||
if (m_curwnd)
|
||||
{
|
||||
RECT r;
|
||||
GetWindowRect(GetDlgItem(hwndDlg,IDC_CHILDRECT),&r);
|
||||
ScreenToClient(hwndDlg,(LPPOINT)&r);
|
||||
SetWindowPos(m_curwnd,0,r.left,r.top,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
|
||||
ShowWindow(m_curwnd,SW_SHOWNA);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
EndDialog(hwndDlg, 0);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
InitCommonControls();
|
||||
|
||||
LoadLibrary("RichEd32.dll");
|
||||
|
||||
g_hInstance = GetModuleHandle(0);
|
||||
|
||||
DialogBox(
|
||||
GetModuleHandle(0),
|
||||
MAKEINTRESOURCE(IDD_INST),
|
||||
0,
|
||||
DialogProc
|
||||
);
|
||||
|
||||
ExitProcess(0);
|
||||
|
||||
return 0;
|
||||
}
|
87
Contrib/UIs/UI Holder/ui.dsp
Normal file
87
Contrib/UIs/UI Holder/ui.dsp
Normal file
|
@ -0,0 +1,87 @@
|
|||
# Microsoft Developer Studio Project File - Name="ui" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=ui - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ui.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ui.mak" CFG="ui - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ui - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# 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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /entry:"WinMain" /subsystem:windows /machine:I386 /nodefaultlib /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
# Begin Target
|
||||
|
||||
# Name "ui - Win32 Release"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ui.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
29
Contrib/UIs/UI Holder/ui.dsw
Normal file
29
Contrib/UIs/UI Holder/ui.dsw
Normal file
|
@ -0,0 +1,29 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ui"=.\ui.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue