HOMEPAGE

Development Sites - Information for Software-Developers

Developer Platform
The first instructions
Installations
System param. structures
connect to MeteoCom
simple screen drawing
own data drawing
Picture service
File Management
EmailBulletin Service

MeteoTools::DrawThumbFolders

void DrawThumbFolders(HDC hDC, int nItem, CRect &re, int bSelected, int currendFolder,
                                              int
selectedPicFolder, int SelectedPicIndex)
 

Parameters

     hDC

     The handle of your device-context (see CDC)

     nItem

     A interger as a ListCtrl item (the same as the index of the picture list)
     for drawing the little thumbnail picture

     re

     Points to a CRect object that contains the logical coordinates of the rectangle
     to be filled with an images of the nItem of an
PictureFileList.

     bSelected

     the list item select state (1=selected)

     currendFolder

     A integer (0-6) that represent the selected folder, who the this selcted list item is exist.
     The possible folder are predefined, described as  Picture Folders

     selectedPicFolder

     A integer (0-6) that represent the currend folder, who the last choosed picture is viewing.
     The possible folder are predefined, described as  Picture Folders

     SelectedPicIndex

     A integer (0-6) that represent the selected index of this last choosed picture.
     The possible folder are predefined, described as  Picture Folders

Remarks

     This function draws an ListCtrl item as image.
     Then the
PictureFileList contains a little thumbnail picture.

Example 

     many more about this you can see in SourceCode

   //m_folder
  //  is the current selcted folder of the
ListCtrl

  //picFolder and picIndex
  //  are from ImageViewer selectedPicFolder and SelectedPicIndex

 void CPicFileRequester::DrawItem(LPDRAWITEMSTRUCT di) 
    {
    CRect rect,rcAllLabels;
    int nItem = di->itemID;
    BOOL bFocus = (GetFocus() == this);
    LV_ITEM lvi;

    if(m_folder<0 || m_folder>FDIR_MAX) return;
    if(nItem>=myPicFiles(m_folder).GetSize()) return;

    GetItemRect(nItem, rect, LVIR_BOUNDS); 

    lvi.mask = LVIF_IMAGE | LVIF_STATE;
    lvi.iItem = nItem;
    lvi.iSubItem = 0;
    lvi.stateMask = 0xFFFF; // get all state flags
    GetItem(&lvi);

    BOOL bSelected = (bFocus || (GetStyle() & LVS_SHOWSELALWAYS))
                          && lvi.state & LVIS_SELECTED;
    bSelected = bSelected || (lvi.state & LVIS_DROPHILITED);

    // this draws the little thumbnail picture
    DrawThumbFolders(di->hDC,nItem,rect,bSelected,m_folder,picFolder,picIndex);
    }

See Also   MeteoTools.cpp

 
   Copyright 2007 © Bonito Germany.   
www.bonito.net