View previous topic :: View next topic |
Author |
Message |
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 20, 2003 10:42 pm Post subject: VDSRC.EXE Frontend |
|
|
Requires VDSRC.EXE that comes with VDS.
Made this a while back and haven't used it a lot, so let me know if
ya find any bugs.
_______________________________________________________________________________________________________________________________________________________________________________________
Code: |
OPTION SCALE, 96
rem -- program directory --
%w = @curdir()"\"
rem -- directory for .RC, .MAP and .DSR files --
%d = @curdir()"\"
TITLE Mac's Resource Compiler
DIALOG CREATE,Mac's Resource Compiler,-1,0,355,325,DRAGDROP
DIALOG ADD,STYLE,Line_Style,,,,BLACK
DIALOG ADD,STYLE,BoldText,MS Sans Serif,8,B
DIALOG ADD,MENU,&File,&New Script...,&Open Script...,&Save Script...,&Add Files To Script,&Load Existing Map,E&xit
DIALOG ADD,MENU,&Compile,&Compile Resource File
DIALOG ADD,MENU,&Help,&Help
DIALOG ADD,TEXT,Line1,0,0,355,1,"",Line_Style
DIALOG ADD,TEXT,TX1,10,5,,,Script File (RC File),BoldText
DIALOG ADD,LIST,LB1,25,5,345,120,SORTED,CLICK
DIALOG ADD,TEXT,TX2,150,5,,,Resource Map (MAP File),BoldText
DIALOG ADD,LIST,LB2,165,5,345,120,CLICK
DIALOG ADD,TEXT,TX3,290,5,,,"No Script File...",BoldText
DIALOG ADD,STATUS,Stat," ",BoldText
DIALOG SHOW
%z = @sendmsg(@winexists(~LB1),$0194,2000,0)
%z = @sendmsg(@winexists(~LB2),$0194,2000,0)
:EVLOOP
DIALOG SET, Stat, " Ready..."
WAIT EVENT
goto @event()
:LB1CLICK
if @ask(Remove This Item From List?@tab())
LIST DELETE, LB1
end
goto EVLOOP
:LB2CLICK
%a = ""
%x = 1
REPEAT
%b = @substr(@item(LB2),%x)
if @numeric(%b)
%a = %a%b
end
%x = @succ(%x)
UNTIL @not(@numeric(%b))
%a = @name(%m).dsr|%a
if %a
CLIPBOARD SET, %a
end
goto EVLOOP
:DRAGDROP
LIST DROPFILES,FileList
goto EVLOOP
:New Script...MENU
LIST CLEAR, LB1
LIST CLEAR, LB2
%n = @input("Enter name for script (RC) file."@tab())
if %n
%n = @name(%n)
%d = @dirdlg(CHOOSE FOLDER FOR THE FILES,%w)"\"
GOSUB AssignFilenames
end
goto EVLOOP
:Open Script...MENU
%z = @filedlg("Script files (*rc)|*rc|All Files|*.*")
if %z
%d = @path(%z)
LIST CLEAR, LB1
LIST CLEAR, LB2
LIST LOADFILE, LB1, %z
%n = @name(%z)
%d = @path(z)
GOSUB AssignFilenames
end
goto EVLOOP
:Save Script...MENU
if @greater(@count(LB1), 0)
if %n
DIALOG SET, Stat, " Saving..."
LIST SAVEFILE, LB1, %d%s
WAIT
end
end
goto EVLOOP
:Add Files To ScriptMENU
%z = @filedlg("Bitmap (*bmp)|*bmp|Text (*.txt)|*txt|Icon (*ico)|*ico|Icon (*dll)|*dll|Icon (*exe)|*exe|All Files|*.*",,,MULTI)
if %z
LIST CREATE, 1
LIST ASSIGN, 1, %z
%x = 0
REPEAT
LIST ADD, LB1, @item(1, %x)
%x = @succ(%x)
UNTIL @equal(%x, @count(1))
LIST CLOSE, 1
end
goto EVLOOP
:Load Existing MapMENU
%z = @filedlg("Map files (*map)|*map|All Files|*.*")
if %z
LIST CLEAR, LB1
LIST CLEAR, LB2
LIST LOADFILE, LB2, %z
%n = ""
%m = %z
%r = ""
%s = ""
end
goto EVLOOP
:Compile Resource FileMENU
if @greater(@count(LB1), 0)
if @both(%m, %r)
LIST SAVEFILE, LB1, %d%s
WAIT
if @file(%d%s)
if @file(%wvdsrc.exe)
DIALOG SET, Stat, " Compiling Resource File..."
RUNZ command /c %wvdsrc.exe %d%s %d%r /m %d%m /g, WAIT
if @file(%d%m)
LIST LOADFILE, LB2, %d%m
end
else
WARN Cannot find VDSRC.EXE resource compiler.@tab()@cr()@cr()This frontend should be located in@cr()the directory where VDSRC.EXE is.
end
end
end
else
INFO Nothing in Script File list.@tab()
end
goto EVLOOP
:HelpMENU
INFO "Requires VDS Resource Compiler ''VDSRC.EXE''"@tab()@tab()@cr()"(see VDS help file under ''Resource Compiler'')."@cr()@cr()1. Select 'Create New Script' from menu.@cr()@cr()"2. Add File(s) to Script File list (click to remove)."@cr()@cr()3. Compile Resource File.@cr()@cr()4. Click Resource Map list to copy@cr()" "the ''file.dsr|offset'' to the clipboard.@cr()@cr()5. Paste to your VDS code.@cr()@cr()These file extensions must be used:@cr()" "Script File = .RC@cr()" "Map File = .MAP@cr()" "Compiled Resource File = .DSR@cr()@cr()You can also load existing map files.
goto EVLOOP
:ExitMENU
:CLOSE
EXIT
STOP
rem ---------------- GOSUB ----------------
:AssignFilenames
rem -- Map, Resource, Script --
%m = %n.map
%r = %n.dsr
%s = %n.rc
DIALOG SET, TX1, "Script File:" %s
DIALOG SET, TX2, "Map File:" %m
DIALOG SET, TX3, "Output Resource File:" %r
exit
|
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 20, 2003 10:58 pm Post subject: |
|
|
Thanks FF,
Actually the "help" code isn't very neat, and for some reason
I used @curdir() instead of @path(%0). I have no idea why,
but it's been a while since I wrote it...
I made it for my own use, and prolly wouldn't have posted it
if Nathan wasn't gonna try VDSRC.EXE.
Cheers, Mac _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|