Re: Newera event processing (LONG and stuffy ;-)
Posted in 1996
John Deviney wrote: > > > My understanding is that you can not set a delegate to an object. > mouse actions. How can I do this? > > I'm not familiar with the term "delegate" in an OO context. > delegate refers to the object which has been delegated to handle the messages an object is supposed to receive. It also can control the object. [From Memory, if the delegate does not have a method for a specified event, the message is passed to the object.] > In NewEra, you cannot have a single object to trap/interpret key strokes or > mouse actions for the entire application. The best NewEra has to offer is a > KeyPress() event and a click() event for a limited number of visual objects. > There is no mouseMove() event. > What occurs in a windowing environment, is that the OS or Window manager controls your I/O devices. As an action occurs, the window manager determines where to send the message that the action has occured. So if you have a window active (highlighted), and a highlighted field, when you type on the keyboard, the window manager takes the keystrokes and messages you application that a key had been pressed, and what key had been pressed. Your screen object then recieves this message and displays the keystroke. But lets say that you want to trap an action/event before your object performs a given task. You assign a delegate. The delegate will get the messages before the object sees them. Here, you can create a method which will recieve the message and process it. After performing its task, it could either pass the message to the object it is the delegate for, or it could just return control to the window manager. [ As a side note, an event is an action. A method is an element of an object which controls the process when triggered by an event.] You are limited then by the events allowed by the operating system / window manager. So if your windowing system cannot message your application of mouse movements, then you cannot use them in your code. (So you are limited in what you can do with drag and drop apps.) Whoops! Im sorry. You can't easily do drag and drop. That means OLE. BTW, I am not advocating a single object to handle all I/O but that can occur in rare casses. > > How can I create an object in one window with a parent in another. > > (Parent meaning an object assigned to be its delegate.) > > > > Does this make sense? I am trying to compare NE with NeXTstep. > > Are you refering to MDI or something comparable? If so...NewEra ixClass Library > does not support MDI, but it might be accomplished with considerable effort. > That's my point. Informix does not allow you to design an application with more than one window. Your base object is your window. All of your other screen objects sit within the window hierarchy. You have to do some funky messaging between windows. This is its biggest drawback. Here's another sample application. Lets say I want to create an application where in one window, I can view a clients brokerage account. In another window, I want to have a ticker tape showing real time quotes. (Or near realtime quotes.) I want to be able to bring up both windows separately, and I want to instantiate multiple ticker tape windows. (One for each market I get a feed from.) Based on the stocks in the active portfolio, I want to highlight the stock as it crosses the ticker. How would you do this in New Era? > > > There does not appear to be a class of objects outside of the > > window hierarchy. > > There are many objects which fall outside the ixWindow hierarchy. In fact, all > visual objects are derived from ixVisualObject which is only about 1/3 of the > entire ixClass Library. However, most of these classes are geared for database > support (data types and SQL). > I think I should rephrase that. There is no method of control outside the window hierarchy. If an I/O action occures from the keyboard, it goes to a window based element. You cannot create your own object to handle the event instead. In other words, the visual object's delegate, is always the window it is found in. Another problem I had was in the object sub-tree. We had a fellow come in to an GLUG meeting to talk about the hierarchy. Unfortunately he did not understand OO Design and I think it was the button class which had a strange hierarchy. If my memory serves me correctly, and I do have altzhimers, when Informix subclasses an object, the child object's dataspace is not within the same page as the parent's dataspace. So that the data elements are fragmented? (Anyone know for sure?) Another big thing. Lets say I have a library of known objects. Can I distribute the binaries, or must I include the source too? -Mikey