# StrongED$Mode = Document
--------------------------------------------------------------------------------
If <Choices$Write> is not defined it fails initially with the message
"Bad file name '.Director.Menus.AutoRun.!!SetVars'.
Harriet Bazley harriet__bazley_freeuk_com

If a filename contains <?>, IfThereIs can't handle it if <?> doesn't exist.
Solution: Call IfThereIs through 'X', i.e.:
  x ifthereis <example$dir>.file echo 1 0
or
  if "<example$dir>" <> "" then ifthereis <example$dir>.file echo 1 0
which doesn't complain if example$dir doesn't exist

--------------------------------------------------------------------------------
If <Choices$Write> is set up (i.e. !Choices application?) but
<Boot$Path> does not exist, the Bin application fails.   Perhaps in this
case an alternative location for the bin directory should be
<Director$Dir>.^.Bin ?
Harriet Bazley harriet__bazley_freeuk_com

Bin has been removed from the default Director distribution and put in the
3rdParty section, under my (Phil L's) name. It has been modified to default to
putting binned items in <Director$Write>.Menus.BinPL.Bin

--------------------------------------------------------------------------------
Finally, Director will no longer work under RISC OS 3.1 without the new
!Boot structure in any case, because it now uses the commands 'Do' and
'Repeat', which I believe were introduced in RISC OS 3.5.   'DirectorDo'
is an alternative already supplied by the Director module, which works
on all versions of RISC OS;  however, as far as I know Director does not
contain a ready-made substitute for the use of 'Repeat'.
Harriet Bazley harriet__bazley_freeuk_com

all 'do' commands have been changed to 'directordo'
Harriet has supplied a BASIC version of Repeat

--------------------------------------------------------------------------------
Also, when I click menu over the pinboard and open the menu..
 Pinboard -> System -> Scrap
 ..I get the error "Filing system ADFS needs a filename at line 24".
Chris Willaims chris__drobe_co_uk

When I (Phil L) click menu over the pinboard and open the menu..
 Pinboard -> System -> Scrap
 ..I get the error "Too long".
This is caused by too long a line being sent to the OS/CLI . A solution
might be to pass the system variable <Wimp$ScrapDir> as that, rather than
it's value - but how?

Fixed (for both errors). Solution: the text '|||<Wimp$ScrapDir>' on first
parsing changes to '|<Wimp$ScrapDir>'. That text is then passed to ExplodeDir
which then finds out exactly where <Wimp$ScrapDir> points.

--------------------------------------------------------------------------------
> I can confirm that two DirectorIcon statements one after each other that
> operate on the same '<sprite>' cause the TaskManager icon to disappear
> - RiscPC, 3.7. The TaskManager module itself is still resident though. 
> I'll look out for the unpleasant side effects for the rest of this
> session!

"Can't open file 'Repeat'" when attempting to use this command was one
of the weird side-effects!

*FileInfo was only listing the first three characters of filenames, and
I was also getting various 'not found' errors that I assumed, with
hindsight, to be associated with the problem.

> Can I ask what machine and which version of RISC OS it's running? 
4Mb A5000, RISC OS 3.1 with Longfiles (no new !Boot - too *slow*!).
 
> Can I ask if issuing the command:
>   DirectorIcon <sprite> -remove
> between the two DirectorIcon commands work?

Afraid not.   It would have been a rather neat solution.

Harriet Bazley harriet__bazley_freeuk_com

Commenting lines 302-338 (IconBlockListCreateIcons) which creates/SWIs the
icons into existence means that there are no icons created, but neither any
problems generated due to multiple DirectorIcon <Icon> calls.

Commenting lines 324-334 and 337/8 which leaves the 'destroy' section of
IconBlockListCreateIcons does present this problem.

When Director stores the information for an icon definition it's memory
block is first initiated with 0.
When Director has finished going through the menu definitions it ends up
with a list of icons to create or delete on the next Wimp_Poll call.
Director handles redefinitions of icons by setting the 'to be
deleted' flag for an icon (in it's internal memory block) and then
creating it's replacement.
On Director's first Wimp_Poll call no icons have been assigned
icon handles.
Therefore, when Director calls Wimp_DeleteIcon, the icon handle has the
default of 0 and thus Director deletes the task manager icon.

