TListBox:IsMultipleSel() refinement

TListBox:IsMultipleSel() refinement

Postby Enrico Maria Giordano » Thu Feb 16, 2006 1:10 pm

The following sample shows .F. when the button is clicked. But an extended selection listbox is a multi-selection listbox as well.

Code: Select all  Expand view
#include "Fivewin.ch"


#define LBS_EXTENDEDSEL     2048


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oLbx

    LOCAL cVar := ""

    DEFINE DIALOG oDlg

    @ 1, 1 LISTBOX oLbx VAR cVar ITEMS { "Bert", "Carl", "William" }

    oLbx:nStyle += LBS_EXTENDEDSEL

    @ 3, 1 BUTTON "&Test" ACTION MSGINFO( oLbx:IsMultipleSel() )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


This is a possible fix:

Code: Select all  Expand view
METHOD IsMultipleSel() INLINE lAnd( GetWindowLong( ::hWnd, GWL_STYLE ),;
                                       nOr( LBS_MULTIPLESEL, LBS_EXTENDEDSEL ) )


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests