1. Gimmy Susan
  2. PowerBuilder
  3. Tuesday, 2 January 2018 08:40 AM UTC

Good morning

A small question

Situation:
I have a MDIDocHelp with some WindowDockBottom! in tab, some WindowDockRight! in tab and some WindowDockleft! in tab.
Then I open some OpenSheetWithParmAsDocument in tab.
I am positioned on the click event of a WindowDockRight !.

How can I find out which OpenSheetWithParmAsDocument is active
Var_Frame.GetActiveSheet () does not work.
Thanks for the reply
Gimmy

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 January 2018 20:57 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Gimmy;

       I think  that I see your dilemma better now that I have dome some more testing. Over the Christmas holidays I created three new functions in the Controller master Window. They are: of_get_docked_windowsof_get_document_windows and of_get_tabgroup_windows. These new methods return you an array of  windows that were opened in those contexts. This functionality is not implemented in PB - just in my framework as an extension to the Window Manager feature that has been in the framework since (like forever - LOL).

    Doing some experimentation last night to carry this feature further, I think that I can tweak the Controller Window to return the "active" sheet in each of the above categories. I just need to extend the Window Manager a little more to track which Window is currently the active one. Then I could give you something like an of_get_active_sheet replacement method that would return to you the active sheet no matter whether it was in a Sheet (MDI Child), TabGroup, Document or Docked open managed state by the MDIDock window.   wink

  PM me directly if you would like to experiment further with this direction. I am now having the same issues in my example OrderEntry App when drilling down to the active sheet within a particular grouping. Which I assume, is what you would like to be able to do as well.

Regards ... Chris

Comment
  1. Gimmy Susan
  2. Thursday, 4 January 2018 09:07 AM UTC
Hi Chris



Thanks for replay



Yes, with your replay i see the sun.



i'll contact you for the detail of test.



 



=)



 



 



Gimmy



 



 



 



 

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 2 January 2018 16:36 PM UTC
  2. PowerBuilder
  3. # 1

Hi Gimmy;

  I believe that your Apps are using my framework. I just tried the following code in a menu item and it works properly for me & returns the active sheet regardless of its opening state ...

// CIPTEST
wn_main_master            lo_win
wn_controller_master     lo_mdi

lo_mdi    =    go_ac.of_get_controller_window( )
lo_win    =    lo_mdi.GetActiveSheet ( )
MessageBox ("Active Sheet", lo_win.classname( ) )
// CIPTEST

HTH

Regards ... Chris

Comment
  1. Gimmy Susan
  2. Wednesday, 3 January 2018 09:43 AM UTC
Hi Chris



You are right, i'm using your framework.



Thanks for your answer, but the messagebox() return me the 'WindowDockRight' windows ( where i click ) and not the 'OpenSheetWithParmAsDocument ' window.



 



=(



Regards



 



Gimmy



 



 

  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 3 January 2018 13:39 PM UTC
Hi Gimmy;



   After some more testing, I see your issue ... the GetActiveSheet() command is not consistent like in a normal MDI windowed App. 



Regards ... Chris

  1. Helpful
  1. David Peace (Powersoft)
  2. Wednesday, 3 January 2018 16:52 PM UTC
I might be being a bit dim here, but where you click is the active sheet/window so the behavior you are experiencing would be logically correct. To do what you want you would need to have some other global / instance variable that is set when the sheet opens and reference that to get the results you are looking for? It's not a very nice solution but may work for you.



Cheers



David



 

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.