Sorry for the delayed response. I am in the office working and participating in the forum part-time as time allows. I have added the code you suggested to the MSOffice2007Demo sample. I am not able to reproduce these cut-off issues you are describing. Would it be possible for you to upload a screenshot so we can see what your talking about?
Actually... I do see a drawing bug here in my office but it is in the "Oil in Mass" Panel. Here on my development box the text is drawing outside of the panel into the non-client area when I resize the window.
Notice how the multiply shows up but not the text to all the other buttons around it. Multiply is larger text than say add so Add should show up if Multiply shows. Any help would be most appreciated. As per everything, this is on XP => if it works on Vista/Windows 7, but not XP that would definitely be worth knowing.
I have tested the modified MSOffice2007Demo binaries on both Win2k and WindowsXP. The panels are drawing the same on all platforms. The only thing that I would classify as being strange... is that in your 'Column operations' pane the first item is 'Multiply' and for some reason this item is the last to be cropped. Even though 'Add' and 'Divide' have a smaller character width.
Is this what you are referring to when you say labels cutting off?
Thats exactly the same behavior I see in the MFC Feature Pack Ribbon Panel. I spent a few minutes debugging the issue and was able to track it down to the file:
\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\afxribbonpanel.cpp
And further into the CMFCRibbonPanel::Reposition function. I stopped debugging the issue at this point because it was taking more time than I was willing to invest. You may also be interested in the CMFCRibbonBaseElement::SetCompactMode[^] function. I did not spend the time to check if this function was able to fix the labels. You may want to continue the research.
The only way I am able to duplicate the issue you are describing is by calling CMFCRibbonMainPanel::Add[^] multiple times with the same element pointer. This causes my Quick Access Toolbar to have multiple entries for my test element inside the 'More Commands' customization dialog.
Can you confirm that this line is executing only once? And could you confirm that the pBtnHelp element pointer is only used once?
\Samples\1033\Visual C++ 2008 Feature Pack\RibbonMDI
I pasted the code snippets you have shown into the InitRibbon() function. It compiles cleanly after I added resource definitions. The items only show once for me. I am not able to reproduce the issue you have described.
CMFCRibbonButton* pBtnPeepHelp = new CMFCRibbonButton(ID_HELP2, _T("Peep &Help"), 10, 11, TRUE);
pBtnPeepHelp->SetDescription(_T("Get help using Peep."));
CMFCRibbonButton* pBtnShowHelp = new CMFCRibbonCheckBox(ID_HELP_SHOWHELPONSTARTUP, _T("Show Help &On Startup"));
pBtnShowHelp->SetToolTipText(_T("Show Help On Startup"));
pBtnShowHelp->SetDescription(_T("Show Help file when starting Peep."));
I have some problems getting the screen coordinates of the client area of my mainframe and later increasing if the right side coordinate of the mainframes client Rect is smaller than the views right side coordinate.
For testing i positioned the view fitting in the mainframes client area(By Mouse). So the outside coordintes of the View Window should be the same as the inside coordinates of the main frame client area.
But it isn't!!
What am I doing wrong?
Code inside the view class:
ViewWindowRectSC.right is not MainFrameClientRectSC.right
I tried a lot but it is getting more and more unclear.
For example i tried to find frames or bars or something else with the GetSystemMetrics() function because i was thinking that there could be coordinate values not bringing these into account these. Didn't help.
Also tried to calculate the outside of the view window by first using
GetClientRect(ViewClientRectCC) and then
Thanks a lot
If your view is going to be bigger than the frame size, you must ideally use CScrollView so that the view is scrollable and you can also use CScrollView::ResizeParentToFit[^] to resize the frame to the size of the view.
«_Superman_» I love work. It gives me something to do between weekends.
I just reduced the problem to the described upstract conditions. In real i am setting views to before stored positions when i rebuild the application or the user opens a config file. The user is able to load a defined graphview which has coordinates which sometimes d'ont fit into the frame. (If the frame was smaller during constructing of the graphviews)
The use of scrollviews would be possible but i wouldn't like to have scrollbars. I constructed tabs in this view and in each tab there are one or more graphs. But there are also more then one view in the mainframe. The user has to positioned them once and he and others can open these configuration from file.
How does CScrollView::ResizeParentToFit increase the Mainframe? Just at the view coordinates which are bigger then the accordant one of the MainFrame?
With this informations i was looking for parent() parent()....... frames and windows until i found the windows and frames with the correct coordinates.
The resulting code as follows:
//ClientRect of mainframe
//View covering outside frame
CMainFrame* pMainFrame=(CMainFrame* )theApp.GetMainWnd();
MainFramePlacement.length = sizeof(WINDOWPLACEMENT);
//Get the Mainframes actual position
//if views right/bottom edge is outside mainframes client area increase MainFramePlacement right/bottom// coordinates so view windows right/bottom will be next to mainframes client area right/bottom if(ViewsFrameWindowRect.right>MainFrameClientRectSC.right)
//increase and position mainframe
Thanks to all which were looking at my question and thinking about a solution but couldn't help.
The second parameter in the CreateProcess Function[^] is the commandline. You can pass your arguments there such as the path to a batch file. This is probably what your looking for.
If you are looking to do some advanced interaction with the console then it would be possible to overide the hStdInput handle of the STARTUPINFO Structure[^] with a handle to a named pipe or something.
Last Visit: 31-Dec-99 18:00 Last Update: 4-Oct-23 7:02