Search Results

Search found 817 results on 33 pages for 'overriding'.

Page 17/33 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Dynamically load nib for iPhone/iPad within view controller

    - by qui
    Hello I have converted an iPhone application using the wizard like thing in XCode into a universal app. It builds fine but obviously looks a bit rubbish in some areas :) I need to load nibs according to which device is being used. I dont wish to create my view controllers using initWithNib as I already have code to create the controllers with some data (initWithMyLovelyData) which doesnt do anything to do with nib loading. I know to find out the device you use UI_USER_INTERFACE_IDIOT() so I tried overriding the initWithNibName within the actual view controllers themselves, assuming they get called internally somehow. But it's not working as I guess I am unsure of the syntax. I have tried if(ipad..) self = [super initWithNibName:@"MyIpadNib" bundle:nibBundleOrNil]; And that doesnt work :/ EDIT - I know I have massively edited this, made my question a bit more specific after doing some more research - apologies!

    Read the article

  • Silverlight Listbox firing MouseRightButtonDown, but not MouseLeftButtonDown

    - by Steav
    I have this problem in a bigger Project...... so I set up a 'Testpoject' as Proof of Concept: New Silverlight-Application Add Listbox Fill listbox with a few Checkboxes Register listBox1_MouseLeftButtonDown register listBox1_MouseRightButtonDown You will see, that the listBox1_MouseLeftButtonDown won't fire under any circumstances.... listBox1_MouseRightButtonDown however fires just fine. I tried using a custom Class deriving from ListBox and overriding, assuming something in the ListBox Class was setting e.Handled = false, but this did not change the behaviour, either. Any Ideas on why this happens and how to fix? (This problem also stops the 'parent'-control from receiving the Click-Event... so the Event-passing is broke)

    Read the article

  • iPad/iPhone HTML5 video loading

    - by mrollinsiv
    I'm trying to load on the fly on the iPad/iPhone and notice that I cannot place a div above this. I put the overlay in the html so that it's generated on page load and not added via javascript and the video when its created is absolutely positioned below this element. This works on a PC, I'm wondering if since it was created via js that the iPhone OS is overriding the z-index and forcing to the top? Also is there a way to override the default "cannot play icon", the one with the slash, and show a loading animation instead? This would solve my issue via another route. My last option would be to loaded all the video tags via js on page load and have them layered on top of each other for the iPad/iPhone? Since the iPhone OS won't load any video until requested would this work? I also am having an issue with the iPhone and showing the "poster" attribute that is set on the video tag.

    Read the article

  • Multi-column sorting with an NSTableView bound to an NSArrayController

    - by Cinder6
    Hi there. I have an NSTableView that's bound to an NSArrayController. Everything gets loaded into the table correctly, and I have sort keys and selectors set for the various columns (this also works). What I'm trying to do is sort multiple columns when the user clicks one column header, but I can't find any way to do this. I could brute-force a way by overriding tableView:mouseDownInHeaderOfTableColumn:, but that seems an inelegant way of doing it. Is there a good way of doing multi-column sorting in an NSTableView using bindings?

    Read the article

  • Javassist: how to create proxy of proxy?

    - by Bozho
    I'm creating proxies with javassist ProxyFactory. When creating a single proxy all works fine. However, when I pass a proxied class to the proxying mechanism, it fails with javassist.bytecode.DuplicateMemberException: duplicate method: setHandler in com.mypackage.Bean_$$_javassist_0_$$_javassist_1 I'm creating the proxies with this: public Object createProxiedInstance(Object originalInstance) throws Exception { Class<?> originalClass = instance.getClass(); ProxyFactory factory = new ProxyFactory(); factory.setSuperclass(originalClass); factory.setHandler(new MethodHandler() {..}); Class<T> proxyClass = factory.createClass(); return proxyClass.newInstance(); } So, how do I create proxies of proxies? Update: The actual problems is that each proxy implements the ProxyObject which defines setHandler(..) method. So the 2nd proxy is trying to redefine the method, instead of overriding it in the subclass.

    Read the article

  • Virtual functions and polymorphism

    - by ritmbo
    Suppose I have this: class A { public: virtual int hello(A a); }; class B : public A { public: int hello(B b){ bla bla }; }; So, A it's an abstract class. 1)In the class B, I'm defining a method that its suppose overrides the A class. But the parameter it's slightly different. I'm not sure about this, is this correct? Maybe because of polymorphism, this is ok but its rather confusing. 2) If I do: A a = new B;, and then a.hello(lol); if "lol" it's not of type B, then it would give compile error?, and if it's of type A from another class C (class C : public A), what would happend? I'm confused about the overriding and virtual thing.. all examples I found work with methods without parameters. Any answer, link, or whatever it's appreciated. thanks pd: sorry for my english

    Read the article

  • deriving from NSTabViewItem

    - by Jonny
    I'm writing a Cocoa app. One dialog has 3 tabs, some of the tabs needs more loading time, so I want to load them lazily. Since each Tab is a NSTabViewItem class, so I'm trying to derive from it and overriding its view property. In the view getter method, I use a ViewController to load a view and returns out. In Debugging, I found NSTabViewItem -view method is get called correctly, but after that NSTabView tries to set Initial FirstResponder and crashed with message: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'In -[NSTabViewItem setInitialFirstResponder:], the first responder must descend from the tab view item's view. (Item: Invalid responder: )' I tried to override the -initialFirstResponder method to return a sub-view of my loaded view, but it still crashes the same place. does anyone know how to get it work correctly? Also is it correct way to do this by deriving the NSTabViewItem? thanks! -Jonny

    Read the article

  • Customize ToolStripMenuItem

    - by Lu Lu
    Hello everyone, I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public class MyToolStripMenuItem : ToolStripMenuItem { public MyToolStripMenuItem() :base() { } public MyToolStripMenuItem(string t) :base(t) { } protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = this.Bounds; g.FillRectangle(Brushes.Blue, r); g.DrawString(this.Text, this.Font, Brushes.Red, r); } } In my code, I will fill a blue color in item's bound. Now, I will create a list of items on menustrip: MyToolStripMenuItem1 |___MyToolStripMenuItem2 |___MyToolStripMenuItem3 I don't know why MyToolStripMenuItem3 don't have a blue background. This is my source code: http://www.mediafire.com/?2qhmjzzfzzn Please help me. Thanks.

    Read the article

  • MkMapView setRegion animation prevents touch events on Annotation Views

    - by Vlad Gurovich
    Hi there! We have a MKmapView with a bunch of Image Annotation where each Image annotation responds to touch by overriding these methods of AnnotationView subclass: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event Our map region is updated using [MkMapView setRegion:animated:] whenever the new location is received and is far enough from the old location to make a difference. What I noticed is that if we set animated flag to YES the touches on our annotation are rarely detected(probably due to the fact that main thread is busy animating between two map regions. When we set animated flag to NO, everything is fine, but map transition may(or may not) become jerky. The question I have is whether this is an expected behavior of animated flag of [MkMapView setRegion:animated] function or whether there is a workaround for this issue. Thanks in advance

    Read the article

  • UISplitViewCOntroller + TabBarCOntroller + iPad

    - by tek3
    Hi all, I am developing a tab-based iPad application in which corresponding to each tab, I have to show an UISplitViewController . I have done this by adding two navigation controllers to my tabBarController and assigning a subclass of UISplitViewController as RootViewController of both navigationController. And also I have to show both viewControllers(Master and Detail) in both modes(Potrait and Landscape). For this I have constructed a subclass of UISplitViewController in which i am overriding willAnimateRotationToInterfaceOrientation method and setting the frame of both ViewControllers as demonstrated in this link. However i am not able to set both viewControllers correctly.If my app starts in Landscape mode everything displays fine but if i open it in Potrait mode then the orientation of both ViewControllers changes. Sometimes the MasterView occupies the entire screen or sometimes both ViewControllers appear leaving a black line between them and the navigationBar. I have been banging my head over this problem since two days without any success. kindly help..

    Read the article

  • Android Cannot execute setListAdapter() user thread.

    - by Ameya
    I got a class class MyClass extends ListActivity implements Runnable{ ArrayList array; onCreate(){ Thread thread = new Thread(this); hread.start(); } @Overriding void run(){ addAnElement(); } void addAnElement(){ if(null==array) array=new ArrayList(); array.add("Some junck string"); this.setListAdapter(.....,array); } } on executing in emulator get error ERROR/AndroidRuntime(288): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. I know we cannot access UI calls from user thread. Can anyone help.

    Read the article

  • Eclipse plugin: content assist working in Galileo, not Ganymede

    - by erwan
    Hi, I am writing a custom editor in a plugin, and I developed it in Galileo. Now I'm trying to run it in Ganymede, but content assist doesn't work. There is no error, just nothing happens when I type "ctrl+space". The way I'm doing it is by providing a custom Configuration class that extends SourceViewerConfiguration, overriding public IContentAssistant getContentAssistant(ISourceViewer sourceViewer). The method gets called when the editor is created but there is no content assist. Was there any change from Ganymede to Galileo that I should be aware of?

    Read the article

  • Not able to use cutomized Ajax HTML editor from code behind

    - by KhanS
    I am customizing the ajax html editor. I am creating a class which derives from ajax html editor, and overriding FillTopToolbar() method to have limited toolbar buttons. I am trying to use this in my aspx page. <%@ Register namespace="Content" tagprefix="edit" %> <edit:MyEditor runat="server" Width="100%" Height="250px"/> I am able to see the editor in my aspx page. The problem comes when I give an ID to the control <edit:QNAEditor ID="htmlEditor" runat="server" Width="100%" Height="250px"/> I get an error in the designer file in the below line. protected global::Content.MYHTMLEditor htmlEditor; I am not able to use it in code behind. I am using VS 2010. Please help me in this regard.

    Read the article

  • How can a Delphi TForm / TPersistent object calculate its own deserialization time?

    - by mjustin
    For performance tests I need a way to measure the time needed for a form to load its definition from the DFM. All existing forms inherit a custom form class. To capture the current time, this base class needs overriden methods as "extension points": start of the deserialization process after the deserialization (can be implemented by overriding the Loaded procedure) the moment just before the execution of the OnFormCreate event So the log for TMyForm.Create(nil) could look like: - 00.000 instance created - 00.010 before deserialization - 01.823 after deserialization - 02.340 before OnFormCreate Which TObject (or TComponent) methods are best suited? Maybe there are other extension points in the form creation process, please feel free to make suggestions.

    Read the article

  • problem in mousewheel getting triggered

    - by deepasundarip
    Hi, I m overriding a mousewheel event in vc++ class and try to trigger mousewheel event, but tat event is not getting triggered. Then, I tried to handle with WndProc function like this, void CascadeControl::WndProc( Message% m ) { switch(m.Msg) { case WM_MOUSEWHEEL: ...............//my code// break; } control::WndProc(m); } but still my mousewheel event is not getting triggered at all... i want to know whether i m doing correctly or not.. If not is there any other way to do it?

    Read the article

  • Use of IsAssignableFrom and "is" keyword in C#

    - by fearofawhackplanet
    While trying to learn Unity, I keep seeing the following code for overriding GetControllerInstance in MVC: if(!typeof(IController).IsAssignableFrom(controllerType)) { ... } this seems to me a pretty convoluted way of basically writing if(controllerType is IController) { ... } I appreciate there are subtle differences between is and IsAssignableFrom, ie IsAssignableFrom doesn't include cast conversions, but I'm struggling to understand the implication of this difference in practical scenarios. When is it imporantant to choose IsAssignableFrom over is? What difference would it make in the GetControllerExample? if (!typeof(IController).IsAssignableFrom(controllerType)) throw new ArgumentException(...); return _container.Resolve(controllerType) as IController;

    Read the article

  • problems of making the sip with mingw32-make-3.81

    - by user160542
    This is the problem in the making progress: make[1]: Entering directory L:/1_????/3_Python/python_gui_programe/sip-4.8. 2/sipgen' makefile:29: warning: overriding commands for target .c.o' makefile:26: warning: ignoring old commands for target .c.o' gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o main.o main.c process_begin: CreateProcess(NULL, gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFI LE_SUPPORT -I. -o main.o main.c, ...) failed. make (e=2): ??????????? make[1]: *** [main.o] Error 2 make[1]: Leaving directory L:/1_????/3_Python/python_gui_programe/sip-4.8.2 /sipgen' make: *** [all] Error 2 I run the command "make" in the sip-4.8.2 directory followed the install guid(http://www.riverbankcomputing.com/static/Docs/sip4/installation.html#configuring); My platform is Windows Xp! Could somebody help me?

    Read the article

  • NHibernate's automatic (dirty checking) update behaviour - turning it off

    - by Andrew Bullock
    I've just discovered that if I get an object from an NHibernate session and change a property on object, NHibernate will automatically update the object on commit without me calling Session.Update(myObj)! I can see how this could be helpful, but as default behaviour it seems crazy! How can I stop this happening? Is this default NHib behaviour or something coming from Fluent NHibs AutoPersistenceModel? If there's no way to stop this, what do I do? Unless I'm missing the point this behaviour seems to create a right mess, violating my UoW. Im using NHibernate 2.0.1.4 and a Fluent NHib build from 18/3/2009 Edit, is this guy right with his answer? Edit: I've also read that overriding an Event Listener could be a solution to this. However, IDirtyCheckEventListener.OnDirtyCheck isn't called in this situation. Does anyone know which listener I need to override? Thanks Andrew

    Read the article

  • Overload method (specifically drawRect:) without subclassing.

    - by SooDesuNe
    I'm using a container UIView to house a UIImageView and do some custom drawing. At this point I'd like to do some drawing on top of my subview. So overriding drawRect: in my container UIView will only draw below the subviews. Is there a way to overload drawRect: in my subview without subclassing it? I think method swizzling may be the answer, but I'm hoping not. (NOTE: yes, it would have been smarter to have the UIView be the subview of the UIImageView, but unfortunately I'm committed to my mistake now.)

    Read the article

  • Ensuring unique ID attribute for elements within ScriptControl

    - by Andy West
    I'm creating a control based on ScriptControl, and I'm overriding the Render method like this: protected override void Render(HtmlTextWriter writer) { RenderBeginTag(writer); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("This is a test."); writer.RenderEndTag(); RenderEndTag(writer); } My question is, what if I want to assign the div an ID attribute and have it be unique on the page, even if there are mulitple instances of my control? I've seen other people's code that does this: writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_divTest"); That will prevent naming conflicts between instances of my control, but what if I've already created a div elsewhere on the page that coincidentally has the same ID? I've also heard about implementing INamingContainer. Would that apply here? How could I use it?

    Read the article

  • Changing view size when orientation changes

    - by Eyal Redler
    I want my UIView subclass to behave so that when it is fitted in portrait orientation is has a certain size and another size when fitted in landscape mode. Is it possible to have the view indicate to the view controller that's resizing it when the orientation changes that it has this "ideal size"? To clarify, I'm confident that this is not something that can be done with the autoresizing mask. I also thought that sizeThatFits: would be what I need but I didn't see it get called when the orientation changed. I'm also aware that I can get this done by overriding layoutSubviews of the superview (or maybe some other method of the view controller but I would like to have this behavior embedded in the view to facilitate reuse.

    Read the article

  • How can a Delphi TForm / TPersistent object calculate its own construction and deserialization time?

    - by mjustin
    For performance tests I need a way to measure the time needed for a form to load its definition from the DFM. All existing forms inherit a custom form class. To capture the current time, this base class needs overriden methods as "extension points": start of the deserialization process after the deserialization (can be implemented by overriding the Loaded procedure) the moment just before the execution of the OnFormCreate event So the log for TMyForm.Create(nil) could look like: - 00.000 instance created - 00.010 before deserialization - 01.823 after deserialization - 02.340 before OnFormCreate Which TObject (or TComponent) methods are best suited? Maybe there are other extension points in the form creation process, please feel free to make suggestions. Background: for some of our app forms which have a very basic structure (with some PageControls and QuantumGrids) I realized that it is not database access and other stuff in OnFormShow but the construction which took most of the time (around 2 seconds) which makes me wonder where this time is spent. As a reference object I will also build a mock form which has a similar structure but no code or datamodule connections and measure its creation time.

    Read the article

  • Is an object in objective-c EVER created without going through alloc?

    - by Jared P
    Hi, I know that there are functions in the objective-c runtime that allow you to create objects directly, such as class_createInstance. What I would like to know is if anything actually uses these functions other than the root classes' (NSObject) alloc method. I think things like KVC bindings might, but those aren't present on the iPhone OS (to my knowledge, correct me if I'm wrong), so is there anything that would do this? In case you're wondering/it matters, I'm looking to allocate the size of an instance in a way that circumvents the objc runtime by declaring no ivars on a class, but overriding the +alloc method and calling class_createInstance(self, numberofbytesofmyivars). Thanks

    Read the article

  • Quickly check which part of the page lifecycle a control is in

    - by Khanzor
    Is there any way to check what events have fired during the asp.net webforms page/control lifecycle? I know that I can manually add handlers for each event, but that seems a bit ... inefficient. Is there a visualiser, or a property that I can check that will tell me whether these events have fired? EDIT The reason I want to know this is that I am overriding the ViewState property of a custom control, and the viewstate disappears at some point, and I'd like to know at which point in the page lifecycle it is being overriden.

    Read the article

  • ExtJS 4.1: FocusManager.enable prevents stopping click event

    - by jacob
    If FocusManager is enabled, then Menu item href click handlers can not be stopped. This causes the native click handler to complete and navigate the location hash to '#'. If FocusManager is not enabled, it does not change the hash. I tried overriding Ext.menu.Item to call evt.stopEvent if href is null. However, it looks like the EventManager.createListenerWrap() method totally hides the actual browser event and replaces it with an EventObject focus event. What's the correct solution here? Thanks.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >