1. Stefan Malkwitz
  2. PowerBuilder
  3. Thursday, 27 April 2023 13:00 PM UTC

Hello Everyone,

 

I need a solution for the following problem.

In Powerbuilder you can use the key combination Ctrl + Tab to switche through all open sheets.

Now i need a button wich does exactly the same but on the button press.

 

Any idea what to write in the button click event to achive the same?

 

Regards Stefan

 

 

Addition:

- it is an MDI Application

- The button is on the Ribbonbar

- The customer wants the same functionality on this button as when pressing Ctrl + Tab

Accepted Answer
Stefan Malkwitz Accepted Answer Pending Moderation
  1. Tuesday, 2 May 2023 08:30 AM UTC
  2. PowerBuilder
  3. # Permalink

Ok

i have a solution that works 4 me.

 

window wSheetFront, wSheetNext
 
wSheetFront = parent.GetFirstSheet()
IF IsValid(wSheetFront) THEN
     wSheetNext = parent.GetNextSheet(wSheetFront)
	
	if IsValid(wSheetNext) then
		wSheetFront.bringtotop = false
		wSheetNext.bringtotop = true
	else
		
	end if
END IF

 



Comment
There are no comments made yet.
Stefan Malkwitz Accepted Answer Pending Moderation
  1. Tuesday, 2 May 2023 08:18 AM UTC
  2. PowerBuilder
  3. # 1

Addition:

- it is an MDI Application

- The button is on the Ribbonbar

- The customer wants the same functionality on this button as when pressing Ctrl + Tab

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 27 April 2023 13:21 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Stefan -

I'm having a little difficulty visualizing how you are wanting this concept to work.

A command button (control) on one (sheet) window? User clicks it and the "next" sheet in the window is brought to the top of all open sheets (possibly covering the window with the command button? Is a similar button on all sheets?

I suggest you look at the PB Help topics for the GetFirstSheet() and GetNextSheet() PowerScript functions.

Best regards, John

Comment
  1. John Fauss
  2. Thursday, 27 April 2023 14:38 PM UTC
Also, the GetActiveSheet() function.
  1. Helpful
  1. Tracy Lamb
  2. Thursday, 27 April 2023 16:14 PM UTC
From the PB help file:

Do not use GetFirstSheet and GetNextSheet in combination with GetActiveSheet.

  1. Helpful
  1. John Fauss
  2. Thursday, 27 April 2023 18:41 PM UTC
Thank you, Tracy! I had missed that in my quick scan of the Help topics. I appreciate you catching that caveat.
  1. Helpful
There are no comments made yet.
Tracy Lamb Accepted Answer Pending Moderation
  1. Thursday, 27 April 2023 13:13 PM UTC
  2. PowerBuilder
  3. # 3

Is this an MDI application?  Would you put the button on the frame's toolbar? Or on each open window?

~~~Tracy

Comment
  1. Stefan Malkwitz
  2. Thursday, 27 April 2023 14:03 PM UTC
its an MDI Appication and the button is on the ribbonbar
  1. Helpful 1
  1. Tracy Lamb
  2. Thursday, 27 April 2023 16:28 PM UTC
I've never used a ribbon bar, but sounds like Rene's suggestion would work. In my MDI app, I have a frame menu item called Window. It's next to the last item on the menu, [File, other stuff, Window, Help]. CTRL+TAB switches between all the open sheets. It's round-robin, so once it opens the last sheet and you CTRL+TAB again, it goes back to the first one. Also, under the Window menu item, all of the open windows display so you can click on any window to display it, I don't know if GetNextSheet() does that once the end of the list is reached.
  1. Helpful
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 27 April 2023 13:10 PM UTC
  2. PowerBuilder
  3. # 4

Hi Stefan,

you can use the mdi windows functions GetFirstSheet and GetNextSheet.

HTH,

René

Comment
  1. Stefan Malkwitz
  2. Thursday, 27 April 2023 14:02 PM UTC
i will try this
  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.