Questions tagged [containment]

94 questions
3
votes
1 answer

Private inheritance vs containment

While explaining when private inheritance must be used, instead of containment, the author of this article says the following : "We need to construct the used object before, or destroy it after, another base subobject. If the slightly longer object…
Belloc
  • 6,318
  • 3
  • 22
  • 52
3
votes
6 answers

Is it bad design to pass the containing object as an argument to a method of a contained object?

Is it bad design to pass the containing object as an argument to a method of a contained object, like in the simplified example below? class A { private B _containedObject; public A(B b) { _containedObject = b; …
Peladao
  • 4,036
  • 1
  • 23
  • 43
3
votes
3 answers

Multiple ViewControllers contained in a UIStackView

I have a UIStackView and I am dynamically adding UIViewControllers contained, here is my code; [self addChildViewController:driverForm]; [self addChildViewController:marketingView]; [self.stackView insertArrangedSubview:driverForm.view…
Adam Rush
  • 155
  • 3
  • 16
3
votes
1 answer

Jquery draggable not working with containment

My application contains all div's with absolute css position property. Since draggable takes relative position, i need to override it with margin-left and calculate left value for dragged div. It works fine if containment is not specified, …
Dhivi
  • 67
  • 4
  • 11
3
votes
1 answer

Remove draggable containment

You can add containment dynamically like this: $(this).draggable( "option", "containment", "parent" ); How do i remove the containment again? Like: $(this).draggable( "option", "containment", "none" ); except that doesn't work.. I could not find…
Koiski
  • 568
  • 2
  • 8
  • 23
3
votes
3 answers

Difference between sub-object and contained object

What is the difference between a sub-object and a contained object? For constructing an instance of a class which is derived from another class, first the sub-object has to be created and then the derived object has to be created. Questions: Is it…
nitin_cherian
  • 6,405
  • 21
  • 76
  • 127
2
votes
1 answer

Wrapping ObservableCollection in C#

I have reason to wrap an instance of ObservableCollection in another type. I'm implementing ICollection in my new type. That's straightforward. I'm also implementing INotifyCollectionChanged, which means implementing public event…
Eric J.
  • 147,927
  • 63
  • 340
  • 553
2
votes
0 answers

jQuery Draggable x,y containment relative to absolutely positioned container

I have a map that I am trying to make draggable, and am containing with x,y coordinates. The problem I'm having is that these coordinates seem to be based on window size. It works perfectly in a 1280x1024 window, but any other window size throws the…
Derek
  • 967
  • 1
  • 8
  • 16
2
votes
1 answer

Django - How do I create a model that contains a collection of its own type?

One of the fields in a model I'm creating is for a list of instances of its own type. How do I do this in django? I couldn't find any documentation on how to do this.. This is something like what I am talking about, but doesn't work because the…
Inversus
  • 3,125
  • 4
  • 32
  • 37
2
votes
0 answers

iOS 8: Transition from UINavigationController to UISplitViewController, bad animation

I'm trying to animate a transition from a UINavigationController to a UISplitViewController, but the split view controller doesn't draw correctly until the animation is finished. The navigation bars are transparent and their titles are positioned…
1
vote
1 answer

limit drag of multiple divs within respective container divs - jquery draggable

I have 3 divs (draggable), each inside its (container) div. I am able to limit the movement of one div using "containment", but when it comes to 3 having the same classes, it doesn't work. Any help on how this can work? here is a quick fiddle:…
Nader Khan
  • 188
  • 2
  • 8
  • 18
1
vote
0 answers

Keeping a drag element contained inside another element

I'm currently working on a drag n' drop plugin. (I'm creating it because I would like other people to use it) and I want to create the containment feature like jQuery draggable has it. I'm trying the following code: var $div =…
Shawn31313
  • 5,978
  • 4
  • 38
  • 80
1
vote
0 answers

jQuery Draggable Modal within visible window, set dynamic containment not works when scroll

I have a Bootstrap Modal, which I would like to drag only within the visible window screen(Not let the Modal get out of sight). My two problems are: The containment is not set on the first drag, and the Model can get out of the visible window. The…
1
vote
1 answer

Enforcing initial containment of a JQuery draggable

For a photography webpage I am implementing an image viewer that allows for selecting an area of interest in a scaled-down reference image by dragging a semi-transparent rectangle over the reference image. The selected area is continuously…
SwedishChef
  • 905
  • 1
  • 6
  • 5
1
vote
1 answer

JQuery-UI containment: 'parent' does not work

As you see here, div with the class .foo is draggable and has containment: 'parent' option, so it must stay in the bounds of its parent div, which is mainDiv, but it does not. Why is that? $(document).ready(function () { $('#deviceName…
Vaxo Basilidze
  • 1,017
  • 13
  • 31