1. Steen Jakobsen
  2. PowerBuilder
  3. Saturday, 14 May 2022 04:25 AM UTC

Hi everyone,

 UPDATE: APPEON HAS INDICATED THAT THERE WILL NOT BE A CLOSE BUTTON ON THE TABCONTROL - TABPAGE. 

And no, the new 2022 R2 features for MDI frames as TABS does not solve the issue. (One cannot have an MDI in a dialog box)

Also you cannot close a dynamically opened category tab in the BibbonBar as there is no way to place a close button on the tab (yes you can code a BAD UI button somewhere else - but that is just ugly and BAD UI - so there is room for improvement.

I'M SETTING THIS TOPIC TO "RESOLVED" and it sems it will not be adressed by Appeon

 

How can I place a close button on each tabpage (or the selected tab) in a tabcontrol. Just like the tabs in a browser and many applications.

I know this is a classic question and a feature request for many many years. I just need it badly now.

Maybe finding the x,y of the active tabpage and dynamically place a control at the end.. I just have no clue on how to find the x,y,width of the tab.

 

Any clue is most appreciated.

//Steen :-)

 

ps. This is a standard feature in VS since 2005  .. I'm very happy with Appeons deliveries I just need this

pps. The pbultimatesuite  is an absolute no-go 

Steen Jakobsen Accepted Answer Pending Moderation
  1. Friday, 2 December 2022 09:07 AM UTC
  2. PowerBuilder
  3. # 1

To be clear .. there are many many use cases of a close button on a tab page.  Every major language has this - Just not PB

And no, the new 2022 R2 features for MDI frames as TABS does not solve the issue. (One cannot have an MDI in a dialog box) and a major reengining is required to make use of the new MDI stuff.

Also you cannot close a dynamically opened category tab in the BibbonBar as there is no way to place a close button on the tab (yes you can code a BAD UI button somewhere else - but that is just ugly and BAD UI - so there is room for improvement.

Comment
  1. Roland Smith
  2. Friday, 2 December 2022 13:41 PM UTC
PB Ultimate Suite has tabs that have close buttons and a choice of tab shapes.
  1. Helpful
  1. John Fauss
  2. Saturday, 3 December 2022 00:15 AM UTC
@Steen - I asked you for a use case because I was trying to help you build an argument with Appeon for getting this enhancement into PB by providing a real-life example or two where everyone could see how this feature would be useful, and you appeared to have a BIG need for it. It seemed like an easy ask. However, stating a generality like "there are many use cases" is not an overly convincing argument, in my opinion. I'm sorry I tried to assist you.

If anyone else in the Community cares strongly about this issue and would like to provide an example or two of how this feature would improve the user experience of your PB application(s), please feel free to do so.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 2 December 2022 01:28 AM UTC
  2. PowerBuilder
  3. # 2

Steen -

Would you be willing to elaborate on the use-case need for this requested enhancement. I've worked on many apps over the years, some using LOTS of tab controls, even some "nested" tab controls (a tab control on a tab page of a "parent" tab controlsurprised)... and like Chris, I've never encountered a situation where it made sense for a user to be able to close a tab page. I'd really like to understand the situation(s) you are needing to address. Of course, I don't want you to disclose any proprietary information. However, if you can spare a couple of minutes to help educate me (and others), I'd really appreciate it!

Best regards, John

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 2 December 2022 01:46 AM UTC
Thanks John for more elegantly wording Appeon's current position on this enhancement request and also seeking use case!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 1 December 2022 01:23 AM UTC
  2. PowerBuilder
  3. # 3

I'm disappointed and confused by the statement that Appeon states they will not be enhancing the Tab control/tab pages to provide an optional "X" (close) button on the tabs for a tab control placed in a window. At the Elevate keynote, when Chris was demonstrating the tabbed MDI "sheet" window planned for 2022 R2, I asked in the accompanying chat if window Tab controls were also going to be enhanced to provide the "X" on the tabs, and I think Armeen's response was that yes, they were (please correct me, Armeen, if I'm mistaken). So, when PB 2022 R2 adds this functionality, a user will be able to close a tabbed window by clicking on the "X", but not on a tab displayed in a Tab control contained within the window? Yeah, our users are going to be so understanding when they see that (not!)

As I understand it (and by golly, I could be wrong), the PB Tab control is essentially the Tab control provided by Microsoft in its Windows Common Controls. Since the Tab control in Common Controls does not support the "X" (close tab) feature, or tab colors, or any number of other modern UI improvements, then neither does PB. Unfortunately, Microsoft updates their common controls very infrequently, choosing instead to make the Windows O/S look more and more like the Apple O/S (who asked for that, by the way?), so we are pretty much stuck with the limited look, feel, and functionality that Microsoft gives us with the antiquated Common Controls.

However, I have found several articles on the web describing how features/capabilities of common controls can be enhanced via subclassing, which can be done in C++ (but not in PB/PowerScript). I even found a post that shows how to subclass the Tab control and Tab Page to implement the "X" (close tab) that Steen and others are needing. Since PB is written in C++, I'm at a loss as to understand why Appeon cannot or will not do this. I also wonder if subclassing the various common controls could provide an improved user experience in PB without requiring us to use themes.

Comment
  1. Mark Goldsmith
  2. Thursday, 1 December 2022 20:14 PM UTC
Thanks Armeen, appreciate that this will be looked at and I do understand there will be no promises.

@Chris...I do appreciate your description of how you (and probably many other developers) implement tab pages. However, I think this is all about options, for both the developer and the business/ users, that may have a specific use case for something like this (as Steen seems to). To address your concern(s), it simply has to be implemented the same way the close button on the datawindow control is implemented, and that is you as the developer control access to it via code/ property settings. At least then those who need it can use it and those who don't want it, like yourself, can simply turn it off.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 1 December 2022 21:17 PM UTC
Hi Mark .. I agree - as long as we have a property setting on the Tab Control to enable / disable the close (X) feature, then that would suffice. :-)
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 2 December 2022 07:29 AM UTC
Hi.

I would like to add my opinion on this topic. First of all I want to say that implementation that appeon will offer is the implementation we actually have in IDE. Now, I believe that this tabbed windows feature (with or without close button) was already available in docking windows. You may say that it was buggy and now it is unsupported. It may be true (I say that because I didn't used that feature a lot). But still there were people that successfully used that feature (ex: https://www.appeon.com/conference/elevate-2020/live?id=240 - by the way I did liked that presentation). There we did had tabs that looked great, were modern and were pretty customizable. I hope that the new control will offer such functionalities, but I'm not sure.

For tab controls, I believe that the close button may be useful. Implementations I've seen in qwerybuilder and aversql where really nice and customizable. I would like to have such an option in powerbuilder. I agree that this close feature should be optional (developers should decide which tab controls should have that feature).

Andreas.
  1. Helpful
There are no comments made yet.
Steen Jakobsen Accepted Answer Pending Moderation
  1. Tuesday, 29 November 2022 05:16 AM UTC
  2. PowerBuilder
  3. # 4

I'm setting this to "resolved" as Appeon have indicated that there will not be a close button on the TabPage.

 

//Steen

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 29 November 2022 16:07 PM UTC
Starting from PB 2022 R2, "tabs" can be used for Windows in addition to within windows. If the tab is for the window, it can be closed clicking the "x". This was demo'ed at Elevate 2022: https://youtu.be/jdFdyeCly3c?t=3912
  1. Helpful
  1. Steen Jakobsen
  2. Wednesday, 30 November 2022 06:21 AM UTC
Hi Armeen,



yes I know. But that is an MDI frame converted into tabs. Not a tab control as such. So as I understand it you cannot use it for anything but a different MDI app. Right ?

(It would be great if I'm wrong)



Thanks

//Steen
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 30 November 2022 15:10 PM UTC
The sheets in an MDI app are displays as tabs that can be closed. It is not standard behavior in UI design for control within a window to close.
  1. Helpful
There are no comments made yet.
Philippe PILAT Accepted Answer Pending Moderation
  1. Tuesday, 15 November 2022 11:46 AM UTC
  2. PowerBuilder
  3. # 5

Hi Steen,

maybe you could take a look at PBToolbox (https://pbtoolbox.home.blog/)

Don't know the pricing but still worth to ask ...

Best regards,

 

Philippe.

Comment
There are no comments made yet.
Steen Jakobsen Accepted Answer Pending Moderation
  1. Tuesday, 15 November 2022 08:20 AM UTC
  2. PowerBuilder
  3. # 6

Hi there .. including Appeon :-)

 

Any news on this really annoying thing ?

(PB2022 is GREAT but this tiny little thing keeps hitting us. Our users are asking all the time for it and cannot understand why we cannot do it..)

 

Thanks Steen

Comment
  1. Andreas Mykonios
  2. Tuesday, 15 November 2022 13:22 PM UTC
Hi Steen.

1800$ is for perpetual license. I agree it's to expensive... Cannot pay more than the IDE itself costs.

Even 495$ for yearly subscription is to expensive in my opinion.

Andreas.
  1. Helpful 1
  1. Andreas Mykonios
  2. Tuesday, 15 November 2022 13:23 PM UTC
I would not encourage working with the web control before we see what will happen in 2022 R2 (there the web control will be based on another engine).

Andreas.
  1. Helpful 2
  1. Miguel Leeuwe
  2. Tuesday, 15 November 2022 13:31 PM UTC
yes, that's very true Andreas! I was thinking of mentioning it, but just wanted to see if Steen would consider it.
  1. Helpful 2
There are no comments made yet.
Steen Jakobsen Accepted Answer Pending Moderation
  1. Friday, 27 May 2022 11:31 AM UTC
  2. PowerBuilder
  3. # 7
Hi John .. this is how I do it today. Thank you.
Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 26 May 2022 04:53 AM UTC
  2. PowerBuilder
  3. # 8

I continue to be blown away by the solutions that Roland comes up with... Nicely done, Roland! As soon as I saw it, I immediately had to dig into his code to learn how it was done, and of course, I learned a lot in the process. The PB Community benefits greatly from your numerous contributions, Roland. Thank you!

My geeky side wanted to see what it would take to extend Roland's proof-of-concept with some additional capabilities:

  • Support alternate tab position settings in addition to TabsOnTop.
  • Support multi-line tabs.
  • Support tabs that utilize perpendicular text.
  • Automatically disable the Tax X "button" when only one tab remains and enable it when more than one tab exists.
  • Tweak the user interface to integrate better when the tab page navigation (left/right) control appears.
  • Add a tooltip for the Tab X "button".
  • Ensures proper operation in 64-bit.

This took several evenings of experimentation. I've attached below an "enhanced" version of the original sample app & objects that accomplishes all of the above. Here are a couple of screen shots:

I had to reduce the size of the "X" slightly in order to make it fit.

For some time now, PB has provided tooltip support in DataWindows. However, I needed a tooltip that worked with a static text control. I started with a version of a non-visual tooltip object created by Aart Onkenhout (Thank you, Aart!) around 2005 and updated his code to use Unicode Windows API calls instead of ANSI as it was originally coded many years ago, and also got it to work in 64-bit.

The command buttons you see make it easy to "load up" the tab control with additional tab pages for testing and also manage the tooltip functionality.

Enjoy!

Attachments (1)
Comment
  1. Steen Jakobsen
  2. Friday, 27 May 2022 06:19 AM UTC
Nice work John :-)

And yes Roland is a GREAT inspiration.
  1. Helpful 1
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 20 May 2022 18:04 PM UTC
  2. PowerBuilder
  3. # 9

My 2cts here is that - once we get tabbed windows - the best thing to do, is get away completely from tab controls. They behave funny, have bugs and just try doing a setredraw(false) of a tab and see how that doesn't do anything to controls inside of it.

Of course that's going to be a lot of refactoring, but it might be worth it.

regards,

MiguelL

Comment
  1. Steen Jakobsen
  2. Saturday, 21 May 2022 04:17 AM UTC
Yes... a completely missing feature ...I wonder why Appeon and forgotten it now that they have taken PB to the next level .. just without tabcontrols.

  1. Helpful
  1. Roland Smith
  2. Thursday, 26 May 2022 12:31 PM UTC
The PB tab control is based on the Windows 'Win32 Tab Control' which hasn't changed in over 20 years.

https://docs.microsoft.com/en-us/windows/win32/controls/tab-controls
  1. Helpful 1
  1. Steen Jakobsen
  2. Friday, 27 May 2022 06:21 AM UTC
I really hope that Appeon is reading also.. I do think it is time for an update to the tab-control.



Appeon, any comment ?
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 20 May 2022 15:44 PM UTC
  2. PowerBuilder
  3. # 10

The attached picture and PB 2019 app has an X button that is located in the upper right corner of the tab control.

When you move the mouse over it, the background color changes. Click it to delete the current tab. When the tab control resizes with the window, the X button automatically stays in the correct position.

I used the SetParent Windows API function to make the parent of the X button (really a statictext object) be the tab control. That makes the upper left corner of the tab control the 0,0 position.

It isn't possible to add a control to the tab buttons themselves. You could use tab pictures but you couldn't determine if the clicked event was due to the picture being clicked.

Attachments (2)
Comment
  1. Steen Jakobsen
  2. Friday, 20 May 2022 15:46 PM UTC
Thanks Roland :-)
  1. Helpful
  1. Steen Jakobsen
  2. Saturday, 21 May 2022 04:18 AM UTC
I just want to express that I'm grateful for your work Roland.
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Saturday, 21 May 2022 12:30 PM UTC
Hi Steven ... I agree!

I think that we need to start a collection & then send Roland some more Mountain Dew. ;-)
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 18 May 2022 14:28 PM UTC
  2. PowerBuilder
  3. # 11

I know you're frustrated, Steen.

Are you willing to consider an alternative UI that provides identical functionality?

As a quick test, I added the same, small Static Text control to each of three tab pages as shown below:

It's a red uppercase T in 12 point Webdings2, in case anyone is interested in those details.

In the clicked event of each of these, I called a window function:

// Ask the window to close the parent tab page of this static text control.
of_CloseTab(Parent)

Here's the window's of_CloseTab object function:

Integer li_index, li_num_tabpages
UserObject luo_tabpage

// A valid reference to the tab page user object to be closed is required.
If Not IsValid(auo_tabpage) Then Return -1

li_num_tabpages = UpperBound(tab_1.Control)

// We cannot (should not) close the tab if it is the only one.
If li_num_tabpages < 2 Then
   MessageBox("Close Tab Request","Unable to close this tab, as it is the only one.",Exclamation!,OK!)
   Return -1
End If

// Find the requested tab page in the tab control's Control array.
For li_index = 1 To li_num_tabpages
   // Cast tab page reference to a user object.
   luo_tabpage = tab_1.Control[li_index]
   
   If luo_tabpage <> auo_tabpage Then Continue
   
   // Found the requested tab page. Close it.
   tab_1.CloseTab(luo_tabpage)
   
   // Did we just close the last tab page?
   li_num_tabpages = UpperBound(tab_1.Control)
   If li_index <= li_num_tabpages Then
      // No - Select the tab page that was after the one that was closed.
      tab_1.SelectTab(li_index)
   Else
      // Yes - Select the tab page that preceded the one that was closed.
      tab_1.SelectTab(li_num_tabpages)
   End If
   
   // Success.
   Return 1
Next

// No action taken.
Return 0

Of course, you can make this much more rugged/sophisticated, check for unsaved data, etc., but here I just wanted to make the close tab functionality work... and it does. Click on the red "X", and...

If you have an ancestor tab page user object, it would be easier to implement (not that what I've done is difficult).

I think it's pretty obvious you're not going to be able to do what you're wanting in the exact manner you've expressed, so it may be time to move on and come up with a reasonable alternative. Maybe not what I've proposed, but something that does what you need it to do.

Best regards, John

Comment
  1. John Fauss
  2. Thursday, 19 May 2022 03:44 AM UTC
That's good to know, Roland. Thank you for passing that information along. I threw the above example together in about 30 minutes last night, so I wasn't concerned with faithfully reproducing the look and feel of existing apps... I'll file this away for future use.
  1. Helpful 1
  1. Steen Jakobsen
  2. Thursday, 19 May 2022 04:34 AM UTC
Hi Roland,

Sounds absolutely great.. I really hope you will be able to pull this off. If think many of us will be very grateful :-)
  1. Helpful
  1. Steen Jakobsen
  2. Thursday, 19 May 2022 07:20 AM UTC
Roland,

How do I get the correct x,y of the tab control page to put the X control ? and what happens when the tab pages are scrolled horizontally, an event ?
  1. Helpful
There are no comments made yet.
Mark Goldsmith Accepted Answer Pending Moderation
  1. Tuesday, 17 May 2022 20:15 PM UTC
  2. PowerBuilder
  3. # 12

Hi Steen,

I have some thoughts on how you might be able to accomplish this in the interim but have a few questions first:


How many tabs are you likely to have opened by the user? Is it unlimited?
Are there pictures currently on the tabs?
Are you okay with having the tabs being fixed width?
Are you okay with NOT having RaggedRight, Perpendicular text or Multiline (may be able to work around Multiline)?
Are you okay with the text of the tabs being right justified?

This may go nowhere if any of the above constraints are deal breakers for you. If not, while the look and feel may not be exactly what you want it may be sufficient/ acceptable given how much you seem to need this at the moment and until Appeon makes this functionality available.

Regards,

Mark

Comment
  1. Steen Jakobsen
  2. Wednesday, 18 May 2022 11:52 AM UTC
Hi Mark,



I really appreciate your help. But the implementation needs many of the features your approach will not support.

So basically the only way is to spend 1800 USD on a tab control if I want to be able to close a tab-page.

I find it very annoying not to be able to close a tab page since it is standard behaviour of most languages except PB and expected feature in many applications.

(Imagine a web browser that was unable to close at tab page! I dont think it would survive very long)



I'm very happy with Appeon, That being said, In my view, It is clearly a mistake on Appeon roadmap not to make the X button that many many of us needs and referring to a new feature some 1.5 - 2 years away go spend 1800 USD to get it.





  1. Helpful
  1. Mark Goldsmith
  2. Wednesday, 18 May 2022 13:41 PM UTC
You're welcome Steen and I can appreciate your frustration...that's a high price to pay just for that piece of functionality. If you have a change of heart just let me know.
  1. Helpful 2
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 17 May 2022 07:57 AM UTC
  2. PowerBuilder
  3. # 13

Brad Wery has implemented that. It's available in Ultimate Suite for PB. Of course it's not free...

The above screenshot is from NotepadPB.

A modern tab control was available in Advanced Gui. But it is missing the close button as you want it.

By the way, Roland Smith and Brad Wery did contributed to advanced gui sample. The close tab is implemented only as a "global" close button on the right...

Andreas.

Comment
  1. Roland Smith
  2. Wednesday, 18 May 2022 03:48 AM UTC
The image I posted earlier was from one of my apps that uses PB Ultimate Suite. The one with the red X is a really early version.
  1. Helpful 1
  1. Andreas Mykonios
  2. Wednesday, 18 May 2022 04:11 AM UTC
Qwerybuilder was using those exact tab controls. Unfortunately when I decided to buy qwerybuilder I left powertothebuilder controls for later... And then the price changed...
  1. Helpful
There are no comments made yet.
Steen Jakobsen Accepted Answer Pending Moderation
  1. Tuesday, 17 May 2022 04:53 AM UTC
  2. PowerBuilder
  3. # 14

.. So there is no solution to get a modern tab control i guess. 

Comment
  1. John Fauss
  2. Tuesday, 17 May 2022 05:34 AM UTC
You could create your own and share it with the Community.

A user-drawn "simulated" tab control with tab pages was the norm prior to the actual tab control being added to PB in version 5, as Chris alluded to. It worked pretty well, especially since there was no alternative. I'm not saying it's easy, but it's doable. You might even be able to find an old implementation posted on the web to help you get jump-started.
  1. Helpful
  1. Steen Jakobsen
  2. Tuesday, 17 May 2022 05:43 AM UTC
Yes. But I really think PB should provide a modern tab-control. It seems odd that one have to create such a basic thing from scratch or pay 1800 usd extra to get it.



PB does so many things and Appeon is doing GREAT job enhancing PB. But it seems that this one have been forgotten.



Please Appeon .. :-)
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Sunday, 15 May 2022 01:56 AM UTC
  2. PowerBuilder
  3. # 15

