Changeset 405 for trunk/Lucide


Ignore:
Timestamp:
Apr 19, 2010, 5:58:25 PM (12 years ago)
Author:
dmik
Message:

Util: Added enumCntrRecords()/enumCntrEmphasis() for easy operation on container items.

Location:
trunk/Lucide/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/gui/luutils.cpp

    r367 r405  
    532532}
    533533
     534void enumCntrRecords( HWND hwndCntr, PENUMCNTRFN pFn, void *pUser )
     535{
     536    PRECORDCORE rec = (PRECORDCORE) WinSendMsg( hwndCntr, CM_QUERYRECORD,
     537                                                0,
     538                                                MPFROM2SHORT( CMA_FIRST, CMA_ITEMORDER ) );
     539    while ( rec != NULL && rec != (PRECORDCORE)(-1) )
     540    {
     541        if ( !pFn( hwndCntr, rec, pUser ) )
     542            return;
     543        rec = (PRECORDCORE) WinSendMsg( hwndCntr, CM_QUERYRECORD,
     544                                        MPFROMP( rec ),
     545                                        MPFROM2SHORT( CMA_NEXT, CMA_ITEMORDER ) );
     546    }
     547}
     548
     549void enumCntrEmphasis( HWND hwndCntr, USHORT fEmphasisMask,
     550                       PENUMCNTRFN pFn, void *pUser )
     551{
     552    PRECORDCORE rec = (PRECORDCORE) WinSendMsg( hwndCntr, CM_QUERYRECORDEMPHASIS,
     553                                                MPFROMP( CMA_FIRST ),
     554                                                MPFROMSHORT( fEmphasisMask ) );
     555    while ( rec != NULL && rec != (PRECORDCORE)(-1) )
     556    {
     557        if ( !pFn( hwndCntr, rec, pUser ) )
     558            return;
     559        rec = (PRECORDCORE) WinSendMsg( hwndCntr, CM_QUERYRECORDEMPHASIS,
     560                                        MPFROMP( rec ),
     561                                        MPFROMSHORT( fEmphasisMask ) );
     562    }
     563}
     564
    534565char *getTmpDir( char *buf )
    535566{
  • trunk/Lucide/gui/luutils.h

    r367 r405  
    5656
    5757#ifdef INCL_WIN
     58
    5859BOOL CreateGraphicsBuffer( HAB hab, PRECTL prectl, HPS hps, HPS *phpsBuffer, HDC *phdcBuffer );
    5960void BlitGraphicsBuffer( HPS hps, HPS hpsBuffer, PRECTL prclPaint );
     
    6970SHORT setZoomValues( HWND lbox );
    7071double convZoom( SHORT v );
     72
     73typedef bool (* PENUMCNTRFN)( HWND hwndCntr, PRECORDCORE pRec, void *pUser );
     74void enumCntrRecords( HWND hwndCntr, PENUMCNTRFN pFn, void *pUser );
     75void enumCntrEmphasis( HWND hwndCntr, USHORT fEmphasisMask,
     76                       PENUMCNTRFN pFn, void *pUser );
    7177#endif
    7278
Note: See TracChangeset for help on using the changeset viewer.