Creating child splitter window with in a parent splitter window
Hi
I have recently been experimenting with SDIs and splitter windows. I have come across a problem which I was hoping someone might help me solve.
I have my SDI split as into a 2 column 2 row windoow. In the first column first row I have a form view which contains a button that resizes this pane . However it also resizes the first column second row at the same time. However This is not really what I intedned to happen. I simply wish the first column first row to resize leaving the second row intact.
IS there some method I can use to get round this.? O
One method I thought of was to move the view that is i nthe second row of the first column into the second row ofd the secoond coloumn and somehow split that second row into two child columns within that pane. However I have not had much luck. I tried a MDI ChldWin with splitter which generates an error when i try to build.
Obtains the child window ID for the pane at the specified row and column.
Who assigned the child window ID?
I debugged it saw that:
For 0, 0 ->> CSplitterWnd::IdFromRowCol returned 59648
For 0,1 ->> CSplitterWnd::IdFromRowCol returned 59664
I know that every child window must have a unique ID but it is assigned by programmer when creating window. But who assigned that numbers? If these are assigned by MFC automatically for splitter windows, is it only valid for Splitter window?
Re: Creating child splitter window with in a parent splitter window
Splitter. When you create non-nested splitter it is transparent. All panes are children of the splitter window, split bars are just drown and panes are part of the splitter, not a window embedded in a splitter. Splitter calculates pane’s ID based upon a position (row, col.).
Splitter cannot be created using runtime information (as views are), hence you have to create nested splitter explicitly and assign ID that parent splitter will be able to parse as pane coordinates. ID is computed as follows: AFX_IDW_PANE_FIRST + row * 16 + col.; instead calculating it using this algorithm, splitter supplies function that does that: IdFromRowCol returns pane’s ID based on roe and col.
How did you find post almost a year old?
There are only 10 types of people in the world: Those who understand binary and those who do not.
Re: Creating child splitter window with in a parent splitter window
By searching.
You attached many codes to your old posts. They are very helpful. Thanks.
I want to ask one more question about Size parameter that we pass CreateView function. To be honest, i wrote many codes to understand splitter window or multi view apps but I still don't understand what CSize parameter actually do? (I mean how MFC use that parameter to show window)
Sometimes it is (0, 0), sometimes (0, value) or (value, 0). Whatever value is assigned it shows something. How does MFC calculate dimensions?
Re: Creating child splitter window with in a parent splitter window
Size of all the panes of the splitter is determined by the size of the first pane.
Splitter panes are organized in the same order like left-to-right reading.
Once first splitter’s size is calculated, next panes are resized to whatever is leftover in the client area of the splitter.
For example: in 4-pane splitter 500x400 (width, height); set size of the first pane to 100x200.
You can set Size(0, 0) for the next pane. It will have size 400x200.
Third pane size can be set to Size(400, 0) for example. Height is already determined (300). Therefore, pane 3 will have size 400x300 and the last will have 100x200.
Size you set is called ideal size, meaning that ideally splitter pane will have requested size. It is not always possible, that is why I have omitted irrelevant values.
Now off the topic, just to let you know about intricacies of English. Please do fill offended, I am just trying to help.
There is slight difference between "writing codes" and "writing code". Writing codes, means writing system of letters or numbers, like coding a message in a spy business. Writing code means writing rules and regulations and that includes programming. Since we are not in a spy business, we are writing code. I just thought you ought to know.
There are only 10 types of people in the world: Those who understand binary and those who do not.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.