15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Tab Controls as views

Gary Krone -- gkrone@inconsys.com
Thursday, March 06, 1997


Environment: VC++ 4.2b, Win NT 4.0

I picked up the example of using the tab control as the view, but there is
one problem with it.  The tab views are created and destroyed on the fly.
If one of the tabs has a rich edit control on it switching from one tab to
another loses the data unless it is saved off and re-initialized upon
creation, a great waste of time.

I tried to modify the example to create several views that will hang around
such as the multiple view switching examples from MS.  The problem I run
into is trying to find the correct placement of the views create call.

Does anyone have any idea of how to use this with views that stay around in
an MDI environment?

Thanks,





Alan J. Livingston -- AlanLivingston@acm.org
Saturday, March 08, 1997

[Mini-digest: 3 responses]

Gary Krone wrote:
> 
> Does anyone have any idea of how to use this with views that stay around in
> an MDI environment?
> 

Gary,

I've solved similar problems by creating multiple views and making them
visible and invisible at the appropriate times.  I'm not clear as to
what your exact problem is, but I've even created separate views for
each tab control and made a view visible when it's tab was selected. 
Let me know if this is what you are trying to do and I can probably dig
my old code up.

-Alan
-----From: Joao Vargem 

Gary Krone wrote:
> 
> Environment: VC++ 4.2b, Win NT 4.0
> 
> I tried to modify the example to create several views that will hang around
> such as the multiple view switching examples from MS.  The problem I run
> into is trying to find the correct placement of the views create call.
> 
> Does anyone have any idea of how to use this with views that stay around in
> an MDI environment?
> 

	Hi, for what I've seen in your mail, it seems your are trying to work
with
a form that has a tab wich allows the user to see various information.
	I have this kind of implementation in several forms and after much
digging and
example seing I've decided for the folowing approach.

	Oops, I almost forgot: 	Environment: Windows 95, Visual C++ 4.1 and
another thing, I'm not
using Visual C++ tab control, but that's not that important.

	I've created my derived class to the control and to each tab I
associate a dialog. The first time
the user selects the tab, the corresponding dialog is created and shown,
while the previous dialog is hidden. And it's all a matter of hidding
and showing dialogs accordingly with the selected tab. The dialogs are
only created if necessary ( selection of the tab) and are destroyed when
the tab is destroyed. It works
quite well, all the code for each page it's inside each dialog, I can
use the dialogs in several
places if I wish and even has "real" dialogs.
	Hope this helps in anyway. Bye
-- 
				Joao Vargem	(jpv.loyaltech@taguspark.pt)
				LoyalTech Portugal SA
				Oeiras, Portugal
-----From: DFPav@aol.com

GKrone:
I would be interested in that:
>>I picked up the example of using the tab control as the view, but there is
Is ther any way you could send me that example or the KB # or URL to get it.
Thanks,
DFPav



Scot -- Scot@STINGSOFT.COM
Monday, March 10, 1997

Check out Objective Toolkit.

I'm 90% sure our SECTabWnd will solve your problem.  It can hold CViews
and doesn't do anything wacky that could destroy the state of your
views.

Scot
Stingray
http://www.stingsoft.com

>-----Original Message-----
>From:	Gary Krone [SMTP:gkrone@inconsys.com]
>Sent:	Thursday, March 06, 1997 9:12 AM
>To:	mfc-l@netcom.com
>Subject:	Tab Controls as views
>
>
>Environment: VC++ 4.2b, Win NT 4.0
>
>I picked up the example of using the tab control as the view, but there is
>one problem with it.  The tab views are created and destroyed on the fly.
>If one of the tabs has a rich edit control on it switching from one tab to
>another loses the data unless it is saved off and re-initialized upon
>creation, a great waste of time.
>
>I tried to modify the example to create several views that will hang around
>such as the multiple view switching examples from MS.  The problem I run
>into is trying to find the correct placement of the views create call.
>
>Does anyone have any idea of how to use this with views that stay around in
>an MDI environment?
>
>Thanks,
>
>



Talin Bingham -- tbingham@wasatchnet.com
Friday, March 14, 1997

I have a MDI MFC App and I'm using the Objective 
Toolkit 1.2 SECWorkbook (instead of MDIFrameWnd), 
SECWorksheet (instead of CMDIChildWnd), and 
CFormView's for my views.  The SECWorkbook and 
SECWorksheet classes allow me to display my CFormView's 
in a 3-D tabbed format.  Cool stuff.  Excellent product.  
I was using them in a VC++ 4.2b environment and I'm now 
using them with VC++ 5.0 (I had to download a minor patch for 
the 5.0 MFC libraries).  From what I'm told, there's a new 5.x version
to be released shortly.

I highly recommend the library.

Talin Bingham
Wasatch Interactive Learning Inc.
(801) 261-1122 x206
tbingham@wasatchnet.com

