CSplitterWnd questions,

When my program starts, only one view of the four splitter window shows.  I 
have to manually drag the bars to induce the other 3.  My question is: how 
do I readjust the size of each splitter window in code?  Also, what method 
do I use to get a HWND (or CWnd) to each subdivided window?


0
hello2995 (32)
6/23/2006 6:41:50 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
362 Views

Similar Articles

[PageSpeed] 25

vsgdp wrote:
> When my program starts, only one view of the four splitter window shows.  I 
> have to manually drag the bars to induce the other 3.  My question is: how 
> do I readjust the size of each splitter window in code?  Also, what method 
> do I use to get a HWND (or CWnd) to each subdivided window?

The CMainFrame parent window resizes the splitter in its WM_SIZE message 
handler.  I suggest you add a WM_SIZE handler and do something like this:

void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if (m_wndSplitter.GetSafeHwnd())
{ int cxCur0, cxCur1, cxMin0, cxMin1;
   m_wndSplitter.GetColumnInfo(0, cxCur0, cxMin0);
   m_wndSplitter.GetColumnInfo(1, cxCur1, cxMin1);
   cxCur0 = ... adjust sizes as desired
   cxCur1 =
   m_wndSplitter.SetColumnInfo(0, cxCur0, cxMin0);
   m_wndSplitter.SetColumnInfo(1, cxCur1, cxMin1);
   m_wndSplitter.RecalcLayout();
}

This can not only set the sizes at startup, you can use this to maintain 
the relative pane sizes as the window is resized.

You can get a CWnd* for any splitter child with m_wndSplitter.GetPane().

-- 
Scott McPhillips [VC++ MVP]

0
Scott
6/23/2006 1:14:29 PM
Reply:

Similar Artilces:

Frx question
Having a problem trying to do a calc column. Is it possible to divide a colume by the base period number. For intance if this is August, i'd want the entire column divided by the number 8. What I've done in the past (to create averages) is create an excel file with the number 1-12 on A though L, then access the worksheet with a column period offset (CPO) setup. "GreatPlainsIntegrator" wrote: > Having a problem trying to do a calc column. Is it possible to divide > a colume by the base period number. For intance if this is August, i'd > want the entire c...

Excel Conditional Formatting Question
I am trying to create a spreadsheet to track suspense dates for projects and I am having difficulty trying to use conditional formatting in order to complete my project. 1. I want to turn the cell green it is greater than 7 days before the date entered into the cell. 2. I want to turn the cell yellow if it is within 7 days before the date entered into the cell. 3. I want to turn the cell red if it is after the date entered into the cell. I want to use this in a spreadsheet used to track due dates (suspenses). Another words, if my suspense is 1 July 2005, I want this suspense...

Deleting question
Desperately need to settle an office argument: Given: You have a 10 page Word document "Once Upon a Time.doc " on your HD, and you want to delete it - irretrievably Suggestion #1 - Go to Explorer, find "Once Upon a Time.doc" and delete it Suggestion #2 - Open "Once Upon a Time.doc" then Ctrl A - delete - in other words, reduce the doc to one blank page, then save it Premise: We all know that if you follow Suggestion #1, the doc will remain on your HD basically untouched, as long as it has not been saved over, and can be restored by approp...

More Query Questions
This one is very detailed. I am trying to run a query that gives me results that contain the distribution center's name, the total number of parked trailers there, and then the total cost that those trailers have accrued for that destribution center. The following is the Rates table that I am pulling from: Carrier Rate/Day WKEND Free Days Triple Crown $50.00 None 2 Alliance $50.00 Included 4 B&W $50.00 None 0 Fourteenth Avenue $35.00 None 3 Tom Donahue $25.00 None 0 JDC Logistics $25.00 None 5 Schneider ...

Crosstab Query Column Question
Hello! I am currently in the process of trying to work with a crosstab query in MS Access. In the rows, I have a list of names, and in the columns, I have dates. I would like the dates to be formatted as follows: (First column for names) Second column: Fiscal Year 2005 (July 2004 results - June 2005 results) Third column: Fiscal Year 2006 (July 2005 results - June 2006 results) Fourth Column: July 2006 Fifth Column: August 2006 Sixth Column: September 2006 ((and so on...)) Is there any way to do this? I would like to import this information into a report. Thank you! Do believe...

theoretical MFC question
I've been debugging like a nutcase for a couple of hours trying to get the systemtime... I used SYSTEMTIME st; GetSystemTime(&st); --pretty straighforward.... I'm using unicode, and in building in RELEASE mode.... Release mode is not a problem in VB.net and I can set a watch on my variables and look inside them any time I want. So here I am in release mode tyring to check for correct data in my variables and get Nothing in them ....So I think that the code isnt working ... --I pull out my hair for a couple of hours and then decide to try debug mode...

