subclassing

Subclassing a window from a thread in c#

I'm creating a thread that looks for a window. When it finds the window, it overrides its windowproc, and handles WM_COMMAND and WM_CLOSE. Here's the code that looks for the window and subclasses it: public void DetectFileDialogProc() { Window fileDialog = null; // try to find the dialog twice, with a delay of 500 ms each time ...

How to subclass a specific jqueryui widget method ?

Since I updated jQueryUI to 1.8 I found a couple of issues in our implementations and I could fix it myself without waiting for a fix on their end if I could find out how to subclass a specific method of the datepicker widget so I call the parent code and then execute my code. I was reading on $.widget but I just can't wrap my head arou...

How do I change the class of an object to a subclass of its current class in C++?

I have an array of pointers to a base class, so that I can make those pointers point to (different) subclasses of the base class, but still interact with them. (really only a couple of methods which I made virtual and overloaded) I'm wondering if I can avoid using the pointers, and instead just make an array of the base class, but have ...

Getting NSRange from Subclassed UIPasteboard Selection

Hi Everyone: I am wondering if there is some way to subclass UIPasteboard in order to get the selection behavior, but not get the "Cut, Copy, and Paste" options. In addition to this, is there some notification I can subscribe to that returns the NSRange of the selected body of text once it is selected? Thanks for any help! EDIT: I wo...

Actionscript/Flex - Is it possible to dynamically extend an object, modify functions, add functions etc

I know this question might be frowned upon, but actionscript is a dynamic language similar to javascript and in javascript I can take an object from a library written by someone else and dynamically (at runtime) add/remove/modify functions, properties, prototypes etc. this is kind of like dynamically extending an object to make it work w...

Can the Microsoft Paint Edit Colors Dialog be supplemented?

I have written a WinForms application that presents a color picker, limited to the known colors. My environment is Visual Studio C# Express 2008, C#, and Framework 2.0. Currently the MS Paint Colors menu item only presents an Edit Colors dialog. I would like to supplement that by causing the Colors menu item to display both "Edit Col...

Which is better Java programming practice: stacking enums and enum constructors, or subclassing?

Hi folks, Given a finite number of items which differ in kind, is it better to represent them with stacked enums and enum constructors, or to subclass them? Or is there a better approach altogether? To give you some context, in my small RPG program (which ironically is supposed to be simple), a character has different kinds of items in...

Custom UIToolBar from Images

I need to create a UIToolbar object that uses an image for the background. Most of the buttons are images as well, and rectangular. One button, however, is round and overlaps the toolbar like the Start button on the Windows task bar. See below. I know that I will need to subclass the UIToolbar to paint the image for the toolbar -- I thi...

overridden three20 TTDefaultStyleSheet style not working

hi, i recently got three20 integrated into my app and am trying to override the default toolbar color in TTWebController. In TTWebController.m:118 I see that this is setting the toolbar's tintColor: _toolbar.tintColor = TTSTYLEVAR(toolbarTintColor); So I created my own stylesheet that subclasses TTDefaultStyleSheet and overrides too...

Subclassing UINavigationBar ... how do I use it in UINavigationController?

Hi, I wanted to subclass UINavigationBar (to set a custom background image & text color) and use that for all the navigation bars in my app. Looking at the API docs for UINavigationController, it looks like navigationBar is read-only: @property(nonatomic, readonly) UINavigationBar *navigationBar Is there a way to actually use a cu...

Best point to overwrite the navigationBar property of navigationController

Hi there, I'm overwriting UINavigationController to replace the default navigationBar property with an instance of my own subclass of UINavigationBar. So I tried something like _navigationBar = [[SBNavigationBar alloc] init]; in my -initWithRootViewController:. But that didn't work out as I expected it. There's still the default navi...

How to properly extend Java FilterOutputStream class?

I would like to roughly monitor the progress of a file upload. I know that I can override the MultipartEntity and make the writeTo(OutputStream out) method write to a FilterOutputStream class that I created to wrap the default InputStream. For full details on how I did that, see my answer here. However, upon closer inspection this coun...

Subclassing UIImageView - animation images do not display or appear.

Hi everyone, I'm trying to subclass UIImageView in order to create an instance of the subclass which plays different animations, depending on a variable I send it. My initial code (before subclassing) for playing a specific 2 frame animation looked like this. 'bubbleAnimationTemp' is just a UIImageView object I declared in the header: ...

Fluent nHibernate - DiscriminateSubClassesOnColumn with multiple tables?

I've been trying to wrap my head around subclasses and joined subclasses in Fluent nHibernate for a few days now without making any sort of headway. I've looked at the wiki but it doesn't seem to give me enough information, and googling returns me old results that uses depreciated code or are seemingly unrelated. I just want a simple...

Subclassing WPF Window

I created a WPF Window than i modified its class definition to: public partial class myWindow : mySubclassedWindow compiler throws: "Partial declarations of 'myWindow' must not specify different base classes" myWindow.Xaml: x:Class="WpfGridtest.myWindow" so somewhere, there is another partial class, that inherits from "Window" b...

Objective C - subclassing classes with multiple init-methods

Hi, im searching for a convenient way of adding new arguments to multiple init-methods. its a little bit hard to discribe but my problem is the following: I have a class witch implements various init-methods. f.e. @interface Circle { CGPoint center; float radius; } - (id)initWithCenter:...radius:...; - (id)initWithRect:...;...

How do I create a custom class from a class that already exists? (Existing class does not support NSCoding)

Hey all! What I'm trying to do is convert an EKEvent into NSData, and then convert it back into an EKEvent. I looked around and noticed that in order to use NSKeyedArchiver, the class must conform to the NSCoding protocol. I also found that if I was creating a custom class, I could make it conform to the NSCoding protocol by implementi...

overloading a UIResponder to capture touch events

I am trying to subclass a MKMapView in order to capture the UIResponder events for additional processing. I find that the subclass's overriding methods are not being triggered though. Is there something basic that I am missing with this implementation? initWithFrame is called in the subclass just fine. In the header: @class MyMapVie...

C++ subclassing a form to trap F1 - F12 keys

The main form opens a child form that has a handful of button CONTROLs on it. I need to trap keyboard events so I subclassed one of the controls. All is good until the control loses focus of course. Ideally, as long as this child form is open I would like to assign the focus to this control and thus trap all the keystrokes, no matter wh...

Python decorators and class inheritance

I'm trying to use decorators in order to manage the way users may or may not access resources within a web application (running on Google App Engine). Please note that I'm not allowing users to log in with their Google accounts, so setting specific access rights to specific routes within app.yaml is not an option. I used the following r...