forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

managing 2 screens

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Wed Jun 12, 2013 4:36 am    Post subject: managing 2 screens Reply with quote

This has probably been asked before, but I am having trouble with menu options and pop up response to right click, when running the program on the second screen.

Now that I have Selected user_resize, I can move the program around, but the pop-up's do not follow. My pop-up response window appears on the primary screen (possibly where the program first started up).

Is there a way to control their location ? or at least set their default to the centre of the active window, when it is on the second screen ?
A few times now, I have forgotten that I was running on the second screen and the program appears to freeze !!

A typical program of mine has the %gr setup as
Code:
!
      i = winio@ ('%ca@&', caption)
!
      i = winio@ ('%ww[no_border]&')
!
      i = winio@ ('%sc&', plot_setup_func)                  ! call setup function
      i = winio@ ('%pv&')
!
      ptr_RGB_Address     = -1                              ! pointer for RGB direct addressing not used
      i = winio@ ('%`^gr[grey, user_resize, rgb_colours]&',               &
                    1024, 768, w_handle, screen_back_func)
!
      i = winio@ ('%mg&', WM_MOUSEWHEEL, OnMouseWheel)      ! mousewheel response
!
      call Tide_Menu
!
      i = winio@ ('%hw', hwnd)                              ! return the handle of the current window.
!


I also have a right-click pop-up window as:
Code:
      i = winio@ ('%ca[Node Information]&')
      i = winio@ (' Node Number %6wd&', node)
      i = winio@ ('      [possible %6wd]&', nf)
      i = winio@ ('%2nlX  = %12wf&',pnxyz(1))
      i = winio@ ( '%nlY  = %12wf&',pnxyz(2))
      i = winio@ ( '%nlZ  = %12wf&',pnxyz(3))
      i = winio@ ('%2nl%cn%bt[OK]')


Any suggestions ?

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Jun 12, 2013 6:28 am    Post subject: Reply with quote

I think that this is just something that needs fixing in ClearWin+.
I will log it for investigation.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Jun 12, 2013 3:28 pm    Post subject: Reply with quote

While Paul is probably right, then what you might like to do is to determine the screen coordinates of the main window (using CALL GET_WINDOW_LOCATION@(....) ), and position your pop-ups relative to that (using %sp in the description of the pop up). I already make my pop ups appear where they were the last time they were closed, and it is just a variation on that. Making them appear where they last appeared is just a matter of recording the window coordinates at closedown (with the callback to %cc also invoking CALL GET_WINDOW_LOCATION@).

If your desktop extends over the two screens, then the coordinates should be those of the two screens combined.

There is also a Windows function for determining how many screens there are, but I never used it.

Eddie

PS. If you do save the position as I described, you need to save it for each type of pop up. If a pop up calls another pop up, then you have to swap handles and it all gets rather complicated as in the following.

