|
I used this class and created it ,but a problem followed sequently.My listview's functions will not work except it was called inside my listview class.For example,when i call InsertItem(...)inside my listview ,it is normal.but if i use GetActiveView()->m_pListCtrl->InsertItem(...) in my mainframe,it doesn't work.
if i don't created this control ,then everything was ok!a strange problem ,who can help me?
i am coming quietly just as i am leaving quietly.
|
|
|
|
|
Hi. I've sort of mixed this class with the newer CSizingControl bar instead of the one you had. The question I had is where are you redrawing the client area. As I have it now I'm getting a rather interesting side affect as demonstrated in this screenshot:
http://fote.dune.net/bad.gif
Whats even odder about it is that it only happens when enlarging the view. If you size it smaller the client area is redrawing just fine. So anyway hoping you can answer this one Thanks.
|
|
|
|
|
Ok in case this might help anyone I found that by placing pWnd->BringWindowToTop(); in the resizing loop it seems to clear up the problem.
|
|
|
|
|
I got the same problem, what resizing loop are you referring to?? Which file/function?
|
|
|
|
|
I think I found it in the derived class OnSize loop, this works but gets understandably terrible flashing when resizing. Is there a better solution?
|
|
|
|
|
This is what I did because I was having problems with both it not drawing when I sized it bigger (or small size decreases) and not redrawing correctly after being sized smaller.
In the OnSize function...
//pWnd->MoveWindow(9, 9, cx-19, bottom-26); //Replaced with:
pWnd->SetWindowPos(&wndTop, 9, 9, cx-19, bottom-26, NULL);
pWnd->RedrawWindow();
This made it work correctly.
-Brett
|
|
|
|
|
I can't run it. It dumped failed info when creat CSizingControlBar
BOOL CSizingControlBar::Create(CWnd* pParentWnd, CSize sizeDefault, UINT nID, DWORD dwStyle)
{
ASSERT_VALID(pParentWnd); // must have a parent
ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
// save the style
m_dwStyle = dwStyle;
dwStyle &= ~CBRS_ALL;
dwStyle |= CCS_NOPARENTALIGN|CCS_NOMOVEY|CCS_NODIVIDER|CCS_NORESIZE;
m_sizeHorz = sizeDefault;
m_sizeVert = sizeDefault;
m_sizeFloat = sizeDefault;
CString wndclass = AfxRegisterWndClass(CS_DBLCLKS, LoadCursor(NULL, IDC_ARROW),
CreateSolidBrush(GetSysColor(COLOR_BTNFACE)), 0);
if (!CWnd::Create(wndclass, NULL, dwStyle, CRect(0,0,0,0),
pParentWnd, nID)) //Dump the failed info here!
return FALSE;
return TRUE;
}
|
|
|
|
|
Hello,
change AddView
// save the style
//m_dwStyle = dwStyle;
m_dwStyle = dwStyle & CBRS_ALL;
|
|
|
|
|
I work under win2k.
I had did and application with CsizingControl Bar and CSizingTABControl Bar; when i REDRAW the TAB control bar, the treeView selected (CClassView or CFileView) didn't appear on the bar. The bar is only grey!!
Can you help me please?'!!??
A.C.
|
|
|
|
|
Adding pWnd->BringWindowToTop(); to the sizing loop seems to correct the problem.
|
|
|
|
|
create the view as a child of tab ctrl.
then the problem that view turns gray will disappeared;;
any way i want to know how can i resolve the fatal problem
that when i close the docking bar (SizingTabCtrlBar) the
mainframe never get the message..
i think it comes from the SetactiveView problem.. but i count't
find the way i can solve it..
anyone knows ?
plz helpme..
zoocmic@hananet.net
|
|
|
|
|
You wrote:
>>when i close the docking bar (SizingTabCtrlBar) the
>>mainframe never get the message
Try to add this code:
void CSizingTabCtrlBar::OnDestroy()
{
CSizingControlBar::OnDestroy();
for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos))
{
TCB_ITEM *pMember=m_views.GetAt(pos);
if (pMember->pWnd != NULL)
{
pMember->pWnd->DestroyWindow();
}
}
}
Good luck!
|
|
|
|
|
Hello,
I check the next thing on Win 9x, 2k, XP and NT.
Under NT only, if my TabWindow is docked and I resize it,
the redraw is VERY VERY VERY slow and I don't understand why:
I wrote a timer in CSizingTabCtrl::OnSize()
I wrote all old source of OnSize() in SizingTabCtrl::OnTimer(), but the Bar is always redraw and it's so SLOW...
PS: I do that under theses conditions:
- With the new CSizingControlBar
- With only the correction in AddView():
if (!pWnd->Create(NULL, NULL, ... ) {
...
}
/* ADD Z-Order CORRECTION */
pWnd->SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOREDRAW);
m_pActiveView = (CView*) pWnd;
Will you help me, please...
Thx, Thotho !!!
|
|
|
|
|
How can I remove a view from the TabControlBar? RmoveView(nView) doesn't work! The associated tab doesn't disappear.
Thanks!
|
|
|
|
|
Hi,
if I resize the Control Bar the Text of the Tablabels didn't change. What must i do to get the same funtion like the Tabcontrol in Visual Studio.
The Labeltext should be to cut short with Text and Dots to the Label Dimensions (i.e. "Data..." for Text "Database")
Thanks for every solution or answer
|
|
|
|
|
Hello,
i have a problem with the CSizingControlBar classes. Here are the description of the problem:
After starting the application, the control bar is docked on the right side of the mainframe. Now i click into the treeview.
Then i do a double click on the control bar, to make the control bar floating.
After this, i close the control bar with the x button.
And now there is the following problem:
After closing the control bar, the mainframe don't receive any messages. This means, i cannot pull down a menu or close the application.
Do anyone have a solution for this problem. How can i make my mainframe working after closing the controlbar.
Can anybody help me.
Thanks
Holger
|
|
|
|
|
I had the same problem and haven't solve it yet. This happens because I (and you maybe) use the newer version of CSizingControlBar from Cristie. I only figured out that the main problem is in AddView function of CSizingTabCtrl. If you comment this function in CMainFrame:OnCreate() this wont happen with your bar so the obvious problem is there and I think we should look error there. If you find solution and if it's no trouble to you please notify me!
nenad
|
|
|
|
|
I have just found the problem in AddView function but...
I did this commented line code in CSizingTabCtrlBar::AddView :
...
int nViews = m_views.GetCount();
if (nViews!=1)
{
pWnd->EnableWindow(FALSE);
pWnd->ShowWindow(SW_HIDE);
}
else
{
// ((CFrameWnd *)GetParent())->SetActiveView((CView *)m_pActiveView);
}
...
putting active view: I haven't thought for now what will happen in the future if this must be set here. Maybe someone knows this?
|
|
|
|
|
in execute time,if i disable the default document , then here is no first empty EditView.
use belowe statment in app::InitInstance() to disable default document .
(
CCommandLineInfo cmdInfo;
cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
ParseCommandLine(cmdInfo);
)
until i resize the MainFrame , the classView and Tabctrl show. does there hay body know , how to fix it??start with
no default document .
beside this , the title-bar(Wnd) of CSizingTabCtrlBar, how can i deal it like "http://www.codeproject.com/docking/sizecbar.asp" Cristi Posea , it has two lines on top and one "X"??
|
|
|
|
|
when I created CSizingTabCtrlBar class from new version of CSizingControlBar and there is problem with handling X-button. First thing that pops up is ASSERT error in function
CSizingControlBar::OnSize(UINT nType, int cx, int cy)
When I comment this assert program works but... when I close dockbar I lose connection to main app and the only thing I can do is closing app. If I don't use function AddView in CMainFrame::OnCreate(),closing(showing/hiding) with that docbar works fine. So the problem is AddView function. I didn't discovered yet. Has anybody same problems as I do? Has anybody idea how to solve this problem?
|
|
|
|
|
Hi,
I was trying to create a dockable window using SizingTabCtrlBar with new base class by Cristi Posea. The problem is that when I want to "close"(hide) window code goes "somewhere" and I lose control of main app.Can someone help (any idea where do I lose window handle-that is obvious, but where to look)? I want to have a grip bar and close button (like VC++ ide) so I use new version of the same CSizingControlBar.
I also get ASSERT error in:
void CSizingControlBar::OnSize(UINT nType, int cx, int cy)
{
.. pWnd->MoveWindow(0, 0, cx, cy);
ASSERT(pWnd->GetWindow(GW_HWNDNEXT) == NULL);
..
}
Anyone knows how to cope with this error? Is this maybe the problem why x-button does things above?
|
|
|
|
|
How to design CSizableControlBar,CSizingTabCtrlBar classes?IF u know
please send code?
|
|
|
|
|
I have tried adding a listview to the Resizable TabControl, however nothing is shown, whereas all other views that I add are displayed. Anybody else had this problem?
Any solution?
|
|
|
|
|
Modify Sample Source
1. Create Windows Style
2. Invalidate ShowWindow
BOOL CSizingControlBar::Create(CWnd* pParentWnd, CSize sizeDefault, UINT nID, DWORD dwStyle)
{
// must have a parent
ASSERT_VALID(pParentWnd);
// cannot be both fixed and dynamic
// (CBRS_SIZE_DYNAMIC is used for resizng when floating)
ASSERT (!((dwStyle & CBRS_SIZE_FIXED) && (dwStyle & CBRS_SIZE_DYNAMIC)));
m_dwStyle = dwStyle& CBRS_ALL; // save the control bar styles
// register and create the window - skip CControlBar::Create()
CString wndclass = ::AfxRegisterWndClass(CS_DBLCLKS, ::LoadCursor(NULL, IDC_ARROW),
::GetSysColorBrush(COLOR_BTNFACE), 0);
dwStyle |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS ; // prevents flashing
if (!CWnd::Create(wndclass, NULL, dwStyle, CRect(0, 0, 0, 0), pParentWnd, nID))
return FALSE;
return TRUE;
}
void CSizingTabCtrlBar::OnSize(UINT nType, int cx, int cy)
{
CSizingControlBar::OnSize(nType, cx, cy);
int bottom = (IsHorz() || IsFloating()) ? cy - 14 : cy - 18;
m_tabctrl.MoveWindow(7, 7, cx - 14, bottom);
CWnd *pWnd;
int nNewTab = 0;
for (POSITION pos=m_views.GetHeadPosition(); pos; m_views.GetNext(pos))
{
pWnd=m_views.GetAt(pos)->pWnd;
// pWnd->MoveWindow(9, 9, cx-19, bottom-26);
if (m_nActiveTab == nNewTab)
{
pWnd->SetWindowPos(NULL, 9, 9, cx-19, bottom-26, SWP_SHOWWINDOW);
pWnd->Invalidate(TRUE);
}
else
pWnd->SetWindowPos(NULL, 9, 9, cx-19, bottom-26, SWP_HIDEWINDOW|SWP_NOREDRAW|SWP_NOZORDER);
nNewTab++;
}
}
|
|
|
|
|
How to add this CSizingControlBar to SingleDocument? This code work only MultiDocument
|
|
|
|
|