Upgrading applications which use previous versions of DrWimp to the latest
version.

If you have never used previous versions of DrWimp then ignore this file.

You may think like I do that if an application is not going to be developed
further significantly then you are probably better leaving it alone.

Check which version you are using for the application, go down to the
relevent point, then make all the modifications detailed from then on.
Running your application without making every single modification all the
way to the end will probably result in a failure. 

Notes:

Making the changes will just ensure that your application works with the
latest version. Checking the History file could reveal new features which
have been added which could replace a lot of your code or improve various
areas.

Not every version is listed here. Only the ones where changes need to be
made and the current version to reassure you that there is nothing further.

I *strongly* advise that you don't attempt this on your only copy!

"..." denotes one or more arguments passed to a procedure or function.


1.01 (04-Apr-95)

  There is an extra parameter added to FNwimp_createmenu. As dynamic menus
were introduced in this version your application won't be using them so
change all occurances of FNwimp_createmenu(<string>) to
FNwimp_createmenu(<string>,0)

  FNwimp_iconbar now returns the handle for the iconbar window (-2). So your
call should look like bar%=FNwimp_iconbar(......, and use window%=bar% in
PROCuser_mouseclick or a similar construct for detecting clicks on the
iconbar icon.


1.02 (19-Apr-95)

  Remove the last parameter to FNwimp_initialise.


1.03 (26-Apr-95)

  Add a fourth parameter to FNwimp_initalise which is the minimum RISC OS
version that you will allow your application to run on multiplied by 100.
Eg: make the fourth parameter 200 for RISC OS 2 and 310 for RISC OS 3.10.


1.10 (24-Dec-95)

  Add the new user function to !RunImage:

    DEF PROCuser_menuopen(menu%,icon%)
    ENDPROC

  (PROCuser_minmenuwidth was also added in this version but removed in a
later version)


2.00 (02-Jul-96)

  Add the following new user functions to !RunImage:

    DEF FNuser_saveicon(window%)
    =0
    :
    DEF FNuser_sliderback(window%,icon%)
    =-1
    :
    DEF FNuser_slider(window%,icon%)
    =-1
    :
    DEF PROCuser_slidervalue(window%,icon%,pcent%)
    ENDPROC

  Change (in !RunImage):

    DEF PROCuser_savedata(path$,window%)
    ...
    ENDPROC

  to

    DEF FNuser_savedata(path$,window%)
    ...
    =1

  Remove the redundant FNuser_minmenuwidth (if you have it).

  I would recommend that you change the way your menus are created if you
want to compress your BASIC files. Here is an example:

    menu%=FNwimp_createmenu("Main menu/Item 1>sub%/Item 2/Item 3>window%",0)

  changes to

    menu%=FNwimp_createmenu("Main menu/Item 1/Item 2/Item 3",0)
    PROCwimp_attachsubmenu(menu%,1,sub%)
    PROCwimp_attachsubmenu(menu%,3,window%)


2.03 (15-Oct-96)

  Add the new user function to !RunImage:

    DEF PROCuser_modechange
    ENDPROC


2.04 (20-Oct-96)

  Add the new user function to !RunImage:

    DEF FNuser_menuhelp(menu%,item%)
    =""


2.06 (25-Nov-96)

  Change all occurances of the following in !RunImage:

    PROCwimp_bar(window%,icon%,length%)

  to

    PROCwimp_bar(window%,icon%,length%,0)


3.00 (31-May-97)

  Add the new user functions to !RunImage:

    DEF PROCuser_declarefonts
    ENDPROC
    :
    DEF PROCuser_print(xmin%,ymin%,xmax%,ymax%,page%)
    ENDPROC
    :
    DEF FNuser_printing(copy%,page%,totpages%,pagepos%)
    =0
    :
    DEF PROCuser_printerchange
    ENDPROC

  Change the following user function in !RunImage:

    DEF FNuser_saveicon(window%)
    =0

  to:

    DEF PROCuser_saveicon(window%,RETURN drag%,RETURN write%,RETURN ok%)
    ENDPROC

  If you have used this function to change the icon to drag then a general
example of the change you need to make is:

    DEF FNuser_saveicon(window%)
    IF window%=save% =3
    =0

  to:

    DEF PROCuser_saveicon(window%,RETURN drag%,RETURN write%,RETURN ok%)
    IF window%=save% drag%=3
    ENDPROC

  Change occurances of the following in !RunImage:

    window%=FNwimp_loadwindow(path$,window$,1)

  to:

    window%=FNwimp_loadwindow(path$,window$,0)

  If you have used sprite areas in the application you are upgrading, then
the following changes need to be made. From this version onwards sprite
areas have handles, and in the following changes, the handle is called
"sprites%" but you may use whatever name you wish. a% is an arbitary
variable.

  Change occurances of the following in !RunImage:

    PROCwimp_loadsprites(path$)

  to:

    size%=FNwimp_measurefile(path$)
    DIM sprites% size%
    a%=FNwimp_loadsprites(path$,sprites%)

  and occurances of:

    PROCwimp_pointer(pointer%,1,pointer$)

  to:

    PROCwimp_pointer(pointer%,sprites%,pointer$)

  and occurances of:

    window%=FNwimp_loadwindow(path$,window$,0)

  to:

    window%=FNwimp_loadwindow(path$,window$,sprites%)

  If you are displaying drawfiles in windows in the application that is
being updated, then the following change needs to be made.
  In previous versions of DrWimp, drawfiles were placed with the top left
corner of the drawfile at the work area coordinates specified. From this
version onwards, it is the bottom left corner that is positioned at these
coordinates. It is best to recalculate your coordinates for the positioning
of the drawfile, rather than waste time using the DrWimp functions to
calculate them for you from the width and height of the drawfile.

  If you create any menus where you attach the submenu at the same time by
using '>', like the following line, then it needs to be changed. For
example:

    menu%=FNwimp_createmenu("Main menu/Item 1>sub%/Item 2/Item 3>window%",0)

  changes to:

    menu%=FNwimp_createmenu("Main menu/Item 1/Item 2/Item 3",0)
    PROCwimp_attachsubmenu(menu%,1,sub%)
    PROCwimp_attachsubmenu(menu%,3,window%)

  This also applies to PROCwimp_putmenuitem, PROCwimp_recreatemenu,
FNwimp_createmenuarray and PROCwimp_recreatemenuarray.

  Change in !RunImage:

    DEF PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%)
    ...
    ENDPROC

  to:

    DEF PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%,printing%,page%)
    ...
    ENDPROC

  and:

    DEF FNuser_loaddata(path$,window%,icon%,ftype$)
    ...
    =0

  to:

    DEF FNuser_loaddata(path$,window%,icon%,ftype$,workx%,worky%)
    ...
    =0

  and:

    DEF PROCuser_mouseclick(window%,icon%,button%)
    ...
    ENDPROC

  to:

    DEF PROCuser_mouseclick(window%,icon%,button%,workx%,worky%)
    ...
    ENDPROC

  Note: as DrWimp is now around 15k bigger than the previous version,
