User control for DrDialog V0.1.1 -------------------------------- This Rexx DLL contains new controls for use with DrDialog. Use it by creating a user control when building your dialog in DrDialog. Have a look at the file Demo.res for more information. Two controls are available: -A pervent bar (DRD_PERCENTBAR) -A fly overhelp control (DRD_BUBBLEHELP) How to use it ------------- In your init function register the new Rexx function "DRCtrlRegister" with Rexx and call it to register the new control with your DrDialog application. The control must be registered in every application because this call is local to the calling process. NOTE: The DLL must be in the current directory, the libpath or where the DrRexx.exe is. The default DrDialog installation sets the working dir for DrRexx.exe to the installation directory. So loading may fail if you start your app with a double click. Copy the DLL to your DrDialog installation directory or change the working directory then. /* Register the new function with Rexx */ rc=RxFuncAdd("DRCtrlRegister", 'drusrctl' , "DRCtrlRegister") /* Register the new control with your application */ call DRCtrlRegister The following Rexxfunctions are available in the DLL: DRCtrlDropFuncs: Drop all registered functions. DRCtrlRegister: Register the new controls. DRCtrlLoadFuncs: Load the functions of this DLL. DRCtrlVersion: Query the release. SAY DRCtrlVersion() returns "0.1.1" (or any other version number) 1. Percent bars --------------- You may change the colors by using the Color() function of DrDialog: /* Change color of bar */ call Color '-','#255 0 0' /* Change color of text */ call Color '+','#255 255 255' You may change the font of the text by using the Font() function of DrDialog: /* Change font to 18.Helv */ call Font '18.Helv' The value of each bar may be set using the Text() function: /* Set bar to 30% */ call Text '30' The label of each bar may be set using the Text() function: /* Set bar to 30% and label to '3 of 10' */ call Text '30#3 of 10' The first part of the text string must be the value the bar should be set to. Everything after the '#' is printed as the label on the bar. You may use any text for the label or no label at all. If you don't want a label only set the value. 2.Flyover help window --------------------- Create a control of type DRD_BUBBLEHELP and set it as the default for hints: call isDefault 'C' call isDefault 'D' Now any hint specified for a control or dialog is shown as a fly over help at the position of the mouse pointer. Use the following calls to customize the fly over help. You may change the colors by using the Color() function of DrDialog: /* Change background color */ call Color '-','#255 0 0' /* Change foreground color of text */ call Color '+','#255 255 255' You may change the font of the text by using the Font() function of DrDialog: /* Change font to 18.Helv */ call Font '18.Helv' Change the delay until the bubble opens using the Text() function: /* Change the delay to 300 ms untill the bubble is opened */ call Text "#delay 300" Change the time the bubble is shown: /* Show the bubble for 2500 ms */ call Text "#show 2500" License ------- /* * Copyright (c) Chris Wohlgemuth 2001 * All rights reserved. * * http://www.geocities.com/SiliconValley/Sector/5785/ * http://www.os2world.com/cdwriting * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The authors name may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ Author ------ Copyright Chris Wohlgemuth 2001-2002 http://www.geocities.com/SiliconValley/Sector/5785/ http://www.os2world.com/cdwriting