|
Do you mean it resizes and then resizes again, or does not remember it's size ?
I admit I typed this response without trying it, I've just found you need also to do this:
GetParent()->MoveWindow(0,0,x,y);
at least in my program, which shows a bitmap to be edited in the view.
I'd suggest this:
CView::OnInitialUpdate();
CSizeDlg sizedlg;
if(sizedlg.DoModal() == IDOK)
{
MoveWindow(0, 0, sizedlg.m_Width, sizedlg.m_Height);
GetParent()->MoveWindow(0, 0, sizedlg.m_Width, sizedlg.m_Height);
}
I see no point in the extra variables you were creating, and you also had the width and height going in the wrong spots.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
EXCELLENT! Thank you so much!
One more thing:
at least in my program, which shows a bitmap to be edited in the view.
As long as we are in the same pot, how about restricting the drwaing area to the same size. I mean even if the user maximizes the view, it still must remain the same drawing area as the desired size, but now it just maximizes it fully (resisez the area as well as the view!)?
|
|
|
|
|
Do you mean resizing the bitmap as well ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
no! just the view. To explain further, please visualize this scenario:
The user opens a new document from menu->new, the size dialog pops up, user selects a 320x200 pxls view and then PASTEs a captured image data of some window by either the print screen key or a CTRL+C keys from any other graphic app.
At this point, when the user PASTEs the image into my apps view as above mentioned with size 320x200, the image could be bigger than the rect area of my view! So I'd have to resize to fit the image! Right!
Suppose the image will be of size 380x380 pxls, then I would resize to fit it, but I do not want the remaining of the view (the white area) to show while the view is fully maximized, as well not to effect the size of the bitmap at all!
Something like whta the "MGI PhotoSuite SE" app does already!
Thankx again Christian!
|
|
|
|
|
I have a base class which I have derived from CPropertyPage, called CXXXPropertyPage. This class overides OnKillActive() in order to call a Validate() method in the derived class (pure virtual in CXXXPropertyPage().)
If I have multiple CXXXPropertyPages in a CPropertySheet, all is well and Validate() is called for all property pages in the sheet via the CXXXPropertyPages base class.
The problem occurs if I only have one CXXXPropertyPage in the CPropertySheet. In this case, we want to SetWizardMode() in the CPropertySheet in order to remove the tab from the top right of the property page dialog. If we do this, then OnKillActive() is no longer called in the CXXXPropertyPage base class. I have tried to hook in at other levels, but with no luck - WM_NOTIFY does not work, nor does anything else I have tried.
Surely a wizard has some hook to allow validation before changing page or calling OnOK. I have also tried OnWizardNext(), OnWizardBack() and OnWizardFinnish().
Can you help me, please!
Regards
Tom
|
|
|
|
|
The 'OnWizard...' functions should be what you are looking for. When Wizard mode is active, these are the functions called for validation. You return FALSE to tell MFC to ignore the request. That is, if the user clicks on the 'Finish' button then 'OnWizardFinish' is called, and you would return 'FALSE' if you did not want the dialog to close.
What exactly happens? Which button do you click ? Which of the the 'OnWizard...' functions is being called (or not called)?
Ian Kilmister
|
|
|
|
|
Thanks Ian,
I had tried all three OnWizard... functions. But I must have done something wrong. I tried OnWizardFinish again and it miraculously worked straight away!
Thanks again.
Tom
|
|
|
|
|
hi
is it possible to get the handle to a submenu using the id of the menu item in the menu bar
thanks
subir
|
|
|
|
|
Popup menus don't have IDs, so you have to access them by their position.
HMENU hmenu = GetMenu(hwnd);
HMENU hFileMenu = GetSubMenu(hmenu, 0); // file menu is position 0
HMENU hEditMenu = GetSubMenu(hmenu, 1); // edit is 1, etc...
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
I have my own class derived from CToolbar, and I want it to look like it's docked ( no caption bar, gripper on the left ) when it is floating. Can anyone suggest how I might achieve this ?
Thanks
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I have my own class derived from CToolbar
Haven't tried it before! One idea would come to mind is what if you override the non client stuff, the WM_NC***** CWnd virtuals! and make your own codings!?
|
|
|
|
|
I have my own class derived from CToolbar, and I want it to look like it's docked ( no caption bar, gripper on the left ) when it is floating. Can anyone suggest how I might achieve this ?
Thanks
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hello Christian,
How are you!
I had this same thing in mind and I last tried it 2 weeks ago by overriding the default NC messages, but it seems it won't work! It actually works but the defualt stuff comes back!
I tried to programicly float the toolbar and it works inbetween here! it draws the whole window+caption with my gradient filling colors!
Also tried to get the menu to delete the Close & Move items, assertions occur (violations in the DeleteMenu(xxx) stuff!).
I wonder/interested if you tried and had any good result with this!
"Socrates is a man. All men are mortal.
Therefore Socrates is mortal."
-- Aristotle (syllogism)
Cheers
Masoud Samimi Go!
|
|
|
|
|
No, I'm still in a hell of my own making. I wouldn't mind a look at your code - my email is cgraus@isw.net.au if you feel inclined. I have got the move/close items to go before, but to be honest, I've not had time to look at it for ages, I was just thinking about it again last night. Maybe if no-one else knows how to do it we could collaborate and produce an article on the subject ?
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi Christian!
I'd be happy to join forces with you!
I'll put together some clean code project (VC++6 SP3, Win98) and send you soon!
"Socrates is a man. All men are mortal.
Therefore Socrates is mortal."
-- Aristotle (syllogism)
Cheers
Masoud Samimi Go!
|
|
|
|
|
I'm working with a wizard and I need to resize it, I have found the buttons ID's, but I can't find anywhere the ID of the separator (the line at the bottom that separates the wizard buttons of the "property pages").
Is there any way to find the ID's? now I'm cycling through the dialog and moving each window to see the results and to get the numerical ID.
Thank you very much.
|
|
|
|
|
Spy++ will show you window IDs (along with everything else about a window!)
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
first of all thank you for reading this question.
the problem:
I'm developing an application that is intended to control a machine. In order to control the machine it use some files that the user writes a kind of programs.
There are some tasks that are easily done by the use of assistants, but now I only know two situations that would be better if It would be solutioned by assistants, but I'm sure that when the client have worked a little with the program he/she will ask for some expansion modules.
How could it be done? (an example would be great)
Thank you again.
|
|
|
|
|
This problem can be overcome by using the WHS.It enables powerful scripting using languages such as VB Script, Java Script, and Perl.
I suggest you take a look at IActiveScriptParse and IActiveScript or use a commercial library such as HyperHost or Hyper Studio, It is owned by Dundas Software.
G. Alfadhly
famous Last Words
"TRUCK!!!!!"
|
|
|
|
|
Hello,
Can anyone tell me how can I get the system date into my own field? What instruction shall i use?
You can e-mail me at pmfsilva@net.mailcom.pt or over here.
Thank you.
Have a nice year!
|
|
|
|
|
CTime time;
time = CTime::GetCurrentTime();
|
|
|
|
|
CTime time;
time = CTime::GetCurrentTime;
|
|
|
|
|
SYSTEMTIME st;
GetSystemTime(&st);
- Anders
|
|
|
|
|
I had a problem with the GetSystemTime() function. When it is 4:00 pm the date changes to the next day. So i was curious if this only happens for me.
Thanks
|
|
|
|
|
I have never seen that problem...
- Anders
|
|
|
|