applications which were tight on memory may now run out and fail, often with
what seems like an unrelated error. The most common is "too many nested
structures". If after upgrading an application you get errors appearing that
are definately NOT possible due to mistakes made in the upgrading, try
increasing the wimpslot of your application in the !Run file.


3.50 (23-Jan-98)

  Add the following user functions to !RunImage:

    DEF FNuser_quit(type%)
    =1

    DEF PROCuser_initialise
    ENDPROC

  Now move all code between FNwimp_initialise and PROCwimp_poll (or other
polling method) into PROCuser_initialise.

  Move all the code between PROCwimp_poll (or other polling method) and END
into FNuser_quit.

  Add the following lines to the start of FNuser_savedata, after any uses
of the LOCAL command already existing:

    LOCAL ERROR
    ON ERROR LOCAL =2

  Change any occurances of PROCwimp_rendersprite and
PROCwimp_renderwindowsprite so that an extra two arguments are passed:

  Change occurances of:

    PROCwimp_rendersprite(...)

  to:

    PROCwimp_rendersprite(...,1,1)

  Change occurances of:

    PROCwimp_renderwindowsprite(...)

  to:

    PROCwimp_renderwindowsprite(...,1,1)

  Change occurances of:

    finished%=TRUE

  to:

    PROCwimp_quit(0)

Five printing related functions (FNwimp_worktopaper, FNwimp_papertowork,
FNwimp_screentopaper and FNwimp_papertoscreen, PROCwimp_print) need to have
an extra argument added.

  Change occurances of:

    FNwimp_worktopaper(...)

  to

    FNwimp_worktopaper(...,0)

  Change occurances of:

    FNwimp_papertowork(...)

  to:

    FNwimp_papertowork(...,0)

  Change occurances of:

    FNwimp_screentopaper(...)

  to:

    FNwimp_screentopaper(...,0)

  Change occurances of:

    FNwimp_papertoscreen(...)

  to:

    FNwimp_papertoscreen(...,0)

  Change occurances of:

    PROCwimp_print(...)

  to:

    PROCwimp_print(...,0)


3.51 (21-Jun-98)

  No changes required.


EOF
