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

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


Switching Spliiter Panes at creation time

Deepak Saxena -- Deepak_Saxena@ccm.ch.intel.com
Thursday, July 11, 1996


nt 3.51, MFC 4.1

I have a SDI app with a static splitter that contains a tree view on the 
left and a drawing surface(scroll view) on the right.  When the window 
is created, the right pane is automatically selected.  How can I change 
this?




Lev Gloukhenki -- lev@shira.co.il
Monday, July 15, 1996

[Mini-digest: 6 responses]

At 11:00 AM 7/11/96 PDT, you wrote:
>
>nt 3.51, MFC 4.1
>
>I have a SDI app with a static splitter that contains a tree view on the 
>left and a drawing surface(scroll view) on the right.  When the window 
>is created, the right pane is automatically selected.  How can I change 
>this?
>
>

Try something like this :

BOOL MyFrameClass::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext*
pContext) 
{
  ...

  // activate the input view
  SetActiveView((CView*)m_Splitter.GetPane(0,0));
  return TRUE;

}

Gloukhenki Lev 
lev@shira.co.il

-----From: "GoroKhM1" 

Add a line like this after all panes are created:
     SetActiveView((CView*)m_wndSplitterV.GetPane(0,0));
This is in the sample VIEWEX.

Mark Gorokhov
Allied Technology Group
Rockville, MD
MarkG@usa.net

-----From: rwagner 

I've been using CSplitterWnd::SetActivePane at the end of the function in which 
I call CreateStatic, on a very similar project, and it works.

In yourApp::InitInstance, make sure the call to AddDocTemplate registers your 
left side view (the one you want to be active).

-----From: Allan Rentcome 

I think you can use the SetPane function in your override where you =
created the splitter window. Check the slpitter windows member function =
SetPane.

-- Allan


-----From: Anujit Sarkar 

Use SetActiveView after calls to CreateView.The code should be
something like this
SetActiveView((CView*)m_Splitter.GetPane(0,0));
m_Splitter is the Splitter Window
-------------------------------------------------------------------
Anujit Sarkar(e-mail address:anujit@vedika.ernet.in)
-------------------------------------------------------------------
Resi: 102 Southern Avenue        Office:Vedika International
      'Sarobar' 7  N.E.                 21 Lansdowne Court
      Calcutta -700029                  5B Sarat Bose Road
      INDIA                             Calcutta-700020 INDIA
      Phone No.+91-33-4661473           Phone No.+91-33-2473810
-------------------------------------------------------------------
-----From: "Manos D. Anastasiadis" 

IF you mean "activated" with the word "selected"
You can either:
	1) call SetActivePane(row, col)
	2) call ActivateNext()
	3) change the order of your calls to CSplitterWnd::CreateView(...) :-))
	(neither elegant, nor tested - I *think* it calls SetActivePane() =
inside)

/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*
 * Manos D. Anastasiadis            *
 * Computer Engineering Dept.       *
 * Technical University of Crete    *
 * Mu.S.I.C.                        *
 * manos@ced.tuc.gr                 *
 =
*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/





| Вернуться в корень Архива |