2025-11-27 16:46:48 +09:00

89 lines
10 KiB
Plaintext

{\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 \rsid8667087}{\*\generator Micro
soft Word 11.0.5604;}{\info{\author TvmServer}{\operator TvmServer}{\creatim\yr2005\mo1\dy17\hr14\min27}{\revtim\yr2005\mo1\dy17\hr14\min27}{\version2}{\edmins0}{\nofpages3}{\nofwords585}{\nofchars3336}{\*\company Dundas India}{\nofcharsws3914}
{\vern24689}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale116\viewzk2\nolnhtadjtbl\rsidroot8667087
\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\cf2\insrsid8667087 COXImageListBox Overview}{\b\fs48\insrsid8667087
\par }{\b\fs15\insrsid8667087 Copyright \'a9 }{\b\fs15\insrsid8667087 The Code Project}{\b\fs15\insrsid8667087 1997-1999, All Rights Reserved
\par }{\insrsid8667087
\par }{\b\insrsid8667087 COXImageListBox}{\insrsid8667087 is }{\b\insrsid8667087 CListBox}{\insrsid8667087 derived class designed to display multiple }{\b\insrsid8667087 images}{\insrsid8667087
of the same size. Images are displayed in multiple columns and if they don't fit the size of the control's window }{\b\insrsid8667087 COXImageListBox}{\insrsid8667087 will automatically support the scrolling in horizontal direction.
\par
\par COXImageListBox control supports only single selection and the following styles must be specified: }{\b\insrsid8667087 LBS_OWNERDRAWFIXED}{\insrsid8667087 and }{\b\insrsid8667087 LBS_MULTICOLUMN}{\insrsid8667087 ; and these styles must not be specified:
}{\b\insrsid8667087 LBS_MULTIPLESEL}{\insrsid8667087 and }{\b\insrsid8667087 LBS_OWNERDRAWVARIABLE}{\insrsid8667087 .\~
\par
\par
\par COXImageListBox uses internally an object of }{\b\insrsid8667087 CImageList}{\insrsid8667087 class as a storage for displayed
images and uses its functionality to draw them. The number of items in this image list is always the same as the number of items in the list box. And an index of the item in the list box corresponds to the same index of the displayed image in the internal
image list. That means that any displayed image can be accessed just by its index.
\par
\par All CListBox functions can be applied to the COXImageListBox object keeping in mind the limitations on the used styles (e.g. functions for a list box with multiple selection are not applicable).
\par
\par \~
\par }{\b\fs27\insrsid8667087 Usage
\par
\par }{\insrsid8667087 In order to use COXImageListBox object in your application you have to create it using standard }{\b\insrsid8667087 CListBox::Create}{\insrsid8667087
() function or subclass the existing list box control, e.g. using DDX/DDV technology for a dialog or a form views.\~
\par
\par After control was successfully created or subclassed you might want to populate it with images that will be displayed in it. We provide many ways of doing this.
\par
\par First of all you can specify your own external image list object as source of images. Call the following function in order to do that:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 int }{\ul\cf2\insrsid8667087 SetImageList}{\insrsid8667087 (CImageList* pImageList);
\par
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 You also can add new images to the existing ones through calling the following functions:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 int }{\ul\cf2\insrsid8667087 AddImage}{\insrsid8667087 (CBitmap* pbmImage, CBitmap* pbmMask);
\par int }{\ul\cf2\insrsid8667087 AddImage}{\insrsid8667087 (CBitmap* pbmImage, COLORREF crMask);
\par int }{\ul\cf2\insrsid8667087 AddImage}{\insrsid8667087 (HICON hIcon);
\par
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 And you can add a set of images by calling:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 int }{\ul\cf2\insrsid8667087 AddImageList}{\insrsid8667087 (CImageList* pImageList);
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 function.
\par
\par We would like to bring your attention to one specific way of populating the image list box with new images. It is known that icons that reside in executable files can be retrieved using Win32 API functions. We provide an automatic way of retrieving icons
from executables and insert them in the list box. In order to do that you just have to call the following function:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 BOOL }{\ul\cf2\insrsid8667087 LoadIconsFromFile}{\insrsid8667087 (LPCTSTR lpszFileName=NULL, BOOL bSmallIcon=TRUE);
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087
\par At any time you can replace any displayed image with another one if you call the following functions:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 BOOL }{\ul\cf2\insrsid8667087 ReplaceImage}{\insrsid8667087 (int nImage, CBitmap* pbmImage, CBitmap* pbmMask=NULL);
\par BOOL }{\ul\cf2\insrsid8667087 ReplaceImage}{\insrsid8667087 (int nImage, HICON hIcon);
\par
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 Note that after you are done with replacing images you have to call }{\b\insrsid8667087 RedrawWindow}{\insrsid8667087 () function in order to update the displayed images.
\par
\par And, finally, you can remove any displayed image from the list box using:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 BOOL }{\ul\cf2\insrsid8667087 RemoveImage}{\insrsid8667087 (int nImage);
\par
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 All displayed images can be removed at once using:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 void }{\ul\cf2\insrsid8667087 EmptyImageList}{\insrsid8667087 ();
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 function.
\par
\par The information about images can be accessed at any time by means of set of the following functions:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 BOOL }{\ul\cf2\insrsid8667087 GetImageInfo}{\insrsid8667087 (int nImage, IMAGEINFO* pImageInfo) const;
\par HICON }{\ul\cf2\insrsid8667087 GetIcon}{\insrsid8667087 (int nImage);
\par HICON }{\ul\cf2\insrsid8667087 GetSelectedIcon}{\insrsid8667087 ();
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087
\par The internal image list object can be accessed directly through calling:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 CImageList* }{\ul\cf2\insrsid8667087 GetImageList}{\insrsid8667087 ();
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087
\par As an additional functionality we support an option to set the list box background color. Use these functions in order to set/retrieve the control's background color:
\par }\pard \ql \li720\ri720\nowidctlpar\faauto\rin720\lin720\itap0 {\insrsid8667087 virtual COLORREF }{\ul\cf2\insrsid8667087 GetBkColor}{\insrsid8667087 () const;
\par void }{\ul\cf2\insrsid8667087 SetBkColor}{\insrsid8667087 (COLORREF clrBackground);\~
\par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\insrsid8667087 \~
\par The sample that demonstrates COXImageListBox class is called }{\b\insrsid8667087 ImageListBox}{\insrsid8667087 and can be found in the }{\b\insrsid8667087 .\\Samples\\gui\\ImageListBox }{\insrsid8667087 subdirectory of your Ultimate Toolbox directory.\~
\par \~
\par }{\b\insrsid8667087 Dependency:
\par }{\insrsid8667087 #include "}{\cf6\insrsid8667087 OXImageListBox.h}{\insrsid8667087 "
\par }{\b\insrsid8667087
\par Source code files:
\par }{\insrsid8667087 "}{\cf6\insrsid8667087 OXImageListBox.cpp}{\insrsid8667087 "
\par \~
\par
\par }{\fs20\insrsid8667087
\par }}