Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PageFrame Trickery

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
Hi All,
Many of you know I've been working on a ribbon bar implementation, and so far it's all gone pretty well. Today I was trying to implement a new behavior in the bar, and ran into something weird.

So, my assumption was that if you made the pageframe height = 1 or 0 that it would effectively have the appearance of the page from being "invisible". The idea being that some people don't want the ribbon bar to stay "in the way" while they're doing other stuff, and only want it to pop down when they go to the topline menu, or maybe choose to turn it on and off.

So I built a routine that slowly collapses the pageframe down to 1 pixel high. (This is good, as it helps maintain the appearance of the bottom "bar" of the top line menu.

But then I discovered, where I have "container" objects on the various pages, they do not "collapse" with the page frame itself. So if I go to another page, those icons (which are in container) remain on the main form background, and if I change page to page, they will even "overlap". Though other controls (like drop-downs, spinner, non-containerized objects) vanish and appear as the page grows and shrinks. Is there something magic about the container objects on a page like this, and if so, how can I get them to follow the "collapse" behavior?


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
First of all, when you adjust the page frame height, any inner objects of pages don't react to this at all, they are staying in position and keeping their size, the pages/page frame will clip them. Why should they shrink? They only would shrink, if you'd anchor them. There is no automatic anchoring, though, so by default the controls don't resize.

There was a bug with I think comboboxes or listboxes on pages showing through in VFP7, but that should be fixed since at least in VFP9.

Bye, Olaf
 
Olaf,
If you open say Word, version after 2007, it has the ribbon bar. The behavior I'm trying to mimic is that of having the ribbon shrink and grow from the topline menu down to full size (when you click on the "expand/contract" button on the right" and then "pin" it to the form if you want it to stay open. So I thought the easy way to do this would just be to reduce the pageframe height until it reached 1, which would just leave the border visible at 1 pixel. I had expected the behavior to hide everything with it, but clearly that's not the case. I don't want to have to reduce every single control down to 0 or 1 because it will mean a lot of craziness to make that happen.
Then the behavior would be if you click a tab it would show the ribbon associated with the new tab.
Any idea how I might make this work?



Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
You said
they do not "collapse" with the page frame itself

You put collapse in quote, if you just meant vanish, disappear, hide, become invisible, then why did you choose the term collapsing? Collapsing reminded me of shrinking by anchoring. I don't propose to anchor all controls is a solution. Simply forget about this aspect.

All I said is that this should work, though I know a bug, a real VFP runtime bug, that made combo boxes of the non active page show through. What you see seems connected to that bug. But it should be fixed already. Are you sure your containers are inside pages and not just on the page location?`

Bye, Olaf.

 
Scott, can I makee sure I have understood this.

Are you saying that when you shrink the ribbon, you do so by reducing the height of the pageframe in such as way that only the tabs are showing? And, if so, when you do that, you are still seeing controls below the tabs in the space that the ribbon previously occupied?

If that's right, it seems likely that the controls in question weren't on the pages in the first places. They were in the higher level container, that is, the container which contains the pageframe.

Is that possible, do you think?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Olaf, sorry, it was a bad choice of words, I had a lot of distractions around me when I wrote that. But the main aim is, mimic the behavior of the ribbon in an office application.

Hi Mike, thanks for looking in on this. As crazy as it sounds, those objects (which are all containers that "show through") are all indeed on the page, and not in the Form over the top of the pageframe/page. And it's also confirmed by: Page 1 has 4 buttons, Page 2 has 1 button, page 3 has 0 buttons page 4 has 1 button (of the container type, or subclasses of it). As I change pages, those all appear (and will even "stack" on top of each other where there was a button before), because interestingly as I change pages, the page 1 buttons remain, and then the subsequent page buttons appear where they normally would if the page was open.

Now, for clarity, the pageframe has Tabs property set to .F. So the page doesn't collapse to just leave the tabs, it collapses to just leave 1 pixel wide line (because the tabs depend on that line as well for their "defining outline". The tabs are actually the same kind of container buttons as are on the pageframe, but text-only versions of them. So I was very surprised that after collapsing the page frame down to only 1 pixel, those items all still appear. It's a very strange behavior and frustrating because it's a plan that I thought should really work, but doesn't due to some quirk... So now I'm looking for other ideas to make this happen. (Or create the illusion of it happening really).


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Hi Olaf, sorry, it was a bad choice of words, I had a lot of distractions around me when I wrote that. But the main aim is, mimic the behavior of the ribbon in an office application.

Hi Mike, thanks for looking in on this. As crazy as it sounds, those objects (which are all containers that "show through") are all indeed on the page, and not in the Form over the top of the pageframe/page. And it's also confirmed by: Page 1 has 4 buttons, Page 2 has 1 button, page 3 has 0 buttons page 4 has 1 button (of the container type, or subclasses of it). As I change pages, those all appear (and will even "stack" on top of each other where there was a button before), because interestingly as I change pages, the page 1 buttons remain, and then the subsequent page buttons appear where they normally would if the page was open.

Now, for clarity, the pageframe has Tabs property set to .F. So the page doesn't collapse to just leave the tabs, it collapses to just leave 1 pixel wide line (because the tabs depend on that line as well for their "defining outline". The tabs are actually the same kind of container buttons as are on the pageframe, but text-only versions of them. So I was very surprised that after collapsing the page frame down to only 1 pixel, those items all still appear. It's a very strange behavior and frustrating because it's a plan that I thought should really work, but doesn't due to some quirk... So now I'm looking for other ideas to make this happen. (Or create the illusion of it happening really).


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Haven't been following all of this, but I can give you my experience: I designed a pageframe toolbar years ago for my framework. The pageframe is put in a toolbar positioned at the top of my toplevel forms. Users can hide the toolbar by calling the toolbar's Hide() method.
 
Well, what version of VFP and SP are you using?

I see a description of a similar bug with comboboxes on several pages with a tabs=.f. pageframe:
I don't find a workaround, but I think it had to do with UIEnable event of the pageframe.

Maybe you could use that solution:
Bye, Olaf.
 
Hi Olaf,
It's VFP 9, SP2, the build is 7423, as far as I'm aware that was the last version...
UIEnable, interesting, I recently used that method for the first time, but i don't remember what for or where. I'll have a look and see if it could be an influence.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top