On Date: Wed, 18 Jul 2007 16:08:47 +0200  Klaus Major wrote:

1) what should be the trigger to write IDE stack positions to
file?  shutdownRequest in Home stack? )

I think "mctools" will be the candidate for writing prefs.
The user might close the home stack to gain screen space before
quitting MC.

2) What should be the trigger to read external file ? (preOpenStack
in "McTools.mc" and "home" stacks?

"home" sounds good, since this will be loaded first anyway.

and later answering  Robert Brenstein ..

Do we really want to modify Home stack?

No, we don't :-)
That was just a (obviously too) quick idea, since many folks will use
their own and probably modified "home" stack...

OK Klaus, I'll leave write / read triggers and saving place for you to decide. You are the list Poobah after all :)

As for script I posted yesterday which is using OpenStacks to register stack locations on ShutDown, it's no good because during the session developer may open, position and then CLOSE any of IDE stacks and querying OpenStacks on shutDownRequest would not allow to register all changes in stack Locations.

The script below has more general approach. It takes about 0.5-1 sec to register ALL IDE stack positions and about 1-1.5 sec to restore them. If you guys can leave with such delay, the script below may be considered....

on RememberIDEstacksPositions
 -- put the milliseconds into tTime
  lock messages
  put "McHome.mc" & cr & the substacks of stack "McHome.mc" & cr & \
      "McTools.mc" & cr & the substacks of stack "McTools.mc" & cr & \
"McHelp.mc" & cr & the substacks of stack "McHelp.mc" into tIDEstacksList
  repeat for each line L in tIDEstacksList
    put L &","& the rect of stack L & cr after tPositionsList
  end repeat
  unlock messages
  put StoragePositionsPath () into FL
  put tPositionsList into url ("file:"&FL)
--  put the milliseconds - tTime
end RememberIDEstacksPositions



on RestoreIDEstackPositions
  put StoragePositionsPath () into FL
  if there is a file FL then
  --  put the milliseconds into tTime
    put url ("file:"&FL) into tPositions
    put the windowBoundingRect into tMonitorRect
    lock messages
    repeat for each line L in tPositions
      put item 1 of L into tStack
      if there is a stack tStack then
        set the rect of stack tStack to (item 2 to 5 of L)
        -- if user changed resolution or monitor
        if (the left of stack tStack) + 10 > item 3 of tMonitorRect then
set the left of stack tStack to the left of stack tStack - 100 -- to make it accessable
        end if
        if the top of stack tStack > item 4 of tMonitorRect then
          set the top of stack tStack to item 4 of tMonitorRect - 100
        end if
      end if
    end repeat
    unlock messages
 --   put the milliseconds - tTime
  end if
end RestoreIDEstackPositions


function StoragePositionsPath
  set the itemDel to "/"
return item 1 to -2 of the effective fileName of stack "home" & "/IDEstackPositions.txt"
end StoragePositionsPath

best regards
Tariel

_______________________________________________
metacard mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/metacard

Reply via email to