The fix I implemented was to check the icon handle before calling
Wimp_DeleteIcon. If it is 0 then the SWI is not called.
I'm not sure if this will also fix the other problems experienced as
I haven't been able to replicate them.

--------------------------------------------------------------------------------
The Pinboard->Paths->Modules-> submenu only shows a subset of !System's
modules (specifically just the contents of '400.Modules').

Personally I think the expansion of System$Path needs a special version
of ExpPath so that it generates a menu (eg) :

  310.Modules  =>
  350.Modules  =>
  360.Modules  =>
  370.Modules  =>
  400.Modules  =>

Lenny lenny__argonet_co_uk

--------------------------------------------------------------------------------
May I suggest against setting the background colour for a menu item, as
it mucks up RO4's textured backdrop for the entire menu (not just the
menuitem in question).  Eg the 'Pinboard' entry in the Pinboard menu.  I
tend to use a red foreground, instead.
Also the Pinboard->Desktop->MouseStep->Mouse final (writeable) menuitem.

Lenny lenny__argonet_co_uk

--------------------------------------------------------------------------------
>As this submenu lists outline fonts, I assume it's intended to set the
>Desktop font (System fonts being the old 8x8 BBCFont things).  However it
>doesn't seem to.  Should it ?

The entry really should be called 'Desktop font' (not 'System font').

>It sets a sys var (Wimp$Font).  This var doesn't exist (on my setup)
>prior to making a selection from this menu.

This varable and it's counterparts Wimp$FontSize and Wimp$FontWidth are
used by the WindowManager (WIMP) if the user has configured WimpFont to
0.

If this is not the case then the menu will have no effect.

Strangely enough even with WimpFont set to 0 the screen refresh that is
then done does not updated the Desktop font used. A press of F12 and
then <return> is required for this to be updated.

Lenny lenny__argonet_co_uk

Fixed: It required a *fx 20 to be issued before the screen redrawed.
Not fixed: It doesn't obviously say that it only works if WimpFont is
configured to 0.

Lenny lenny__argonet_co_uk

Not fixed: *fx20 isn't whats' required.
Actual fix: send the wimp message FontChanged and *then* redraw the screen.
It now: *co. WimpFont 0 as well

Lenny lenny__argonet_co_uk

--------------------------------------------------------------------------------
I said:
I'm having a minor problem with StrongED's interaction with CVS (the
RISC OS front end).

