QuickTabs hide a tab based on time of day.

General discussion forum about all things Team Developer 6.x
Headcold
United States of America
Posts: 3
Joined: 05 Mar 2018, 16:01
Location: USA

QuickTabs hide a tab based on time of day.

Post by Headcold » 05 Mar 2018, 20:25

I am curious how I can go about hiding a QuickTab based on time of day. If there is any sample or another post that could assist me in figuring this out that would be great. Any help is very much appreciated.

- Sergio

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 400
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: QuickTabs hide a tab based on time of day.

Post by Dave Rabelink » 06 Mar 2018, 10:05

Hi Sergio,

The good old QuickTab control does not have the feature to hide/show a tab.
You can enable/disable.

To mimic hide/show, you can delete a tab and when needed create it again at runtime.
(when you create the tab using the same name/label the previously assigned controls will be assigned again).

An example can be found here:
viewtopic.php?f=60&t=42800&hilit=hide+tab

When you are able to use the new TabBar control, you can hide/show tabpages using:

SalTabHidePage
SalTabShowPage
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Headcold
United States of America
Posts: 3
Joined: 05 Mar 2018, 16:01
Location: USA

Re: QuickTabs hide a tab based on time of day.

Post by Headcold » 06 Mar 2018, 12:47

Thanks for the quick response. If you can not hide the tabs can you choose which one is active or switch between the tabs based on time?

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 123
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: QuickTabs hide a tab based on time of day.

Post by Jeff Luther » 06 Mar 2018, 19:01

Probably more elaborate than it needs to be ;) but I put together a timer example for you which should have most of what you might need. This sample:
> starts a timer, in this test simply counts to the next minute to turn itself off.
> allows yield to the PB for clicking so the timer can be cancelled before the next minute arrives.

> I check time every second for demo purposes. Could be at 5-second intervals, 1-minute, etc. And you would likely want to check hour & minute (and day?) intervals in real life. My test only 'times' to the next whole minute.

Of course, what your code does in the sample

Code: Select all

On SAM_Timer
    ...
    If nMinute >= dfnMinute OR lParam    ! lParam not equal 0 because SAM_Timer sent from pbSetTimer to cancel 
        ...
is entirely up to you. Swap tabs, hide/show as Dave describes, etc. Unless this tab manipulation is very low-level, I guess I'd alert the user that something 'under the covers' is about to happen (like a tab disappears). What if the user is editing etc. the tab at the time?

Note that time formatting likely not correct for non-US time displays. I attached both a v5.2 and v6.3 versions.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California
TD info. & samples: http://www.jeffluther.net/TD/

User avatar
Charlie
Canada
Posts: 54
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: QuickTabs hide a tab based on time of day.

Post by Charlie » 07 Mar 2018, 11:57

Using TD5.2SP3 over here.

In many or our QuickTab Windows, I've started using Tab Bars as an interface to hidden (at Run-Time) QuickTabs.

Compared to QuickTabs, I prefer the look of Tab Bars and I like that tabs in a Tab Bar can easily be hidden. However, I very much prefer the QuickTab interface for linking controls to tabs.

Best of both worlds by having QuickTabs and Tab Bars working together.

I keep the QuickTab tucked in some part of the form that is out of the way, and the height only as much as I need to read the labels on the tabs.

At run-time, the QuickTab gets hidden completely. The Tab Bar is front and center.

When a tab is selected in the Tab Bar, the numerically corresponding tab in the QuickTab is displayed. The QuickTab itself stays hidden, but all controls linked to the tab are displayed.

Before dropping new controls on the window, I comment out the Tab Bar. ( I don't like the way controls get linked to tabs in Tab Bars.)

Food for thinking. If anybody wants some code snipits, I can do some cutting and pasting later when I can sneak the time.
A little trick to help direct folk from old Gupta forum to this one: Link to post

Headcold
United States of America
Posts: 3
Joined: 05 Mar 2018, 16:01
Location: USA

Re: QuickTabs hide a tab based on time of day.

Post by Headcold » 07 Mar 2018, 14:15

Thanks for the responses. I appreciate it.

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 118
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: QuickTabs hide a tab based on time of day.

Post by Igor Ivanovic » 08 Mar 2018, 06:34

Charlie wrote:
07 Mar 2018, 11:57
Food for thinking. If anybody wants some code snipits, I can do some cutting and pasting later when I can sneak the time.
Good samples are always welcome :) :) :)
Igor Ivanovic
Image

User avatar
Charlie
Canada
Posts: 54
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: QuickTabs hide a tab based on time of day.

Post by Charlie » 21 Mar 2018, 00:04

That took way too much time to squeeze into the schedule.

See attached.

Cheers !
You do not have the required permissions to view the files attached to this post.
A little trick to help direct folk from old Gupta forum to this one: Link to post

Return to “General Discussion”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests