|
Assuming the frame window owns the splitters, have the button handlers in the MDI child window pass the commands to the frame (which you can get via AfxGetMainWnd() ), which recalculates the splitter information. CSplitterWnd has the methods GetRowInfo , SetRowInfo , GetColumnInfo , and SetColumnInfo for manually setting the splitter locations.
Software Zen: delete this;
|
|
|
|
|
That's what I've done, and it works perfectly when you grab the document window, and resize it. Let me try to explain again, what my problem is...
A little background...
My MDI application uses 4 views in 4 static splitter windows in a single single frame window to display my the data. Most of the time, you're working in one or two of these views, and don't really care to see what's in the other ones. The user can move the splitter bar(s), and size the window as necessary, which is normal behavior. What's annoying about the standard implementation of the splitter windows, is if you resize the window, some views remain the same size, while others change their size to fill the new (larger or small) window. You can observe this behavior by firing up Visual Studio, and resizing the application.
To get around this problem, I added a toolbar button (freeze) the user can click on that is handled by the MDI child window. It calculates the relative sizes of each of the splitter windows by virtue of the functions you mentioned (GetRowInfo, SetRowInfo...), and stores the result for later use by RecalcLayout whenever the Frame Window is resized. It all works perfectly. If you manually resize the windows such that only 3 split windows are visible, click the "freeze" button, you can now resize the frame window, and the 3 views are redrawn with the same relative sizing. I was very happy, but then I got dangerous... I added some additional buttons to the toolbar that allow the user to select the more common sets of views. When I click on them, I set up the variables RecalcLayout will use to redraw the window in a manner consistent with the layout button selected. The only thing is, I have to manually resize the window with the mouse to display the frame window with the new set of views (a picture would be worth a thousand words).
What I want to be able to do is have the frame window redraw it's client area with the sizing of the splitter windows programmatically, instead of requiring the user to go through the additional step of resizing the window. One solution would be to do something (send a message...?) to cause RecalcLayout to execute, but I can't find it.
I hope that's a little more clear...
|
|
|
|
|
You could try moving the frame window via MoveWindow or SetWindowPos , making it 1 pixel taller or wider. This would force it to resize the splitters, just like if the user had done it.
Software Zen: delete this;
|
|
|
|
|
Just got back from a little time away...
Tried that suggestion, but it has ill effects if the window is maximized!
I give up!
Thanks anyway.
|
|
|
|
|
If the window is maximized, reduce the size of the window by one pixel.
Software Zen: delete this;
|
|
|
|
|
Hi all,
I need to reboot computer in my VC++ project.
How to do it?
Thanks in advance.
Laura
|
|
|
|
|
With ExitWindowsEx .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Man, windows sucks. Back in the good old days, a simple "memcpy (0, "TRASH MY LITTLE MEMORY BABY", 1000);" would work wonders.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
roflol
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
It feels like Friday, doesn't it?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I have written a program that contains a CDocument derived class. The
user can create a document that is a template. Basically, the document
contains a list of objects like IMAGEBOXES, BORDERS, and CAPTIONS which
the user positioned on the document. This is all working fine. The user
can save and open the document.
Now, part 2. I have another application that needs to be able to open the
first program's document. However, rather than moving the document
objects around, this program needs to let the user specify what images go
in the IMAGEBOXES, what color the BORDERS should be, and what text should
go in the CAPTIONS. Also, this program does not modify the "template"
document. It needs to save a different document.
What is the logical way to implement this?
Should I just include the document class from the first program in the
second?
Can I just use the first program's document in the second program without
the view?
I do need the same basic view functionality in the second program (i.e.
drawing the IMAGEBOXES, BORDERS, and CAPTIONS. Should I use the first
program's view as well?
I don't know what my next step should be. Perhaps I should just write new
document and view classes that contain copy-and-paste pieces from the
original classes (but I want code changes for one to be reflected in the
other with the smallest chance of error).
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
What about creating a base document class with all the common code for each application, and then have derived classes for the different apps. Copy and paste is not the way to go in the OO/C++ world.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
if i have to print 'u' then i have to execute this line
SendMessage(hTestWnd, WM_CHAR, (WPARAM) 'u', (LPARAM) 0);
but if i have to print character like
1-:
2-"
3-?
4->
etc
it does not work what to do?
SendMessage(hTestWnd, WM_CHAR, (WPARAM) ':', (LPARAM) 0);
r00d0034@yahoo.com
|
|
|
|
|
What does the MSDN say ? I seem to recall that the higher half of your WPARAM value needs to be set to something other than 0 for non alpha characters, maybe ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
yea it should contain contains the scan code plus the virtual-key code.
let suppose i have both the scan code and virtual key code then how to form wparam from it ?
how to get scan code and virtual key code from wparam?
r00d0034@yahoo.com
|
|
|
|
|
It appears Norm has provided a better answer anyhow.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
SendInput
The SendInput function synthesizes keystrokes, mouse motions, and button clicks.
UINT SendInput(
UINT nInputs, // count of input events
LPINPUT pInputs, // array of input events
int cbSize // size of structure
);
|
|
|
|
|
Cool, Norm. I guess it WAS worth his while to keep asking this question for weeks. I had no idea this API existed....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thats what we're hear for
|
|
|
|
|
i have an MDI application and I am able to save the Document . Now before the Document is saved and the FileDialog invoked i need to save some parameters . If i implement "ONFileSave()" in my view class I no longer get the File Dialog prompt.
I need to be achieving both .
1. Saving my changes
2. Then call the default save mechanism of windows
Also in the FileDialog that appears how do I specify the type of the File (i.e File FIlter). I want my documents to be saved with my custom File extension .
Please help
|
|
|
|
|
(Not sure) Try calling your document's OnFileSaveAs message handler inside yours.
If this does not work, Nish has written an article that may help you: CDocument::DoSave revealed[^].
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i am having a window hwnd and i want to get its child window hwnd that has keyboard focus.
how to get it
r00d0034@yahoo.com
|
|
|
|
|
|
How do I determine the default browser of an NT-based (that is, NT 4/2k/XP/.NET) system? Is there an API call?
Actually, the simplest solution is to call ShellExecute() and just launch the HTML file. Is there a way to get an HWND for a console application?
Barring that, I need to determine the default browser, launch it, and have it open a specified URL.
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|
I'm going to create a temporary window (::CreateWindow()), and then use that to call ShellExecute(). Can anyone see any problems with this strategy? Is there a better way to do this?
Jon Sagara
If you think of wheat fields as questionable metaphors, you can think of me as the state of Kansas.
-- Mike Blaszczak
|
|
|
|
|