Click here to Skip to main content
16,011,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionexisting file ? Pin
toxcct19-Nov-04 5:14
toxcct19-Nov-04 5:14 
AnswerRe: existing file ? Pin
Blake Miller19-Nov-04 5:25
Blake Miller19-Nov-04 5:25 
AnswerRe: existing file ? Pin
22491719-Nov-04 17:19
22491719-Nov-04 17:19 
AnswerRe: existing file ? Pin
ThatsAlok22-Nov-04 1:18
ThatsAlok22-Nov-04 1:18 
GeneralRe: existing file ? Pin
toxcct22-Nov-04 3:06
toxcct22-Nov-04 3:06 
GeneralDOC VIEW SDI Pin
act_x19-Nov-04 4:19
act_x19-Nov-04 4:19 
GeneralRe: DOC VIEW SDI Pin
David Crow19-Nov-04 5:02
David Crow19-Nov-04 5:02 
GeneralCView derived class in splitter pane Pin
manonthecorner_19-Nov-04 4:06
manonthecorner_19-Nov-04 4:06 
Hi all Smile | :)

i dared to code a simple 3d viewer with my limited iq. Dead | X| i want to get 2 panes with a vertical static splitter. The left will have a Tree control and right (CMgcCanvas) will draw the model. canvas is derived from CView and OnCreate is overrided. Splitter and tree works well. I added a Messagebox to OnNotify() of CMgcCanvas and CEditorView.

Problem: When i click left pane i can see my messagebox but at right it doesnt work! why?
Note : when i create the tree at right pane, left pane doesnt show messagebox.
Do i create CMgcCanvas wrong? Confused | :confused:

Thanks In Advance,
Burak

At OnCreateClient proc. of mainframe i did it as ;

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class

//calculate client size
CRect cr;
GetClientRect( &cr);

//Create Splitter
if ( !m_mainSplitter.CreateStatic( this, 1, 2 ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return false;
}

//Create pane views of splitter
//Editor - Tree View
if ( !m_mainSplitter.CreateView( 0, 0,
RUNTIME_CLASS(CMGCEditorView),
CSize(cr.Width()/3, cr.Height()), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return false;
}

//Canvas View
CRuntimeClass* canvas = RUNTIME_CLASS(CMgcCanvas);
if ( !m_mainSplitter.CreateView( 0, 1,
canvas, CSize(cr.Width()*2/3, cr.Height()), pContext ) )
{
MessageBox( "Error setting up splitter frames!",
"Init Error!", MB_OK | MB_ICONERROR );
return false;
}

m_bInitSplitter = TRUE;

CRect leftrect, rightrect;

m_leftpane = m_mainSplitter.GetPane(0,0);
m_rightpane = m_mainSplitter.GetPane(0,1);
m_leftpane->GetClientRect(&leftrect);
m_rightpane->GetClientRect(&rightrect);


//Create Tree Control
m_MgcTree = new CMgcTree;

if (!m_MgcTree->Create(WS_VISIBLE | WS_TABSTOP | WS_CHILD |
TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
CRect(0, 0, leftrect.Width(), leftrect.Height()),
m_leftpane, IDC_TREE1))
{
TRACE0("Failed to create instant bar child\n");
return -1; // fail to create
}

m_MgcTree->Initialise();

//Create Canvas View -???
m_canvas = new CMgcCanvas;

if (!m_canvas->Create(NULL,"Canvas",WS_VISIBLE | WS_TABSTOP | WS_CHILD ,
CRect(0, 0, rightrect.Width(), rightrect.Height()),
m_rightpane, 143))
{
TRACE0("Failed to create canvas\n");
return -1; // fail to create
}


return true;
}


GeneralRe: CView derived class in splitter pane Pin
BlackDice19-Nov-04 4:34
BlackDice19-Nov-04 4:34 
GeneralRe: CView derived class in splitter pane Pin
manonthecorner_19-Nov-04 5:15
manonthecorner_19-Nov-04 5:15 
GeneralSaving data and version handling Pin
Cedric Moonen19-Nov-04 3:55
Cedric Moonen19-Nov-04 3:55 
GeneralRe: Saving data and version handling Pin
Navin19-Nov-04 5:29
Navin19-Nov-04 5:29 
GeneralRe: Saving data and version handling Pin
Cedric Moonen19-Nov-04 6:34
Cedric Moonen19-Nov-04 6:34 
GeneralRe: Saving data and version handling Pin
Blake Miller19-Nov-04 5:30
Blake Miller19-Nov-04 5:30 
GeneralRe: Saving data and version handling Pin
Henry miller19-Nov-04 6:21
Henry miller19-Nov-04 6:21 
GeneralRe: Saving data and version handling Pin
Cedric Moonen19-Nov-04 6:37
Cedric Moonen19-Nov-04 6:37 
GeneralRe: Saving data and version handling Pin
Henry miller19-Nov-04 7:56
Henry miller19-Nov-04 7:56 
GeneralRe: Thanks ! Pin
Cedric Moonen19-Nov-04 6:39
Cedric Moonen19-Nov-04 6:39 
QuestionUCHAR to string??? how? Pin
blueworks19-Nov-04 3:43
blueworks19-Nov-04 3:43 
AnswerRe: UCHAR to string??? how? Pin
BlackDice19-Nov-04 4:02
BlackDice19-Nov-04 4:02 
GeneralRe: UCHAR to string??? how? Pin
blueworks19-Nov-04 4:10
blueworks19-Nov-04 4:10 
Generalcan't seem to make FindWindow() work right Pin
BlackDice19-Nov-04 3:12
BlackDice19-Nov-04 3:12 
GeneralRe: can't seem to make FindWindow() work right Pin
David Crow19-Nov-04 3:34
David Crow19-Nov-04 3:34 
GeneralRe: can't seem to make FindWindow() work right Pin
BlackDice19-Nov-04 3:53
BlackDice19-Nov-04 3:53 
GeneralResolved Pin
BlackDice19-Nov-04 4:19
BlackDice19-Nov-04 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.