Code:
       SUBROUTINE POP (TEXT)
       INCLUDE <WINDOWS.INS>
       INTEGER, EXTERNAL ::  GET_POSITION_FN
       CHARACTER*(*) TEXT
       COMMON/PLACE/  IWINDPOS_X(80), IWINDPOS_Y(80)
       COMMON/STICKY/ NPOS, KHAND
       NSAVE = NPOS
       KSAVE = KHAND
       IA=WINIO@('%ca[Oops!]&')
       IA=WINIO@('%bg[white]&')
       NPOS = 75
       IA=WINIO@('%sp&', IWINDPOS_X(NPOS), IWINDPOS_Y(NPOS))
       IA=WINIO@('%hw%cc&', KHAND, GET_POSITION_FN)
       CALL SET_FONT_FOR_POPUPS
       IA=WINIO@('%cn%si!'//TEXT//'&')
       IA=WINIO@('%2nl%cn%`7bt[OK]')
       KHAND = KSAVE
       NPOS  = NSAVE
       RETURN
       END
      INTEGER FUNCTION GET_POSITION_FN()
      COMMON  /PLACE/   IWINDPOS_X(80),     IWINDPOS_Y(80)
      COMMON  /STICKY/  NPOS,     KHAND
      INCLUDE <WINDOWS.INS>
      CALL GET_WINDOW_LOCATION@ (KHAND, IX, IY, IWID, IHT)
         IWINDPOS_X(NPOS) = IX
         IWINDPOS_Y(NPOS) = IY
      GET_POSITION_FN = 0    ! Guarantees continue to exit
      RETURN
      END


In the above, each type of pop up knows what number it is (75 in the example) but to reuse the same code you have to save NPOS on entry and restore it on exit along with the window handle to cope with cascades of pop ups. In my example, all the standard window features such as font name, font size etc are wrapped up in another subroutine. You may wish to give minimum (or maximum) values to which the popup can be set.

E
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Jun 13, 2013 1:08 am    Post subject: Reply with quote

Eddie,

Thanks very much for this suggestion. It should solve the problem of my pop-up. I will investigate and see what I learn.

I am also finding a problem with the menu option "Pop-up", such as:
i = winio@ ('%mn[&File[]]&' )

Since I provided resize, to drag the aplication over screens, these also pop-up on the primary screen, which is where the application started.
I notice that a lot of applications lock the menu pop-up to below the menu option. I wonder what options there could be for something like '%mn[&File[]]&'

John
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Thu Jun 13, 2013 9:47 am    Post subject: Reply with quote

When I used 2 screens (of identical size I) found modal dialogs appearing across the junction between the two. I found this disconcerting. Also, I couldn't edit graphics well if they spanned 2 screens. I now use only 1.

Another approach is to have 2 Windows for the application - a left window and a right window. That didn't work for me at the time in a particular application, but I could see how it might.

Second-level, fly-out, menus are something for Paul, as there is no obvious (to me) solution for those appearing on the original screen.

As for dynamic menus, the main use I could see for those was to give a most-recently-used file list, but I noticed that some applications put this in the start-up 'splash' window (i.e. CorelDraw etc) or they have a completely separate window for it. By the time I mastered greying-out I also discovered that users don't like menus with content that changes too much. The Windows User Interaction guidelines also warn against this. Even greying-out confuses some people if they can't see why some options are inaccessible.

The function GetSystemMetrics (see MSDN) is the one I couldn't remember for my previous reply.

Eddie
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri Jun 14, 2013 2:16 am    Post subject: Reply with quote

Eddie,

There are a few ideas there I havn't tried.
I shall try using excel spanning 2 screens, with 2 sheets visable on either screen. It might give me some ideas on how to manage a %gr screen stretched across 2 screens.
Stretches the ideas for where the pop-up window and sub-menu window should be positioned.

John
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Fri Jun 14, 2013 6:37 pm    Post subject: Reply with quote

John, I don't know if what you are experiencing is a bug - do not have that because do popups differently.

I track window positions, save x,y data every time position changes for further use (for popups to know to pop at the same place it did before).

Here exist though some small issues too. For example one window tracking CWP function (forgot the name, will look and post its name later) tells about window position change only if you touch bottom right corner and resize while it keeps mum if you just move the whole window, so you will need some other functions simultaneously (had no time to discover if this is default behavior and left it as is)

With such tracking of windows in multiple monitors if their configuration changes (you add or remove one monitor etc) the popups may appear in the place outside the displaying area of current monitor configuration, so either you should provide a reset position key or teach the code to not plot anything outside the area which sometimes is hard or impossible because, for example, the window position (x,y) =(-1500,300) could create invisible window for one configuration and is in the visible area for another
Back to top
View user's profile Send private message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Mon Jun 17, 2013 7:39 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
I think that this is just something that needs fixing in ClearWin+.


There is a nice example available here that might help at positioning objects on a multiple display setup.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Jun 18, 2013 6:29 am    Post subject: Reply with quote

Thanks for this.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Jun 28, 2013 1:11 pm    Post subject: Reply with quote

John

I have tried this and can not see a problem when using %pm.

I don't think that anything has changed in this respect but you could try the latest salflibc.dll beta download.

Also could you post a short sample program that illustrates the problem?
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group