// ======================================================================== // THIS CLASS AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright 1997-1998 Giuseppe "Jo" Parrello. All Rights Reserved. // // Site : http://space.tin.it/computer/giparrel // E-Mail : joparrel@tin.it, giusparr@tin.it, giparre@tin.it // ======================================================================== // // Class: JPDialog (Release 2.1 - July 31, 1998) // // Files: jpdialog.cpp jpdialog.h // // Purpose: Provides an extended dialog that supports tooltips and // status bar's messages. // // Platforms: This class has been tested on Windows 95 and on Windows 3.1 // and it should run on Windows NT too. // I've used Borland C++ 5.02 to build this class, but I think // that it should run with 5.01 release too. // // Comments: JPDialog is derived from TDialog class. // Its only purpose is to provide you a tooltip and a // status bar's message for each control of the dialog. // The code is very easy to understand. // If you need more info, please e-mail me. // // JPDialog::JPDialog(TWindow* parent, // TResId resId, // TModule* module, // JPTooltipSupport* mytooltip, // bool FullTooltipSupport, // bool AlwaysForceRectAssociate, // bool ForceRectAssociateIfDisabled, // bool EnableStatusbarMessages) // The first three params are the same as TDialog class. // The fourth param "mytooltip" is a JPTooltipSupport // object, that must be created before. // The next param "FullTooltipSupport" must be true if you // have a static control in your window and you want to add // a tooltip to it. // The next param "AlwaysForceRectAssociate" must be true if // you want to force the association to all controls in the // window. // The next param "ForceRectAssociateIfDisabled" must be true // if you want to force the association if you have a // disabled control. // (These last three params associate the control to the // tooltip using their rectangle, not their handle. // Be careful if you intend to move, to disable or to enable // your controls after the association.) // The last param "EnableStatusbarMessages" must be true // if you want to display the controls' messages on // the status bar. // Note that the parent window must be a Decorated Frame // if you want see a message on the status bar. // // Methods: Constructor: // We only initialize our internal variables. // // Destructor: // We dissociate all the controls' strings from the tooltip // control and we erase the status bar's area. // // Method EvInitDialog // We associate all the controls' strings to the tooltip // control. We check if the parent window is a decorated // frame. // // Method SetStatusbarMessage(int Id) // This method sets the status bar's message according to // the control id passed on the first parameter. // It needs a Decorated Frame to do this job! // // Method FindChildFromPoint(HWND hwnd, POINT Point) // This method returns the handle of the child window // according to the specified point. It is the same as // the standard API function "ChildWindowFromPoint", but // here we search for a real control id, higher than zero // and unlike -1. This costrains all of you to put a valid // id for each control, if you want to add a "Group Control" // you must put -1 as its id. If you put a valid id instead, // this function acts like "ChildWindowFromPoint", that is // returns the handle of the group control even if the mouse // stands on another control which is inside of it. // Remember this note when you build the resource file (.rc). // // Method IdleAction(long idleCount) // We handle this message to change the status bar's message. // We need a decorated frame to do this job! // // Usage: You can create a tooltip and a status bar's message using // the following line in your .rc file: // // STRINGTABLE // { // CONTROLID, "Message\nTooltip" // } // // Put always a "\n" between your message to be displayed on // status bar and tooltip string for each control. // // HISTORY: Release 2.1 (July 31, 1998) // This release relies on the extended JPTooltipSupport // class. It doesn't need a decorated frame to display // the tooltip, but it needs a decorated frame to display // the tooltip and the status bar's message. // // Release 2.0 (February 2, 1998) // This release relies on JPTooltipSupport class. // That means you must have this class in your project // together with JPTooltipSupport sources. // It doesn't require TDecoratedFrame in target application. // It correctly runs as a modeless dialog. // It doesn't seem to have problems on Win16 targets. // // Release 1.0 (January 28, 1998) // This release is the first release. // It has serious problems if dialog is a modeless dialog. // It presents serious bugs on Win16 targets too. // It requires TDecoratedFrame in target application. //--------------------------------------------------------------------------- //===========================================================================