Listing 1. Colors Deck ************* * Deck "Colors" * Time 14:15:37 * Date 01/17/94 ************* ************* * Card(s) in deck. * Card "MainCard" ************* * 1 Card(s), 1 were printed. ************* ************* * Natural order of Cards * Card "MainCard" ************* ************* * Global Routine(s) in deck. * Routine "GetColors" ************* * 1 Global routines(s), 1 were printed. ************* ************* * Card "MainCard" AfterAttachment ; used to be AfterStartup Let MaxColor=WindowColors-1 Nop; Get colors the first time this routine executes If Invocation=0 Do "GetColors" EndIf Let Invocation=1 Let I=0 Nop; Put color rectangles on the card Nop; The color arrays used in the SetRGB command are assigned in Nop; the GetColors routine Loop SetRGB I,Red[I],Green[I],Blue[I] SetPen I AreaRectangle 20,15+5*I,280,5 Let I=I+1 Until I>MaxColor EndScript BeforeDetachment ; used to be OnFinishup Nop; Get new colors to use when this card is reattached Do "GetColors" EndScript MessageFromSubDeck Let Message=Arg1 If Message="Quit" ClosePendingWindow ;Close palette req before next command FirstCard ;Reattach card to show that colors are changed EndIf EndScript Window "UserWindow" Definition Origin 0,0 Size 320,200 Title "Colors" NumberOfColors 32,69632 WindowColors 0,1,0 ; Detail, Block, Background WindowObjects CLOSEBUTTON WindowFlags ACTIVATE SEPARATESCREEN TOFRONT EndScript OnCloseButton Quit EndScript EndObject TextButton "ChangeColors" Definition Origin 192,179 Font "diamond",12 ; FontName, PointSize PrintStyle SHADOW ,2,3 ; Style, Pen1, Pen2 TextColors 1,0,NORMAL ; PenA, PenB, DrawMode Text " ChangeColors " Border BEVEL ,2,1 ; BorderStyle, MainPen, ExtraPen Highlight COMPLEMENT ButtonFlags NONE EndScript OnRelease LoadSubDeck "CanDo:Decks/ColorChange","CC" OpenRequester "CC","ChangePalette" EndScript EndObject * End of Card "MainCard" ************* ************* * Global routine "GetColors" Let I=0 Loop GetRGB I,Red[I],Green[I],Blue[I] Let I=I+1 Until I>MaxColor * End of routine "GetColors" *************