{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\froman\fcharset238\fprq2 Times New Roman CE;} {\f41\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f43\froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\f46\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f47\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255; \red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0; \red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid1510598\rsid2827592 \rsid5183391\rsid8147271\rsid16398236}{\*\generator Microsoft Word 11.0.5604;}{\info{\author TvmServer}{\operator TvmServer}{\creatim\yr2005\mo1\dy17\hr11\min12}{\revtim\yr2005\mo1\dy17\hr11\min15}{\version5}{\edmins3}{\nofpages3}{\nofwords869} {\nofchars4954}{\*\company Dundas India}{\nofcharsws5812}{\vern24689}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3 \jcompress\viewkind1\viewscale100\nolnhtadjtbl\rsidroot8147271 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3 \pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} {\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\fs42\cf2\insrsid16398236\charrsid2827592 COXCoolComboBox}{\b\fs42\insrsid16398236\charrsid2827592 \par }{\b\fs16\insrsid16398236\charrsid2827592 Copyright \'a9 }{\b\fs16\insrsid8147271\charrsid2827592 The Code Project}{\b\fs16\insrsid16398236\charrsid2827592 1997 1998, All Rights Reserved \par }{\insrsid16398236\charrsid2827592 \par COXCoolComboBox class implements standard combo box as cool control. Refer to }{\cf2\insrsid16398236\charrsid2827592 description of COXCoolCtrl}{\insrsid16398236\charrsid2827592 class for details on cool controls. Briefly,}{\insrsid1510598 }{ \insrsid16398236\charrsid2827592 we call any control (generally speaking, any window) as cool one if it supports normal or hot state. By definition, window is in hot state when mouse cursor is over it or it has focus. Otherwise window is in normal state. \par \par COXCoolComboBox is derived from COXCoolCtrl. COXCoolComboBox doesn't have it's own public functions and it relies heavily on COXCoolCtrl class. }{\insrsid16398236 \par }{\insrsid1510598\charrsid2827592 \par }{\insrsid16398236\charrsid2827592 Refer to }{\cf2\insrsid16398236\charrsid2827592 COXCoolCtrl function reference}{\insrsid16398236\charrsid2827592 for details. \par \par Basically, COXCoolComboBox provides drawing routines for normal and hot state.Use COXCoolComboBox class the same way you would use standard CComboBox. \par \par Note that COXCoolCtrl automatically support tooltip for control. You can set/retrieve tooltip text using the following functions: \par \par \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL SetTooltipText(const CString& sTooltipText);}{\insrsid16398236\charrsid2827592 \par \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL GetTooltipText(CString& sTooltipText) const; \par }{\insrsid16398236\charrsid2827592 \par }{\b\insrsid16398236\charrsid2827592 Dependencies}{\insrsid16398236\charrsid2827592 : \par \par \~\~ }{\b\insrsid16398236\charrsid2827592 #include "OXCoolComboBox.h"}{\insrsid16398236\charrsid2827592 \par \par Source code files: \par \par }{\b\insrsid16398236\charrsid2827592 \~\~\~ "OXCoolComboBox.cpp" \par }{\b\fs48\cf2\insrsid16398236\charrsid2827592 \par }{\b\fs42\cf2\insrsid16398236\charrsid2827592 COXCoolCtrl}{\b\fs48\insrsid16398236\charrsid2827592 \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid2827592 {\b\fs16\insrsid2827592\charrsid2827592 Copyright \'a9 The Code Project 1997 1998, All Rights Reserved \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid16398236\charrsid2827592 \par Almost every application uses some of common controls in its implementation. Users used to see these common controls and khow how to use them. \par \par This the primary reason why you usually don't want to change the look and functionality of existing controls too much. But sometimes even by slightly changing the appearance of a control you can achive good results in terms of enhancing the feel and look of your application's user interface. \par \par We suggest the following new feature for common controls: every control (generally speaking, any window) can be in normal or hot state. By definition,}{\insrsid16398236 }{\insrsid16398236\charrsid2827592 window is in hot state when mouse cursor is over it or it has focus. Otherwise window is in normal state. Naturally, in order to distinguish window in different states some graphical effects should be applied. E.g. the drawing of window borders in different states might be different. \par \par We call controls that support normal and hot state - cool controls. \par \par We designed template class COXCoolCtrl that simplifies process of converting of common controls to cool ones. \par \par COXCoolCtrl template has one argument that specifies the parent class of the new cool control. E.g. if you would like to design your own cool listbox class you can declare it as following: \par \par }{\b\insrsid16398236\charrsid2827592 \~\~\~ class CCoolListBox : public COXCoolCtrl \par }{\insrsid16398236\charrsid2827592 \par \par While implementing cool control using COXCoolCtrl derivation you might would like to override the following protected virtual functions: \par \par \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual void OnChangeHotState(BOOL bInHotState); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual void OnFocusChange(CWnd* pWndGainFocus, CWnd* pWndLooseFocus); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual void OnMouseEnter(const CPoint ptCursor); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual void OnMouseLeave(const CPoint ptCursor); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual BOOL HandleKey(const int nVirtKey); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 virtual BOOL OnChangeTooltipText(const CString& sTooltipText); \par }{\insrsid16398236\charrsid2827592 \par Refer to the }{\insrsid16398236\charrsid16398236 class reference}{\insrsid16398236\charrsid2827592 for detailed function explanations. \par \par Almost always you would like to override }{\cf2\insrsid16398236\charrsid2827592 OnChangeHotState()}{\insrsid16398236\charrsid2827592 function which is called when window is about to change its state from hot to normal and vise versa. }{\insrsid1510598 I} {\insrsid16398236\charrsid2827592 n your implementation of this function you might redraw the window in order to show that window has changed its state. \par \par }{\cf2\insrsid16398236\charrsid2827592 OnFocusChange()}{\insrsid16398236\charrsid2827592 is called every time window looses or gains focus and }{\cf2\insrsid16398236\charrsid2827592 OnMouseEnter()}{\insrsid16398236\charrsid2827592 and }{ \cf2\insrsid16398236\charrsid2827592 OnMouseLeave()}{\insrsid16398236\charrsid2827592 functions are called every time mouse enters or leaves the screen space taken by the window correspondingly. \par \par }{\cf2\insrsid16398236\charrsid2827592 HandleKey()}{\insrsid16398236\charrsid2827592 function will be called every time when user presses any key down. Overriding this function you can handle pressed key before control has a chance to do that. By returning TRUE you will notify control that you handled the event yourself and don't want to run default handler implementation. \par \par One of the additional useful feature that COXCoolCtrl supports is tooltip for the control. You can set/retrieve tooltip text using the following functions: \par \par \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL SetTooltipText(const CString& sTooltipText); \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL GetTooltipText(CString& sTooltipText) const; \par }{\insrsid16398236\charrsid2827592 \par \par Every time you change the tooltip text }{\cf2\insrsid16398236\charrsid2827592 OnChangeTooltipText()}{\insrsid16398236\charrsid2827592 function will be called. By overriding this function you can control the process of setting of tooltip text. By returning FALSE you specify that you don't allow to change the tooltip text. \par \par There are a few additional public functions that you might find useful: \par \par \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL IsInHotState() const; \par }{\insrsid16398236\charrsid2827592 \~\~\~ }{\cf2\insrsid16398236\charrsid2827592 BOOL IsMouseOver() const; \par }{\insrsid16398236\charrsid2827592 \par }{\cf2\insrsid16398236\charrsid2827592 IsInHotState()}{\insrsid16398236\charrsid2827592 function retrieves the flag that specifies whether the window is in hot or normal state. }{\cf2\insrsid16398236\charrsid2827592 IsMouseOver()}{ \insrsid16398236\charrsid2827592 function retrieves the flag that specifies whether the current mouse position is over the window or not. \par \par Although it's not a must requirement but it would be nice if control was able to support standard and new cool state. By default when control is created of subclassed the existing one it is set to cool state. But calli ng the following function you can set it back to statndard state: \par \par }{\cf2\insrsid16398236\charrsid2827592 virtual void SetCoolState(const BOOL bCoolState); \par }{\insrsid16398236\charrsid2827592 \par You can retrieve the flag that specifies whether the control is in cool or normal state \par \par }{\cf2\insrsid16398236\charrsid2827592 virtual BOOL IsInCoolState() const; \par }{\insrsid16398236\charrsid2827592 \par As you can see both of these functions are declared as virtual so if you don't want to support standard appearance of the control you might override this function (}{\cf2\insrsid16398236\charrsid2827592 SetCoolState()}{\insrsid16398236\charrsid2827592 would do nothing and }{\cf2\insrsid16398236\charrsid2827592 IsInCoolState()}{\insrsid16398236\charrsid2827592 would always return TRUE). \par \par \par \par Again we would like to emphasize that COXCoolCtrl class is designed specifically in order to help you to create coll common controls. We are going to come up}{\insrsid16398236 }{\insrsid16398236\charrsid2827592 with classes that implements some common controls as cool ones (take look at the}{\insrsid16398236 }{\cf2\insrsid16398236\charrsid2827592 COXCoolComboBox}{\insrsid16398236\charrsid2827592 class which implements cool combobox). \par \par }{\b\insrsid16398236\charrsid16398236 Dependencies}{\insrsid16398236\charrsid2827592 : \par \par }{\b\insrsid16398236\charrsid2827592 #include "OXCoolCtrl.h"}{\insrsid16398236\charrsid2827592 \par \par Source code files: \par \par }{\b\insrsid16398236\charrsid2827592 "OXCoolCtrl.h"}{\fs20\insrsid16398236\charrsid2827592 \par }}