When I perform an action that requires a log message to be entered I get
a message (come up in an Wimp_ReportError window). These messages are
all in a similar format, a few examples are below:
Please insert disk 'GreenbackL', to read 'IDEFS::GreenbackLib/Docs'
Please insert disk 'GreenbackD', to read 'GreenbackDDBPlay/o'`
Please insert disk 'GreenbackD', to read 'cvs'
These messages all are titled: Prompt from IDEFS

Later I said:
To fully replicate the problem: Run SE, CVS GUI Client and WimpMon
(Director is not needed, it just shows/ed up the bug in SE). Set WimpMon
to monitor all User Messages from StrongED, (CVS GUI Client optionally)
and ensure that Catch new is also ticked.

WimpMon has a redraw bug so hide the WimpMon window behind another
window. In the CVS GUI Client select the right project and do a commit
on the whole of it. When the ExternalEdit window opens, close it and
abort the cvs commit action.

When completed, save the WimpMon log file to HD and quit WimpMon.
Note: Director always generated the error just before the ExternalEdit
window opened.

Still later I said:
Right. I believe I have solved the problem.
Director has a filter on Wimp_Messages for Memoriser. Memoriser looks
out for things like the DataLoad messages you get in the Data transfer
protocol. It seems that an application (or a filing system ?) doesn't
always zero terminate filenames when sending these messages - or if it
does, it doesn't account for the extra byte that is required.


I have altered memoriser to 0 terminate any wimp message it gets if the
message length is less than 256 bytes long.

Phil L philip__philipnet_com

--------------------------------------------------------------------------------
Using the CurrentMenu's Director->Edit->Reload entry, only re-runs that
specific menu (Default / MachineName).
Any files in Choices:Director.Menus.AutoRun are not re-run.  As this is
the home for user files, I had expected them to be.

One solution is to have everything in the MachineName menu, and not use
Choices:Director.Menus.AutoRun (for things that are likely to be
edited).

The solution I've used is to have my subsidiary menu files in another
directory within Choices:Director.Menus, and to explicitly run these
from my MachineName file.
(Putting them in Choices:Director.Menus.AutoRun would mean they'd get
run twice when first running Director - not a problem, just slower.)

Lenny lenny__argonet_co_uk

--------------------------------------------------------------------------------
The Paths->Drives menu is getting it wrong re my SCSI drives.

It identifies that there are 4 partitions, though they're all greyed
(it says they're 'empty').  Only drive 7 is 'empty' (it's a syquest).
Drives 4-6 are mounted, so they should show okay.
I'm using Cumana SCSI2 2.08.

Ah, this may be the problem ...
The SWI SCSIFS_Drives exists on my system, though the filing system
name is SCSI:: not SCSIFS::

Also (here) SCSIFS_Drives returns : flops=0 hards=4

My (PJL) reply was:
I have made a small change to FindDrives. If the SCSI card uses SCSI_...
SWIs then it presumes that drives are display with names like: SCSI::4.$
If it uses SCSIFS_... then is displays them like: SCSIFS::4.$

I need to do the check another way.

Lenny lenny__argonet_co_uk

--------------------------------------------------------------------------------
Selecting the 'small icons' or 'full info' options from Switch submenu
gives 'bad pointer passed to Wimp in R0 at line 190'.   I did some work
on this back in August when the beta first came out - I enclose my RISC
OS 3.1-friendly versions of Close, DoCLose amd DoWin.

Note that in DoClose as supplied in Director, PROCswitch in line 41 does
not exist, and that using OS_Mouse rather than Wimp_GetWindowOutline in
PROCpin appears to return wrong values - the object is always pinned
noticeably below the mouse position, though I cannot see why, and this
same code is used in many other places without problems!

Harriet Bazley harriet__bazley_freeuk_com

--------------------------------------------------------------------------------
Reuben Thomas rrt1001__cam_ac_uk
Subject: Director Modules menu

Bug in Modules: it can't cope with long module help strings. I suggest you
fix it by only reading up to 255 characters in FN0. I know that no modules
should have a help string that long, but it helps for those which do,
erroneously.

--------------------------------------------------------------------------------
One of the things in my genes is an ability to crash any computer program
within 5 seconds merely by looking at the screen ...

Thus the VERY FIRST  System => Modules => modname  => SWI's =>

caused !Director to flash up an error box "SWI name not known at 48".

The module I hit on, the very first one you note, was  PrintQFS,
something CC supply with the Laser Direct printer.

I had a look at the module, and find that it has no SWI decoding entries
at Offset + &24 or +&28

Fixed.

--------------------------------------------------------------------------------
Unknown operand at 420 is an error message given by 
RISC OS V.4.27 when menu is selected on the CD icon.

It also applies to !Director .28 and previous 
releases.

Computer: Castle Kinetic
Memory: 128 Mb

Fixed. In later version of CDFS, the CDFS iconbar icon has indiected text.
CDFS wasn't Wimp_TransferBlock-ing the memory before trying to get the drive
number.

--------------------------------------------------------------------------------
> Director 0.26 (sometimes the Switch program crashes).

Yes I have noticed this.  It is a 3.70 problem I think.

--------------------------------------------------------------------------------
> ADJUST on Director's Iconbar Icon => System => Modules => error "String
> not recognised at 35"

CR in module name - more defensive?

Hopefully fixed.

--------------------------------------------------------------------------------
And I would also like to suggest that Director canonicalise the path of
any directories/files it opens, where possible, as StrongED does.
Currently I often end up with one Filer window, entitled, for example,
'Utils:!Textseek.Source' opened from a Director menu, and an identical
duplicate view entitled e.g. 'IDEFS::A5000.$.WIMP.Work.!Textseek.Source'
opened from the Filer, or by ADJUST-clicking on the close icon when
editing one of the files from the first view.

Harriet Bazley harriet__bazley_freeuk_com

--------------------------------------------------------------------------------
I have an extra little command "RMSave" That I used to include in my
System:Modules menus.  Is there any chance this could be incorporated into
the standard stuff, as it is about the only change from the "Out-of-the-box"
Director setup that I would like.

Later,

Jamie.

Jamie Michael Temple jamie__parsed-out_demon_co_uk

My reply:

As to where it saves the module and what name it calls it will have to
be given some thought.

Jamie replied saying:

I used the following code:

   560 : REM ---------------------------------
   570 : REM Slight Jamie Adjustments begin...
   580 : REM ---------------------------------
   590 : SYS Dash%
   600 : OSCLI "*RMSave "+title$+" <Wimp$ScrapDir>."+title$
   610 : SYS Option%,"""Save..."" -sub Save:<Wimp$ScrapDir>."+title$
   620 : REM ---------------------------------------------------------

... it automatically saves the file into <Wimp$Scrap> as the Module submenu
is created, then uses the Director Save: window to allow you to drag it to
wherever you want.

--------------------------------------------------------------------------------
I have created a Choices:Director.Utils directory for some of my extra bits.
Unfortunately, this does not work. - I have made a simple alteration to
the main !Director.!Run file which I suggest may be a handy change:

I have altered line 8 of !Director.!Run from :

If "<Director$Dir>" = "" Then Set Run$Path <Run$Path>,<Obey$Dir>.Utils.

... to ...

If "<Director$Dir>" = "" Then Set Run$Path <Run$Path>,Director:Utils.

... which enables us to have a Choices:Director.Utils directory.


Later,

Jamie.

Jamie Michael Temple jamie__parsed-out_demon_co_uk

--------------------------------------------------------------------------------
DirectorIcon directory -time <37>24:%MI -text ""

Appears on the iconbar but with the icon exactly half way up. The next second when the time appears, the bottom half of the icon is overwritten.

Director crashes shortly afterwards due to a buffer overflow.

Fixed: The crash caused by the buffer overflow. The end of the buffer is
checked and not exceeded.
Not fixed: The icon doesn't get reposistioned.

DirectorIcon directory -time <37>24:%MI -text " "

Does the same as above.

DirectorIcon directory -time <37>24:%MI -text "0"

Seems to work.

However, all of the above fail to allocate the right space for time string

Fix the interaction between DirectorIcon and strcpyl (and strcpyl0)

Fixed.
--------------------------------------------------------------------------------
Issues with PollWord

There isn't 2^32 possibel values for it as ORR_Poll_Word *ORs* the value in r0
with the curreny value.
There is only 32 possible values.
The PollWordNonZero function needs to take account of that.

Fixed.

--------------------------------------------------------------------------------
5) Director is able to show, when installed, the time below its icon on the
Iconbar, how about one for  free memory?

This is a nice idea.  I'd need to think of a general purpose interface so
you could put anything under  the icon though.  You might have to write a
code variable to return the memory used

Done :-).

--------------------------------------------------------------------------------
Would it be possible for files acted upon via a MenuMenu entry to
register in the Memoriser, as they would if the same action had been
carried out via the Filer?   This would make it easier to get back to
the same place again without navigating through deeply-nested menus,
something I seem to find myself wanting to do with surprising frequency.
(In fact, I'm not quite clear how the Filer_Action tasks manage to
escape the Memoriser in the first place.)

Ideally, any time a MenuMenu was called up, even if no action was
ultimately taken, it would be nice if this file were available from the
Memoriser history, as it would be if a directory had been opened to
access it.

Harriet Bazley harriet__bazley_freeuk_com

Changes now mean that <Wimp$ScrapDir>.ScrapFile now gets added to the
Memoriser. Need to CMP supplied file with actual value of
<Wimp$ScrapDir>.ScrapFile as well.

--------------------------------------------------------------------------------
In message 4ae0a6b697lenny__argonet_co_uk
, Lenny lenny__argonet_co_uk wrote:

>As this submenu lists outline fonts, I assume it's intended to set the
>Desktop font (System fonts being the old 8x8 BBCFont things).  However it
>doesn't seem to.  Should it ?

>It sets a sys var (Wimp$Font).  This var doesn't exist (on my setup)
>prior to making a selection from this menu.

This varable and it's counterparts Wimp$FontSize and Wimp$FontWidth are
used by the WindowManager (WIMP) if the user has configured WimpFont to
0.

If this is not the case then the menu will have no effect.

Strangely enough even with WimpFont set to 0 the screen refresh that is
then done does not updated the Desktop font used. A press of F12 and
then <return> is required for this to be updated.

Lenny lenny__argonet_co_uk

Fixed: It required a *fx 20 to be issued before the screen redrawed.
Not fixed: It doesn't obviously say that it only works if WimpFont is
configured to 0.

Update (20th Feb 2002):
Lenny has submitted some code that handles the WimpFont stuff.
It only handles the CMOS side of things and doesn't allow for the user to
configure the WimpFont to be any font and at any size.

--------------------------------------------------------------------------------
> Also, if an icon is created and the sprite does not exist, I sometimes seem
> to get undefined behaviour.  The sprite is not created, and I get the 'Sprite
> doesn't exist' message.  However, this is *sometimes* followed by an 'Illegal
> window handle' and the Task Manager icon disappears!
> 
> Unfortunately, I cannot reproduce this very often and it seems to have gone
> away now (the problem was that I was iconspritesing a file from Obey$Dir,
> which didn't seem to have been set...).

Philip Ludlam: I think I've fixed the Task Manager icon disappearing one.
               Not sure about the rest.

No on'e reported anything similar since. I believe the problem to be solved.

--------------------------------------------------------------------------------
I've just noticed you're using sexed single quotes when generating
MenuMenu.  These chars don't map across all fonts (I've been playing with
the desktop font :o)

Eg the line :

SYS Option,"""Set CSD to '"+DirLeaf$+"'"""
                         ^            ^

Using unsexed quotes would avoid odd looking menus (with some fonts).

Lenny lenny__argonet_co_uk


Phil L. : I believe this to be sorted now.

--------------------------------------------------------------------------------
DirectorIcon directory -time <37>24:%MI -text ""

Appears on the iconbar but with the icon exactly half way up. The next second
when the time appears, the bottom half of the icon is overwritten with text.

Director crashes shortly afterwards due to a buffer overflow.

Fixed: The crash caused by the buffer overflow. The end of the buffer is
checked and not exceeded.
Not fixed: The icon doesn't get reposistioned.

DirectorIcon directory -time <37>24:%MI -text " "

Does the same as above.

Phil L: This can't be fixed. The string is GSTrans-ed. In doing this any leading spaces are stripped leading to the effect described above.

--------------------------------------------------------------------------------
Would it be possible to tell director to display the free space of a
harddisc, instead of a label, or time. I have been try this myself but
cannot compile the altered source as I do not have objasm myself.

Martin Dann Martin__f451_freeserve_co_uk

The submitted source code and e-mail conversation have been placed in
External.MDann.Free

Would it also be a good idea to show the free RAM of a machine as well?

From Martin:
I have semi blindly added the code, I think that it would be better to
have a word containing the meaning of the string, rather than as in my
code, "free" used if "time" is not use. This means that a word contains e.g.
0 permanent string
1 time
2 free

What about the used space of drives and RAM?

--------------------------------------------------------------------------------
Concerning filer tree menus (clicking MENU on a filer title bar) ...

Both versions of the Director module use a sorting method that differs
slightly from that used by the filer.  Eg :

 * The filer :

   Test
   Test1    <-- Hard space between 't' and '1'
   Test2

 * Director 0.26+ and 0.27 :

   Test
   Test2
   Test 1

Lenny lenny__argonet_co_uk

DirectorP.Dir has been created (raFS) containing as many single character
files as RISC OS will allow. The routines that do the sorting are strcmpi
(s.Memory) and UpperCase (Asslib:hdr.Maros). This will need investigating.

Current theory:
Implement an array which holds the character as an single 8-bit character and
a value for the character to have whem being sorted. So that instead of the
string being sorted on ASCII value (but still case insensitive) it is sorted
based upon a different value altogether. Generation of this array will need
some work.

To implement a RISC OS 4+ style sorting where you have 1,2,3,10,11,20,a,b etc.
an EVAL/a search for numbers may need to be done on the string being sorted to
see if it is a number.

--------------------------------------------------------------------------------
MenuProcessing on and off nestable?

--------------------------------------------------------------------------------
By: spoj ( Steve Johnson ) 
   Offer of help ?   
2001-11-25 21:17 
Is this forum the place to offer help, as in the offer of taking little sub-projects for use in Director ? 

If so, can I offer an enhancement I made a few years ago... it modifies MenuMenu so that if you click Menu on a module
name, not only do you get the usual Copy/Rename etc, but also a sub-menu that shows info on the module, the SWI's,
commands, help text, and whether there is a copy in !System somewhere ! 

Having recently setup the new Director, I had to re-apply this mod I'd made, 'cos I really find it useful finding out if a module
that's supplied with a little app from the net is already in my !System ! 


By: philipnet ( Philip Ludlam ) 
   RE: Offer of help ?   
2001-11-26 00:21 
Hi Steve, 

Yes, this is the right place for such offers of help. 

Could you e-mail me (philipnet__users_sf_net) with your updated copy of MenuMenu please.

If you have anything else you would like to submit then let me know. 

Yours, 

Phil L.

--------------------------------------------------------------------------------
Option -dash now works

(Harriet Bazley)

--------------------------------------------------------------------------------
>I've just realised that Director always loads a backdrop /tiled/.  Which
>is none too nice with images that are just a little too small to fill the
>current screen.
>
>How about automating between tiled and scaled depending on the size
>(pixel wise) of the image file ?  Eg if both it's x and y are over half
>the current screen x and y, then scale it, otherwise tile it.
To throw a spanner in that idea: what about images which are just a
little bit smaller than the screen size which look awful when scaled?

Alternatively each menu option could have a submenu for Tiled, Scaled or
Centered. If I can do it this is the way I would go.

Lenny

--------------------------------------------------------------------------------
Just spotted a nasty bug.  I've been adding Email and Web links in the
ProgInfo window to one of my apps and I wanted to see what Director did
when no web/email resources are present.

It reports 'Cannot open Url' - fine.
Clicking on OK is fine.  Clicking on Cancel kills the wimp (cascading
dying tasks ... reset required).

It's probably gone unnoticed because most people have browser/email
resources available.

Lenny

--------------------------------------------------------------------------------
>> >As a temporay solution (until I can get 0.32 beta out of the door) try
>> >the following:
>> >At the addresses &00001088 and &00001B9C change the BL &00003E44 to a
>> >MOV r0, r0 That will stop Director from (re)setting the system variable
>> >tmp.
>> >
>> >This is totally without any testing though, so beware!  
>> 
>> err - that would be &00001090 rather than &00001088!
>
>I just get the error    :-(

Ah!
Odd!

I've just remebered that Director CRC's itself when initialising.
Making that change to the module will change its CRC value and it
should then error with the message "Module has become corrupted".

Harriet Bazley
--------------------------------------------------------------------------------

Update setdate to generate the 5 byte time block.
Possibly with: 'setdate o.file Block=""' ?

Update Templates to take that block and generate the Author & Version details.
It should get the format for both of these from the Messages file

--------------------------------------------------------------------------------

DirectorWindow Info -alias DirectorInfo -file <Director$Resources>Templates -command <Director$Dir>.Menus.Internal.Templates
DirectorWindow DirectorInfo -remove

Causes Director to error.

The problem: Director sends a WIMP message to itself to create a window. Any
subsequent operations on that window (to re-created it/kill it) results in
the ptr supplied in the (1st) WIMP message to point to corrupted data & thus
generates an error.

Solution: Stop Director sending itself WIMP messages and use the PollWord set
system instead (much safer).
The Window WIMP message system was never an external interface and removing it
could stop nasty programs from trying to crash Director.

Richard Hallas
--------------------------------------------------------------------------------
