1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

@select window problem

Discussion in 'Support' started by nikbackm, Aug 8, 2008.

  1. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Using TCMD 9.02.151.

    I have defined the following function for starting a @select window maximized to the whole screen. I run it from TCMD.

    ypos=%@FIELD[0,%@winpos[%_winfgwindow]]
    xpos=%@FIELD[1,%@winpos[%_winfgwindow]]

    : %1 = filename, %2 = window title
    selectwinmax=%@select[%1, %@eval[0-%@ypos[]], %@eval[0-%@xpos[]], %@eval[%_ypixels-%@ypos[]], %@eval[%_xpixels-%@xpos[]], %2]

    Ex: set entry="%@selectwinmax[c:\datalist.txt,Select entry]"

    It works well when the filename parameter contains less lines than fits on the screen. Then the @select window is positioned so that the upper left corner is placed in the upper left corner of the screen and the bottom right corner is placed to the right of the screen.
    The bottom of the window ends when the lines in the file ends.

    When the file contains more lines than fits on the screen however, there are some problems. In that case it seems that the bottom of the @select window is placed at the top of the screen so that the whole window is invisible. If you move the window (Alt-Space to open menu and then select move) its size corresponds to the size of the screen.

    This has worked well previously on older TCMD/TCC versions but not any longer. Has there been any change in the @select behavior or is there an error in my function definition?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    nikbackm wrote:

    @SELECT was changed in v9 to *not* try to validate & correct your
    incorrect parameters. (This was necessary in order to support multiple
    monitors & off-window positioning.)

    Rex Conn
    JP Software
     
  3. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Well, I first created this function with v9 so the change was then made in later v9 builds maybe?

    If the parameters are incorrect, how come the window size and position varies with the number of lines in the file? Obviously the top,bottom,left,right parameters are the same with each use (unless the TCMD window is moved).
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    nikbackm wrote:

    The height is reduced if the file doesn't have enough lines to fill the
    specified window. If the file has more lines @SELECT will use the
    specified size and add a scrollbar.

    Rex Conn
    JP Software
     
  5. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Ok, that makes sense.

    How does @select interpret "top,left,bottom,right"? It seems a bit inconsistent. It's not documented in the help file either.

    This

    %@select[power.txt,0,0,120,100,test]

    Opens a window starting from the top left of the TCC tab window in TCMD that is almost as wide as the tab window as well.

    But this (Increased "right" from 100 to 200)

    %@select[power.txt,0,0,120,200,test]

    Opens a window starting from the top left of the TCMD main window. This window is also much smaller, both height and width.

    I guess the second example uses pixels to size the window while the first uses characters. But why does the first use the TCC tab window as origo while the latter uses the TCMD main window?
     
  6. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    I got it to work by changing the function like this:

    ypos=%@FIELD[0,%@winpos[%_winfgwindow]]
    xpos=%@FIELD[1,%@winpos[%_winfgwindow]]
    : %1 = file, %2 = title

    selectwinmax=%@select[%1, %@eval[0-%@ypos[]], %@eval[0-%@xpos[]], %@eval[%_ypixels-%@ypos[]-30], %@eval[%_xpixels-%@xpos[]], %2]

    That is, I subtract 30 from the calculated bottom value.
    Anything less => select window is displayed above the visible area of the screen.

    The @select window does not use all the screen this way however. There are some 20-30 pixels at the bottom of the screen it does not use.

    My Windows task bar is set to auto-hide so it's most often not visible. Perhaps the @select window placement does not take this into account and always assumes the task bar is visible?
     
  7. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    I should perhaps also point out a positive thing with the new @select implementation to offset the complaints. :)

    The old @select only worked with files containing ~2300 lines or less. The new one seems to have no upper limit.

    Good for my search aliases/batchfiles which uses @select to displayed found results.
     
  8. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    nikbackm wrote:

    V9 added a screen coordinate positioning option for all popup windows
    (v8 and earlier only allowed row/column positioning, and only within the
    4NT window). If the width is > 150, it is assumed to be a screen
    coordinate. (It has been discussed several times here, and is in the
    help file in the configuration dialog section.)

    In v10 and beyond, the row/column positioning will be removed and
    everything will be in screen coordinates.

    Rex Conn
    JP Software
     
  9. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    rconn wrote:
    | In v10 and beyond, the row/column positioning will be removed and
    | everything will be in screen coordinates.

    ... thus breaking old batch files.

    I'd like the option of "window coordinates", i.e., positioning the pop-up
    relative to the TCC window, or in a TCMD tab, relative to the TCC tab
    display (I am allowing for the vertical/horizontal splits available in
    TCMD), i.e., I should be able to fix the locations of the pop-ups for
    multiple TCC instances relative to the display locaiton of the underlying
    TCC instances.
    --
    Steve
     
  10. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    ----- Original Message ----- Subject: RE: [Support-t-380] Re: @select window
    problem

    : V9 added a screen coordinate positioning option for all popup windows
    : (v8 and earlier only allowed row/column positioning, and only within the
    : 4NT window). If the width is > 150, it is assumed to be a screen
    : coordinate. (It has been discussed several times here, and is in the
    : help file in the configuration dialog section.)
    :
    : In v10 and beyond, the row/column positioning will be removed and
    : everything will be in screen coordinates.
    :
    : Rex Conn
    : JP Software

    V10 sounds very cool. So this will apply to QUERYBOX/MSBGOX/@SELECT and any
    other tool that requires coordinates. ?
    Will drawbox/hline/vline be removed or updated to follow the above syntax.
    If "drawbox/ h-v line" updated could they be updated to include true
    windowie styled qui boxes in a simpler manner drawbox /pos=130,250 n
    n being the type of gui box [1 2 3 4]
     
  11. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    Steve Fábián wrote:

    But it hasn't seemed to affect you with the v10 beta till now?


    There is no "underlying" position of the TCC windows (they're hidden &
    off-screen).

    Rex Conn
    JP Software
     
  12. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    rconn wrote:
    | Steve Fábián wrote:
    |
    |
    | ---Quote---
    || rconn wrote:
    ||| In v10 and beyond, the row/column positioning will be removed and
    ||| everything will be in screen coordinates.
    ||
    || ... thus breaking old batch files.
    | ---End Quote---
    | But it hasn't seemed to affect you with the v10 beta till now?

    No - I don't normally use @select.
    |
    |
    |
    | ---Quote---
    || I'd like the option of "window coordinates", i.e., positioning the
    || pop-up relative to the TCC window, or in a TCMD tab, relative to the
    || TCC tab display (I am allowing for the vertical/horizontal splits
    || available in TCMD), i.e., I should be able to fix the locations of
    || the pop-ups for multiple TCC instances relative to the display
    || locaiton of the underlying TCC instances.
    | ---End Quote---
    | There is no "underlying" position of the TCC windows (they're hidden &
    | off-screen).

    Not even for stand-alone TCC? Notice that for TCC running in TCMD tab I
    explicitly stated "relative to the TCC tab display" - in other words,
    wherever the originating TCC instance is displayed. If stand-alone TCC is
    also running in a "fake" display, my suggestion for all cases is the same:
    allow the specification to be relative to whereever TCC commands and
    responses are displayed.

    Hope this eliminates and ambiguity.
    --
    Steve
     
  13. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Thanks.

    I had some vague memory of this and managed to find the TCC Configuration Dialog - Windows help item where it was documented. It would perhaps be a good idea to have a link in the @select help item to this one. Or just repeat it.

    But perhaps no need if the row/column positioning will be removed in v10.
     

Share This Page