Have one simple view and one split view in MFC - mfc

I have a multiple view SDI project. One of the views has to be split, probably with CSplitterWnd or CSplitterWndEx. But the other views should not be split, and should not have the split buttons and scrollbars. I tried various combinations using CSplitterWnd and some classes derived from it which I found online, but I can't get what I need. So here are the constraints:
One view is CViewUnsplit, without splitter
The second view displays initially only CViewSplitLeft
A command allows the user to split/unsplit and add or remove CViewRight.

It should work in the following way.
The first is CViewUnsplit is just the way a simple SDI application comes up.
The second switched view can be easily achived in just swapping the view. This is well documented.
The basics are shown here in this sample with two views
http://msdn.microsoft.com/en-us/library/s199bks0.aspx
The third is a little tricky. Just create the splitter and place the CViewSplitLeft with SetParent into the left splitter part. The right view can always stay in the splitter. Again here the splitter is just hidden in the main window. When you switch back to another view just Use SetParent again and move the CViewSplitLeft to the CMainFrame.
Always just hide all unneeded views.
Take care about the IDs of the views as shown in the sample. Otherwise the resizing will not work.

Related

How does a CSplitterWnd and two different views handle UPDATE_COMMAND_UI for the menu/toolbar

I took an existing single view and changed it to a CSplitterWnd to add a new split view of a new CTreeView and the old CListView.
How is the toolbar update supposed to work with the use of UPDATE_COMMAND_UI so when THE focus is in one view vs. the other, the toolbar options are enabled/disabled properly (some toolbar buttons are shared).
Turns out MFC tries the active view first, then moves up to the mainframe and even document and app. So you can handle the UPDATE_COMMAND_UI wherever it would make the most since.

iOS Custom Tab Bar

I am looking to implement a custom Tab Bar in iOS where selected item is bigger size than the rest of the tabs and peeks out over the content similar to this screenshot.
Could someone point to a tutorial of how to accomplish this preferably in Swift?
I faced with this task several times. I found a lot of tutorials but I've never found one that gives the ability to create a center button that part of it is out of the tab bar.
At the end, I created an approach to have it done correctly. I implemented a simple example project with instructions how to do that. Please check my Custom Tabbar Center Button repo as an example.
One more benefit of it it's center button hides correctly with the tab bar when you use Hide Button Bar on Push property.
A UITabBar contains an array of UITabBarItems, which inherit from
UIBarItem. But unlike UIBarButtonItem that also inherits from
UIBarItem, there is no API to create a UITabBarItem with a customView.
So instead of trying to create a custom UITabBarItem, we’ll just
create a regular one and then put the custom UIButton on top of the
UITabBar
Not swift, but should be easily translated.
https://github.com/boctor/idev-recipes/tree/master/RaisedCenterTabBar
This one is Swift:
https://github.com/itsKaynine/SwiftRaisedTab
Source code for a similar question, using Swift 3:
https://stackoverflow.com/a/36016377/300897

How to call print function if I changed the original view class?

I'm an MFC user.
In my code, there are two Views with split bar which are filled with buttons on the left and signals on the right side.
And, I tried to call the print functions which include print preview, OnPreparePrinting(),OnPaint() what so ever, through a button which is made by me and called PrintScreen on the menu, but it didn't work.
How can I connect from the menu button with the print functions?
And how can I project the both images from the two views on one page?
P.S. I've googled a lot, but I couldn't find completely the same as my situation. If someone knows this solution or information, please link or leave any solutions.
The MFC only supports printing for one view only, as long as you don't write your own print routines.
When you have two views divided by a splitter, one should be the active one. (Usually the view with the focus). In this case all standard commands like printing route to the one view that is active.
When you want that both views including the splitter to be printed, you have to write your own code. A simple solution would be calling the print functions for both views one after another.

Disable only specific list items in a win32 ListView

I am using win32, c++.
I have a ListView & i want to disable (grey out) only some of the items from the list.
Is that possible or only whole ListView can be greyed out?
The ListView control does not have a concept of disabled items. You can simulate that appearance using custom drawing support. This Sample demonstrates how to change the text and background color of items within the list view.
You would need to go further and provide some means of determining when a disabled item is selected within the view (as the selection will continue to work).
The Windows List View Common Control does not have a disabled state for Items. If you want to do that, you will have to implement it yourself.
This is a not-trivial exercise. It's not hard to change the visible appearance using customer draw, but handling hit-testing and selection would be quite complex.

What is the ember way to add popovers to views?

I'm working on a events board app. Events are displayed in columns at the height matching the start time and pack into the space if there is more then one overlapping. Each event is a view and I want to have a div next to the view that shows and hides on hover.
I know how to bind to mouseEnter and mouseLeave to show and hide part of the template but I want to show something adjacent to my view/template not within it.
I've already got some computed properties on the view to place the event with the correct height and width so I don't want to add the popover inside the view.
Here is something to mess with http://jsbin.com/osoner/1/edit
Seems like something simple but I want to make sure I'm doing things the Ember way.
After messing a little with your provided jsbin, here the results.
Basically what I've done was adding a new popup css declaration wich do position the popup so that it appears outside the parent view, and also moved the {{#if...}} helper into the originating view.
If you want to go more fancy, checkout this jsfiddle wich uses the twitter boostrap popover.
Hope it helps.