From Pat Winstanley · 1996-04-08 19:23 · #69269 in DRIVING
In reply to Re: VB/TBV/VBC++ (was Cop by Paul Walker
Hi Paul, Monday April 08 1996 21:19, Paul Walker wrote to Pat Winstanley: PWi>> these panels does essentially the same thing - PWi>> displays a set of choices, then when a choice is PWi>> clicked, sends a message out to say which value has PWi>> been chosen. PWa> However, the keyboard thing is totally different, because PWa> it's got different numbers of buttons on it. How do you do PWa> that? (You might want to netmail me... I use Pascal a lot, PWa> but've never tried Delphi) I know Pascal very little... never did the windows and/or object stuff with it, and barely touched pointers, however you are right in that an object in Delphi is like a super-duper Unit... sort of! The point is that the general parent panel simply knows how to draw one or more buttons, and can detect which one (via its *internal* numbering of the buttons it draws) has been pressed. When creating the child panels the programmer simply tells the child how many buttons to draw, and from a lookup table translates the value being returned into a letter, a number, a symbol, or whatever according to that 'map'. Another programmer just using that panel needs only to know what the translation map is (or even that could be hidden inside the object, and probably would be, so that the child panel squirted out an ASCII value or whatever. Then the second programmer would simply need to set up a mechanism to know when the object is sending an "Oi! I've just been pressed" signal, and "Here you are - your user wants a "J"". Or whatever... Like... if panel signalling, get value from panel. Just the sae as a signal from a real keyboard... PWa> Eek - did I really just write all those lines of wibble? Oh PWa> dear... _ |_) Indeed you did! :-) Pat --- * Origin: Pierless, Wigan, UK. [01942-749012 (cable)] (2:250/107.99)