Print Page | Close Window

Multiple Documents Tabs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11938
Printed Date: 28 February 2025 at 7:04pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Multiple Documents Tabs
Posted By: vijaymahajan
Subject: Multiple Documents Tabs
Date Posted: 23 August 2008 at 2:13am
Hello,
I am implementing the extreame toolkit library in my multiple document MFC application.
 
i have added the ribbon bar also in my application.
Whenever i open multiple documents,tabs are appearing below the ribbon.We can  switch between the documents with the help of this tab.
 
Is it possible,to trace Which tab is clicked? Means,is there any event handler for these tabs?
 
My requirement is,whenever user switch the document,he should save it.So i have to tell him to save before he switch from one tab to another.
 
Is it possible? Please guide me about the possible solution.
 
Thanks And Regards,
Vijay.



Replies:
Posted By: Oleg
Date Posted: 23 August 2008 at 1:27pm
Hi,
you can try use this method:
virtual void OnActivateView( BOOL bActivate, CView* pActivateView, CView* pDeactiveView );


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: vijaymahajan
Date Posted: 30 August 2008 at 8:21am
Hello,
I tried to find for switching the child tabs in OnActivateView event,But unfortunately i couldnt found the exact case.
 
see,Herewith i am giving the text file in which the two cases i have given.
 
1)The first case works exactly for switching the tabs,But when user do alt+tab to switch to some another application,it fails.
In first case i get the bool variable bModified as TRUE.
so it works proper for switching the child view.But dont know why it fails while doing alt+tab for switching between applications.
 
 
2)The second case works when user do the alt+tab,But it fails when he switches between the child tabs.
in this case i get the bool variable FALSE.
 
https://forum.codejock.com/uploads/20080830_082102_New_Text_Docume.zip - uploads/20080830_082102_New_Text_Docume.zip
 
I know,this is pure MFC,and this kind of querry shouldnt be asked on this forum.But i am really screwed at this point.and couldnt find the way.
 
My application is multiple document application  and only one view for each document. And My requirement is,whenever user switch the document,he should save the previous document.
If we handle it in OnActivateView,we will have to check bActivate variable is false and then save the document.This it is doing,But it gets that variable false in alt + tab condition also.So whenever user does alt+tab it asks to save the document when we come back to our application.
How can i avoid this?
Please guide me,what exactly shall i do to catch the childview tabs click event? Or Please guide to avoid the alt+tab problem. Because even if we get the tab clk event,i think we wont be able to get the previous document that time.This i am not sure,just guessing.
Please tell,what can be the possible solution for this problem.
 
 
Thanks And Regards,
Vijay.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net