Questions for help
According to documentation, for a CMyDialog : public CDialog, CMyDialog::OnInitDialog calls CDialog::OnInitDialog, and then CWnd::UpdateData() is called. From which function specifically is the CWnd::UpdateData() called? Is there any chance that I have to explicitly call UpdateData() in CMyDialog::OnInitDialog()? My other questions are about worker thread: Worker thread lacks a message pump. If adding something like, PeekMessage() inside such thread, does this make worker thread become an UI thread? Is UI thread a general term on Win32 programming, or it just related to MFC programming? ...

Flowchart shape question
I've been unsuccessfully trying to learn more about the use of a particular shape on the basic flowchart template. I've tried using the right click on the shape and selecting help, but don't get any specific information. The shape is called Parallel mode. I am not able to get more information about how to use it in Visio. Any help you can give me would be nice. Thank you. On Tue, 21 Nov 2006 17:01:01 -0800, vimesfan <vimesfan@discussions.microsoft.com> wrote: >I've been unsuccessfully trying to learn more about the use of a particular >shape on the basic ...

Unicode Question
Is a Unicode character always represented as a single 16-bit integer for every language besides the oriental languages? No. Read about surrogates. A number of other languages, particularly some of the more obscure scripts (including several dead scripts which scholars in those areas use to communicate their findings, such as Cuneiform), are in the surrogate range. You should probably get the Unicode 5.0 standard which is now available. Apparently it incorporates a lot of material previously scattered throughout the Unicode Consortium's site. There's a link to it from my Web s...

Conditional Formatting Question #5
Using Excel 2000, can I conditionally format a row to change background color when the first column meets the condition of the current date (within a 7 day range) I would like the color to default to white unless the condition is met, then the row be highlighted to show the current weeks row. Hope I explained this well enough. Mark Strohmeyer Seems possible, but I think you will have to provide an example. I'm confused by what "within a 7 day range" means. Do you mean, 'if the date in column A is between today and 7 days from now'? If I'm guessing correctly, highl...

