* :--------------------------------------- * ------------------------: Copybook for ChooseColor. * : * : See the documentation for details. * :--------------------------------------- * * To use: * * COPY WIN32API. * COPY CHOOSCLR. * . * . * * ------------------------: Load owner instance handle; it's * : returned when you open the main panel. * * MOVE mymain-HINSTANCE TO CHOOSECOLOR-HINSTANCE. * ------------------------: Load the window handle of the window * : that will own this dialog; (it's * : passed back by GUI ScreenIO when you * : display a panel). Zero is OK. * * MOVE mypanel-HWND TO CHOOSECOLOR-HWNDOWNER. * * ------------------------: Set the flag bits by adding the * : values, giving CHOOSECOLOR-FLAGS. * : These are the useful ones. * * : Initializes selection to that passed * CC-RGBINIT VALUE H'00000001'. * : Offers only nondithered colors * CC-SOLIDCOLOR VALUE H'00000080'. * : Offers all colors * CC-ANYCOLOR VALUE H'00000100'. * : Displays controls for custom colors * : (no need to press the button) * CC-FULLOPEN VALUE H'00000002'. * : Prevents use of custom colors button * CC-PREVENTFULLOPEN VALUE H'00000004'. * * ADD CC-RGBINIT * CC-SOLIDCOLOR * CC-FULLOPEN * GIVING CHOOSECOLOR-FLAGS. * * ------------------------: Select the API to use: * * SET API-CHOOSECOLOR TO TRUE * * ------------------------: Call the GUI ScreenIO API routine: * * CALL 'GSWINAPI' USING WIN32API-PARMS * CHOOSECOLOR-PARMS * CHOOSECOLOR-CUSTOMCOLORS * WIN32API-C * WIN32API-D * WIN32API-E * WIN32API-F. * * IF WIN32API-FAILED * do no-color-found * ELSE * color specifications are returned... * * * ---------------------------------------------------------------- * * 01 CHOOSECOLOR-PARMS. 05 CHOOSECOLOR-HINSTANCE PIC X(4). 05 CHOOSECOLOR-HWNDOWNER PIC X(4). 05 CHOOSECOLOR-FLAGS PIC S9(9) COMP-5. * : Values returned by CHOOSECOLOR * : RGB color selected 05 CHOOSECOLOR-RGBRESULT PIC X(4). * * : Array of 16 custom RGB colors. * : if you "remember" prior selections and * : pre-load these they will be offered * : as choices to your users. Any custom * : colors your user configures will be * : returned here, but the one selected * : will be returned in the above field. * 01 CHOOSECOLOR-CUSTOMCOLORS. 05 CHOOSECOLOR-CUSTOMCOLOR PIC X(4) OCCURS 16 INDEXED CCDEX. * : Sources for switches 01 CHOOSECOLOR-SOURCES. 060615ja 05 CC-RGBINIT PIC S9(9) COMP-5 VALUE H'00000001'. 060615ja 05 CC-SOLIDCOLOR PIC S9(9) COMP-5 VALUE H'00000080'. 060615ja 05 CC-ANYCOLOR PIC S9(9) COMP-5 VALUE H'00000100'. 060615ja 05 CC-FULLOPEN PIC S9(9) COMP-5 VALUE H'00000002'. 060615ja 05 CC-PREVENTFULLOPEN PIC S9(9) COMP-5 VALUE H'00000004'. 060615ja