Author Topic: Script Prompt Position  (Read 821 times)

Richard Clubb

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Script Prompt Position
« on: October 21, 2015, 06:42:47 pm »
Hello.

I recently came across a very strange problem, when running a script on another PC it caused the Session.Input window to appear off the visible screen size.

Is there any way to override the "default" position of the Input dialogue?

Sincerely,

Rich.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7671
  • Karma: +156/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script Prompt Position
« Reply #1 on: October 21, 2015, 06:59:54 pm »
Not that I know of.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7671
  • Karma: +156/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Script Prompt Position
« Reply #2 on: October 21, 2015, 07:55:12 pm »
But you could use the VBScript InputBox, which allows you to indicate the position
Quote
InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])

See https://msdn.microsoft.com/en-us/library/3yfdhzk5(v=vs.84).aspx for more info

Geert
« Last Edit: October 21, 2015, 07:56:37 pm by Geert.Bellekens »

Pawel Zubkiewicz

  • EA User
  • **
  • Posts: 78
  • Karma: +1/-1
    • View Profile
    • zubkiewicz.com
Re: Script Prompt Position
« Reply #3 on: July 26, 2017, 07:00:40 pm »
This problem still exists and it's quite random. I've got JavaScripts that ask for user input and they are displaying sometimes input windows outside of "visible screen". For no apparent reason. This behavior can be seen on the same machine but also can be working ok on one and badly on the other (Repo in DB).

Dear Sparx could you please do something about that, for example overload Session.Input method with positionX,positonY attributes so we have a way to force window to be showed on screen?
Enhanced Requirement Attributes Addin for Enterprise Architect (ERA Addin) - http://zubkiewicz.com/?p=239

Mr Stuff

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
Re: Script Prompt Position
« Reply #4 on: July 31, 2017, 07:41:11 pm »
I also had problems with Session.Prompt placing the box in odd places and now use vbscript inputbox for the reason Geert gave.

Just once thing... have you checked the parameter list? I have a vague recollection that one of my early errors was passing too many parameters thinking it worked like InputBox and the invalid parameters were indirectly causing bad placement.

Nairam Serball

  • EA Novice
  • *
  • Posts: 10
  • Karma: +2/-1
    • View Profile
Re: Script Prompt Position
« Reply #5 on: November 07, 2017, 07:23:02 am »
Hello

I have observed that the placement of the Session.Input box isn't that random (but that doesn't mean it's logic, indeed): unlike the Session.Prompt that places at the center of EA's main area, the Session.Input box actually "tries" to place at the center of the "Scripting" window... or at the place where the Scripting window last was before it was closed.

If the Scripting window is at the center of the screen, you'll see the Session.Input box appear over it (I have tried doing several tests while moving the Scripting window from place to place on my screens : the Session.Input box follows the Scripting Window).
And it still works if you close the scripting window (the last position is remembered) !

If the scripting window is docked on the side of the screen, chances are the Session.Input box will only be partially visible and partially off screen.

Worse : if the Scripting window is docked on a screen side with auto-hide activated, the Session.Input box appears totally off screen.
An emergency solution to get it back is placing the mouse cursor over the corresponding input window icon you'll notice in the MS-Windows taskbar, wait for the window preview to appear then right click on it, choose "move", hit an arrow key on keyboard, move the mouse cursor to bring the invisible window back into visible screen area.  :o

A better and long term solution is... not using the Session.Input method anymore and switch to Geert's VBScript InputBox suggestion.

Hope this may help.

Regards
Update : I have submitted it as a bug to Sparx through registered user bug report.
« Last Edit: November 07, 2017, 07:30:39 am by Nairam Serball »