|
Hello.
It turns out one of our company`s application uses your code without noticing you. Sorry for all the late but I am wondering if I can use your code for the application, since there is no statement about the license of your code.
Can you give me some information about the lisence for your code??
Thank you in advance.
|
|
|
|
|
|
This vid was not very useful; 6 minutes plus with no audio and in the end the result did nothing! Don't waste your time!
|
|
|
|
|
I think that must change the CXTabctrl::ChangeTab() to
CXTabctrl::ChangeTab( ... )
{
...
int i = GetCurSel();
TCHAR buf[1024];
item.pszText=buf;
item.cchTextMax=sizeof(buf)/sizeof(buf[0]);
BOOL b = GetItem(i,&item);
VERIFY(b);
CWnd* pWnd=(CWnd*)item.lParam;
pWnd->ShowWindow(SW_SHOW);
pWnd->Invalidate(TRUE);
}
no any way, go any way.
modified 11-Jul-12 21:50pm.
|
|
|
|
|
|
1.
void CXTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
...
if( IsTabEnabled( nTabIndex ) )
{
pImageList->Draw( pDC, item.iImage, CPoint( rect.left, nYpos ), ILD_TRANSPARENT );
}
else
{
HICON hIconImage = pImageList->ExtractIcon( item.iImage );
pDC->DrawState( CPoint( rect.left, nYpos ), CSize( 16, 16 ), (HICON)hIconImage, DSS_DISABLED, (CBrush *)NULL );
DestroyIcon( hIconImage );
}
...
2.
BOOL CXTabCtrl::SelectNextTab( BOOL bForward )
{
int iSum = bForward ? 1 : -1;
int iCurSel = GetCurSel();
ASSERT( iCurSel > -1 && iCurSel < GetItemCount() );
int iCurSelSave( iCurSel );
do
{
iCurSel += iSum;
if( iCurSel < 0 )
{
iCurSel = GetItemCount() - 1;
}
else if( iCurSel >= GetItemCount() )
{
iCurSel = 0;
}
if( IsTabEnabled( iCurSel ) )
{
SelectTab( iCurSel );
return TRUE;
}
}
while( iCurSel != iCurSelSave );
return FALSE;
}
|
|
|
|
|
I have a dialog application but I can not get the int value from the edit control inside the tab. Can you tell me how I can access this value from the OK button?
|
|
|
|
|
in CXTabControl_demo
how can i get values of ID,Name values into tabDlg.cpp..................
so that i can manupulate the values of ID,Name............
Vipula.N
|
|
|
|
|
Hello,
I'm using your easy class for my program. It#s working well. I would like to know now how to get the index of the currently page.
Thank you in advance
Cyril Carpentier
|
|
|
|
|
Hi, thank you for your help, i give me much help. it can be used simply. But now i meet a problem. I can't change it when my dlg resizes.
My code are as follows:
void CADlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
//m_tabctrl.MoveWindow(0, 0, rect.Width(), rect.Height());
}
It gave me an assertion.
Please help me about it. Thanks for your help again.
|
|
|
|
|
1. Change declaration XTabCtrl.h
void ChangeTab(int iIndex, CWnd *pNewTab, LPTSTR lpszCaption, int iImage, int newWidth, int newHeight);
2. Change XTabCtrl.cpp
void CXTabCtrl::ChangeTab(int iIndex, CWnd *pNewTab, LPTSTR lpszCaption, int iImage, int newWidth, int newHeight)
{
......
pNewTab->SetWindowPos(NULL, m_ptTabs.x, m_ptTabs.y , newWidth, newHeight, SWP_FRAMECHANGED | SWP_NOZORDER);
......
}
3. Example, new declaration, you *.h:
......
public:
bool fChange=false;
......
protected:
CPomoc* m_pPOMOC; //new class for TAB (new dialog window, child)
......
// Dialog Data
//{{AFX_DATA(.....)
enum { IDD = IDD_....._DIALOG };
CXTabCtrl m_cTAB; //you TabCtrl
//}}AFX_DATA
4. Example, OnInitDialog....
m_pPOMOC = new CPomoc; //new class
m_pPOMOC -> Create(CPomoc::IDD, &m_cTAB);
m_cTAB.AddTab(m_pPOMOC,"Titel",0);
m_pPOMOC -> m_pTab = &m_cTAB;
5. Example, procedure:
void .......OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if (nType==SIZE_MAXIMIZED) //Window has been maximized.
{
m_cTAB.SelectTab(iIndex); //always first before "ChangeTab", as no.1
m_cTAB.ChangeTab(iIndex,m_pPOMOC,"Titel",0,myWidth-18,myHeight-42); //resize declaration this TAB, as no.2
m_cTAB.MoveWindow(x,y,myWidth-12,myHeight-12,TRUE); //resize this TAB (windows)
fChange=true;
}
Invalidate(FALSE); //OnPaint
}
// myWidth and myHeight you must calculations....
// warning: no.1 and no.2 repeated for all Tab (this example is only one Tab)!
6. Example, new class CPomoc, procedure:
void CPomoc::OnPaint()
{
CPaintDC dc(this); // device context for painting
if (fChange==true)
{
//Example: m_cPOMOC as Edit Control (in CPomoc dialog) resize if window has been maximized.
m_cPOMOC.MoveWindow(x,y,myWidth-12,myHeight-12,TRUE);
fChange=false
}
// Do not call CDialog::OnPaint() for painting messages
}
modified on Wednesday, April 16, 2008 5:48 PM
|
|
|
|
|
when I build my project my error is:
Compiling...
XTabCtrl.cpp
E:\projet Alstom TSLG modi point Test\source\Source\XTabCtrl.cpp(5) : fatal error C1083: Cannot open include file: 'tabctrl.h': No such file or directory
Error executing cl.exe.
have you a solution
thank
|
|
|
|
|
I have no idea Add code in main dialog, or constructor of tab, or sub_dialog?
|
|
|
|
|
Hi, i have a problem :
I'm using the dialog form and on CPaint draw the jpeg format using CxImage and over the jpeg draw the moving bitmap.
If I run the form itself(without CxTabCtrl), the bitmap is moving without flicker
Then i applied the CxTabCtrl which call the dialog form,
using the SelectTab(), the bitmap doesn't move.
using the ChangeTab(), the bitmap move but flicker.
Could you give me a solution, I want use SelectTab and the bitmap move.
Thank you
|
|
|
|
|
Those tab labels are draw OVER those default XP style tabs. Can anyone give me a solution? I am using VS6. Thanks a million in advance!
|
|
|
|
|
In CXTabCtrl::DrawItem remove the following line -
// pDC -> FillSolidRect
This works for me...
|
|
|
|
|
On it's good side, a perusal of the CXTabCtrl code will give one an idea of how much work it takes to wrap the functions for a tab control. However, the even the example code doesn't work correctly. Witness the above compaints about Tab Focus and Tab Page Blanking for <enter> and <esc> Key Presses. I have put a substantial amount of time into developing some applications with this code only to find out the underlying code doesn't work properly. Needless to say I am a little frustrated.
The Code described in this article could really have used some debugging before posting. That's not to say that there isn't good work to be found here. It's just not polished. Hopefully, the author can make some revisions. However, it is unlikely seeing as he hasn't seen fit to provide feedback to the comments made on his article/code.
|
|
|
|
|
Is it possible to create Multinine Tabs? I have problems, because the contents of the tabs covers the tab captions!
Regards
Torsten
|
|
|
|
|
Hi, I looked for the same answer and I found it on codeguru.
I copy the answer as I saw it!! And many thanks to M.K.Kim !
Adil TIADI
adil.tiadi@hotmail.fr
"Hi...
CXTabCtrl is wonderful control !!!
I was so glad to find this control.
But This Control has something wrong.
I cannot use multiline tab.
So I add this code. The Problem is resolved.
---- CXTabCtrl.cpp ----
void CXTabCtrl::ItemReposition()
{
//----- this code is inserted by M.K.Kim --------
int iRow = GetRowCount();
SetTopLeftCorner( CPoint(4, 28*iRow) );
int iCount = GetItemCount();
for(int i = 0; i < iCount; i++)
{
TCITEM item;
item.mask = TCIF_PARAM;
GetItem(i, &item);
// --- Reposition Tab Page Window -----
CWnd *pWnd = reinterpret_cast<cwnd*>(item.lParam);
pWnd->SetWindowPos(NULL, m_ptTabs.x,
m_ptTabs.y , 0, 0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
}
}
// modify AddTab() Function
void CXTabCtrl::AddTab(CWnd* pWnd, LPTSTR lpszCaption, int iImage)
{
ASSERT_VALID(pWnd);
TCITEM item;
item.mask = TCIF_TEXT|TCIF_PARAM|TCIF_IMAGE;
item.lParam = (LPARAM) pWnd;
item.pszText = lpszCaption;
item.iImage = iImage;
int iIndex = m_arrayStatusTab.GetSize();
InsertItem(iIndex, &item);
pWnd->SetWindowPos(NULL, m_ptTabs.x, m_ptTabs.y , 0, 0,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOZORDER);
pWnd->ShowWindow(iIndex ? SW_HIDE : SW_SHOW);
//** the initial status is enabled
m_arrayStatusTab.Add(TRUE);
//** for MultiRow Position
ItemReposition(); // <--- Insert this.
}
Good Luck Everyone...
Bye...
M.K.Kim
"
|
|
|
|
|
Hi,
I'v used this ctrl in a dialog. When I show it (DoModal) for the second time the ctrl looks blank. only after selecting another tab and going back to the first one it shows. Any ideas ?
|
|
|
|
|
I know for the function "EnableThemeDialogTexture", but I don't know how to use it. Please help me...
|
|
|
|
|
I would like to know how to do a "drag and drop" of a filename in the main Tab Control Dialog.
|
|
|
|
|
i have a problem in the class...
how to resizable two dialog box in the cxtab control?
how can i resizing frame window with dialog over the cxtab?
|
|
|
|
|
Do you encounter a problem if I click any control
(likes edit field, button) on dialog in tab will cause the hot key (likes Ctrl+O to Open file) can't work.
Eric Lee
|
|
|
|
|
hi~~all
I am the mfc new hand and i want to use the class.
first i build a dialog mfc exe project.
And i include the XTabCtrl.h and XTabCtrl.cpp to my project.
But i use the classwizard i can't see the cxtabctrl class when i want to add variable?
how can i use the class?
i really have no idea?
any body can help me?
my email is m9021005@stmail.cgu.edu.tw
thanks.
|
|
|
|
|