[comp.sys.amiga] Help with gadgets.

KENNEDAM%WWPS@dupont.com (Tony Kennedy) (06/07/89)

This is posted for a friend...Send replys to me...

>-----------------------------------------------------///----------------< 
|    Tony Kennedy      | Any resemblance       |     /// AMIGA           | 
|   Project Engineer   | between these and my  |\\\ /// The computer     |  
|    Setpoint Inc      | employers opinions is | \\X// For the best      | 
|                      | pure coincidence.     |  \X/ of us.             | 
>------------------------------------------------------------------------<  
| INTERNET : kennedam%wwps%dupont.com@relay.cs.net                       |  
>------------------------------------------------------------------------<  
| A computer can make as many mistakes in 20 seconds as 20 men working   |  
| for 20 years.                                                          |  
>------------------------------------------------------------------------<

**********************************************************************

    The most help I need is with examples of code that has been 
    written.  For instance, I would like to see where someone has used 
    a STRINGGADGET defined as LONGINT to accept input values of float 
    numbers.  I suspect that this can't be done, and that you probably 
    need to use a STRINGGADGET with an atof() call.  At any rate, I 
    would like to see more examples of good code to help me stumble 
    through this effort.  If you have access to USENET, I imagine that 
    there are plenty of contributions of good code over the wires and 
    would appreciate your mailing them to me.
    
    Well, so far I've created a window full of gadgets and transaction 
    display panel to enter in the investment identification 
    information.  It's a doubly linked list with an up and down arrow 
    gadget to let you move through each entry and permit editing of 
    the entries.
    
    It looks somewhat like this:
    
            +---------------------------------------------------+
       Name:|                                                   |
            +----------------------------------------------+----+-------+
        +-----------------------+ +-------+  CURRENT VALUE:|            |
Address:|                       | |DELETE |                +------------+
        |                       | +-------+        OWNER:  |            |
        |                       | | TRANS |                +------------+
        +-----------------------+ +---+---+          TYPE: | STOCK      |
  Phone:|                       | | <-|-> |                +------------+
        +-----------------------+ +---+---+      DELIVERY: | QUARTERLY  |
        +--------------------------------------------------+------------+
   Note:|                                                               |
        +---------------------------------------------------------------+
|B| Trans | Number | Price | Commission | Total Cost | Yield |
|S|       |   of   |  Per  |            |            |       |
|L| Date  | Shares | Share |            |            |       |
+---------------------------------------------------------------+ +-+
|                                                               | | |
|                                                               | | |
|                                                               | | |
|                                                               | | |
+---------------------------------------------------------------+ +-+
    The TYPE and DELIVERY gadgets are boolean.  TYPE for instance 
    rotates the Gadget.IText among Stock, Bond, Mutual, and Other.  
    DELIVERY indicates how often dividends are payed.
    
    The TRANS gadget opens another window using the same message port 
    as the first and permits entry of the BSL, Trans Date, Price Per 
    Share... information.  Eventually the yield will be calculated 
    based on the Trans Date, Total Cost, Dividends and Current Value.
    
    I need to add another window that represents the market values of 
    the investment and the dividends with time.  I also hope to have a 
    graphical trending of performance with time.
    
    Right now I only have the gadgets in the first two windows 
    working.  I do not have the Transaction display nor the PropGadget 
    functional yet.  I'm struggling with the data structures to get 
    pointers to point to the right things since everthing is 
    dynamically mallocated.
    
    I'm also working in Lattice.  If you want to see the code, I can 
    send it to you.  I need help to do a bit more basic design on the 
    data structures - what information I want to store and what I want 
    to calculate, but basically I want something that will give me the 
    IRR of my investments at any given point, ie. a series of cash 
    flows over time with a given investment.
    
    							Robert