forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VDSRC.EXE Frontend

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Mar 20, 2003 10:42 pm    Post subject: VDSRC.EXE Frontend Reply with quote

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
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 20, 2003 10:46 pm    Post subject: Reply with quote

Nice code, Mac! Very Happy

There's also another program, Visual Resource, which is a front-end for
the VDSRC.EXE file.

It's available at http://rolandfg.vdsworld.com/ Wink

Download Directly: http://www.vdsworld.com/~rolandfg/get.php?id=visual_resource&type=_setup.exe&lang=eng

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Mar 20, 2003 10:58 pm    Post subject: Reply with quote

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... Confused

I made it for my own use, and prolly wouldn't have posted it
if Nathan wasn't gonna try VDSRC.EXE. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group