{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;} {\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\f43\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f45\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\trcbpat1\trcfpat1\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 \rsid1259828}{\*\generator Micro soft Word 11.0.5604;}{\info{\author TvmServer}{\operator TvmServer}{\creatim\yr2005\mo1\dy17\hr16\min59}{\revtim\yr2005\mo1\dy17\hr16\min59}{\version2}{\edmins0}{\nofpages2}{\nofwords396}{\nofchars2259}{\*\company Dundas India}{\nofcharsws2650} {\vern24689}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale116\viewzk2\nolnhtadjtbl\rsidroot1259828 \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\fs48\insrsid1259828 COXPopupBarCtrl General Information \par }{\insrsid1259828 \par }{\b\insrsid1259828 Copyright \'a9}{\b\insrsid1259828 The Code Project}{\b\insrsid1259828 1997 - 1998, All Rights Reserved}{\insrsid1259828 \par \par Our Popup Bar control as any control that can be represented as a top most popup window with items on it that can be chosen using the mouse or keyboard. For example standard Popup Menu Bar or Color Picker from Word 97 are Popup Bar controls. Next types of items can be defined on our Popup Bar control : \par \par "Default" button. Always is located on the top. The size of this button is calculated automatically. \par "Common" buttons. You can set the number of common buttons and their size. You can also set the number of rows used to display them. \par "Custom" button. Is always located at the bottom. Size of this button is calculated automatically. \par \par Default and Custom buttons are optional and at least one common button has to be assigned to the Popup Bar control. \par \par After displaying, the Popup Bar control captures all mouse messages and hides itself if any mouse button is clicked or the user presses ESC, ENTER or SPACE buttons. If at the moment of clicking the mouse wasn't over any button within Popup Bar or user pressed ESC then nothing was chosen. \par \par COXPopupBarCtrl is a generic class designed specifically as a base class to provide basic functionality of any Popup Bar control. \par \par Next are the main points about this class: \par \par }\pard \ql \fi-360\li720\ri0\nowidctlpar\faauto\rin0\lin720\itap0 {\insrsid1259828 With any button (except Custom button) we associate DWORD value to uniquely identify them. In derived cl ass you specify the logic of this value. It can be just a plain value or a pointer to any object, but it's up to implementor to provide logic that stands by that value. \par \par COXPopupBarCtrl is created in two steps: }{\ul\cf2\insrsid1259828 constructor}{\insrsid1259828 and }{\ul\cf2\insrsid1259828 Create}{\insrsid1259828 function. In construc tor you can specify number of common buttons, number of rows to display common buttons, common button size, the value that should be associated with Default button and the text that is going to be displayed on Default and Custom buttons. \par After creation you can change whatever attributes you want (including those specified in the }{\ul\cf2\insrsid1259828 constructor}{\insrsid1259828 and }{\ul\cf2\insrsid1259828 Create}{\insrsid1259828 function) \par \par In order to provide graphical representation of buttons in your derived class, you will probably need to overwrite the following virtual functions: \par \par virtual void DrawButton(CDC* pDC, UINT nIndex); \par virtual void DrawDefaultButton(CDC* pDC); \par virtual void DrawCustomButton(CDC* pDC); \par virtual void DrawFrameRect(CDC* pDC, CRect& rect, UINT nIndex); \par \par pDC - device context to draw in \par nIndex - index of button to be drawn \par \par When the Custom button is pressed next virtual function is called: \par \par virtual BOOL OnCustomButton(); \par \par Override it too in order to provide your own handling of custom button in derived class. \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\fs20\insrsid1259828 \par }}