Commit 21a13cb5 authored by Robert Sprowson's avatar Robert Sprowson

Changed to use MessageTrans for messages

Version 1.36. Tagged as 'ChangeFSI-1_36'
parent 1e4ace8f
processed in
seconds
Image created from '
' not saved
Image info
Source info
Range info
Zoom
Save image
Reprocess
Info
Scaling
Processing
Sprite Output
Fast
Save Choices
Quit
Scale to fill
by
Range not used
ChangeFSI
_TaskName:ChangeFSI
_Version:Substituted at build time
Incorrect value for
in
dialogue box.
JPEG quality
mode number
JPEG Output
Overwrite source file?
Ignore,Quit
Cancel,Discard
# Picture menu
Pimg:Image info
Psrc:Source info
Prange:Range info
Pzoom:Zoom
Psave:Save image
# Iconbar menu
Iinfo:Info
Iscale:Scaling
Iproc:Processing
Ijpg:JPEG Output
Ispr:Sprite Output
Ifast:Fast
Ichoice:Save Choices
Iquit:Quit
# Common menus
PIredo:Reprocess
# General messages
ScaleFill:Scale to fill %0 by %1
NoRange:Range not used
OverW:Overwrite source file?
ButErr:Ignore,Quit
ButCon:Cancel,Discard
BadJQ:Invalid JPEG quality in JPEG output dialogue box
BadMode:Invalid mode number in sprite output dialogue box
Proc:processed in %0 seconds
Unsaved:Image created from '%0' not saved
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.35"
Module_Version SETA 135
Module_MajorVersion SETS "1.36"
Module_Version SETA 136
Module_MinorVersion SETS ""
Module_Date SETS "27 Oct 2012"
Module_ApplicationDate SETS "27-Oct-12"
Module_ComponentName SETS "ChangeFSI"
Module_ComponentPath SETS "mixed/RiscOS/Sources/Apps/ChangeFSI"
Module_FullVersion SETS "1.35"
Module_HelpVersion SETS "1.35 (27 Oct 2012)"
Module_FullVersion SETS "1.36"
Module_HelpVersion SETS "1.36 (27 Oct 2012)"
END
/* (1.35)
/* (1.36)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.35
#define Module_MajorVersion_CMHG 1.36
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Oct 2012
#define Module_MajorVersion "1.35"
#define Module_Version 135
#define Module_MajorVersion "1.36"
#define Module_Version 136
#define Module_MinorVersion ""
#define Module_Date "27 Oct 2012"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "ChangeFSI"
#define Module_ComponentPath "mixed/RiscOS/Sources/Apps/ChangeFSI"
#define Module_FullVersion "1.35"
#define Module_HelpVersion "1.35 (27 Oct 2012)"
#define Module_LibraryVersionInfo "1:35"
#define Module_FullVersion "1.36"
#define Module_HelpVersion "1.36 (27 Oct 2012)"
#define Module_LibraryVersionInfo "1:36"
......@@ -34,18 +34,14 @@ task%=INSTR(A$," -wimp")
SYS "OS_SWINumberFromString",,"OS_ReadMonotonicTime" TO Time%
SYS "OS_SWINumberFromString",,"ColourTrans_ReturnColourNumber" TO ctran%
IF task% THEN
DIM z%(1),p%(3),s%(3),m$(33)
A%= OPENIN"<ChangeFSI$Dir>.Messages"
B%=-1
REPEAT
B%+=1
m$(B%)= GET$#A%
UNTIL EOF#A%
CLOSE#A%
DIM z%(1),p%(3),s%(3)
SYS"MessageTrans_FileInfo",,"<ChangeFSI$Dir>.Messages" TO,,S%
DIM msgb% 16,msgf% S%
SYS"MessageTrans_OpenFile",msgb%,"<ChangeFSI$Dir>.Messages",msgf%
startfile%=RIGHT$(A$,6)<>"-wimp "
DIM taskid%4
$taskid%="TASK"
SYS "Wimp_Initialise",200,!taskid%,m$(20) TO version%
SYS "Wimp_Initialise",200,!taskid%,FNmsg0("_TaskName") TO version%
IF version%>=350 THEN
SYS "XOS_Memory",8+(2<<8) TO ,r1,r2;F%
IF F% AND 1 vramsize%=0 ELSE vramsize%=r1*r2
......@@ -108,7 +104,7 @@ IF task% THEN
SYS "Wimp_LoadTemplate",,z%,idata%,eidata%,-1,"Info"+z$,0 TO ,,idata%
ENDIF
SYS CreateW,,z% TO infow%
$!(z%+88+7*32+20)=MID$(m$(21),INSTR(m$(21),":")+1)
$!(z%+88+7*32+20)=FNmsg0("_Version")
PROCdotemplate("Processing")
SYS CreateW,,z% TO proc%
p%(0)=!(z%+88+8*32+20)
......@@ -162,7 +158,7 @@ IF task% THEN
q%!12=68
q%!16=68
q%!20=%11000000000010
$(q%+24)="!"+m$(20)
$(q%+24)="!"+FNmsg0("_TaskName")
SYS "Wimp_CreateIcon",,q% TO iconbar%
SYS "XOS_Find",&40,"Choices:ChangeFSI.Choices" TO A%;V%
IF (A%=0) OR ((V% AND 1)=1) THEN
......@@ -366,10 +362,7 @@ REM
DEF PROCreceive(q%)
CASE q%!16 OF
WHEN 0
PROCremovearea
SYS "Wimp_CloseDown"
END
REM PROCcheckandfinish
PROCfinishandquit
WHEN 1
IF q%!20<>save% THEN
!q%=60
......@@ -451,7 +444,7 @@ DEF PROCcallFSI
A$="garbage "+F$+" <ChangeFSI$Dir>.Foo "+A$
PROCChangeFSISuffix
info$=""
range$=m$(19)
range$=FNmsg0("NoRange")
cputime%=0
IF sprite% !q%=pic%:SYS &400c3,,q%:saved%= TRUE :sprite%= FALSE
nextlocation%=HIMEM
......@@ -499,7 +492,7 @@ DEF PROCcallFSI
q%!12=0
SYS SetI,,q%
$adran%=range$
$adsrc%=info$+m$(0)+ STR$(cputime% DIV 100)+decimal_point$+RIGHT$("0"+ STR$(cputime%MOD 100),2)+m$(1)
$adsrc%=info$+" "+FNmsg1("Proc",STR$(cputime% DIV 100)+decimal_point$+RIGHT$("0"+ STR$(cputime%MOD 100),2))
saved%= FALSE
sprite%= TRUE
REM Get the leafname of F$ for the save box (so you don't overwrite the source),but have the full path in the title bar
......@@ -519,7 +512,7 @@ DEF FNcheckvalues
REM Is the JPEG quality within the correct range?
IF dest%=0 AND VAL ($adjpegq%) > 100 THEN
e = 1
error$ = m$(22) + m$(25) + m$(23) + m$(27) +m$(24)
error$ = FNmsg0("BadJQ")
ENDIF
REM Is it a numerical mode?
IF LEFT$($admode%,1) < "A" AND dest%=1 THEN
......@@ -529,15 +522,15 @@ DEF FNcheckvalues
IF VAL ($admode%) > 127 AND VAL ($admode%) < 256 flag%=2
IF (flag% AND 2) > 0 THEN
e = 2
error$ = m$(22) + m$(26) + m$(23) + m$(13) +m$(24)
error$ = FNmsg0("BadMode")
ENDIF
ENDIF
IF e <> 0 THEN
SYS Drag,,-1
!buffer%=e
$(buffer%+4)=error$+CHR$0
SYS "Wimp_ReportError",buffer%,%01,m$(20) TO ,A%
IF A%=2 PROCremovearea:SYS "Wimp_CloseDown":END
SYS "Wimp_ReportError",buffer%,%01,FNmsg0("_TaskName") TO ,A%
IF A%=2 THEN PROCfinishandquit
ENDIF
=e
:
......@@ -576,20 +569,27 @@ DEF PROCChangeFSISuffix
ENDPROC
:
REM
DEF PROCfinishandquit
PROCremovearea
SYS "Wimp_CloseDown"
SYS "XMessageTrans_CloseFile",msgb%
ENDPROC
:
REM
DEF PROCcheckandfinish
IF saved% OR NOT sprite% PROCremovearea:SYS "Wimp_CloseDown":END
IF saved% OR NOT sprite% THEN PROCfinishandquit
!buffer%=ERR
$(buffer%+4)=m$(2)+F$+m$(3)+CHR$0
SYS "Wimp_ReportError",buffer%,%010100000000,m$(20),"!changefsi",1,m$(30) TO ,A%
IF A%=4 PROCremovearea:SYS "Wimp_CloseDown":END
$(buffer%+4)=FNmsg1("Unsaved",F$)+CHR$0
SYS "Wimp_ReportError",buffer%,%010100000000,FNmsg0("_TaskName"),"!changefsi",1,FNmsg0("ButCon") TO ,A%
IF A%=4 THEN PROCfinishandquit
ENDPROC
:
REM
DEF PROCchecksaved(q%)
IF saved% OR NOT sprite% ENDPROC
!buffer%=ERR
$(buffer%+4)=m$(2)+F$+m$(3)+CHR$0
SYS "Wimp_ReportError",buffer%,%010100000000,m$(20),"!changefsi",1,m$(30) TO ,A%
$(buffer%+4)=FNmsg1("Unsaved",F$)+CHR$0
SYS "Wimp_ReportError",buffer%,%010100000000,FNmsg0("_TaskName"),"!changefsi",1,FNmsg0("ButCon") TO ,A%
q%!12=q%!8
IF A%<>4 SYS "Wimp_SendMessage" ,19, q%, 0
ENDPROC
......@@ -678,8 +678,8 @@ DEF PROCsavesprite
IF F$ = $adsave% THEN
SYS Drag,,-1
!buffer%=3
$(buffer%+4)=m$(28)+CHR$0
SYS "Wimp_ReportError",buffer%,%11,m$(20) TO ,A%
$(buffer%+4)=FNmsg0("OverW")+CHR$0
SYS "Wimp_ReportError",buffer%,%11,FNmsg0("_TaskName") TO ,A%
IF A%=2 THEN
REM Cancel
SYS CrMenu,,-1
......@@ -696,14 +696,21 @@ ENDPROC
:
REM
DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
LOCAL moved%
LOCAL moved%,imenu$,pmenu$
REM Picture menu structure
pmenu$= FNmsg0("Pimg")+">sinfo%,"+FNmsg0("Psrc")+">srcinfo%,"+FNmsg0("Prange")+">raninfo%,"
pmenu$=pmenu$+FNmsg0("Pzoom")+">zoom%,"+FNmsg0("Psave")+">save%,"+FNmsg0("PIredo")
REM Iconbar menu structure
imenu$= FNmsg0("Iinfo")+">infow%,"+FNmsg0("Iscale")+">scalew%,"+FNmsg0("Iproc")+">proc%,"
imenu$=imenu$+FNmsg0("Ispr")+">output%:dest%,"+FNmsg0("Ijpg")+">jpego%:1-dest%,"+FNmsg0("PIredo")+","
imenu$=imenu$+FNmsg0("Ifast")+":fast%AND1,"+FNmsg0("Ichoice")+","+FNmsg0("Iquit")
moved%= FALSE
IF b% AND 2 THEN
CASE handle% OF
WHEN pic%
PROCdomenu(pic%,m$(4)+">sinfo%,"+m$(5)+">srcinfo%,"+m$(6)+">raninfo%,"+m$(7)+">zoom%,"+m$(8)+">save%,"+m$(9),m$(20))
PROCdomenu(pic%,pmenu$,FNmsg0("_TaskName"))
WHEN -2
PROCdomenu(101,m$(10)+">infow%,"+m$(11)+">scalew%,"+m$(12)+">proc%,"+m$(13)+">output%:dest%,"+m$(27)+">jpego%:1-dest%,"+m$(9)+","+m$(14)+":fast%AND1,"+m$(15)+","+m$(16),m$(20))
PROCdomenu(101,imenu$,FNmsg0("_TaskName"))
ENDCASE
rmenuhandle%=handle%
ENDIF
......@@ -740,7 +747,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
IF b% AND 5 THEN
CASE handle% OF
WHEN output%
IF dest%=0 dest%=1:PROCdomenu(101,m$(10)+">infow%,"+m$(11)+">scalew%,"+m$(12)+">proc%,"+m$(13)+">output%:dest%,"+m$(27)+">jpego%:1-dest%,"+m$(9)+","+m$(14)+":fast%AND1,"+m$(15)+","+m$(16),m$(20)):SYS Getcaret%,,q%:moved%= TRUE
IF dest%=0 dest%=1 THEN PROCdomenu(101,imenu$,FNmsg0("_TaskName")):SYS Getcaret%,,q%:moved%= TRUE
CASE icon% OF
WHEN 3,4,5,6
PROCkillcurrent( STR$(22+icon%))
......@@ -922,7 +929,7 @@ DEF PROCcheckmouse(mousex%,mousey%,b%,handle%,icon%,ob%)
IF dest%=1 THEN
SYS Getcaret%,,q%
dest%=0
PROCdomenu(101,m$(10)+">infow%,"+m$(11)+">scalew%,"+m$(12)+">proc%,"+m$(13)+">output%:dest%,"+m$(27)+">jpego%:1-dest%,"+m$(9)+","+m$(14)+":fast%AND1,"+m$(15)+","+m$(16),m$(20))
PROCdomenu(101,imenu$,FNmsg0("_TaskName"))
IF icon%=5 SYS Caretpos%,jpego%,q%!4,q%!8,q%!12,q%!16,q%!20
ENDIF
CASE icon% OF
......@@ -1042,7 +1049,7 @@ DEF PROCmenuitem(text$)
ENDIF
menuptr%!0=flg%
menuptr%!4=submenu%
IF (text$=m$(9) AND (F$="" OR F$="SpriteFile" OR F$="JPEGImage")) OR (text$=m$(14) AND vram%) THEN
IF (text$=FNmsg0("PIredo") AND (F$="" OR F$="SpriteFile" OR F$="JPEGImage")) OR (text$=FNmsg0("Ifast") AND vram%) THEN
menuptr%!8=&07400021
ELSE
menuptr%!8=&07000021
......@@ -1070,20 +1077,20 @@ DEF PROCmenuselect(menus%)
CASE menuhandle% OF
WHEN pic%
CASE a$ OF
WHEN m$(9)
WHEN FNmsg0("PIredo")
PROCcallFSI
ENDCASE
WHEN 101
CASE a$ OF
WHEN m$(14)
WHEN FNmsg0("Ifast")
fast%=NOT fast%
WHEN m$(27)
WHEN FNmsg0("Ijpg")
dest%=0
WHEN m$(13)
WHEN FNmsg0("Ispr")
dest%=1
WHEN m$(9)
WHEN FNmsg0("PIredo")
PROCcallFSI
WHEN m$(15)
WHEN FNmsg0("Ichoice")
statescale%=0
FOR I%=0 TO 9
statescale%+=FNgeticonstate(scalew%,I%)<<I%
......@@ -1109,7 +1116,7 @@ DEF PROCmenuselect(menus%)
PRINT#A%,$p%(0),FNlocale_convert($p%(1),decimal_point$,"."),$p%(2),$p%(3),$admode%,$adspcl%
PRINT#A%,$s%(0),$s%(1),$s%(2),$s%(3)
CLOSE#A%
WHEN m$(16)
WHEN FNmsg0("Iquit")
PROCcheckandfinish
ENDCASE
ENDCASE
......@@ -1321,7 +1328,7 @@ DEF PROCshowscaletofit
ENDCASE
tofitx+=1
tofity+=1
$adscale%=m$(17)+ STR$tofitx+m$(18)+ STR$tofity
$adscale%=FNmsg2("ScaleFill",STR$tofitx,STR$tofity)
q%!12=1<<21
!q%=output%
FOR I%=0 TO 11
......@@ -1344,6 +1351,21 @@ DEF PROCkillcurrent(m$)
ENDPROC
:
REM
DEF FNmsg0(t$)
=FNmsg2(t$,"","")
:
REM
DEF FNmsg1(t$,a$)
=FNmsg2(t$,a$,"")
:
REM
DEF FNmsg2(t$,a$,b$)
LOCALr$
REM Superset of message lookup with substitution
SYS"MessageTrans_Lookup",msgb%,t$,STRING$(200,"@"),200,a$,b$ TO,,r$
=r$
:
REM
DEF FNZS(I%)LOCAL A$
REPEAT
A$+=CHR$?I%
......@@ -1357,8 +1379,8 @@ DEF PROCerrorbox
!buffer%=ERR
$(buffer%+4)=REPORT$+CHR$0
REM $(buffer%+4)=REPORT$+" (ref: "+STR$ERL+")"+CHR$0
SYS "Wimp_ReportError",buffer%,%010100000000,m$(20),"!changefsi",1,m$(29) TO ,A%
IF A%=4 PROCremovearea:SYS "Wimp_CloseDown":END
SYS "Wimp_ReportError",buffer%,%010100000000,FNmsg0("_TaskName"),"!changefsi",1,FNmsg0("ButErr") TO ,A%
IF A%=4 THEN PROCfinishandquit
ENDPROC
:
REM A$ Command String
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment