// ======================================================================== // 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: JPPropertySheet/Page (Release 2.0 - July 31, 1998) // // Files: jpprpage.cpp jpprpage.h // // Purpose: Provides an extended property sheet 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: JPPropertySheet/Page is derived from TPropertySheet/Page class. // Its only purpose is to provide you a tooltip // for each control of all property pages. // The code is very easy to understand. // If you need more info, please e-mail me. // // Declaration: JPPropertySheet::JPPropertySheet(TWindow* parent, // const char far* title, // uint startPage, // bool isWizard, // uint32 flags, // TModule* module, // JPTooltipSupport* mytooltip, // bool FullTooltipSupport, // bool AlwaysForceRectAssociate, // bool ForceRectAssociateIfDisabled, // bool EnableStatusbarMessages); // The first six params are the same as TPropertySheet class. // The seventh 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 and that if these two conditions are true // (the param is true and the parent window is a Decorated // frame) the class will automatically enable Property Sheet's // subclassing, as it needs to manage the mouse's messages. // // JPPropertyPage::JPPropertyPage(JPPropertySheet* parent, // TResId resId, // const char far* title, // TResId iconRes, // TModule* module, // bool FullTooltipSupport, // bool AlwaysForceRectAssociate, // bool ForceRectAssociateIfDisabled, // bool EnableStatusbarMessages) // The first five params are the same as TPropertyPage class. // The other new params are the same as JPPropertySheet class. // Note that the new params of JPPropertySheet are needed // to manage tooltips and status bar's messages in the // lower tail of the property sheet (where are located // the buttons of the property sheet). The new params of // JPPropertyPage are needed to manage tooltips and status // bar's messages of each page (that is a real dialog) of // the property sheet. // // Methods: Constructor: // In the JPPropertySheet class we check if parent window // is a decorated frame. If it true, we enable // subclassing on this property sheet. // In the JPPropertyPage class we retrieve the tooltip // from property sheet and if we set the PSH_HASHELP flag // if the property sheet has set this flag. // // Destructor: // We simply call the TPropertySheet and TPropertyPage // destructors! // // Method SetupWindow: // We associate the controls' strings to the tooltip control. // Besides in the JPPropertyPage class we retrieve the // decorated frame object from the Property Sheet. // // Method CleanupWindow: // We dissociate the controls' strings from the tooltip control. // // Method GetGlobalTooltip() [only JPPropertySheet class] // This method returns the JPTooltipSupport object used // by JPPropertySheet class. // // Method SetStatusbarMessage(int Id) [JPPropertySheet only] // 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) // [ JPPropertySheet class only ] // 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 EvSetCursor [ both classes ] // We handle this message to change the status bar's message. // We need a decorated frame to do this job! // // Method GetDecoratedFrame() [ JPPropertySheet only ] // It returns the current decorated frame object. // // HISTORY: Release 2.0 (July 31, 1998) // The code is optimized (I hope!!), and has // many parameters to make it customizable. // // Release 1.0 (February 2, 1998) // This release is the first release. // It doesn't support status bar's messages. // The code has not been optimized and has some bugs. //--------------------------------------------------------------------------- //===========================================================================