Somewhat of a start
16
Tools/FARDive/FARDive.hpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include "version.hpp"
|
||||
|
||||
namespace Archive {
|
||||
extern wchar_t Path[1024], Filename[1024];
|
||||
|
||||
extern bool IsOpen;
|
||||
extern bool IsModified;
|
||||
|
||||
bool Add(const wchar_t * Path);
|
||||
bool Close();
|
||||
bool Open();
|
||||
bool PopulateEntries();
|
||||
bool Save();
|
||||
bool SaveAs();
|
||||
bool SetWorkspace();
|
||||
}
|
44
Tools/FARDive/Makefile
Normal file
|
@ -0,0 +1,44 @@
|
|||
# macros --------------------------------------------------------------------
|
||||
CC = gcc
|
||||
LD = gcc
|
||||
CFLAGS = -m32 -Os -march=i686 -fomit-frame-pointer -ffast-math -funsafe-loop-optimizations -fmerge-all-constants -g0 -fno-exceptions
|
||||
LDFLAGS = -m32 -s -fwhole-program
|
||||
|
||||
WINDRES = windres -F pe-i386
|
||||
|
||||
LIBS = -mwindows -lole32 -luxtheme -L. -lpng15
|
||||
|
||||
OBJS = obj/windows/common.o \
|
||||
obj/windows/Startup.o \
|
||||
obj/windows/Interaction.o \
|
||||
obj/windows/MainWindow.o \
|
||||
obj/windows/ReadPNGIcon.o \
|
||||
obj/windows/Dialog/AddToArchive.o \
|
||||
obj/windows/Dialog/NewArchive.o \
|
||||
obj/windows/resource.o
|
||||
|
||||
# These will rebuild the entire program upon edit.
|
||||
DEPS = Makefile \
|
||||
FARDive.hpp \
|
||||
version.hpp \
|
||||
windows/GUI.hpp \
|
||||
windows/resource.hpp \
|
||||
windows/Windows.hpp
|
||||
|
||||
# dependencies --------------------------------------------------------------
|
||||
all: ./FARDive.exe
|
||||
./FARDive.exe: $(OBJS)
|
||||
$(LD) $(LDFLAGS) -L. -o $@ $(OBJS) $(LIBS)
|
||||
|
||||
$(OBJS): $(DEPS)
|
||||
|
||||
# make rules ----------------------------------------------------------------
|
||||
./obj/%.o: %.cpp
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
./obj/%.o: %.rc
|
||||
$(WINDRES) -i $< -o $@
|
||||
|
||||
# maintenance ---------------------------------------------------------------
|
||||
clean:
|
||||
del /Q /S FARDive.exe obj
|
BIN
Tools/FARDive/resources/icons/accessories-text-editor.png
Normal file
After Width: | Height: | Size: 409 B |
BIN
Tools/FARDive/resources/icons/applications-other.png
Normal file
After Width: | Height: | Size: 518 B |
BIN
Tools/FARDive/resources/icons/audio-x-generic.png
Normal file
After Width: | Height: | Size: 614 B |
BIN
Tools/FARDive/resources/icons/document-new.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
Tools/FARDive/resources/icons/document-open.png
Normal file
After Width: | Height: | Size: 598 B |
BIN
Tools/FARDive/resources/icons/document-properties.png
Normal file
After Width: | Height: | Size: 346 B |
BIN
Tools/FARDive/resources/icons/document-save-as.png
Normal file
After Width: | Height: | Size: 616 B |
BIN
Tools/FARDive/resources/icons/document-save.png
Normal file
After Width: | Height: | Size: 666 B |
BIN
Tools/FARDive/resources/icons/edit-clear.png
Normal file
After Width: | Height: | Size: 682 B |
BIN
Tools/FARDive/resources/icons/edit-copy.png
Normal file
After Width: | Height: | Size: 404 B |
BIN
Tools/FARDive/resources/icons/edit-find.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
Tools/FARDive/resources/icons/edit-select-all.png
Normal file
After Width: | Height: | Size: 328 B |
BIN
Tools/FARDive/resources/icons/emblem-unreadable.png
Normal file
After Width: | Height: | Size: 396 B |
BIN
Tools/FARDive/resources/icons/go-first.png
Normal file
After Width: | Height: | Size: 607 B |
BIN
Tools/FARDive/resources/icons/go-jump.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
Tools/FARDive/resources/icons/go-last.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
Tools/FARDive/resources/icons/info.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
Tools/FARDive/resources/icons/internet-web-browser.png
Normal file
After Width: | Height: | Size: 758 B |
BIN
Tools/FARDive/resources/icons/list-add.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
Tools/FARDive/resources/icons/list-remove.png
Normal file
After Width: | Height: | Size: 188 B |
BIN
Tools/FARDive/resources/icons/mail-send-receive.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
Tools/FARDive/resources/icons/package-x-generic-selected.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
Tools/FARDive/resources/icons/package-x-generic.png
Normal file
After Width: | Height: | Size: 469 B |
BIN
Tools/FARDive/resources/icons/preferences-desktop.png
Normal file
After Width: | Height: | Size: 384 B |
BIN
Tools/FARDive/resources/icons/preferences-system-windows.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
Tools/FARDive/resources/icons/system-file-manager.png
Normal file
After Width: | Height: | Size: 247 B |
BIN
Tools/FARDive/resources/icons/system-log-out.png
Normal file
After Width: | Height: | Size: 725 B |
BIN
Tools/FARDive/resources/icons/utilities-terminal.png
Normal file
After Width: | Height: | Size: 610 B |
108
Tools/FARDive/resources/optimize.bat
Normal file
|
@ -0,0 +1,108 @@
|
|||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 accessories-text-editor.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 accessories-text-editor.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k accessories-text-editor.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 applications-other.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 applications-other.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k applications-other.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 audio-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 audio-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k audio-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 document-new.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 document-new.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k document-new.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 document-open.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 document-open.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k document-open.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 document-properties.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 document-properties.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k document-properties.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 document-save-as.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 document-save-as.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k document-save-as.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 document-save.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 document-save.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k document-save.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 edit-clear.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 edit-clear.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k edit-clear.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 edit-copy.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 edit-copy.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k edit-copy.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 edit-find.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 edit-find.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k edit-find.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 edit-select-all.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 edit-select-all.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k edit-select-all.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 emblem-unreadable.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 emblem-unreadable.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k emblem-unreadable.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 go-first.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 go-first.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k go-first.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 go-jump.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 go-jump.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k go-jump.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 go-last.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 go-last.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k go-last.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 internet-web-browser.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 internet-web-browser.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k internet-web-browser.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 list-add.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 list-add.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k list-add.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 list-remove.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 list-remove.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k list-remove.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 mail-send-receive.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 mail-send-receive.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k mail-send-receive.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 package-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 package-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k package-x-generic.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 package-x-generic-selected.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 package-x-generic-selected.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k package-x-generic-selected.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 preferences-desktop.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 preferences-desktop.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k preferences-desktop.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 preferences-system-windows.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 preferences-system-windows.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k preferences-system-windows.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 system-file-manager.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 system-file-manager.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k system-file-manager.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 system-log-out.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 system-log-out.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw1k system-log-out.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw256 utilities-terminal.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zw512 utilities-terminal.png
|
||||
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 -i0 -zwutilities-terminal.png
|
||||
advpng -z -4 accessories-text-editor.png
|
||||
advpng -z -4 applications-other.png
|
||||
advpng -z -4 audio-x-generic.png
|
||||
advpng -z -4 document-new.png
|
||||
advpng -z -4 document-open.png
|
||||
advpng -z -4 document-properties.png
|
||||
advpng -z -4 document-save-as.png
|
||||
advpng -z -4 document-save.png
|
||||
advpng -z -4 emblem-unreadable.png
|
||||
advpng -z -4 edit-clear.png
|
||||
advpng -z -4 edit-copy.png
|
||||
advpng -z -4 edit-find.png
|
||||
advpng -z -4 edit-select-all.png
|
||||
advpng -z -4 go-first.png
|
||||
advpng -z -4 go-jump.png
|
||||
advpng -z -4 go-last.png
|
||||
advpng -z -4 internet-web-browser.png
|
||||
advpng -z -4 list-add.png
|
||||
advpng -z -4 list-remove.png
|
||||
advpng -z -4 mail-send-receive.png
|
||||
advpng -z -4 package-x-generic-selected.png
|
||||
advpng -z -4 package-x-generic.png
|
||||
advpng -z -4 preferences-desktop.png
|
||||
advpng -z -4 preferences-system-windows.png
|
||||
advpng -z -4 system-file-manager.png
|
||||
advpng -z -4 system-log-out.png
|
||||
advpng -z -4 utilities-terminal.png
|
1
Tools/FARDive/resources/windows/FARDive.exe.manifest
Normal file
|
@ -0,0 +1 @@
|
|||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/></dependentAssembly></dependency></assembly>
|
BIN
Tools/FARDive/resources/windows/FARDive.ico
Normal file
After Width: | Height: | Size: 23 KiB |
17
Tools/FARDive/version.hpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
#define FD_VERSION_A 0
|
||||
#define FD_VERSION_B 0
|
||||
#define FD_VERSION_C 1
|
||||
#define FD_REVISION 1
|
||||
|
||||
//You don't have to touch the following
|
||||
#define xstr(x) str(x)
|
||||
#define str(x) #x //Yes, double levels is required. See <http://gcc.gnu.org/onlinedocs/cpp/Stringification.html>
|
||||
#define FDVERSION L"" \
|
||||
xstr(FD_VERSION_A) \
|
||||
L"." \
|
||||
xstr(FD_VERSION_B) \
|
||||
L"." \
|
||||
xstr(FD_VERSION_C) \
|
||||
L" (rev. " \
|
||||
xstr(FD_REVISION) \
|
||||
L")"
|
53
Tools/FARDive/windows/Dialog/AddToArchive.cpp
Normal file
|
@ -0,0 +1,53 @@
|
|||
#include "../Windows.hpp"
|
||||
#include "../GUI.hpp"
|
||||
|
||||
namespace AddToArchive {
|
||||
|
||||
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
|
||||
switch (message){
|
||||
case WM_INITDIALOG: {
|
||||
CenterDialog(hDlg);
|
||||
|
||||
HWND hBox = GetDlgItem(hDlg, IDC_A2A_FILE);
|
||||
SendMessage(hBox, EM_SETLIMITTEXT, 1023, 0);
|
||||
hBox = GetDlgItem(hDlg, IDC_A2A_FILENAME);
|
||||
SendMessage(hBox, EM_SETLIMITTEXT, 1023, 0);
|
||||
|
||||
if(lParam){
|
||||
HWND hBox = GetDlgItem(hDlg, IDC_A2A_FILE);
|
||||
SetWindowText(hBox, (wchar_t*) lParam);
|
||||
hBox = GetDlgItem(hDlg, IDC_A2A_FILENAME);
|
||||
wchar_t Filename[1024];
|
||||
GetFileTitle((wchar_t*) lParam, Filename, 1024);
|
||||
SetWindowText(hBox, Filename);
|
||||
}
|
||||
|
||||
} return TRUE;
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)){
|
||||
case IDC_A2A_BROWSE: {
|
||||
wchar_t Path[1024] = L"", Filename[1024] = L"";
|
||||
ofn.hwndOwner = hDlg;
|
||||
ofn.lpstrFilter = FILTER_FILES;
|
||||
ofn.lpstrCustomFilter = ArchiveAddFilter;
|
||||
ofn.lpstrFile = Path;
|
||||
ofn.lpstrFileTitle = Filename;
|
||||
ofn.Flags = OFN_DONTADDTORECENT | OFN_HIDEREADONLY;
|
||||
if(GetOpenFileName(&ofn)){
|
||||
SetWindowText(GetDlgItem(hDlg, IDC_A2A_FILE), Path);
|
||||
SetWindowText(GetDlgItem(hDlg, IDC_A2A_FILENAME), Filename);
|
||||
}
|
||||
} break;
|
||||
case IDOK:
|
||||
EndDialog(hDlg, true);
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, false);
|
||||
} break;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, false);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
118
Tools/FARDive/windows/Dialog/NewArchive.cpp
Normal file
|
@ -0,0 +1,118 @@
|
|||
#include "../Windows.hpp"
|
||||
#include "../GUI.hpp"
|
||||
|
||||
#ifndef TTI_INFO_LARGE
|
||||
#define TTI_INFO_LARGE 4
|
||||
#endif
|
||||
|
||||
namespace NewArchive {
|
||||
|
||||
enum {TYPE_FAR, TYPE_DBPF};
|
||||
void SetType(HWND hDlg, int type){
|
||||
for(int i=IDC_NA_FARVERSIONTEXT; i<=IDC_NA_FARVERSION; i++)
|
||||
EnableWindow(GetDlgItem(hDlg, i), type==TYPE_FAR);
|
||||
for(int i=IDC_NA_DBPFVERSIONTEXT; i<=IDC_NA_DBPFCOMPRESS; i++)
|
||||
EnableWindow(GetDlgItem(hDlg, i), type==TYPE_DBPF);
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam){
|
||||
switch (message){
|
||||
case WM_INITDIALOG: {
|
||||
CenterDialog(hDlg);
|
||||
|
||||
//Fill the drop-down boxes
|
||||
HWND hBox = GetDlgItem(hDlg, IDC_NA_TYPE);
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"FAR");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"DBPF");
|
||||
SendMessage(hBox, CB_SETCURSEL, 0, 0);
|
||||
hBox = GetDlgItem(hDlg, IDC_NA_FARVERSION);
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"1a");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"1b");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"3");
|
||||
SendMessage(hBox, CB_SETCURSEL, 0, 0);
|
||||
hBox = GetDlgItem(hDlg, IDC_NA_DBPFVERSION);
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"1.0");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"1.1");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"2.0");
|
||||
SendMessage(hBox, CB_SETCURSEL, 0, 0);
|
||||
hBox = GetDlgItem(hDlg, IDC_NA_INDEXVERSION);
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"7.0");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"7.1");
|
||||
SendMessage(hBox, CB_INSERTSTRING, -1, (LPARAM) L"3.0");
|
||||
SendMessage(hBox, CB_SETCURSEL, 0, 0);
|
||||
|
||||
//Create the tooltips
|
||||
HWND FARInfo = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
|
||||
WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | TTS_ALWAYSTIP,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
hDlg, NULL, hInst, NULL),
|
||||
DBPFInfo = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
|
||||
WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | TTS_ALWAYSTIP,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
hDlg, NULL, hInst, NULL);
|
||||
|
||||
TOOLINFO tinfo = {
|
||||
sizeof(TOOLINFO), //cbSize
|
||||
TTF_IDISHWND | TTF_SUBCLASS, //uFlags
|
||||
hDlg, //hwnd
|
||||
0, //uId
|
||||
NULL, //rect
|
||||
0 //hinst
|
||||
};
|
||||
|
||||
tinfo.uId = (UINT_PTR) GetDlgItem(hDlg, IDC_NA_FARINFO);
|
||||
tinfo.lpszText = (wchar_t*)
|
||||
L"FAR version 1a is found in The Sims 1.\r\n\r\n"
|
||||
L"Version 1b appears to be a mistake, in which it was intended to take on the version number 2.\r\n\r\n"
|
||||
L"1b and 3 are both found exclusively in The Sims Online.";
|
||||
SendMessage(FARInfo, TTM_SETMAXTIPWIDTH, 2000, 200);
|
||||
SendMessage(FARInfo, TTM_SETTITLE, TTI_INFO_LARGE, (LPARAM) L"FAR version");
|
||||
SendMessage(FARInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
|
||||
SendMessage(FARInfo, TTM_SETDELAYTIME, TTDT_AUTOPOP, 12000);
|
||||
tinfo.uId = (UINT_PTR) GetDlgItem(hDlg, IDC_NA_DBPFINFO);
|
||||
tinfo.lpszText = (wchar_t*)
|
||||
L"DBPF version numbers can be shortened to the form a.b;ix,y, where "
|
||||
L"a.b is the Archive version and x.y is the Index version.\r\n\r\n"
|
||||
L"DBPF 1.0;i7.0 is found in The Sims Online and SimCity 4.\r\n\r\n"
|
||||
L"1.0;i7.0 and 1.1;i7.1 are found in The Sims 2.\r\n\r\n"
|
||||
L"2.0;i3.0 is found in Spore.";
|
||||
SendMessage(DBPFInfo, TTM_SETMAXTIPWIDTH, 2000, 200);
|
||||
SendMessage(DBPFInfo, TTM_SETTITLE, TTI_INFO_LARGE, (LPARAM) L"DBPF version");
|
||||
SendMessage(DBPFInfo, TTM_ADDTOOL, 0, (LPARAM) &tinfo);
|
||||
SendMessage(DBPFInfo, TTM_SETDELAYTIME, TTDT_AUTOPOP, 20000);
|
||||
|
||||
SetType(hDlg, TYPE_FAR);
|
||||
} return TRUE;
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if((HWND) lParam == GetDlgItem(hDlg, IDC_NA_TYPETEXT)){
|
||||
SetBkColor((HDC) wParam, GetSysColor(COLOR_WINDOW));
|
||||
return (INT_PTR) GetSysColorBrush(COLOR_WINDOW);
|
||||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam)){
|
||||
case IDC_NA_TYPE:
|
||||
if(HIWORD(wParam) == CBN_SELCHANGE)
|
||||
SetType(hDlg, SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0));
|
||||
break;
|
||||
case IDOK:
|
||||
Archive::IsOpen = true;
|
||||
Archive::IsModified = true;
|
||||
|
||||
Archive::Path[0] = '\0'; //No actual path
|
||||
wcscpy(Archive::Filename, L"Untitled");
|
||||
Archive::SetWorkspace();
|
||||
|
||||
EndDialog(hDlg, 0);
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, 0);
|
||||
} break;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
59
Tools/FARDive/windows/GUI.hpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
extern HINSTANCE hInst;
|
||||
|
||||
extern HMENU hMenu, listmenu;
|
||||
extern HDC hDC;
|
||||
extern OPENFILENAME ofn;
|
||||
extern unsigned int statusbarheight;
|
||||
|
||||
extern HBITMAP PNGIcon[MENUICONS];
|
||||
enum {
|
||||
BMP_FILE_NEW,
|
||||
BMP_FILE_OPEN,
|
||||
BMP_FILE_SAVE,
|
||||
BMP_FILE_SAVEAS,
|
||||
BMP_FILE_ADD,
|
||||
BMP_FILE_EXPORTALL,
|
||||
BMP_FILE_EXPORTSELECTED,
|
||||
BMP_FILE_CHANGETYPE,
|
||||
BMP_FILE_CLOSE,
|
||||
BMP_FILE_EXIT,
|
||||
BMP_EDIT_DUPLICATE,
|
||||
BMP_EDIT_REMOVE,
|
||||
BMP_EDIT_RENAME,
|
||||
BMP_EDIT_PROPERTIES,
|
||||
BMP_EDIT_CONTENTS,
|
||||
BMP_EDIT_FIND,
|
||||
BMP_EDIT_FINDNEXT,
|
||||
BMP_EDIT_FINDPREVIOUS,
|
||||
BMP_EDIT_MATCHES,
|
||||
BMP_EDIT_GOTO,
|
||||
BMP_EDIT_PREFERENCES,
|
||||
BMP_TOOLS_RECOMPRESS,
|
||||
BMP_TOOLS_RESORT,
|
||||
BMP_TOOLS_REMOVEHOLES,
|
||||
BMP_TOOLS_BATCH,
|
||||
BMP_HELP_HOWTOUSE
|
||||
};
|
||||
|
||||
static const wchar_t FILTER_ARCHIVES_FILES[] =
|
||||
L"All supported archives\0*.far;*.dbpf;*.dat;*.package\0"
|
||||
L"FAR (*.far, *.dat, *.package)\0*.far;*.dat;*.package\0"
|
||||
L"DBPF (*.dbpf, *.dat, *.package)\0*.dbpf;*.dat;*.package\0"
|
||||
L"All Files\0*.*\0\0";
|
||||
|
||||
static const wchar_t FILTER_ARCHIVES_ONLY[] =
|
||||
L"All supported archives\0*.far;*.dbpf;*.dat;*.package\0"
|
||||
L"FAR (*.far, *.dat, *.package)\0*.far;*.dat;*.package\0"
|
||||
L"DBPF (*.dbpf, *.dat, *.package)\0*.dbpf;*.dat;*.package\0"
|
||||
L"All Files\0*.*\0\0";
|
||||
|
||||
static const wchar_t FILTER_FILES[] =
|
||||
L"All Files\0*.*\0\0";
|
||||
|
||||
extern wchar_t ArchiveOpenFilter[128], ArchiveAddFilter[128], ArchiveSaveFilter[128];
|
||||
|
||||
//Controls
|
||||
extern HWND hWnd, statusbar, hList;
|
||||
|
||||
void CenterDialog(HWND hDlg);
|
||||
HBITMAP ReadPNGIcon(int ID);
|
174
Tools/FARDive/windows/Interaction.cpp
Normal file
|
@ -0,0 +1,174 @@
|
|||
#include "Windows.hpp"
|
||||
#include <uxtheme.h>
|
||||
#include "GUI.hpp"
|
||||
|
||||
namespace Archive {
|
||||
|
||||
wchar_t Path[1024], Filename[1024];
|
||||
|
||||
bool IsOpen = false;
|
||||
bool IsModified;
|
||||
|
||||
bool Add(const wchar_t * Path){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Close(){
|
||||
if(!Archive::IsOpen) return true;
|
||||
|
||||
if(Archive::IsModified){
|
||||
//Ask for consent
|
||||
int result = MessageBox(hWnd, L"Save changes?", L"Save changes?", MB_YESNOCANCEL);
|
||||
if(result == IDYES){
|
||||
if(!Archive::Save())
|
||||
return false;
|
||||
}else if(result != IDNO)
|
||||
return false;
|
||||
}
|
||||
|
||||
//Close the workspace
|
||||
|
||||
Archive::IsOpen = false;
|
||||
|
||||
SetWindowText(hWnd, L"FARDive");
|
||||
SendMessage(statusbar, SB_SETTEXT, 0, (LPARAM) L"");
|
||||
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_STATE;
|
||||
mii.fState = MFS_DISABLED;
|
||||
|
||||
int DisableItems[] = {
|
||||
ID_FILE_SAVE,
|
||||
ID_FILE_SAVEAS,
|
||||
ID_FILE_ADD,
|
||||
ID_FILE_EXPORTALL,
|
||||
ID_FILE_EXPORTSELECTED,
|
||||
ID_FILE_CHANGETYPE,
|
||||
ID_FILE_CLOSE,
|
||||
ID_EDIT_DUPLICATE,
|
||||
ID_EDIT_REMOVE,
|
||||
ID_EDIT_RENAME,
|
||||
ID_EDIT_PROPERTIES,
|
||||
ID_EDIT_CONTENTS,
|
||||
ID_EDIT_FIND,
|
||||
ID_EDIT_FINDNEXT,
|
||||
ID_EDIT_FINDPREVIOUS,
|
||||
ID_EDIT_MATCHES,
|
||||
ID_EDIT_GOTO,
|
||||
ID_TOOLS_RECOMPRESS,
|
||||
ID_TOOLS_RESORT,
|
||||
ID_TOOLS_REMOVETRASH,
|
||||
0};
|
||||
for(int i=0; DisableItems[i]; i++)
|
||||
SetMenuItemInfo(hMenu, DisableItems[i], FALSE, &mii);
|
||||
|
||||
DestroyWindow(hList);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Open(){
|
||||
if(!Archive::Close()) return false;
|
||||
|
||||
GetFileTitle(Archive::Path, Archive::Filename, 1024);
|
||||
|
||||
Archive::IsOpen = true;
|
||||
Archive::IsModified = false;
|
||||
|
||||
SetWorkspace();
|
||||
}
|
||||
|
||||
bool PopulateEntries(){
|
||||
unsigned EntryCount = 1;
|
||||
LVITEM item;
|
||||
memset(&item, 0x00, sizeof(LVITEM));
|
||||
item.mask = LVIF_TEXT;
|
||||
item.iItem = 0;
|
||||
item.pszText = (LPTSTR) L"Test";
|
||||
SendMessage(hList, LVM_SETITEMCOUNT, EntryCount, LVSICF_NOSCROLL);
|
||||
SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM) &item);
|
||||
|
||||
wchar_t buffer[17];
|
||||
wsprintf(buffer, L"%u file%s", EntryCount, (EntryCount == 1) ? L"" : L"s");
|
||||
SendMessage(statusbar, SB_SETTEXT, 0, (LPARAM) buffer);
|
||||
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_STATE;
|
||||
mii.fState = (EntryCount > 0) ? MFS_ENABLED : MFS_DISABLED;
|
||||
SetMenuItemInfo(hMenu, ID_FILE_EXPORTALL, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_FIND, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_FINDNEXT, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_FINDPREVIOUS, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_MATCHES, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_GOTO, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_TOOLS_RECOMPRESS, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_TOOLS_RESORT, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_TOOLS_REMOVETRASH, FALSE, &mii);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Save(){
|
||||
if(!Archive::IsModified) return true;
|
||||
if(Path[0] == '\0'){ //No path because we're dealing with a newly created archive
|
||||
return SaveAs();
|
||||
}
|
||||
|
||||
Archive::IsModified = false;
|
||||
wchar_t WindowTitle[1024+10];
|
||||
wsprintf(WindowTitle, L"%s%s - FARDive", Archive::Filename, L"");
|
||||
SetWindowText(hWnd, WindowTitle);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SaveAs(){
|
||||
wchar_t OldPath[1024], OldFilename[1024];
|
||||
//Backup old settings
|
||||
wcscpy(OldPath, Archive::Path);
|
||||
wcscpy(OldFilename, Archive::Filename);
|
||||
|
||||
ofn.hwndOwner = hWnd;
|
||||
ofn.lpstrFilter = FILTER_ARCHIVES_ONLY;
|
||||
ofn.lpstrCustomFilter = ArchiveSaveFilter;
|
||||
ofn.lpstrFile = Path;
|
||||
ofn.lpstrFileTitle = Filename;
|
||||
ofn.Flags = OFN_DONTADDTORECENT | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
if(GetSaveFileName(&ofn) && Save())
|
||||
return true;
|
||||
|
||||
//Restore old settings
|
||||
wcscpy(Archive::Path, OldPath);
|
||||
wcscpy(Archive::Filename, OldFilename);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SetWorkspace(){
|
||||
wchar_t WindowTitle[1024+11];
|
||||
wsprintf(WindowTitle, L"%s%s - FARDive", Archive::Filename, Archive::IsModified ? L"*" : L"");
|
||||
SetWindowText(hWnd, WindowTitle);
|
||||
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_STATE;
|
||||
mii.fState = MFS_ENABLED;
|
||||
|
||||
SetMenuItemInfo(hMenu, ID_FILE_SAVE, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_FILE_SAVEAS, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_FILE_ADD, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_FILE_CHANGETYPE, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_FILE_CLOSE, FALSE, &mii);
|
||||
|
||||
RECT ClientRect;
|
||||
GetClientRect(hWnd, &ClientRect);
|
||||
hList = CreateWindowEx(WS_EX_CLIENTEDGE | LVS_EX_DOUBLEBUFFER | WS_EX_COMPOSITED, WC_LISTVIEW, NULL, LVS_LIST | LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE,
|
||||
5, 5, 192, ClientRect.bottom-statusbarheight-10, hWnd, NULL, NULL, NULL);
|
||||
SetWindowTheme(hList, L"Explorer", NULL);
|
||||
|
||||
PopulateEntries();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
167
Tools/FARDive/windows/MainWindow.cpp
Normal file
|
@ -0,0 +1,167 @@
|
|||
#include "Windows.hpp"
|
||||
#include "GUI.hpp"
|
||||
|
||||
HWND hList;
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message){
|
||||
|
||||
case WM_SIZE:
|
||||
SendMessage(statusbar, WM_SIZE, 0, 0);
|
||||
|
||||
if(Archive::IsOpen)
|
||||
SetWindowPos(hList, 0, 0, 0, 192, HIWORD(lParam)-statusbarheight-10,
|
||||
SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOOWNERZORDER);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case ID_FILE_NEW:
|
||||
if(Archive::Close())
|
||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_NEWARCHIVE), hWnd, NewArchive::DlgProc, NULL);
|
||||
break;
|
||||
case ID_FILE_OPEN:
|
||||
if(!Archive::Close()) break;
|
||||
ofn.hwndOwner = hWnd;
|
||||
ofn.lpstrFilter = FILTER_ARCHIVES_FILES;
|
||||
ofn.lpstrCustomFilter = ArchiveOpenFilter;
|
||||
ofn.lpstrFile = Archive::Path;
|
||||
ofn.lpstrFileTitle = NULL;
|
||||
ofn.Flags = OFN_DONTADDTORECENT | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||
if(GetOpenFileName(&ofn))
|
||||
Archive::Open();
|
||||
break;
|
||||
case ID_FILE_SAVE:
|
||||
Archive::Save();
|
||||
break;
|
||||
case ID_FILE_SAVEAS:
|
||||
Archive::SaveAs();
|
||||
break;
|
||||
case ID_FILE_ADD: {
|
||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ADDTOARCHIVE_FAR1), hWnd, AddToArchive::DlgProc, 0);
|
||||
} break;
|
||||
case ID_HELP_ABOUT:
|
||||
MessageBox(hWnd, L"FARDive version " FDVERSION
|
||||
L"\r\n\r\nThis is an alpha release of FARDive. The About box is not yet complete.\r\n\r\n"
|
||||
L"Don't worry, file writing will not be implemented until it is guaranteed stable.\r\n\r\n"
|
||||
L"Saving the archive through File -> Save (or Save as) will not actually "
|
||||
L"take place until we reach that point.\r\n\r\n"
|
||||
L"=-----=\r\n\r\n"
|
||||
L"FARDive - Copyright (c) 2011 Fatbag <X-Fi6@phppoll.org>\r\n\r\n"
|
||||
L"Permission to use, copy, modify, and/or distribute this software for any "
|
||||
L"purpose with or without fee is hereby granted, provided that the above "
|
||||
L"copyright notice and this permission notice appear in all copies.\r\n\r\n"
|
||||
L"THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES "
|
||||
L"WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF "
|
||||
L"MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR "
|
||||
L"ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES "
|
||||
L"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN "
|
||||
L"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF "
|
||||
L"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\r\n\r\n", L"About", MB_OK);
|
||||
break;
|
||||
case ID_FILE_CLOSE:
|
||||
Archive::Close();
|
||||
break;
|
||||
case ID_FILE_EXIT:
|
||||
if(Archive::Close())
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY: {
|
||||
NMHDR *nmhdr = (NMHDR*) lParam;
|
||||
if(nmhdr->hwndFrom == hList){
|
||||
switch(nmhdr->code){
|
||||
case LVN_ITEMCHANGED: {
|
||||
unsigned selected = SendMessage(hList, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_STATE;
|
||||
|
||||
mii.fState = (selected > 0) ? MFS_ENABLED : MFS_DISABLED;
|
||||
SetMenuItemInfo(hMenu, ID_FILE_EXPORTSELECTED, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_DUPLICATE, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_REMOVE, FALSE, &mii);
|
||||
|
||||
mii.fState = (selected == 1) ? MFS_ENABLED : MFS_DISABLED;
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_RENAME, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_PROPERTIES, FALSE, &mii);
|
||||
SetMenuItemInfo(hMenu, ID_EDIT_CONTENTS, FALSE, &mii);
|
||||
} break;
|
||||
|
||||
case NM_RCLICK: {
|
||||
unsigned selected = SendMessage(hList, LVM_GETSELECTEDCOUNT, 0, 0);
|
||||
|
||||
if(listmenu) DestroyMenu(listmenu);
|
||||
listmenu = CreatePopupMenu();
|
||||
|
||||
#define AddSeparator() \
|
||||
mii.fMask = MIIM_TYPE; \
|
||||
InsertMenuItem(listmenu, ++position, TRUE, &mii); \
|
||||
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_BITMAP
|
||||
#define AddItem(x,y,z) \
|
||||
mii.wID = x; \
|
||||
mii.dwTypeData = (wchar_t*) y; \
|
||||
mii.hbmpItem = PNGIcon[z]; \
|
||||
InsertMenuItem(listmenu, ++position, TRUE, &mii)
|
||||
|
||||
unsigned position = 0;
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_BITMAP;
|
||||
mii.fType = MFT_SEPARATOR;
|
||||
|
||||
AddItem(ID_LISTMENU_ADD, L"A&dd to archive", BMP_FILE_ADD);
|
||||
|
||||
if(selected > 0){
|
||||
AddSeparator();
|
||||
AddItem(ID_LISTMENU_EXPORTSELECTED, L"Export &selected...", BMP_FILE_EXPORTSELECTED);
|
||||
AddItem(ID_LISTMENU_DUPLICATE, L"D&uplicate", BMP_EDIT_DUPLICATE);
|
||||
AddItem(ID_LISTMENU_REMOVE, L"&Remove", BMP_EDIT_REMOVE);
|
||||
if(selected == 1){
|
||||
AddSeparator();
|
||||
AddItem(ID_LISTMENU_RENAME, L"Re&name", BMP_EDIT_RENAME);
|
||||
AddItem(ID_LISTMENU_PROPERTIES, L"Change pr&operties...", BMP_EDIT_PROPERTIES);
|
||||
AddItem(ID_LISTMENU_CONTENTS, L"Change file &contents...", BMP_EDIT_CONTENTS);
|
||||
}
|
||||
}
|
||||
|
||||
POINT p;
|
||||
GetCursorPos(&p);
|
||||
TrackPopupMenu(listmenu, TPM_RIGHTBUTTON, p.x, p.y, 0, hWnd, NULL);
|
||||
PostMessage(hWnd, WM_NULL, 0, 0);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case WM_DROPFILES:
|
||||
if(!Archive::IsOpen){
|
||||
//Open as an archive
|
||||
unsigned strlen = DragQueryFile((HDROP) wParam, 0, Archive::Path, 1024);
|
||||
DragFinish((HDROP) wParam);
|
||||
if(strlen)
|
||||
Archive::Open();
|
||||
}else{
|
||||
//Add to the current archive
|
||||
wchar_t EntryPath[1024];
|
||||
unsigned strlen = DragQueryFile((HDROP) wParam, 0, EntryPath, 1024);
|
||||
DragFinish((HDROP) wParam);
|
||||
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ADDTOARCHIVE_FAR1), hWnd, AddToArchive::DlgProc, (LPARAM) EntryPath);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CLOSE:
|
||||
if(Archive::Close())
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
67
Tools/FARDive/windows/ReadPNGIcon.cpp
Normal file
|
@ -0,0 +1,67 @@
|
|||
#include <windows.h>
|
||||
#include "../libpng-1.5.6/png.h"
|
||||
|
||||
extern HDC hDC;
|
||||
|
||||
char * buffer;
|
||||
|
||||
void user_read_data(png_structp, png_bytep data, png_size_t length){
|
||||
memcpy(data, buffer, length);
|
||||
buffer += length;
|
||||
}
|
||||
|
||||
HBITMAP ReadPNGIcon(int ID){
|
||||
HRSRC resource = FindResource(NULL, MAKEINTRESOURCE(ID), RT_RCDATA);
|
||||
buffer = (char *) LockResource(LoadResource(NULL, resource));
|
||||
|
||||
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
png_set_read_fn(png_ptr, NULL, user_read_data);
|
||||
png_infop info_ptr = png_create_info_struct(png_ptr);
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
png_uint_32 width, height;
|
||||
int bit_depth, color_type;
|
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, NULL, NULL, NULL);
|
||||
if(color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
png_set_gray_to_rgb(png_ptr);
|
||||
else if(color_type == PNG_COLOR_TYPE_PALETTE || color_type == PNG_COLOR_MASK_PALETTE)
|
||||
png_set_palette_to_rgb(png_ptr);
|
||||
|
||||
png_set_add_alpha(png_ptr, 0xFF, PNG_FILLER_AFTER);
|
||||
png_set_bgr(png_ptr);
|
||||
|
||||
png_read_update_info(png_ptr, info_ptr);
|
||||
BITMAPINFOHEADER bmi = {
|
||||
sizeof(BITMAPINFOHEADER), //biSize
|
||||
width, //biWidth
|
||||
height, //biHeight
|
||||
1, //biPlanes
|
||||
32, //biBitCount
|
||||
BI_RGB, //biCompression
|
||||
width*height*4, //biSizeImage
|
||||
0, //biXPelsPerMeter
|
||||
0, //biYPelsPerMeter
|
||||
0, //biClrUsed
|
||||
0 //biClrImportant
|
||||
};
|
||||
|
||||
unsigned char *buffer;
|
||||
png_bytep row_pointers[height];
|
||||
HBITMAP hBmp = CreateDIBSection(hDC, (BITMAPINFO*) &bmi, DIB_RGB_COLORS, (void**) &buffer, NULL, 0);
|
||||
for(unsigned i=0; i<height; i++)
|
||||
row_pointers[i] = buffer + width*4*(height-i-1);
|
||||
png_read_image(png_ptr, row_pointers);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
|
||||
//Convert from BGRA to pre-multiplied BGRA (PBGRA)
|
||||
//Description here: http://msdn.microsoft.com/en-us/library/ee719797%28VS.85%29.aspx
|
||||
for(unsigned i=0; i<width*height*4; i+=4){
|
||||
unsigned alpha = buffer[i+3];
|
||||
int j;
|
||||
for(j=0; j<3; j++)
|
||||
buffer[i+j] = (char)((unsigned) buffer[i+j]*alpha/255);
|
||||
}
|
||||
|
||||
return hBmp;
|
||||
}
|
78
Tools/FARDive/windows/Startup.cpp
Normal file
|
@ -0,0 +1,78 @@
|
|||
#include "Windows.hpp"
|
||||
#include "GUI.hpp"
|
||||
#include "../libpng-1.5.6/png.h"
|
||||
|
||||
HBITMAP PNGIcon[MENUICONS];
|
||||
|
||||
HINSTANCE hInst;
|
||||
|
||||
HWND hWnd, statusbar;
|
||||
HDC hDC;
|
||||
unsigned int statusbarheight;
|
||||
|
||||
OPENFILENAME ofn;
|
||||
|
||||
wchar_t ArchiveOpenFilter[128] = L"", ArchiveAddFilter[128] = L"", ArchiveSaveFilter[128] = L"";
|
||||
|
||||
HMENU hMenu, listmenu = 0;
|
||||
|
||||
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int){
|
||||
hInst = hInstance;
|
||||
|
||||
WNDCLASS wc = {
|
||||
CS_HREDRAW | CS_VREDRAW, //style
|
||||
WndProc, //lpfnWndProc
|
||||
0, //cbClsExtra
|
||||
0, //cbWndExtra
|
||||
hInst, //hInstance
|
||||
(HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_FARDIVE), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR), //hIcon
|
||||
(HCURSOR) LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE), //hCursor
|
||||
(HBRUSH) (COLOR_MENU+1), //hbrBackground
|
||||
MAKEINTRESOURCE(IDM_FARDIVE), //lpszMenuName
|
||||
L"F" //lpszClassName
|
||||
};
|
||||
RegisterClass(&wc);
|
||||
|
||||
hWnd = CreateWindowEx(WS_EX_ACCEPTFILES | WS_EX_COMPOSITED, L"F", L"FARDive",
|
||||
WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 616, 616, 0, 0, hInst, 0);
|
||||
statusbar = CreateWindowEx(WS_EX_COMPOSITED, L"msctls_statusbar32", NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hWnd, 0, hInst, 0);
|
||||
RECT rect;
|
||||
GetWindowRect(statusbar, &rect);
|
||||
statusbarheight = rect.bottom - rect.top;
|
||||
|
||||
hDC = GetDC(NULL);
|
||||
hMenu = GetMenu(hWnd);
|
||||
|
||||
memset(&ofn, sizeof(ofn), 0x00);
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.nMaxCustFilter = 128;
|
||||
ofn.nMaxFile = 1024;
|
||||
ofn.nMaxFileTitle = 1024;
|
||||
ofn.lpstrDefExt = L"dat";
|
||||
|
||||
MENUITEMINFO mii;
|
||||
mii.cbSize = sizeof(MENUITEMINFO);
|
||||
mii.fMask = MIIM_BITMAP;
|
||||
|
||||
static const short iconmenulist[] = {
|
||||
2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107,
|
||||
2108, 2109, 2200, 2201, 2202, 2203, 2204, 2205,
|
||||
2206, 2207, 2208, 2209, 2210, 2300, 2301, 2302,
|
||||
2303, 2400
|
||||
};
|
||||
|
||||
for(unsigned i=0; i<MENUICONS; i++){
|
||||
int ID = iconmenulist[i];
|
||||
mii.hbmpItem = PNGIcon[i] = ReadPNGIcon(ID);
|
||||
SetMenuItemInfo(hMenu, ID-1000, FALSE, &mii);
|
||||
}
|
||||
|
||||
HACCEL acceltable = LoadAccelerators(hInst, MAKEINTRESOURCE(ID_ACCELERATOR));
|
||||
MSG msg;
|
||||
while(GetMessage(&msg, NULL, 0, 0)){
|
||||
TranslateAccelerator(hWnd, acceltable, &msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
12
Tools/FARDive/windows/Windows.hpp
Normal file
|
@ -0,0 +1,12 @@
|
|||
#define UNICODE
|
||||
#define WINVER 0x0600
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "../FARDive.hpp"
|
||||
#include "resource.hpp"
|
||||
|
||||
#define DefineDialog(x) namespace x {INT_PTR CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);}
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
DefineDialog(AddToArchive);
|
||||
DefineDialog(NewArchive);
|
11
Tools/FARDive/windows/common.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "Windows.hpp"
|
||||
#include "GUI.hpp"
|
||||
|
||||
void CenterDialog(HWND hDlg){
|
||||
RECT parent, child;
|
||||
GetWindowRect(hWnd, &parent);
|
||||
GetWindowRect(hDlg, &child);
|
||||
int x = (parent.right + parent.left - child.right + child.left)/2,
|
||||
y = (parent.bottom + parent.top - child.bottom + child.top)/2;
|
||||
SetWindowPos(hDlg, 0, x, y, 0, 0, SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
|
||||
}
|
101
Tools/FARDive/windows/resource.hpp
Normal file
|
@ -0,0 +1,101 @@
|
|||
#define ID_VERSIONINFO 1
|
||||
#define ID_MANIFEST 1 //Not a typo
|
||||
#define IDI_FARDIVE 2
|
||||
|
||||
#define ID_ACCELERATOR 100
|
||||
#define IDB_INFO 101
|
||||
|
||||
#define IDC_STATIC -1
|
||||
|
||||
#define IDM_FARDIVE 1000
|
||||
#define ID_FILE_NEW 1100
|
||||
#define ID_FILE_OPEN 1101
|
||||
#define ID_FILE_SAVE 1102
|
||||
#define ID_FILE_SAVEAS 1103
|
||||
#define ID_FILE_ADD 1104
|
||||
#define ID_FILE_EXPORTALL 1105
|
||||
#define ID_FILE_EXPORTSELECTED 1106
|
||||
#define ID_FILE_CHANGETYPE 1107
|
||||
#define ID_FILE_CLOSE 1108
|
||||
#define ID_FILE_EXIT 1109
|
||||
#define ID_EDIT_DUPLICATE 1200
|
||||
#define ID_EDIT_REMOVE 1201
|
||||
#define ID_EDIT_RENAME 1202
|
||||
#define ID_EDIT_PROPERTIES 1203
|
||||
#define ID_EDIT_CONTENTS 1204
|
||||
#define ID_EDIT_FIND 1205
|
||||
#define ID_EDIT_FINDNEXT 1206
|
||||
#define ID_EDIT_FINDPREVIOUS 1207
|
||||
#define ID_EDIT_MATCHES 1208
|
||||
#define ID_EDIT_GOTO 1209
|
||||
#define ID_EDIT_PREFERENCES 1210
|
||||
#define ID_TOOLS_RECOMPRESS 1300
|
||||
#define ID_TOOLS_RESORT 1301
|
||||
#define ID_TOOLS_REMOVETRASH 1302
|
||||
#define ID_TOOLS_BATCH 1303
|
||||
#define ID_HELP_WEBSITE 1400
|
||||
#define ID_HELP_ABOUT 1401
|
||||
|
||||
#define MENUICONS 26
|
||||
#define IDI_FILE_NEW 2100
|
||||
#define IDI_FILE_OPEN 2101
|
||||
#define IDI_FILE_SAVE 2102
|
||||
#define IDI_FILE_SAVEAS 2103
|
||||
#define IDI_FILE_ADD 2104
|
||||
#define IDI_FILE_EXPORTALL 2105
|
||||
#define IDI_FILE_EXPORTSELECTED 2106
|
||||
#define IDI_FILE_CHANGETYPE 2107
|
||||
#define IDI_FILE_CLOSE 2108
|
||||
#define IDI_FILE_EXIT 2109
|
||||
#define IDI_EDIT_DUPLICATE 2200
|
||||
#define IDI_EDIT_REMOVE 2201
|
||||
#define IDI_EDIT_RENAME 2202
|
||||
#define IDI_EDIT_PROPERTIES 2203
|
||||
#define IDI_EDIT_CONTENTS 2204
|
||||
#define IDI_EDIT_FIND 2205
|
||||
#define IDI_EDIT_FINDNEXT 2206
|
||||
#define IDI_EDIT_FINDPREVIOUS 2207
|
||||
#define IDI_EDIT_MATCHES 2208
|
||||
#define IDI_EDIT_GOTO 2209
|
||||
#define IDI_EDIT_PREFERENCES 2210
|
||||
#define IDI_TOOLS_RECOMPRESS 2300
|
||||
#define IDI_TOOLS_RESORT 2301
|
||||
#define IDI_TOOLS_REMOVEHOLES 2302
|
||||
#define IDI_TOOLS_BATCH 2303
|
||||
#define IDI_HELP_WEBSITE 2400
|
||||
|
||||
//Right-click menu items
|
||||
#define ID_LISTMENU_ADD 3100
|
||||
#define ID_LISTMENU_EXPORTSELECTED 3101
|
||||
#define ID_LISTMENU_DUPLICATE 3102
|
||||
#define ID_LISTMENU_REMOVE 3103
|
||||
#define ID_LISTMENU_RENAME 3104
|
||||
#define ID_LISTMENU_PROPERTIES 3105
|
||||
#define ID_LISTMENU_CONTENTS 3106
|
||||
|
||||
//Dialogs
|
||||
#define IDD_NEWARCHIVE 3000
|
||||
#define IDD_ADDTOARCHIVE_FAR1 3001
|
||||
#define IDD_ADDTOARCHIVE_FAR3 3002
|
||||
#define IDD_ADDTOARCHIVE_DBPF 3003
|
||||
|
||||
//New Archive
|
||||
#define IDC_NA_TYPETEXT 4000
|
||||
#define IDC_NA_TYPE 4001
|
||||
#define IDC_NA_FARINFO 4002
|
||||
#define IDC_NA_DBPFINFO 4003
|
||||
#define IDC_NA_FARVERSIONTEXT 4004
|
||||
#define IDC_NA_FARVERSION 4005
|
||||
#define IDC_NA_DBPFVERSIONTEXT 4006
|
||||
#define IDC_NA_DBPFVERSION 4007
|
||||
#define IDC_NA_INDEXVERSIONTEXT 4008
|
||||
#define IDC_NA_INDEXVERSION 4009
|
||||
#define IDC_NA_DBPFCOMPRESS 4010
|
||||
|
||||
//Add to Archive
|
||||
#define IDC_A2A_FILE 4000
|
||||
#define IDC_A2A_BROWSE 4001
|
||||
#define IDC_A2A_FILENAME 4002
|
||||
#define IDC_A2A_TYPEID 4003
|
||||
#define IDC_A2A_INSTANCEID 4004
|
||||
#define IDC_A2A_INSTANCEID2 4005
|
169
Tools/FARDive/windows/resource.rc
Normal file
|
@ -0,0 +1,169 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "../version.hpp"
|
||||
#include "resource.hpp"
|
||||
|
||||
ID_MANIFEST RT_MANIFEST "resources/Windows/FARDive.exe.manifest"
|
||||
IDI_FARDIVE ICON "resources/Windows/FARDive.ico"
|
||||
|
||||
ID_VERSIONINFO VERSIONINFO
|
||||
FILEVERSION FD_VERSION_A,FD_VERSION_B,FD_VERSION_C,FD_REVISION
|
||||
PRODUCTVERSION FD_VERSION_A,FD_VERSION_B,FD_VERSION_C,FD_REVISION
|
||||
FILEOS 0x00040000L //Windows 32-bit+
|
||||
FILETYPE 1 //1 is exe, 2 is dll, and so on.
|
||||
//The list can be found at <http://msdn.microsoft.com/en-us/library/aa381058.aspx>
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Written by Fatbag."
|
||||
VALUE "FileDescription", "An interactive file browser for FAR/DBPF"
|
||||
VALUE "FileVersion", FDVERSION
|
||||
VALUE "InternalName", "FARDive"
|
||||
VALUE "LegalCopyright", "X11 license"
|
||||
VALUE "OriginalFilename", "FARDive.exe"
|
||||
VALUE "ProductName", "FARDive"
|
||||
VALUE "ProductVersion", FDVERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
|
||||
IDM_FARDIVE MENUEX
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New...\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
|
||||
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Save &As...", ID_FILE_SAVEAS, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "A&dd to archive...", ID_FILE_ADD, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Export a&ll...", ID_FILE_EXPORTALL, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Export s&elected...", ID_FILE_EXPORTSELECTED, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Change archive &type...", ID_FILE_CHANGETYPE, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Close archive\tCtrl+W", ID_FILE_CLOSE, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "E&xit", ID_FILE_EXIT
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "&Duplicate\tCtrl+D", ID_EDIT_DUPLICATE, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "&Remove\tDel", ID_EDIT_REMOVE, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Re&name", ID_EDIT_RENAME, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "File pr&operties...", ID_EDIT_PROPERTIES, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Change file &contents...", ID_EDIT_CONTENTS, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Find...\tCtrl+F", ID_EDIT_FIND, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Find ne&xt\tF3", ID_EDIT_FINDNEXT, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Find pre&vious\tShift+F3", ID_EDIT_FINDPREVIOUS, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "&Show all matches", ID_EDIT_MATCHES, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "&Go to...\tCtrl+G", ID_EDIT_GOTO, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Preferences...", ID_EDIT_PREFERENCES
|
||||
END
|
||||
POPUP "&Tools"
|
||||
BEGIN
|
||||
MENUITEM "Re&compress...", ID_TOOLS_RECOMPRESS, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Re-&sort files...", ID_TOOLS_RESORT, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "Remove t&rash files...", ID_TOOLS_REMOVETRASH, MFT_STRING,MFS_GRAYED
|
||||
MENUITEM "&Batch processing...", ID_TOOLS_BATCH
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "Visit &Website...", ID_HELP_WEBSITE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About", ID_HELP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
IDI_FILE_NEW RCDATA "resources/icons/document-new.png"
|
||||
IDI_FILE_OPEN RCDATA "resources/icons/document-open.png"
|
||||
IDI_FILE_SAVE RCDATA "resources/icons/document-save.png"
|
||||
IDI_FILE_SAVEAS RCDATA "resources/icons/document-save-as.png"
|
||||
IDI_FILE_ADD RCDATA "resources/icons/list-add.png"
|
||||
IDI_FILE_EXPORTALL RCDATA "resources/icons/package-x-generic.png"
|
||||
IDI_FILE_EXPORTSELECTED RCDATA "resources/icons/package-x-generic-selected.png"
|
||||
IDI_FILE_CHANGETYPE RCDATA "resources/icons/applications-other.png"
|
||||
IDI_FILE_CLOSE RCDATA "resources/icons/emblem-unreadable.png"
|
||||
IDI_FILE_EXIT RCDATA "resources/icons/system-log-out.png"
|
||||
IDI_EDIT_DUPLICATE RCDATA "resources/icons/edit-copy.png"
|
||||
IDI_EDIT_REMOVE RCDATA "resources/icons/list-remove.png"
|
||||
IDI_EDIT_RENAME RCDATA "resources/icons/edit-select-all.png"
|
||||
IDI_EDIT_PROPERTIES RCDATA "resources/icons/document-properties.png"
|
||||
IDI_EDIT_CONTENTS RCDATA "resources/icons/accessories-text-editor.png"
|
||||
IDI_EDIT_FIND RCDATA "resources/icons/edit-find.png"
|
||||
IDI_EDIT_FINDNEXT RCDATA "resources/icons/go-last.png"
|
||||
IDI_EDIT_FINDPREVIOUS RCDATA "resources/icons/go-first.png"
|
||||
IDI_EDIT_MATCHES RCDATA "resources/icons/preferences-system-windows.png"
|
||||
IDI_EDIT_GOTO RCDATA "resources/icons/go-jump.png"
|
||||
IDI_EDIT_PREFERENCES RCDATA "resources/icons/preferences-desktop.png"
|
||||
IDI_TOOLS_RECOMPRESS RCDATA "resources/icons/system-file-manager.png"
|
||||
IDI_TOOLS_RESORT RCDATA "resources/icons/mail-send-receive.png"
|
||||
IDI_TOOLS_REMOVEHOLES RCDATA "resources/icons/edit-clear.png"
|
||||
IDI_TOOLS_BATCH RCDATA "resources/icons/utilities-terminal.png"
|
||||
IDI_HELP_WEBSITE RCDATA "resources/icons/internet-web-browser.png"
|
||||
|
||||
IDB_INFO BITMAP "resources/icons/info.bmp"
|
||||
|
||||
ID_ACCELERATOR ACCELERATORS
|
||||
BEGIN
|
||||
"^N", ID_FILE_NEW, ASCII
|
||||
"^O", ID_FILE_OPEN, ASCII
|
||||
"^S", ID_FILE_SAVE, ASCII
|
||||
"^W", ID_FILE_CLOSE, ASCII
|
||||
|
||||
"^D", ID_EDIT_DUPLICATE, ASCII
|
||||
"^F", ID_EDIT_FIND, ASCII
|
||||
VK_F3, ID_EDIT_FINDNEXT, VIRTKEY
|
||||
VK_F3, ID_EDIT_FINDPREVIOUS, SHIFT, VIRTKEY
|
||||
"^G", ID_EDIT_GOTO, ASCII
|
||||
END
|
||||
|
||||
IDD_NEWARCHIVE DIALOGEX 0, 0, 200, 161
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "New archive"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "",IDC_STATIC,-2,-2,204,27,SS_WHITERECT | WS_BORDER
|
||||
RTEXT "Archive type:",IDC_NA_TYPETEXT,12,9,80,8
|
||||
COMBOBOX IDC_NA_TYPE,108,7,50,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
GROUPBOX "FAR options",IDC_STATIC,7,33,186,30
|
||||
RTEXT "Version:",IDC_NA_FARVERSIONTEXT,12,44,80,8
|
||||
COMBOBOX IDC_NA_FARVERSION,108,43,50,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL IDB_INFO,IDC_NA_FARINFO,"STATIC",SS_BITMAP | SS_NOTIFY | SS_REALSIZEIMAGE,164,44,11,10
|
||||
GROUPBOX "DBPF options",IDC_STATIC,7,71,186,62
|
||||
RTEXT "Archive Version:",IDC_NA_DBPFVERSIONTEXT,12,83,80,8
|
||||
COMBOBOX IDC_NA_DBPFVERSION,108,81,50,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
RTEXT "Index Version:",IDC_NA_INDEXVERSIONTEXT,12,103,80,8
|
||||
COMBOBOX IDC_NA_INDEXVERSION,108,101,50,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL IDB_INFO,IDC_NA_DBPFINFO,"STATIC",SS_BITMAP | SS_NOTIFY | SS_REALSIZEIMAGE,164,92,11,10
|
||||
CHECKBOX "Use QFS compression",IDC_NA_DBPFCOMPRESS,12,118,100,10,BS_AUTOCHECKBOX | WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,34,140,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,116,140,50,14
|
||||
END
|
||||
|
||||
IDD_ADDTOARCHIVE_FAR1 DIALOGEX 0, 0, 200, 149
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Add to archive"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Source",IDC_STATIC,7,7,186,30
|
||||
CTEXT "File:",IDC_STATIC,12,18,30,8
|
||||
EDITTEXT IDC_A2A_FILE,44,16,90,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Browse...",IDC_A2A_BROWSE,138,16,50,14
|
||||
GROUPBOX "Attributes",IDC_STATIC,7,44,186,58
|
||||
CTEXT "File name:",IDC_STATIC,12,54,80,8
|
||||
EDITTEXT IDC_A2A_FILENAME,96,52,92,14,ES_AUTOHSCROLL
|
||||
CTEXT "Type ID:",IDC_STATIC,12,70,80,8
|
||||
EDITTEXT IDC_A2A_TYPEID,96,68,92,14,ES_AUTOHSCROLL
|
||||
CTEXT "Instance ID:",IDC_STATIC,12,86,80,8
|
||||
EDITTEXT IDC_A2A_INSTANCEID,96,84,92,14,ES_AUTOHSCROLL
|
||||
DEFPUSHBUTTON "OK",IDOK,34,128,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,116,128,50,14
|
||||
END
|