NSTableColumn animation - core-animation

I want to make a table view with dynamic columns.
Similar to the one in Ecoute
I just need one column to be visible at a time. As soon as it is double clicked, the whole table view (not scroll view) should animate to the left, and the new column should appear.
I have no idea how to implement it.
Has anyone an idea?

Just added a new NavigationViewController which handles multiple TableViewControllers which handle a table view. The NavigationViewController then animates between them.
It's actually pretty simple if you have the idea.

Related

NSTableView section banner column with custom height

I am trying to create the following layout with a NSTableView:
A big banner per section on the side and regular text content rows on the right side.
The Image on the left side is the problem. It should behave like a floating section when scrolling (stay below the section header). It seems impossible to have the view part of the NSTableView as each column of a row needs to have the same height.
I already tried a lot of things, but I need some input which is the right direction.
What I tried:
Add the image view as a floating view into the NSScrollView? That seems like a good approach, but it doesn't stick on top while scrolling and the (re)positioning within the table is... tricky. Any hints here?
Add the view into the section header and disable clipping somehow (to make them larger than the section)? Couldn't make that work.
Having a table with NSStackViews per row that host itself tables - that did work, but: Independent selections per table is not what I want.
Ok, I finally found a solution.
The view is added to the floating view container of the NSScrollView that holds the NSTableView. I use the bounds of the row views and translate that to coordinates of the floating view container.
I also modified the selection drawing to make it look good and recalculate the coordinates on animations.

Adding drag and drop functionality to metro style app buttons with C# and XAML

I'm trying to implement a sort of drag functionality into my app. As a simplistic example imagine I have a 2x2 square of buttons, so four buttons total. Clicking a button will perform some other functionality however I want when they hold and drag one of these buttons for it to do something else (ideally if you drag one button and drop it while in the space of another button the two buttons will swap places, as long as I can get dragging and dropping working the swap should be easy).
I've done some research and followed a few tutorials but seemed to get errors at one step or another with all of those. It seems ListViews and GridViews have some drag and drop functionality in them already , but I had trouble properly arranging my buttons (there are many more than four and they are in very specific positions, like a diagram) inside these views, let alone getting drag and drop working with them.
How would I go about doing this? Ideally I could just tag these buttons as draggable, and then on a drag-drop event check for a drop position, then if the position is valid perform a swap method. I just can't seem to figure out how to make them draggable or how to have an event that checks a drop position.
Thanks.
Easy peasy, create a custom control that looks the way you want it to, set ManipulationMode to TranslateX|TranslateY, handle manipulation delta events to update positioning with something like a Canvas or TranslateTransform and when manipulation completes - either make it click or animate to the new position. From my experience - getting any other manipulations to work with a regular Button class just isn't working and since a button is a really simple control - it is easier to create your own than try to extend the existing one in such cases.

Table view inside a table view

In my app i am having a table view in which i am having buttons in which images are shown .Now what i want is that when i click on any image(button).then another table view has to be shown inside the first table view.Then i need to click on the images present in the second table view .How can i achieve that .Is it possible to create a table view inside other table view or i is there any other solution like creating a view and then adding images inside it.Please help.Any help will be appreciated.
Thanks,
Christy
It's definitely possible, but Apple advises not putting a UITableView inside another UITableView (it makes touch tracking and behavior significantly more complex).
The best solution depends on your exact situation, but if the sub-view contains a lot of data, you can move it off into it's own modal view, or you can create a static or semi-static view that is embedded inside your UITableViewCell when that cell is selected.

how to make the table view to scroll till the last row in the table

I have some 10 rows in my table. I can able to scroll the table view, but the scroll is not fixed. when i leave the scroll the table is again hiding the last row. Can any one help me out in this issue.
Thanks in advance
You need to adjust the size of table view and also set the autosizing in inspector from IB.
It is hard to give an opinion without any code, but have you checked that your Table is not larger that the size of the view? Maybe the bottom of your Table is just displayed outside the window.
If not, you shall post the code of your controller methods to get some more accurate help.
Are you using interface builder or everything is defined in the code?

Cocoa one row table view or a horizontal list view

Is it posible to use table view to show just one row of a big amount of elements? What I'm looking for is for some kind of horizontal list, like we have in XCode preferences or Aperture image list.
It would behave just like a one columnt table view, but instead of showing the elements vertically, it should be horizontally.
Can you point me to where should I start from?
If you're okay with Leopard-only, The new NSCollectionView supports horizontal display. Just set the collection view's number of rows to 1 in Interface Builder; it'll even handle the horizontal scroll bar for you. The IconCollection sample code provides a simple demonstration of how it works. It's bindings work similarly to a table view's, except instead of rows and columns, each object represented gets an 'item' (an object of type NSCollectionViewItem) that displays it, and those items will be laid out in a grid. The sample code above demonstrates how to set up these 'items' in Interface Builder, which is definitely the easiest way.
With a table view? No. If I'm understanding correctly what you want, in the past I've created my own NSView subclass for this type of control. Define a data source protocol similar to NSTableView, and in your NSView drawRect method, draw the elements in order one by one from left to right. You can either keep track of paging in your control, or put it in a scroll view and resize yourself whenever the number of items changes.
Usually this type of thing starts off pretty simple, and gets a bit complex once you start handling caching, paging, selection, mouse and keyboard input and so on. My advice, start as simple as possible and add new features one by one, only after you've finished the previous task.