summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorleo2002-10-10 20:39:12 +0000
committerleo2002-10-10 20:39:12 +0000
commit89a11141852de0a6c66a8065faf6454fb7d382be (patch)
tree840eb5b4bd2786bb8f258692897a23fb2ee5c341 /win
parentd82784547a0f37e21c3b6e4a402009655fc531bf (diff)
Added functions to manage textures.
git-svn-id: http://svn.leocad.org/trunk@301 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win')
-rw-r--r--win/LeoCAD.dsp279
-rw-r--r--win/LeoCAD.rc41
-rw-r--r--win/Libdlg.cpp11
-rw-r--r--win/resource.h12
-rw-r--r--win/texdlg.cpp116
-rw-r--r--win/texdlg.h50
6 files changed, 234 insertions, 275 deletions
diff --git a/win/LeoCAD.dsp b/win/LeoCAD.dsp
index a86782a..803a425 100644
--- a/win/LeoCAD.dsp
+++ b/win/LeoCAD.dsp
@@ -1,5 +1,5 @@
# Microsoft Developer Studio Project File - Name="LeoCAD" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# Microsoft Developer Studio Generated Build File, Format Version 60000
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
@@ -25,7 +25,7 @@ CFG=LeoCAD - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=snCl.exe
MTL=midl.exe
RSC=rc.exe
@@ -51,7 +51,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=snLink.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 vfw32.lib jpeglib.lib 3dsftk.lib libpng.lib zlib.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libc.lib" /libpath:"./jpeglib/release" /libpath:"./3dsftk/release" /libpath:"./libpng/release" /libpath:"./zlib/release"
@@ -77,7 +77,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=link.exe
+LINK32=snLink.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 vfw32.lib jpeglib.lib 3dsftk.lib libpng.lib zlib.lib gdi32.lib /nologo /subsystem:windows /map /debug /machine:I386 /nodefaultlib:"libcd.lib" /libpath:"./jpeglib/debug" /libpath:"./3dsftk/debug" /libpath:"./libpng/debug" /libpath:"./zlib/debug"
# SUBTRACT LINK32 /pdb:none
@@ -235,10 +235,6 @@ SOURCE=.\Piececmb.cpp
# End Source File
# Begin Source File
-SOURCE=.\Piecelst.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\Pieceprv.cpp
# End Source File
# Begin Source File
@@ -324,6 +320,10 @@ SOURCE=.\Terrwnd.cpp
# End Source File
# Begin Source File
+SOURCE=.\texdlg.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Titletip.cpp
# End Source File
# Begin Source File
@@ -548,6 +548,10 @@ SOURCE=.\Terrwnd.h
# End Source File
# Begin Source File
+SOURCE=.\texdlg.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Titletip.h
# End Source File
# Begin Source File
@@ -1101,17 +1105,7 @@ SOURCE=..\common\view.h
# Begin Source File
SOURCE=..\Common\camera.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1129,160 +1123,56 @@ SOURCE=..\common\console.cpp
# Begin Source File
SOURCE=..\common\curve.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\file.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\globals.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\group.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\im_bmp.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\im_gif.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# ADD CPP /I "./jpeglib"
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\im_jpg.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# ADD CPP /I "./jpeglib"
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\im_png.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# ADD CPP /I "./libpng" /I "./zlib"
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# ADD CPP /I "./libpng" /I "./zlib"
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\image.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# ADD CPP /I "./jpeglib"
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# ADD CPP /I "./jpeglib"
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\library.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1292,77 +1182,27 @@ SOURCE=..\Common\light.cpp
# Begin Source File
SOURCE=..\common\mainwnd.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\matrix.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\message.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\minifig.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\object.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1382,26 +1222,19 @@ SOURCE=..\common\opengl.cpp
# Begin Source File
SOURCE=..\Common\piece.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
+SOURCE=..\Common\pieceinf.cpp
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
-SOURCE=..\Common\pieceinf.cpp
+SOURCE=..\common\piecelst.cpp
!IF "$(CFG)" == "LeoCAD - Win32 Release"
-# SUBTRACT CPP /YX /Yc /Yu
-
!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
# SUBTRACT CPP /YX /Yc /Yu
@@ -1412,62 +1245,22 @@ SOURCE=..\Common\pieceinf.cpp
# Begin Source File
SOURCE=..\Common\project.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\quant.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\str.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\terrain.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
@@ -1485,62 +1278,22 @@ SOURCE=..\common\texfont.cpp
# Begin Source File
SOURCE=..\Common\texture.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\Tr.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\Common\vector.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# Begin Source File
SOURCE=..\common\view.cpp
-
-!IF "$(CFG)" == "LeoCAD - Win32 Release"
-
-# SUBTRACT CPP /YX /Yc /Yu
-
-!ELSEIF "$(CFG)" == "LeoCAD - Win32 Debug"
-
# SUBTRACT CPP /YX /Yc /Yu
-
-!ENDIF
-
# End Source File
# End Group
# Begin Source File
diff --git a/win/LeoCAD.rc b/win/LeoCAD.rc
index 00c425a..841f054 100644
--- a/win/LeoCAD.rc
+++ b/win/LeoCAD.rc
@@ -204,6 +204,7 @@ BEGIN
BUTTON ID_TERDLG_FILE_OPEN
BUTTON ID_TERDLG_FILE_SAVE
SEPARATOR
+ BUTTON ID_TERDLG_EDIT_SELECT
BUTTON ID_TERDLG_EDIT_ZOOM
BUTTON ID_TERDLG_EDIT_PAN
BUTTON ID_TERDLG_EDIT_ROTATE
@@ -248,7 +249,7 @@ BEGIN
END
MENUITEM SEPARATOR
MENUITEM "Propert&ies...", ID_FILE_PROPERTIES
- MENUITEM "Piece &Library Manager...", ID_FILE_EDITPIECELIBRARY
+ MENUITEM "Pieces &Library Manager...", ID_FILE_EDITPIECELIBRARY
MENUITEM "Terrain &Editor...", ID_FILE_TERRAINEDITOR
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
@@ -519,6 +520,7 @@ BEGIN
MENUITEM "&Print Catalog...", ID_LIBDLG_FILE_PRINTCATALOG
MENUITEM "Load &Update...", ID_LIBDLG_FILE_MERGEUPDATE
MENUITEM "&Import Piece...", ID_FILE_IMPORTPIECE
+ MENUITEM "Te&xtures...", ID_LIBDLG_FILE_TEXTURES
MENUITEM SEPARATOR
MENUITEM "Re&turn", IDOK
MENUITEM "&Cancel", IDCANCEL
@@ -558,6 +560,7 @@ BEGIN
MENUITEM "&Random", ID_TERDLG_EDIT_RANDOM
MENUITEM "Reset &Camera", ID_TERDLG_EDIT_RESETCAMERA
MENUITEM SEPARATOR
+ MENUITEM "&Select", ID_TERDLG_EDIT_SELECT
MENUITEM "&Zoom", ID_TERDLG_EDIT_ZOOM
MENUITEM "&Pan", ID_TERDLG_EDIT_PAN
MENUITEM "Ro&tate", ID_TERDLG_EDIT_ROTATE
@@ -1380,6 +1383,19 @@ BEGIN
PUSHBUTTON "New",IDC_EDITGRP_NEWGROUP,7,136,41,14
END
+IDD_LIBRARY_TEXTURES DIALOG DISCARDABLE 0, 0, 226, 201
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "LeoCAD Pieces Library Textures"
+FONT 8, "MS Sans Serif"
+BEGIN
+ LISTBOX ID_LIBTEX_LIST,7,7,152,187,LBS_SORT |
+ LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL |
+ WS_TABSTOP
+ DEFPUSHBUTTON "Close",IDOK,169,7,50,14
+ PUSHBUTTON "Add...",ID_LIBTEX_ADD,169,24,50,14
+ PUSHBUTTON "Remove",ID_LIBTEX_REMOVE,169,41,50,14
+END
+
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
@@ -1626,6 +1642,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 150
END
+
+ IDD_LIBRARY_TEXTURES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 219
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 194
+ END
END
#endif // APSTUDIO_INVOKED
@@ -1694,18 +1718,18 @@ END
STRINGTABLE DISCARDABLE
BEGIN
- ID_FILE_NEW "Create a new document\nNew"
- ID_FILE_OPEN "Open an existing document\nOpen"
+ ID_FILE_NEW "Create a new project\nNew"
+ ID_FILE_OPEN "Open an existing project\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
- ID_FILE_SAVE "Save the active document\nSave"
- ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
+ ID_FILE_SAVE "Save the active project\nSave"
+ ID_FILE_SAVE_AS "Save the active project with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
- ID_FILE_PRINT "Print the active document\nPrint"
+ ID_FILE_PRINT "Print the active project\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
ID_FILE_UPDATE "Update the container to show any changes\nUpdate"
ID_FILE_SAVE_COPY_AS "Save a copy of the active document with a new name\nSave Copy"
- ID_FILE_SEND_MAIL "Send the active document through electronic mail\nSend Mail"
+ ID_FILE_SEND_MAIL "Send the active project through electronic mail\nSend Mail"
END
STRINGTABLE DISCARDABLE
@@ -1806,6 +1830,7 @@ BEGIN
ID_SNAP_SNAPZ "Snap Z Toggle"
ID_SNAP_SNAPALL "Snap Toggle"
ID_SNAP_SNAPNONE "Snap Toggle"
+ ID_FILE_SAVEPICTURE "Save a picture"
END
STRINGTABLE DISCARDABLE
@@ -1918,6 +1943,7 @@ BEGIN
ID_EDIT_SELECTNONE "De-select everything"
ID_EDIT_SELECTINVERT "Invert the current selection set"
ID_EDIT_SELECTBYNAME "Select objects by name"
+ ID_FILE_MERGE "Merge the contents of another project with the current one\nMerge"
ID_VIEW_FULLSCREEN "Toggle fullscreen mode\nFullscreen"
ID_VIEW_STEP_NEXT "Advance one step or frame\nGo Foward"
ID_VIEW_STEP_PREVIOUS "Go back one step or frame\nGo Back"
@@ -1943,6 +1969,7 @@ END
STRINGTABLE DISCARDABLE
BEGIN
+ ID_FILE_EDITPIECELIBRARY "Configure the LeoCAD Pieces Library"
ID_VIEW_ZOOMIN "Zoom In"
ID_VIEW_ZOOMOUT "Zoom Out"
ID_PIECE_EDITGROUPS "Edit groups"
diff --git a/win/Libdlg.cpp b/win/Libdlg.cpp
index 107d0a4..68fa91c 100644
--- a/win/Libdlg.cpp
+++ b/win/Libdlg.cpp
@@ -7,6 +7,7 @@
#include "GroupDlg.h"
#include "Print.h"
#include "Tools.h"
+#include "texdlg.h"
#include "ProgDlg.h"
#include "project.h"
#include "pieceinf.h"
@@ -293,7 +294,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
if (filedlg.DoModal() != IDOK)
return TRUE;
- LoadUpdate(filedlg.GetPathName());
+ project->GetPiecesLibrary ()->LoadUpdate(filedlg.GetPathName());
// update m_Parts
UpdateList();
@@ -342,6 +343,12 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
return TRUE;
}
+ case ID_LIBDLG_FILE_TEXTURES:
+ {
+ CTexturesDlg dlg;
+ dlg.DoModal();
+ } break;
+
case ID_LIBDLG_GROUP_INSERT:
{
HTREEITEM hti = m_Tree.GetSelectedItem();
@@ -620,7 +627,7 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam)
sel++;
}
- DeletePiece(names, sel);
+ project->GetPiecesLibrary ()->DeletePiece(names, sel);
free(names);
CString str = project->GetPiecesLibrary ()->GetLibraryPath();
diff --git a/win/resource.h b/win/resource.h
index 287b70a..8c84f02 100644
--- a/win/resource.h
+++ b/win/resource.h
@@ -133,6 +133,7 @@
#define IDD_TERRAIN_OPTIONS 218
#define IDR_PREVIEW 221
#define IDD_EDIT_GROUPS 231
+#define IDD_LIBRARY_TEXTURES 234
#define IDC_SELDLG_LIST 1000
#define IDC_SELDLG_ALL 1001
#define IDC_SELDLG_NONE 1002
@@ -398,9 +399,12 @@
#define IDC_HTMLDLG_HTMLEXT 1223
#define IDC_MF_ARMRANGLE 1224
#define IDC_MF_HANDLANGLE 1225
+#define ID_LIBTEX_ADD 1225
#define IDC_MF_HANDRANGLE 1226
+#define ID_LIBTEX_REMOVE 1226
#define IDC_MF_TOOLLANGLE 1227
#define IDC_MF_TOOLRANGLE 1228
+#define ID_LIBTEX_LIST 1228
#define IDC_MF_LEGLANGLE 1229
#define IDC_MF_LEGRANGLE 1230
#define IDC_MF_SHOELANGLE 1231
@@ -611,6 +615,7 @@
#define ID_TERDLG_FILE_OPEN 33114
#define ID_TERDLG_FILE_SAVE 33115
#define ID_TERDLG_EDIT_PREFERENCES 33116
+#define ID_TERDLG_EDIT_SELECT 33119
#define ID_TERDLG_EDIT_ZOOM 33120
#define ID_TERDLG_EDIT_PAN 33121
#define ID_TERDLG_EDIT_ROTATE 33122
@@ -638,6 +643,7 @@
#define ID_FILE_IMPORTPIECE 33152
#define ID_VIEW_NEWVIEW 33153
#define ID_VIEW_STEP_DELETE 33154
+#define ID_LIBDLG_FILE_TEXTURES 33157
#define ID_VIEW_PIECES_BAR 59425
#define ID_VIEW_TOOLS_BAR 59426
#define ID_VIEW_ANIMATION_BAR 59427
@@ -648,9 +654,9 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 234
-#define _APS_NEXT_COMMAND_VALUE 33155
-#define _APS_NEXT_CONTROL_VALUE 1225
+#define _APS_NEXT_RESOURCE_VALUE 235
+#define _APS_NEXT_COMMAND_VALUE 33158
+#define _APS_NEXT_CONTROL_VALUE 1229
#define _APS_NEXT_SYMED_VALUE 121
#endif
#endif
diff --git a/win/texdlg.cpp b/win/texdlg.cpp
new file mode 100644
index 0000000..49b13dc
--- /dev/null
+++ b/win/texdlg.cpp
@@ -0,0 +1,116 @@
+// texdlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "leocad.h"
+#include "texdlg.h"
+#include "library.h"
+#include "project.h"
+#include "globals.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CTexturesDlg dialog
+
+
+CTexturesDlg::CTexturesDlg(CWnd* pParent /*=NULL*/)
+ : CDialog(CTexturesDlg::IDD, pParent)
+{
+ //{{AFX_DATA_INIT(CTexturesDlg)
+ // NOTE: the ClassWizard will add member initialization here
+ //}}AFX_DATA_INIT
+}
+
+
+void CTexturesDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(CTexturesDlg)
+ DDX_Control(pDX, ID_LIBTEX_LIST, m_List);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CTexturesDlg, CDialog)
+ //{{AFX_MSG_MAP(CTexturesDlg)
+ ON_BN_CLICKED(ID_LIBTEX_ADD, OnLibtexAdd)
+ ON_BN_CLICKED(ID_LIBTEX_REMOVE, OnLibtexRemove)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CTexturesDlg message handlers
+
+BOOL CTexturesDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ UpdateList();
+
+ return TRUE;
+}
+
+void CTexturesDlg::OnOK()
+{
+ CDialog::OnOK();
+}
+
+void CTexturesDlg::OnLibtexAdd()
+{
+ CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
+ "All Image Files|*.bmp;*.gif;*.jpg;*.png|JPEG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif|BMP Files (*.bmp)|*.bmp|PNG Files (*.png)|*.png|All Files (*.*)|*.*||", this);
+
+ if (dlg.DoModal() == IDOK)
+ {
+ project->GetPiecesLibrary ()->ImportTexture (dlg.GetPathName());
+ UpdateList();
+ }
+}
+
+void CTexturesDlg::OnLibtexRemove()
+{
+ int i, selected = 0;
+
+ for (i = 0; i < m_List.GetCount(); i++)
+ if (m_List.GetSel(i))
+ selected++;
+
+ // Nothing to be done
+ if (selected == 0)
+ return;
+
+ char** names = (char**)malloc(selected*sizeof(char**));
+
+ for (selected = 0, i = 0; i < m_List.GetCount(); i++)
+ {
+ if (m_List.GetSel(i))
+ {
+ names[selected] = (char*)m_List.GetItemDataPtr (i);;
+ selected++;
+ }
+ }
+
+ project->GetPiecesLibrary ()->DeleteTextures (names, selected);
+
+ free (names);
+
+ UpdateList();
+}
+
+void CTexturesDlg::UpdateList()
+{
+ PiecesLibrary *pLib = project->GetPiecesLibrary ();
+
+ m_List.ResetContent ();
+
+ for (int i = 0; i < pLib->GetTextureCount (); i++)
+ {
+ int index = m_List.AddString (pLib->GetTexture(i)->m_strName);
+ m_List.SetItemDataPtr (index, pLib->GetTexture(i)->m_strName);
+ }
+}
diff --git a/win/texdlg.h b/win/texdlg.h
new file mode 100644
index 0000000..b0620bb
--- /dev/null
+++ b/win/texdlg.h
@@ -0,0 +1,50 @@
+#if !defined(AFX_TEXDLG_H__01AFB4FD_6C04_41FB_8FF6_CC87EAF49D31__INCLUDED_)
+#define AFX_TEXDLG_H__01AFB4FD_6C04_41FB_8FF6_CC87EAF49D31__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// texdlg.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CTexturesDlg dialog
+
+class CTexturesDlg : public CDialog
+{
+// Construction
+public:
+ CTexturesDlg(CWnd* pParent = NULL); // standard constructor
+
+// Dialog Data
+ //{{AFX_DATA(CTexturesDlg)
+ enum { IDD = IDD_LIBRARY_TEXTURES };
+ CListBox m_List;
+ //}}AFX_DATA
+
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CTexturesDlg)
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ void UpdateList();
+
+ // Generated message map functions
+ //{{AFX_MSG(CTexturesDlg)
+ virtual void OnOK();
+ afx_msg void OnLibtexAdd();
+ afx_msg void OnLibtexRemove();
+ virtual BOOL OnInitDialog();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_TEXDLG_H__01AFB4FD_6C04_41FB_8FF6_CC87EAF49D31__INCLUDED_)