----------
> From: Scot 
> To: 'mfc-l@netcom.com'
> Cc: 'gkrone@inconsys.com'
> Subject: RE: Tab Controls as views
> Date: Monday, March 10, 1997 9:05 AM
> 
> Check out Objective Toolkit.
> 
> I'm 90% sure our SECTabWnd will solve your problem.  It can hold CViews
> and doesn't do anything wacky that could destroy the state of your
> views.
> 
> Scot
> Stingray
> http://www.stingsoft.com
> 
> >-----Original Message-----
> >From:	Gary Krone [SMTP:gkrone@inconsys.com]
> >Sent:	Thursday, March 06, 1997 9:12 AM
> >To:	mfc-l@netcom.com
> >Subject:	Tab Controls as views
> >
> >
> >Environment: VC++ 4.2b, Win NT 4.0
> >
> >I picked up the example of using the tab control as the view, but there
is
> >one problem with it.  The tab views are created and destroyed on the
fly.
> >If one of the tabs has a rich edit control on it switching from one tab
to
> >another loses the data unless it is saved off and re-initialized upon
> >creation, a great waste of time.
> >
> >I tried to modify the example to create several views that will hang
around
> >such as the multiple view switching examples from MS.  The problem I run
> >into is trying to find the correct placement of the views create call.
> >
> >Does anyone have any idea of how to use this with views that stay around
in
> >an MDI environment?
> >
> >Thanks,
> >
> >



Jim Leavitt -- jimll@halcyon.com
Monday, March 17, 1997

Gary,
I've done this, and it's really pretty easy. My method was to derive a =
class (CtabView) from CCtrlView. I then created views as necessary. When =
the user selected a tab, I showed the view associated with the selected =
tab and hid the currently shown view.=20

I had to override OnEraseBkgnd among others. I can also recommend the =
classes from Stingray Software, you'll have everything pretty much =
pre-coded. If you want sample code from my method, e-mail me back and =
I'll send it along.

Jim Leavitt



Sunit Katkar -- sunit@darkstar.tulbom.unisys.com
Saturday, March 22, 1997

[Mini-digest: 4 responses]

I wanted tabs as my main view. I searched the Visionx MFC PRo and went to 
their MS knowledge Base page. From there I got the lead to this sample.

I am mailing you the example put up by Microsoft at their site. Its a 
Winzip file 'psmain.zip'

[Moderator's note: Sorry, but I'm not mailing enclosures like this
to 3000 people.  It's at Microsoft's web site.]

Hope it solves your problem.

BYe, 


Regards

Sunit Katkar
-----------------------------------------------------------------------
Sunit Katkar,         |    Tel: (R) +91-22-620 2448
Sr. Software Engnr.,  |         (O) +91-22-836 9319/20/21/22
Tata Infotech Ltd.,   |    Fax: (O) +91-22-838 3585
SEEPZ, Andheri (East),|    Email Address:
Mumbai - 400096,      |    sunit@darkstar.tulbom.unisys.com (Office)
INDIA                 |    sonalik@giasbma.vsnl.net.in (Residence)
------------------------------------------------------------------------
-----From: Keith Vasilakes 

Gary Krone wrote:
> 
> Environment: VC++ 4.2b, Win NT 4.0
> 
> I picked up the example of using the tab control as the view, but there is
> one problem with it.  The tab views are created and destroyed on the fly.
> If one of the tabs has a rich edit control on it switching from one tab to
> another loses the data unless it is saved off and re-initialized upon
> creation, a great waste of time.
> 
> I tried to modify the example to create several views that will hang around
> such as the multiple view switching examples from MS.  The problem I run
> into is trying to find the correct placement of the views create call.
> 
> Does anyone have any idea of how to use this with views that stay around in
> an MDI environment?
> 
> Thanks,

Are you talking about the PSView sample from microsoft? it's SDI but it
only creates dialogs once upon startup.
It's in the KB, Article ID: Q161886.

Keith V
-----From: wen.lin@autodesk.com

     Jim,
     
     Sorry, I don't have Jim's Email address so I reply back to here.
     
     I have go cross the same problem.  Please send me your sample code
     also.
     
     Thanks,
     
     
     - Wen
     wen.lin@autodesk.com


______________________________ Reply Separator _________________________________
Subject: RE: Tab Controls as views
Author:  mfc-l@netcom.com at SMTPCC3
Date:    3/20/97 9:21 PM


Gary,
I've done this, and it's really pretty easy. My method was to derive a = 
class (CtabView) from CCtrlView. I then created views as necessary. When = 
the user selected a tab, I showed the view associated with the selected = 
tab and hid the currently shown view.=20
     
I had to override OnEraseBkgnd among others. I can also recommend the = 
classes from Stingray Software, you'll have everything pretty much = 
pre-coded. If you want sample code from my method, e-mail me back and = 
I'll send it along.
     
Jim Leavitt

-----From: Gary Krone 

At 10:34 PM 3/17/97 -0800, you wrote:
>Gary,
>I've done this, and it's really pretty easy. My method was to derive a =
>class (CtabView) from CCtrlView. I then created views as necessary. When =
>the user selected a tab, I showed the view associated with the selected =
>tab and hid the currently shown view.=20
>
>I had to override OnEraseBkgnd among others. 
>If you want sample code from my method, e-mail me back and =
>I'll send it along.
>
>Jim Leavitt
>

If it wouldn't be too much trouble, I would like to have an example to get
me started.

Thanks,
Gary Krone
gkrone@inconsys.com
gkrone@execpc.com






Become an MFC-L member | Вернуться в корень Архива |