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::LoadPictureList 

void LoadPictureList();

Remarks

    Load the picture-list. This function is very complex and uses a lot of time.
    Because the Systen conks out, however, if the list is loaded, you can nothing do more.
    Therefore the function in the background will work on another wise:

    We say to the system, that he is supposed to load the picture list,
    then sends me a message, when it is ready. Before according to receipt of the
    Message the list will not be available.   

    The Message will be: WM_BONITO_PICFILE and WPARAM = PICFILE_REFRESH
    After the reception of these messages must you do what would be necessary
    in order to look at the pictures in your Picure List Control.

Example

  
many more about this you can see in SourceCode

      //in your Message-Receptor (here CMainframe)

   ON_MESSAGE(WM_BONITO_PICFILE,OnPicFileChanged)

   LRESULT CMainFrame::OnPicFileChanged(WPARAM wParam, LPARAM lParam)
     {
     if(wParam==PICFILE_RELOAD) LoadPictureList();
     else PicFileRequester.OnFileChanged(wParam,lParam);
     return NULL;
     }

     //in your Message-Receptor (here PicFileRequester)
 
 
#include "RenameDlg.h"

ON_BN_CLICKED(ID_FAX_DELETE, OnDelete)
ON_BN_CLICKED(ID_FAX_RENAME, OnRename)
ON_BN_CLICKED(ID_FAX_DNL_FOLDER, OnMoveDNL)
ON_BN_CLICKED(ID_FAX_RX_FOLDER, OnMoveRX)
ON_BN_CLICKED(ID_FAX_SAT_FOLDER, OnMoveSAT)
ON_BN_CLICKED(ID_FAX_B1_FOLDER, OnMoveB1)
ON_BN_CLICKED(ID_FAX_B2_FOLDER, OnMoveB2)
ON_BN_CLICKED(ID_FAX_B3_FOLDER, OnMoveB3)
ON_BN_CLICKED(ID_FAX_TRASH, OnMoveTrash)

ON_MESSAGE(WM_BONITO_PICFILE,OnFileChanged)

   void CPicFileRequester::OnMoveDNL()   {MoveTo(FDIR_DNL);}
   void CPicFileRequester::OnMoveRX()    {MoveTo(FDIR_RX);}
   void CPicFileRequester::OnMoveSAT()   {MoveTo(FDIR_SAT);}
   void CPicFileRequester::OnMoveB1()    {MoveTo(FDIR_BANK1);}
   void CPicFileRequester::OnMoveB2()    {MoveTo(FDIR_BANK2);}
   void CPicFileRequester::OnMoveB3()    {MoveTo(FDIR_BANK3);}
   void CPicFileRequester::OnMoveTrash() {MoveTo(FDIR_TRASH);}

   void CPicFileRequester::OnDelete()    {DeletePicFile(m_index,m_folder);}
   void
CPicFileRequester::OnRename()
          {
          CRenameDlg dlg(this,myPicFiles(m_folder)[m_index].filepath);
          if(dlg.DoModal()==IDOK)
             {
             RenamePicFileName(m_index,m_folder,
                      myPicFiles(m_folder)[m_index].filepath);
             }
           }

   LRESULT CPicFileRequester::OnFileChanged(WPARAM type,LPARAM l)
     {
     int i;

     switch(type)
         {
         case PICFILE_DELETE://the indicated picture was deleted
            myImageView->ClearView();
            goto rename_OK;

         case PICFILE_SELCHG://indicated picture was changed, find new index
             for(i=0; i<myPicFiles(m_folder).GetSize(); i++)
              {
              if(myPicFiles(m_folder)[i].select)
                 {
                 myImageView->picFolder=m_folder;
                 myImageView->picIndex=i;
                 goto rename_OK;
                 }
               }
             myImageView->ClearView(); //not braek is ready

         case PICFILE_REFRESH:
rename_OK:
             RefreschTheList();
             Invalidate();
             break;
         }

      return NULL;
      }
 

See Also   MeteoTools.cpp

 

   Copyright 2006 © Bonito Germany.   
www.bonito.net