Something like the attached.

Attachments (1)
Comment
  1. Steen Jakobsen
  2. Sunday, 15 May 2022 06:19 AM UTC
Yes :-)

I guss many people are wanr it. Very simple.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Sunday, 15 May 2022 13:49 PM UTC
Hi Roland ... Yes, and a new modern tab page look would be nice as well. ;-)
  1. Helpful 1
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Saturday, 14 May 2022 16:42 PM UTC
  2. PowerBuilder
  3. # 16

Hi Steven;

   The way I did this back in the PB 3.0-4.0 days in the early days of my framework was to write my own Visual User Object as a Tab Control / Tab Page combination where I could control the GUI 100% (including the X button on the TP).

  Your right.. this feature has been requested since way back in the PowerSoft days.

Regards ... Chris

Comment
  1. John Fauss
  2. Tuesday, 17 May 2022 05:39 AM UTC
Do you still have a copy in your archives you could blow the bit-dust off of, Chris? Granted, it's not the solution that Steen is wanting, but a possible solution to a problem is better than NO solution.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 17 May 2022 12:37 PM UTC
Hi John... No, unfortunately. I removed the UO's after PB 5.0 was released as PB 5.x now had it's own built-in TC/TP.

Regards .. Chris
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Saturday, 14 May 2022 15:52 PM UTC
  2. PowerBuilder
  3. # 17

Hi Steen, It is on our roadmap to add a tabbed document interface in the revisions of PB 2022, but for now you would need to do a workaround.

Comment
  1. Armeen Mazda @Appeon
  2. Sunday, 15 May 2022 02:49 AM UTC
Yes, what he wants is on our roadmap for revision of PB 2022.
  1. Helpful
  1. Steen Jakobsen
  2. Sunday, 15 May 2022 06:23 AM UTC
Armeen,



My request is shared by many people who have to buy a ton of useless controls to get that one little X on the tab control tages.

It seems a little thing but in many applications it is a BIG thing. Imagine a browser without the ability to close a tab - that browser would not make it in the competition.



Please add the little X to that ab control pages :-)



About the tabbed MDI. There are several good workarounds for that
  1. Helpful
  1. Steen Jakobsen
  2. Monday, 30 May 2022 06:13 AM UTC
Hi Armeen,



Do you have any plans for enhancing the tab-control to match modern requirements ?

(The implementation in pb is 20 years old)



Thanks
  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.