updated resources convertor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -60,4 +60,5 @@ AC_OUTPUT([
|
|||||||
utils/Makefile
|
utils/Makefile
|
||||||
utils/wxrc/Makefile
|
utils/wxrc/Makefile
|
||||||
utils/wxrcedit/Makefile
|
utils/wxrcedit/Makefile
|
||||||
|
utils/convertrc/Makefile
|
||||||
])
|
])
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
CONTRIB_UTILS=wxrc wxrcedit
|
CONTRIB_UTILS=wxrc wxrcedit convertrc
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@for d in $(CONTRIB_UTILS); do (cd $$d && $(MAKE)); done
|
@for d in $(CONTRIB_UTILS); do (cd $$d && $(MAKE)); done
|
||||||
|
307
contrib/utils/convertrc/ConvertVC.dsp
Normal file
307
contrib/utils/convertrc/ConvertVC.dsp
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
# Microsoft Developer Studio Project File - Name="ConvertVC" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||||
|
|
||||||
|
CFG=ConvertVC - Win32 Debug
|
||||||
|
!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 "ConvertVC.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 "ConvertVC.mak" CFG="ConvertVC - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "ConvertVC - Win32 Release" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "ConvertVC - Win32 Debug" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "ConvertVC - Win32 Debug DLL" (based on "Win32 (x86) Application")
|
||||||
|
!MESSAGE "ConvertVC - Win32 Release DLL" (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
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "ConvertVC - Win32 Release"
|
||||||
|
|
||||||
|
# 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" /YX /FD /c
|
||||||
|
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c
|
||||||
|
# SUBTRACT CPP /YX
|
||||||
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x809 /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 wsock32.lib winmm.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 rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/wxconvert.exe"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
|
# PROP BASE Output_Dir "Debug"
|
||||||
|
# PROP BASE Intermediate_Dir "Debug"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 1
|
||||||
|
# PROP Output_Dir "Debug"
|
||||||
|
# PROP Intermediate_Dir "Debug"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||||
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c
|
||||||
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||||
|
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||||
|
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 wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||||
|
# 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 rpcrt4.lib wsock32.lib winmm.lib wxd.lib xpmd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/wxconvert.exe" /pdbtype:sept
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug DLL"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
|
# PROP BASE Output_Dir "DebugDLL"
|
||||||
|
# PROP BASE Intermediate_Dir "DebugDLL"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 1
|
||||||
|
# PROP Output_Dir "DebugDLL"
|
||||||
|
# PROP Intermediate_Dir "DebugDLL"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||||
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /YX"wxprec.h" /FD /c
|
||||||
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||||
|
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||||
|
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 wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||||
|
# 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 rpcrt4.lib wsock32.lib winmm.lib wxdlld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/wxconvert.exe" /pdbtype:sept
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Release DLL"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
|
# PROP BASE Output_Dir "ReleaseDLL"
|
||||||
|
# PROP BASE Intermediate_Dir "ReleaseDLL"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 0
|
||||||
|
# PROP Output_Dir "ReleaseDLL"
|
||||||
|
# PROP Intermediate_Dir "ReleaseDLL"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||||
|
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /FD /c
|
||||||
|
# SUBTRACT CPP /YX
|
||||||
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||||
|
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x809 /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 wsock32.lib winmm.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 rpcrt4.lib wsock32.lib winmm.lib wxdll.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/wxconvert.exe"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "ConvertVC - Win32 Release"
|
||||||
|
# Name "ConvertVC - Win32 Debug"
|
||||||
|
# Name "ConvertVC - Win32 Debug DLL"
|
||||||
|
# Name "ConvertVC - Win32 Release DLL"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\blank.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\bullseye.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\convert.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\convert.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\error.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\hand.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\info.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\magnif1.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\noentry.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\pbrush.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\pencil.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\pntleft.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\pntright.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\query.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\question.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\rc2wxr.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "ConvertVC - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug"
|
||||||
|
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug DLL"
|
||||||
|
|
||||||
|
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Release DLL"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\rc2wxr.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\rc2xml.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "ConvertVC - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug"
|
||||||
|
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug DLL"
|
||||||
|
|
||||||
|
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Release DLL"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\rc2xml.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\roller.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\size.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\tip.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\warning.ico
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wx\msw\watch1.cur
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wxconvert.rc
|
||||||
|
# ADD BASE RSC /l 0x809
|
||||||
|
# ADD RSC /l 0x809
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wxr2xml.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "ConvertVC - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug"
|
||||||
|
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Debug DLL"
|
||||||
|
|
||||||
|
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||||
|
# SUBTRACT CPP /YX /Yc /Yu
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "ConvertVC - Win32 Release DLL"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\wxr2xml.h
|
||||||
|
# End Source File
|
||||||
|
# End Target
|
||||||
|
# End Project
|
11
contrib/utils/convertrc/Makefile.in
Normal file
11
contrib/utils/convertrc/Makefile.in
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# $Id$
|
||||||
|
|
||||||
|
top_srcdir = @top_srcdir@/..
|
||||||
|
top_builddir = ../../..
|
||||||
|
program_dir = contrib/utils/convertrc
|
||||||
|
|
||||||
|
PROGRAM=convert
|
||||||
|
|
||||||
|
OBJECTS=convert.o rc2xml.o rc2wxr.o wxr2xml.o
|
||||||
|
|
||||||
|
include $(top_builddir)/src/makeprog.env
|
222
contrib/utils/convertrc/convert.cpp
Normal file
222
contrib/utils/convertrc/convert.cpp
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
//wxConvertApp Programming Utility
|
||||||
|
/*This program currently offers 3 useful conversions
|
||||||
|
1. Converts most of an .RC file into a wxXml file
|
||||||
|
2. Converts most of an .wxr file into a wxXml file
|
||||||
|
3. Converts portions of an .RC file into a wxr file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "convert.cpp"
|
||||||
|
#pragma interface "convert.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
|
#include <wx/wxprec.h>
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// for all others, include the necessary headers (this file is usually all you
|
||||||
|
// need because it includes almost all "standard" wxWindows headers
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include <wx/wx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <wx/image.h>
|
||||||
|
#include "wx/resource.h"
|
||||||
|
|
||||||
|
#include "convert.h"
|
||||||
|
#include "rc2wxr.h"
|
||||||
|
#include "wxr2xml.h"
|
||||||
|
#include "rc2xml.h"
|
||||||
|
|
||||||
|
IMPLEMENT_APP(wxConvertApp)
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
wxConvertApp::wxConvertApp()
|
||||||
|
{
|
||||||
|
m_pFrame=NULL;
|
||||||
|
m_pMenuBar=NULL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
wxConvertApp::~wxConvertApp()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool wxConvertApp::OnInit()
|
||||||
|
{
|
||||||
|
//Initialize all image loaders(JPEG,BMP,PNG,and etc)
|
||||||
|
wxInitAllImageHandlers();
|
||||||
|
SetAppName("wxConvertApp");
|
||||||
|
|
||||||
|
if (HandleCommandLine())
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
// Create the main frame window
|
||||||
|
m_pFrame = new wxMainFrame(NULL, -1, "wxConvertApp", wxPoint(0, 0), wxSize(500, 400),
|
||||||
|
wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL);
|
||||||
|
|
||||||
|
InitMenu();
|
||||||
|
m_pFrame->Show(TRUE);
|
||||||
|
SetTopWindow(m_pFrame);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxConvertApp::InitMenu()
|
||||||
|
{
|
||||||
|
m_pMenuBar=new wxMenuBar;
|
||||||
|
wxASSERT(m_pMenuBar);
|
||||||
|
|
||||||
|
wxMenu *filemenu=new wxMenu;
|
||||||
|
filemenu->Append(ID_RC2WXR,"Convert RC file to WXR file");
|
||||||
|
filemenu->Append(ID_WXR2XML,"Convert WXR file to XML file");
|
||||||
|
filemenu->Append(ID_RC2XML,"Convert RC file to XML file");
|
||||||
|
|
||||||
|
filemenu->Append(ID_QUIT, "E&xit");
|
||||||
|
m_pMenuBar->Append(filemenu,"&File");
|
||||||
|
|
||||||
|
m_pFrame->SetMenuBar(m_pMenuBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// MainFrame.cpp: implementation of the wxMainFrame class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(wxMainFrame, wxFrame)
|
||||||
|
EVT_MENU(ID_QUIT,wxMainFrame::OnQuit)
|
||||||
|
EVT_MENU(ID_RC2WXR,wxMainFrame::OnRc2Wxr)
|
||||||
|
EVT_MENU(ID_WXR2XML,wxMainFrame::OnWXR2XML)
|
||||||
|
EVT_MENU(ID_RC2XML,wxMainFrame::OnRC2XML)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
wxMainFrame::wxMainFrame(wxWindow* parent,wxWindowID id,
|
||||||
|
const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||||
|
long style, const wxString& name)
|
||||||
|
:wxFrame(parent,id,title,pos,size,style,name)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMainFrame::~wxMainFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void wxMainFrame::OnQuit()
|
||||||
|
{
|
||||||
|
Close(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxMainFrame::OnRc2Wxr()
|
||||||
|
{
|
||||||
|
wxFileDialog filed(this);
|
||||||
|
filed.SetWildcard("*.rc");
|
||||||
|
filed.SetStyle(wxOPEN);
|
||||||
|
|
||||||
|
if (filed.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxFileDialog wxrfile(this,"Enter Desired WXR file name");
|
||||||
|
wxrfile.SetWildcard("*.wxr");
|
||||||
|
wxrfile.SetStyle(wxOPEN);
|
||||||
|
wxrfile.SetFilename("resource.wxr");
|
||||||
|
|
||||||
|
if (wxrfile.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc2wxr convert;
|
||||||
|
convert.Convert(wxrfile.GetPath(),filed.GetPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMainFrame::OnWXR2XML()
|
||||||
|
{
|
||||||
|
wxFileDialog f(this);
|
||||||
|
f.SetWildcard("*.wxr");
|
||||||
|
if (f.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
wxFileDialog xmlfile(this,"Enter Desired XML file name");
|
||||||
|
xmlfile.SetWildcard("*.xml");
|
||||||
|
xmlfile.SetStyle(wxOPEN);
|
||||||
|
xmlfile.SetFilename("resource.xml");
|
||||||
|
|
||||||
|
if (xmlfile.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxr2xml XMLCon;
|
||||||
|
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMainFrame::OnRC2XML()
|
||||||
|
{
|
||||||
|
wxFileDialog f(this);
|
||||||
|
f.SetWildcard("*.rc");
|
||||||
|
if (f.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wxFileDialog xmlfile(this,"Enter Desired XML file name");
|
||||||
|
xmlfile.SetWildcard("*.xml");
|
||||||
|
xmlfile.SetStyle(wxOPEN);
|
||||||
|
xmlfile.SetFilename("resource.xml");
|
||||||
|
|
||||||
|
if (xmlfile.ShowModal()!=wxID_OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rc2xml XMLCon;
|
||||||
|
XMLCon.Convert(f.GetPath(),xmlfile.GetPath());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxConvertApp::HandleCommandLine()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (argc != 2)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
//Figure out kind of conversion
|
||||||
|
wxString source,target;
|
||||||
|
wxr2xml trans_wxr2xml;
|
||||||
|
rc2xml trans_rc2xml;
|
||||||
|
rc2wxr trans_rc2wxr;
|
||||||
|
|
||||||
|
source=argv[1];
|
||||||
|
target=argv[2];
|
||||||
|
|
||||||
|
|
||||||
|
if ((source.Find(".wxr")>0)&&(target.Find(".xml")>0))
|
||||||
|
{
|
||||||
|
trans_wxr2xml.Convert(source,target);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else if ((source.Find(".rc")!=-1)&(target.Find(".wxr")!=-1))
|
||||||
|
{
|
||||||
|
trans_rc2wxr.Convert(source,target);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else if ((source.Find(".rc")!=-1)&(target.Find(".xml")!=-1))
|
||||||
|
{
|
||||||
|
trans_rc2xml.Convert(source,target);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
50
contrib/utils/convertrc/convert.h
Normal file
50
contrib/utils/convertrc/convert.h
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
// MainFrame.h: interface for the wxMainFrame class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if !defined(MAINFRAME_H)
|
||||||
|
#define MAINFRAME_H
|
||||||
|
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define ID_QUIT 1002
|
||||||
|
#define ID_ABOUT 1003
|
||||||
|
#define ID_RC2WXR 1005
|
||||||
|
#define ID_WXR2XML 1006
|
||||||
|
#define ID_RC2XML 1007
|
||||||
|
|
||||||
|
class wxMainFrame:public wxFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void OnRC2XML();
|
||||||
|
void OnWXR2XML();
|
||||||
|
void OnRc2Wxr();
|
||||||
|
void OnQuit();
|
||||||
|
wxMainFrame(wxWindow* parent, wxWindowID id,
|
||||||
|
const wxString& title, const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = "frame");
|
||||||
|
virtual ~wxMainFrame();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
class wxConvertApp : public wxApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool HandleCommandLine();
|
||||||
|
void InitMenu();
|
||||||
|
bool OnInit(void);
|
||||||
|
wxConvertApp();
|
||||||
|
virtual ~wxConvertApp();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxMenuBar * m_pMenuBar;
|
||||||
|
wxMainFrame *m_pFrame;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // !defined(MAINFRAME_H)
|
@@ -1,8 +1,32 @@
|
|||||||
// RC2WXR.cpp: implementation of the wxRC2WXR class.
|
// rc2wxr.cpp: implementation of the rc2wxr class.
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
//Author: Brian Gavin 9/24/00
|
||||||
|
//License: wxWindows License
|
||||||
|
/*
|
||||||
|
WARNING- I know this code has some bugs to work out but
|
||||||
|
I don't plan to fix them since I feel that wxr files will
|
||||||
|
not be used much longer.
|
||||||
|
This code was used as a starting point for my rc2xml converter
|
||||||
|
*/
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma implementation "rc2wxr.cpp"
|
||||||
|
#pragma interface "rc2wxr.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx/wx.h".
|
// For compilers that support precompilation, includes "wx/wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include <wx/wxprec.h>
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// for all others, include the necessary headers (this file is usually all you
|
||||||
|
// need because it includes almost all "standard" wxWindows headers
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include <wx/wx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "rc2wxr.h"
|
#include "rc2wxr.h"
|
||||||
#include "wx/image.h"
|
#include "wx/image.h"
|
||||||
@@ -11,30 +35,26 @@
|
|||||||
// Construction/Destruction
|
// Construction/Destruction
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxRC2WXR::wxRC2WXR()
|
rc2wxr::rc2wxr()
|
||||||
{
|
{
|
||||||
m_done=FALSE;
|
m_done=FALSE;
|
||||||
m_controlid=6000;
|
m_controlid=6000;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRC2WXR::~wxRC2WXR()
|
rc2wxr::~rc2wxr()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::Open(wxString wxrfile, wxString rcfile)
|
void rc2wxr::Convert(wxString wxrfile, wxString rcfile)
|
||||||
{
|
{
|
||||||
wxFileProgressDlg fileprog;
|
m_rc.Open(rcfile);
|
||||||
|
m_filesize=m_rc.Length();
|
||||||
|
|
||||||
m_rc.Open(rcfile);
|
|
||||||
m_filesize=m_rc.Length();
|
|
||||||
if( (m_wxr = fopen( wxrfile, "wt" )) == NULL )
|
if( (m_wxr = fopen( wxrfile, "wt" )) == NULL )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprog.Show(TRUE);
|
|
||||||
|
|
||||||
wxString tok,prevtok;
|
wxString tok,prevtok;
|
||||||
|
|
||||||
@@ -46,25 +66,22 @@ tok=GetToken();
|
|||||||
|
|
||||||
if (tok=="DIALOG")
|
if (tok=="DIALOG")
|
||||||
{
|
{
|
||||||
ParseDialog(prevtok);
|
ParseDialog(prevtok);
|
||||||
fileprog.UpdateProgress(&m_rc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (tok=="MENU")
|
if (tok=="MENU")
|
||||||
{
|
{
|
||||||
ParseMenu(prevtok);
|
ParseMenu(prevtok);
|
||||||
fileprog.UpdateProgress(&m_rc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prevtok=tok;
|
prevtok=tok;
|
||||||
}
|
}
|
||||||
fileprog.UpdateProgress(&m_rc);
|
|
||||||
fclose(m_wxr);
|
fclose(m_wxr);
|
||||||
//fclose(m_rc);
|
//fclose(m_rc);
|
||||||
m_rc.Close();
|
m_rc.Close();
|
||||||
|
|
||||||
fileprog.Show(FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,26 +105,26 @@ FONT 8, "MS Sans Serif"
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void wxRC2WXR::ParseDialog(wxString dlgname)
|
void rc2wxr::ParseDialog(wxString dlgname)
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
static int dlgid=999;
|
static int dlgid=999;
|
||||||
dlgid++;
|
dlgid++;
|
||||||
/* Make sure that this really is a dialog
|
/* Make sure that this really is a dialog
|
||||||
microsoft reuses the keyword DIALOG for other things
|
microsoft reuses the keyword DIALOG for other things
|
||||||
*/
|
*/
|
||||||
tok=PeekToken();
|
tok=PeekToken();
|
||||||
//Microsoft notation?
|
//Microsoft notation?
|
||||||
if (tok=="DISCARDABLE")
|
if (tok=="DISCARDABLE")
|
||||||
{
|
{
|
||||||
tok=GetToken();
|
tok=GetToken();
|
||||||
tok=PeekToken();
|
tok=PeekToken();
|
||||||
}
|
}
|
||||||
//This isn't a Dialog resource eject eject
|
//This isn't a Dialog resource eject eject
|
||||||
if (!tok.IsNumber())
|
if (!tok.IsNumber())
|
||||||
return;
|
return;
|
||||||
//Generate Dialog text
|
//Generate Dialog text
|
||||||
fprintf(m_wxr,"static char *dialog%i = \"dialog(name = '%s',\\\n",dlgid,dlgname);
|
fprintf(m_wxr,"static char *dialog%i = \"dialog(name = '%s',\\\n",dlgid,dlgname.mb_str());
|
||||||
//be lazy about style for now. add it later
|
//be lazy about style for now. add it later
|
||||||
fprintf(m_wxr,"style = 'wxRAISED_BORDER | wxCAPTION | wxTHICK_FRAME | wxSYSTEM_MENU',\\\n");
|
fprintf(m_wxr,"style = 'wxRAISED_BORDER | wxCAPTION | wxTHICK_FRAME | wxSYSTEM_MENU',\\\n");
|
||||||
|
|
||||||
@@ -127,10 +144,10 @@ wxString title;
|
|||||||
while ((tok!="BEGIN")&(tok!="{"))
|
while ((tok!="BEGIN")&(tok!="{"))
|
||||||
{
|
{
|
||||||
if (tok=="CAPTION")
|
if (tok=="CAPTION")
|
||||||
{
|
{
|
||||||
title=GetQuoteField();
|
title=GetQuoteField();
|
||||||
fprintf(m_wxr,"title = '%s',\\\n",title);
|
fprintf(m_wxr,"title = '%s',\\\n",title.mb_str());
|
||||||
}
|
}
|
||||||
tok=GetToken();
|
tok=GetToken();
|
||||||
}
|
}
|
||||||
fprintf(m_wxr,"use_dialog_units = 1,\\\n");
|
fprintf(m_wxr,"use_dialog_units = 1,\\\n");
|
||||||
@@ -152,7 +169,7 @@ BEGIN
|
|||||||
EDITTEXT IDC_NAME,10,3,75,14,ES_AUTOHSCROLL
|
EDITTEXT IDC_NAME,10,3,75,14,ES_AUTOHSCROLL
|
||||||
END
|
END
|
||||||
*/
|
*/
|
||||||
void wxRC2WXR::ParseControls()
|
void rc2wxr::ParseControls()
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
|
|
||||||
@@ -179,7 +196,7 @@ tok=GetToken();
|
|||||||
|
|
||||||
}
|
}
|
||||||
//LTEXT "Radius",IDC_STATIC,9,67,23,8
|
//LTEXT "Radius",IDC_STATIC,9,67,23,8
|
||||||
void wxRC2WXR::ParseStaticText()
|
void rc2wxr::ParseStaticText()
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
wxString phrase,varname;
|
wxString phrase,varname;
|
||||||
@@ -188,12 +205,12 @@ varname=GetToken();
|
|||||||
m_controlid++;
|
m_controlid++;
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr," control = [%i,wxStaticText,'%s','0','%s',",m_controlid,phrase,varname);
|
fprintf(m_wxr," control = [%i,wxStaticText,'%s','0','%s',",m_controlid,phrase.mb_str(),varname.mb_str());
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
}
|
}
|
||||||
//EDITTEXT IDC_RADIUS,36,65,40,14,ES_AUTOHSCROLL
|
//EDITTEXT IDC_RADIUS,36,65,40,14,ES_AUTOHSCROLL
|
||||||
void wxRC2WXR::ParseTextCtrl()
|
void rc2wxr::ParseTextCtrl()
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
wxString varname;
|
wxString varname;
|
||||||
@@ -201,13 +218,13 @@ varname=GetToken();
|
|||||||
m_controlid++;
|
m_controlid++;
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr," control = [%i,wxTextCtrl,'','0','%s',",m_controlid,varname);
|
fprintf(m_wxr," control = [%i,wxTextCtrl,'','0','%s',",m_controlid,varname.mb_str());
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
//PUSHBUTTON "Create/Update",IDC_CREATE,15,25,53,13,NOT WS_TABSTOP
|
//PUSHBUTTON "Create/Update",IDC_CREATE,15,25,53,13,NOT WS_TABSTOP
|
||||||
void wxRC2WXR::ParsePushButton()
|
void rc2wxr::ParsePushButton()
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
wxString phrase,varname;
|
wxString phrase,varname;
|
||||||
@@ -227,27 +244,27 @@ c=wxID_APPLY;
|
|||||||
|
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr," control = [%i,wxButton,'%s','0','%s',",c,phrase,varname);
|
fprintf(m_wxr," control = [%i,wxButton,'%s','0','%s',",c,phrase.mb_str(),varname.mb_str());
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxRC2WXR::Seperator(int ch)
|
bool rc2wxr::Seperator(int ch)
|
||||||
{
|
{
|
||||||
if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|'))
|
if ((ch==' ')|(ch==',')|(ch==13)|(ch==10)|(ch=='|'))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (ch==EOF)
|
if (ch==EOF)
|
||||||
{
|
{
|
||||||
m_done=TRUE;
|
m_done=TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ParseGroupBox()
|
void rc2wxr::ParseGroupBox()
|
||||||
{
|
{
|
||||||
// GROUPBOX "Rotate",IDC_STATIC,1,1,71,79
|
// GROUPBOX "Rotate",IDC_STATIC,1,1,71,79
|
||||||
wxString tok;
|
wxString tok;
|
||||||
@@ -257,14 +274,14 @@ varname=GetToken();
|
|||||||
m_controlid++;
|
m_controlid++;
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr," control = [%i,wxStaticBox,'%s','0','%s',",m_controlid,phrase,varname);
|
fprintf(m_wxr," control = [%i,wxStaticBox,'%s','0','%s',",m_controlid,phrase.mb_str(),varname.mb_str());
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,'',\\\n",x,y,width,height);
|
||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ReadRect(int & x, int & y, int & width, int & height)
|
void rc2wxr::ReadRect(int & x, int & y, int & width, int & height)
|
||||||
{
|
{
|
||||||
x=atoi(GetToken());
|
x=atoi(GetToken());
|
||||||
y=atoi(GetToken());
|
y=atoi(GetToken());
|
||||||
@@ -273,7 +290,7 @@ height=atoi(GetToken());
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxRC2WXR::GetToken()
|
wxString rc2wxr::GetToken()
|
||||||
{
|
{
|
||||||
wxString tok="";
|
wxString tok="";
|
||||||
|
|
||||||
@@ -300,15 +317,15 @@ while (Seperator(ch))
|
|||||||
|
|
||||||
if (ch==EOF)
|
if (ch==EOF)
|
||||||
{
|
{
|
||||||
m_done=TRUE;
|
m_done=TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
while (!Seperator(ch))
|
while (!Seperator(ch))
|
||||||
{
|
{
|
||||||
tok+=(char)ch;
|
tok+=(char)ch;
|
||||||
ReadChar(ch);
|
ReadChar(ch);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +336,7 @@ if (ch==EOF)
|
|||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxRC2WXR::GetQuoteField()
|
wxString rc2wxr::GetQuoteField()
|
||||||
{
|
{
|
||||||
wxString phrase;
|
wxString phrase;
|
||||||
//ASCII code 34 "
|
//ASCII code 34 "
|
||||||
@@ -339,7 +356,7 @@ while (ch!=34)
|
|||||||
return phrase;
|
return phrase;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ReadChar(int &ch)
|
void rc2wxr::ReadChar(int &ch)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
result=m_rc.Tell();
|
result=m_rc.Tell();
|
||||||
@@ -356,7 +373,7 @@ if(ch==EOF)
|
|||||||
m_done=TRUE;
|
m_done=TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ParseComboBox()
|
void rc2wxr::ParseComboBox()
|
||||||
{
|
{
|
||||||
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
||||||
WS_VSCROLL | WS_TABSTOP */
|
WS_VSCROLL | WS_TABSTOP */
|
||||||
@@ -367,19 +384,19 @@ m_controlid++;
|
|||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
|
|
||||||
fprintf(m_wxr," control = [%i,wxChoice,'','0','%s',",m_controlid,varname);
|
fprintf(m_wxr," control = [%i,wxChoice,'','0','%s',",m_controlid,varname.mb_str());
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,[],\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,[],\\\n",x,y,width,height);
|
||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ParseMenu(wxString name)
|
void rc2wxr::ParseMenu(wxString name)
|
||||||
{
|
{
|
||||||
wxString tok="";
|
wxString tok="";
|
||||||
static int menuid=0;
|
static int menuid=0;
|
||||||
menuid++;
|
menuid++;
|
||||||
fprintf(m_wxr,"static char *MenuBar%i = \"menu(name = '%s',\\\n",menuid,name);
|
fprintf(m_wxr,"static char *MenuBar%i = \"menu(name = '%s',\\\n",menuid,name.mb_str());
|
||||||
fprintf(m_wxr,"menu = \\\n");
|
fprintf(m_wxr,"menu = \\\n");
|
||||||
fprintf(m_wxr,"[\\\n");
|
fprintf(m_wxr,"[\\\n");
|
||||||
|
|
||||||
@@ -399,7 +416,7 @@ if (tok=="POPUP")
|
|||||||
fprintf(m_wxr,"]).\";\n\n");
|
fprintf(m_wxr,"]).\";\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRC2WXR::ParsePopupMenu()
|
void rc2wxr::ParsePopupMenu()
|
||||||
{
|
{
|
||||||
static int menuitem=99;
|
static int menuitem=99;
|
||||||
menuitem++;
|
menuitem++;
|
||||||
@@ -410,7 +427,7 @@ int spot;
|
|||||||
//Remove /t because it causes problems
|
//Remove /t because it causes problems
|
||||||
spot=tok.First("\\t");
|
spot=tok.First("\\t");
|
||||||
tok=tok.Left(spot);
|
tok=tok.Left(spot);
|
||||||
fprintf(m_wxr," ['%s',%i,'',\\\n",tok,menuitem);
|
fprintf(m_wxr," ['%s',%i,'',\\\n",tok.mb_str(),menuitem);
|
||||||
while ((tok!="BEGIN")&(tok!="{"))
|
while ((tok!="BEGIN")&(tok!="{"))
|
||||||
tok=GetToken();
|
tok=GetToken();
|
||||||
|
|
||||||
@@ -418,26 +435,26 @@ while ((tok!="END")&(tok!="}"))
|
|||||||
{
|
{
|
||||||
tok=GetToken();
|
tok=GetToken();
|
||||||
if (tok=="MENUITEM")
|
if (tok=="MENUITEM")
|
||||||
{
|
{
|
||||||
if (PeekToken()=="SEPARATOR")
|
if (PeekToken()=="SEPARATOR")
|
||||||
fprintf(m_wxr," [],\\\n");
|
fprintf(m_wxr," [],\\\n");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tok=GetQuoteField();
|
tok=GetQuoteField();
|
||||||
//Remove /t because it causes problems
|
//Remove /t because it causes problems
|
||||||
spot=tok.First("\\t");
|
spot=tok.First("\\t");
|
||||||
tok=tok.Left(spot);
|
tok=tok.Left(spot);
|
||||||
menuitem++;
|
menuitem++;
|
||||||
fprintf(m_wxr," ['%s',%i,''],\\\n",tok,menuitem);
|
fprintf(m_wxr," ['%s',%i,''],\\\n",tok.mb_str(),menuitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxRC2WXR::PeekToken()
|
wxString rc2wxr::PeekToken()
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
int p;
|
int p;
|
||||||
@@ -448,7 +465,7 @@ m_rc.Seek(p);
|
|||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
//Windows pain in the butt CONTROL
|
//Windows pain in the butt CONTROL
|
||||||
void wxRC2WXR::ParseControlMS()
|
void rc2wxr::ParseControlMS()
|
||||||
{
|
{
|
||||||
wxString label,varname,kindctrl,tok;
|
wxString label,varname,kindctrl,tok;
|
||||||
label=GetQuoteField();
|
label=GetQuoteField();
|
||||||
@@ -468,11 +485,11 @@ if (kindctrl=="BUTTON")
|
|||||||
TBS_NOTICKS | WS_TABSTOP,52,73,100,15
|
TBS_NOTICKS | WS_TABSTOP,52,73,100,15
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void wxRC2WXR::ParseSlider(wxString label, wxString varname)
|
void rc2wxr::ParseSlider(wxString label, wxString varname)
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
while (ReadOrs(tok));
|
while (ReadOrs(tok));
|
||||||
fprintf(m_wxr," control = [%i,wxSlider,'','wxSL_HORIZONTAL','%s',",m_controlid,varname);
|
fprintf(m_wxr," control = [%i,wxSlider,'','wxSL_HORIZONTAL','%s',",m_controlid,varname.mb_str());
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,",x,y,width,height);
|
||||||
@@ -483,11 +500,11 @@ fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n"
|
|||||||
CONTROL "Progress1",CG_IDC_PROGDLG_PROGRESS,"msctls_progress32",
|
CONTROL "Progress1",CG_IDC_PROGDLG_PROGRESS,"msctls_progress32",
|
||||||
WS_BORDER,15,52,154,13
|
WS_BORDER,15,52,154,13
|
||||||
*/
|
*/
|
||||||
void wxRC2WXR::ParseProgressBar(wxString label, wxString varname)
|
void rc2wxr::ParseProgressBar(wxString label, wxString varname)
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
while (ReadOrs(tok));
|
while (ReadOrs(tok));
|
||||||
fprintf(m_wxr," control = [%i,wxGauge,'','wxGA_HORIZONTAL','%s',",m_controlid,varname);
|
fprintf(m_wxr," control = [%i,wxGauge,'','wxGA_HORIZONTAL','%s',",m_controlid,varname.mb_str());
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,",x,y,width,height);
|
||||||
@@ -495,7 +512,7 @@ fprintf(m_wxr," 0, 10,\\\n");
|
|||||||
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
fprintf(m_wxr,"[8, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0, 'MS Sans Serif']],\\\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRC2WXR::ReadOrs(wxString & w)
|
bool rc2wxr::ReadOrs(wxString & w)
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
tok=PeekToken();
|
tok=PeekToken();
|
||||||
@@ -506,17 +523,17 @@ return TRUE;
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Is it a check button or a radio button
|
//Is it a check button or a radio button
|
||||||
void wxRC2WXR::ParseCtrlButton(wxString label, wxString varname)
|
void rc2wxr::ParseCtrlButton(wxString label, wxString varname)
|
||||||
{
|
{
|
||||||
wxString tok;
|
wxString tok;
|
||||||
tok=GetToken();
|
tok=GetToken();
|
||||||
|
|
||||||
m_controlid++;
|
m_controlid++;
|
||||||
int x,y,width,height;
|
int x,y,width,height;
|
||||||
|
|
||||||
if (tok=="BS_AUTOCHECKBOX")
|
if (tok=="BS_AUTOCHECKBOX")
|
||||||
{
|
{
|
||||||
fprintf(m_wxr," control = [%i,wxCheckBox,'%s','0','%s',",m_controlid,label,varname);
|
fprintf(m_wxr," control = [%i,wxCheckBox,'%s','0','%s',",m_controlid,label.mb_str(),varname.mb_str());
|
||||||
while (ReadOrs(tok));
|
while (ReadOrs(tok));
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,0,\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,0,\\\n",x,y,width,height);
|
||||||
@@ -525,7 +542,7 @@ if (tok=="BS_AUTOCHECKBOX")
|
|||||||
|
|
||||||
if (tok=="BS_AUTORADIOBUTTON")
|
if (tok=="BS_AUTORADIOBUTTON")
|
||||||
{
|
{
|
||||||
fprintf(m_wxr," control = [%i,wxRadioButton,'%s','0','%s',",m_controlid,label,varname);
|
fprintf(m_wxr," control = [%i,wxRadioButton,'%s','0','%s',",m_controlid,label.mb_str(),varname.mb_str());
|
||||||
while(ReadOrs(tok));
|
while(ReadOrs(tok));
|
||||||
ReadRect(x,y,width,height);
|
ReadRect(x,y,width,height);
|
||||||
fprintf(m_wxr,"%i,%i,%i,%i,0,\\\n",x,y,width,height);
|
fprintf(m_wxr,"%i,%i,%i,%i,0,\\\n",x,y,width,height);
|
||||||
@@ -536,106 +553,3 @@ if (tok=="BS_AUTORADIOBUTTON")
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxFileProgressDlg,wxDialog)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
wxFileProgressDlg::wxFileProgressDlg()
|
|
||||||
{
|
|
||||||
wxPoint pos;
|
|
||||||
wxSize size;
|
|
||||||
pos = ConvertDialogToPixels(wxPoint(10,10));
|
|
||||||
size = ConvertDialogToPixels(wxSize(170,31));
|
|
||||||
Create(GetParent(),100,"Parsing RC File",pos,size,603985920);
|
|
||||||
SetClientSize(size);
|
|
||||||
Move(pos);
|
|
||||||
//wxGauge Control
|
|
||||||
pos = ConvertDialogToPixels(wxPoint(16,16));
|
|
||||||
size = ConvertDialogToPixels(wxSize(136,6));
|
|
||||||
m_pProgress = new wxGauge(this,101,100,pos,size);
|
|
||||||
//wxStaticText Control
|
|
||||||
pos = ConvertDialogToPixels(wxPoint(72,4));
|
|
||||||
size = ConvertDialogToPixels(wxSize(18,6));
|
|
||||||
m_pCompleteLabel= new wxStaticText(this,102,"0",pos,size,0);
|
|
||||||
}
|
|
||||||
wxFileProgressDlg::~wxFileProgressDlg()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxFileProgressDlg::UpdateProgress(wxFile * f)
|
|
||||||
{
|
|
||||||
int p;
|
|
||||||
p=(int)((float)f->Tell()/(float)f->Length()*100.0);
|
|
||||||
m_pProgress->SetValue(p);
|
|
||||||
wxString t;
|
|
||||||
t.sprintf("%i%%",p);
|
|
||||||
m_pCompleteLabel->SetLabel(t);
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
// GenerateBitmapSrc Class
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
// Construction/Destruction
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
GenerateBitmapSrc::GenerateBitmapSrc()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
GenerateBitmapSrc::~GenerateBitmapSrc()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GenerateBitmapSrc::Create(wxString imfile, wxString srcfile,wxString varname)
|
|
||||||
{
|
|
||||||
|
|
||||||
wxImage img;
|
|
||||||
FILE *src;
|
|
||||||
|
|
||||||
int h,w;
|
|
||||||
|
|
||||||
img.LoadFile(imfile,wxBITMAP_TYPE_ANY);
|
|
||||||
h=img.GetHeight();
|
|
||||||
w=img.GetWidth();
|
|
||||||
|
|
||||||
if( (src = fopen( srcfile, "at" )) == NULL )
|
|
||||||
return FALSE;
|
|
||||||
fprintf(src,"#if !defined(IMG_%s)\n",varname);
|
|
||||||
fprintf(src,"#define IMG_%s\n",varname);
|
|
||||||
|
|
||||||
fprintf(src,"//Data from bitmap file %s \n",imfile);
|
|
||||||
fprintf(src,"//Image Height=%i,Width=%i RGB format\n",h,w);
|
|
||||||
fprintf(src,"static unsigned char %s[][3]={\n",varname);
|
|
||||||
|
|
||||||
|
|
||||||
for (int y=0;y<h;y++)
|
|
||||||
{
|
|
||||||
for (int x=0;x<w;x++)
|
|
||||||
{
|
|
||||||
//fprintf(src,"{%i,%i,%i},",img.GetRed(x,y),img.GetGreen(x,y),img.GetBlue(x,y));
|
|
||||||
|
|
||||||
}
|
|
||||||
fprintf(src,"\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(src,"};\n\n");
|
|
||||||
|
|
||||||
fprintf(src,"wxBitmap Load%s()\n{\n",varname);
|
|
||||||
fprintf(src,"wxImage myimg(%i,%i);\n",w,h);
|
|
||||||
int size=w*h*3;
|
|
||||||
fprintf(src,"memcpy(myimg.GetData(),&%s[0][0],%i);\n",varname,size);
|
|
||||||
fprintf(src,"return myimg.ConvertToBitmap();\n");
|
|
||||||
fprintf(src,"}\n");
|
|
||||||
fprintf(src,"#endif\n");
|
|
||||||
fclose(src);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@@ -8,12 +8,12 @@
|
|||||||
#include "wx/file.h"
|
#include "wx/file.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
class wxRC2WXR : public wxObject
|
class rc2wxr : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxRC2WXR();
|
rc2wxr();
|
||||||
~wxRC2WXR();
|
~rc2wxr();
|
||||||
void Open(wxString wxrfile, wxString rcfile);
|
void Convert(wxString wxrfile, wxString rcfile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxFile m_rc;
|
wxFile m_rc;
|
||||||
@@ -44,28 +44,5 @@ void ParseCtrlButton(wxString label, wxString varname);
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class wxFileProgressDlg : public wxDialog
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void UpdateProgress(wxFile *f);
|
|
||||||
|
|
||||||
wxFileProgressDlg();
|
|
||||||
virtual ~wxFileProgressDlg();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
wxGauge *m_pProgress;
|
|
||||||
wxStaticText *m_pCompleteLabel;
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
|
||||||
};
|
|
||||||
class GenerateBitmapSrc : public wxObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
bool Create(wxString imfile, wxString srcfile,wxString varname);
|
|
||||||
GenerateBitmapSrc();
|
|
||||||
virtual ~GenerateBitmapSrc();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
File diff suppressed because it is too large
Load Diff
@@ -10,15 +10,20 @@
|
|||||||
#include <wx/list.h>
|
#include <wx/list.h>
|
||||||
|
|
||||||
|
|
||||||
class wxRC2XML : public wxObject
|
class rc2xml : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void WriteIcon(wxString iconname);
|
||||||
void ParseNormalMSControl();
|
void ParseNormalMSControl();
|
||||||
bool Convert(wxString rcfile, wxString xmlfile);
|
bool Convert(wxString rcfile, wxString xmlfile);
|
||||||
wxRC2XML();
|
rc2xml();
|
||||||
~wxRC2XML();
|
~rc2xml();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
wxString LookUpId(wxString id);
|
||||||
|
|
||||||
|
void ParseResourceHeader();
|
||||||
|
void WriteBitmap(wxString bitmapname);
|
||||||
void ParseListCtrl(wxString label,wxString varname);
|
void ParseListCtrl(wxString label,wxString varname);
|
||||||
void ParseCalendar(wxString label,wxString varname);
|
void ParseCalendar(wxString label,wxString varname);
|
||||||
void ParseTreeCtrl(wxString label,wxString varname);
|
void ParseTreeCtrl(wxString label,wxString varname);
|
||||||
@@ -32,52 +37,53 @@ protected:
|
|||||||
void ParseMenuItem();
|
void ParseMenuItem();
|
||||||
|
|
||||||
//Functions
|
//Functions
|
||||||
bool SplitHelp(wxString msg, wxString &shorthelp, wxString &longhelp);
|
bool SplitHelp(wxString msg, wxString &shorthelp, wxString &longhelp);
|
||||||
bool LookUpString(wxString strid,wxString & st);
|
bool LookUpString(wxString strid,wxString & st);
|
||||||
void ParseStringTable(wxString varname);
|
void ParseStringTable(wxString varname);
|
||||||
void WriteToolButton(wxString name,int index,int width,int height,wxBitmap bitmap);
|
void WriteToolButton(wxString name,int index,int width,int height,wxBitmap bitmap);
|
||||||
wxString LookupString(wxString varname,wxStringList id,wxStringList msg);
|
wxString LookupString(wxString varname,wxStringList id,wxStringList msg);
|
||||||
void ParseToolBar(wxString varname);
|
void ParseToolBar(wxString varname);
|
||||||
void SecondPass();
|
void SecondPass();
|
||||||
void FirstPass();
|
void FirstPass();
|
||||||
void ParseBitmap(wxString varname);
|
void ParseBitmap(wxString varname);
|
||||||
void ParseSpinCtrl(wxString label,wxString varname);
|
void ParseSpinCtrl(wxString label,wxString varname);
|
||||||
void ParseRichEdit(wxString label, wxString varname);
|
void ParseRichEdit(wxString label, wxString varname);
|
||||||
void ParseDialog(wxString dlgname);
|
void ParseDialog(wxString dlgname);
|
||||||
void ParseControls();
|
void ParseControls();
|
||||||
void ParseListBox();
|
void ParseListBox();
|
||||||
void ParseStaticText();
|
void ParseStaticText();
|
||||||
void ParseTextCtrl();
|
void ParseTextCtrl();
|
||||||
void ParsePushButton();
|
void ParsePushButton();
|
||||||
bool Seperator(int ch);
|
bool Seperator(int ch);
|
||||||
void ParseGroupBox();
|
void ParseGroupBox();
|
||||||
void ReadRect(int & x, int & y, int & width, int & height);
|
void ReadRect(int & x, int & y, int & width, int & height);
|
||||||
wxString GetToken();
|
wxString GetToken();
|
||||||
wxString GetQuoteField();
|
wxString GetQuoteField();
|
||||||
void ReadChar(int &ch);
|
void ReadChar(int &ch);
|
||||||
void ParseComboBox();
|
void ParseComboBox();
|
||||||
void ParseMenu(wxString varname);
|
void ParseMenu(wxString varname);
|
||||||
void ParsePopupMenu();
|
void ParsePopupMenu();
|
||||||
wxString PeekToken();
|
wxString PeekToken();
|
||||||
void ParseControlMS();
|
void ParseControlMS();
|
||||||
void ParseSlider(wxString label, wxString varname);
|
void ParseSlider(wxString label, wxString varname);
|
||||||
void ParseProgressBar(wxString label, wxString varname);
|
void ParseProgressBar(wxString label, wxString varname);
|
||||||
bool ReadOrs(wxString & w);
|
bool ReadOrs(wxString & w);
|
||||||
void ParseCtrlButton(wxString label, wxString varname);
|
void ParseCtrlButton(wxString label, wxString varname);
|
||||||
void WriteStyle(wxString style);
|
void WriteStyle(wxString style);
|
||||||
void WriteBasicInfo(int x,int y,int width,int height,wxString name);
|
void WriteBasicInfo(int x,int y,int width,int height,wxString name);
|
||||||
void WriteName(wxString name);
|
void WriteName(wxString name);
|
||||||
void WriteTitle(wxString title);
|
void WriteTitle(wxString title);
|
||||||
void WritePosition(int x,int y);
|
void WritePosition(int x,int y);
|
||||||
void WriteSize(int width,int height);
|
void WriteSize(int width,int height);
|
||||||
void WriteLabel(wxString label);
|
void WriteLabel(wxString label);
|
||||||
//variables
|
//variables
|
||||||
wxList * m_stringtable;
|
wxList * m_stringtable;
|
||||||
wxList *m_bitmaplist;
|
wxList *m_bitmaplist;
|
||||||
wxFile m_rc;
|
wxList * m_resourcelist;
|
||||||
wxFFile m_xmlfile;
|
wxFile m_rc;
|
||||||
int m_filesize;
|
wxFFile m_xmlfile;
|
||||||
bool m_done;
|
int m_filesize;
|
||||||
|
bool m_done;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
1
contrib/utils/convertrc/wxconvert.rc
Normal file
1
contrib/utils/convertrc/wxconvert.rc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#include "wx/msw/wx.rc"
|
File diff suppressed because it is too large
Load Diff
@@ -9,14 +9,22 @@
|
|||||||
#include "wx/resource.h"
|
#include "wx/resource.h"
|
||||||
|
|
||||||
|
|
||||||
class wxWxr2Xml : public wxObject
|
class wxr2xml : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool Convert(wxString wxrfile,wxString xmlfile);
|
bool Convert(wxString wxrfile,wxString xmlfile);
|
||||||
wxWxr2Xml();
|
wxr2xml();
|
||||||
virtual ~wxWxr2Xml();
|
virtual ~wxr2xml();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void GetFontWeight(wxFont font);
|
||||||
|
void GetFontStyle(wxFont font);
|
||||||
|
void ParseBitmapButton(wxItemResource *res);
|
||||||
|
void GetFontFace(wxFont font);
|
||||||
|
void WriteFontInfo(wxItemResource *res);
|
||||||
|
wxString GetValue2(wxItemResource *res);
|
||||||
|
wxString GetValue3(wxItemResource *res);
|
||||||
|
wxString GetValue5(wxItemResource *res);
|
||||||
void PanelStuff(wxItemResource *res);
|
void PanelStuff(wxItemResource *res);
|
||||||
bool m_systemdefaults;
|
bool m_systemdefaults;
|
||||||
bool m_dlgunits;
|
bool m_dlgunits;
|
||||||
@@ -58,7 +66,6 @@ protected:
|
|||||||
void ParseControls(wxItemResource *res);
|
void ParseControls(wxItemResource *res);
|
||||||
void ParseDialog(wxItemResource *res);
|
void ParseDialog(wxItemResource *res);
|
||||||
bool ParseResources();
|
bool ParseResources();
|
||||||
|
|
||||||
//Variables
|
//Variables
|
||||||
wxResourceTable m_table;
|
wxResourceTable m_table;
|
||||||
wxFFile m_xmlfile;
|
wxFFile m_xmlfile;
|
||||||
|
Reference in New Issue
Block a user