Form design question 10-24-07
Suppose we have a customer form where the first field on the form is Customer Name. (There's a Customer Code as well which is the actual key of the file, but that is hidden from the user.) The Customer Name field is a combo box that the user can use to jump to a specific customer. The only catch is that, on the rare occasion when the user needs to modify the customer name, we need to alert Access that their typing is meant to change the customer name, not jump to another customer. So we've added a button for "Edit customer name". We've used the button for editing t...

I am still waiting for a good response to the question I posted?
Howdy there all you folks, wuz happening, I dont know. I have a suggestion to > make here to yal, I purchased a gateway desktop PC from my local library > yesterday for only 10 dollars right, they said it do not have a operating > system on it, well it have 128 MB RAM on it though, last night I tried > installing windows xp home edition service pack 2 right, well its telling me > that I need to install a full version of an previous version of windows like > 98, 2000 professional, or Millenium Edition and then I can upgade from that > and be on my way to surfing onli...

OWA 2000 SSL question
Hello We just installed certificate for OWA on our company's Exchange 2000 server. Can anyone please tell me, why when the users log into accaunts they get message ''The page contain both secure and nonsecure items. Do you want to display nonsecure items'' How can I disable this message, or what do I need to do ?? IIS on Exchange server is hosting only OWA site ? Thanks for all help Regards Miha Hi, there is nice tutorial http://www.msexchange.org/tutorials/MF004.html good luck BEG "Miha Bernik" <miha.bernik@gvskupina.si> p�e v diskusn�m p��sp�v...

formula question #19
Need help on 2 formulas. here the work sheet cell A1 will have input either letter DO then a number (i.e. D102) or just the number (i.e. 134) cell A2 & A3 will input only numbers. (i.e. 9) 1st formula Cells A4 will add A2 + A3 only when cell A1 starts with the letter D (ie D102) Cell A5 will add cells A2+A3 only when cell A1 does not start with the letter D. (ie 134) Can this be done? One way in A4 =SUM(A2:A3)*(LEFT(A1)="D") in A5 =SUM(A2:A3)*(ISNUMBER(A1)) you could also use an IF function =IF(LEFT(A1)="D",SUM(A2:A3),0) =IF(ISNUMBER(A1),SUM(A2:A3),0) -...

CSplitterWnd problem
Hi there, in a first step I create a splitter window with 2 rows. If I split the first row again, into 2 columns, the resulting panes don't have a size. But I do set a size when I create a pane. Please can someone help out? Here is the source: BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { CRect cr; GetClientRect( &cr ); // create a splitter window with 2 rows if( !m_mainSplitter.CreateStatic( this, 2, 1) ) { return FALSE; } // split the first row of m_mainSplitter if( !m_Splitter2.CreateStatic( &m_mainSplitter, 1, 2, ...

Drop Down List Question!
How do I go about having a drop down list in a invoice so as it will link up with a name and address on another sheet. Sheet (Address) has name and address in A1, A2, A3, A4, A5. Then in Sheet Invoice I want to have a drop down list then select and the next 4 cells fall below to complete a invoice address! -- Thanks in advance for your help....Bob Vance .. .. .. .. Hello Select the cells of your address (A1:A50) in Sheet Address Then | Insert| Name | Define give a name - for eg: "add" Now in your Invoice Sheet, go to the cell where you want the address to be printed Data | V...

Question for the gurus.
How can I make my spreadsheet automatically jump to the next cell when I scan into it? The input comes from a scanner, patched into the keyboard, that reads bar codes. I want to scan into cell "A1", then have the cursor move to cell "B1". And after the data is entered into cell "B1", the cursor drops down to "A2". I know this has to be a simple command.:confused: Anyone have a clue? --- Message posted from http://www.ExcelForum.com/ In tools=>Option=>Edit Tab, under Move Selection After Enter, do you have Down selected? -- Regards, Tom Og...

POS2009 questions
I am using RMS right now and will be getting pos2009 In RMS we use alot of Macros, custom menu, touch screen, custom buttons, net display, new item wizard and reports are those all available in pos2009? what features are not availabe in pos2009 that are in RMS. And what features are new? is there a news group for ppos2009? Do we upgrade from RMS or have to install a fresh copy and add the database itmes? or you can do both? Is microsoft going to drop one of the programs? Stick with RMS there are many things that you will regret losing with a move to POS2K9. RMS has had its ...

Grid Line Question
Hello, Let's see if I can explain this clearly, as I imagine it's against the groups protocal to post a small graphic clip showing it. Or is it ? I have graph with the vertical axis labeled 60, 80, 100, etc. I have the horizontal grid lines going from these 60, 80, 100, etc. I have ticks marks, also, at 70, 90 110, etc. (no axis labels here; just the ticks) Can I also have horiz. grid lines extending from 70, 90, 110, but Not have numerical axis values for them ? Just horiz grid lines extensions from these Ticks ? Thanks, Bob You can add another series to the chart with the...

GetNumberFormat() Question
I am using the GetNumberFormat() function with a clip of code from Locale Explorer, thanks to Joe Newcomer.. sorta like this: CString csValue contains the numerical string upon entry ...... { /* GetNumberFormat */ int length = ::GetNumberFormat(lcid, 0, csValue, NULL, NULL, 0); if(length == 0) { /* error */ DWORD err = ::GetLastError(); return false; // .. handle error here } /* error */ else { /* valid length */ LPTSTR p = Number.GetBuffer(length); if(::GetNumberFormat(lcid, 0, csValue, NULL, p, length) == 0) { /* failed */ DWORD err...

Rule question #4
I have a rule to redirect email messages as they come in. Very simple, where my Name is in the To and CC box, redirect to this email. What is happening, im not getting all messages redirected to me, if its a internal group that was emailed and im in that group, doesnt get redirected. If im bcc, no redirect. How can i configure my redirect to send every email that is delivered to my inbox no matter what? If you want a rule to apply to EVERY email put NO criteria in the first step wich asks for what criteria the email must meet. You will see a pop up window asking if you really want to...

CBitmap and CDC question
Hi, How do you create and dispose of a CBitmap correctly? When destroying CDC objects do I need to call DeleteDC, because when resizing a CDC I select its old object and call deleteDC. Then I use createCompatibleBitmap and CreateCompatibleDC to reuse the object. Is this correct? Thanks. I'd be surprised if you ever needed to call DeleteDC under any conditions, since it is rare to ever need to write that call at all. It is equally rare to ever write GetDC calls. Typically, a DC does not exist longer than a single funciton invocation, and therefore you are more likely to write CClientDC...

Alias question
hi - I'm wondering why the following SQL doesn't work. It treats the 'FullName' alias in the last line as a parameter and asks the user for its value. SELECT tblEmp.EmpID, tblEmp.LName & ", " & tblEmp.FName AS FullName FROM tblEmp ORDER BY tblEmp.FullName The SQL works fine when I replace the last line by... ORDER BY tblEmp.LName & ", " & tblEmp.FName , but the SQL Help says that ORDER BY can be followed by the name of any field, and the alias following the 'AS' should have assigned 'FullName' a...

Formula question #25
=IF(C6:F10,G6:G7 = "V"or"PH"or"COV" than subtract 1 for each entry, then sum total and subtract from A6 leaving remaining) I'm trying to add a formula in Excel that will subtract vacation, personal holidays or carryover vacation days from a calendar in Excel. I'm sure it's a nested formula with array's but I'm unclear as to how I should write it. I think that youi just want =SUMPRODUCT(COUNTIF(C6:F10,{"V","PH","COV"}))+SUMPRODUCT(COUNTIF(G6:G7,{"V", "PH","COV"})) -- HTH RP...

CSplitterWnd
Hello, I hope someone can fix my problem. I create with two CSplitterWnd in CMainFrame something like this : oooooooooooooooo o o o o o o o o o o oooooooooo o o o o oooooooooooooooo My code is the following for OnCreateClient BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext) { if ( ! m_wndSplitter.CreateStatic(this,1,3) || ! m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CExamen2View),CSize(75,0),pContex t) || ! m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CMiddelView),CSize(150,0),pCon...