hi,
when have a Listbox / Combobox with Drive-Letter i want to show all but "disable" all "fix Drive"
i want to use it for USB-Stick which i want to "safe eject"
PUBLIC bColorUSB := { || IF( USB_DeviceColor(), SP_nColor2(), SP_nColor13() ) }
DEFINE GRID Grid_Device
...
DYNAMICFORECOLOR { bColorUSB, bColorUSB }
oListBox := MyListbox() :new(...)
METHOD MyListbox:Init(...)
::XbpListbox:Init(...)
::DrawMode := XBP_DRAW_OWNER
::XbpListbox:MeasureItem := { | nItem, aDims, oSelf | oSelf:MyMeasureItem( nItem, aDims, oSelf ) }
::XbpListbox:drawItem := { | oPS, aInfo, oSelf | oSelf:MyDrawItem( oPS, aInfo, oSelf ) }
METHOD MyListbox:MyDrawItem( oPS, aInfo, oSelf )
...
IF ::aCargo[ nItem ] [ 3 ] = .F.
aSAttrs[ GRA_AS_COLOR ] := SP_nColor13()
ELSE
aSAttrs[ GRA_AS_COLOR ] := IIF( BAnd( nState, XBP_DRAWSTATE_DISABLED ) != 0, SP_nColor13(), SP_nColor2() )
ENDIF
aSAttrs[ GRA_AS_HORIZALIGN ] := GRA_HALIGN_RIGHT
aSAttrs[ GRA_AS_VERTALIGN ] := GRA_VALIGN_HALF
aSAttrs[ GRA_AS_ANGLE ] := { 1, 0 }
aOldAttrs := GRASETATTRSTRING( oPS, aSAttrs )
oPS:DrawCaptionStr( { nFix * 1, aTxtBox[ 2 ] }, ;
{ nFix * 2, aTxtBox[ 4 ] }, cStr )
cVol := ::aCargo[ nItem ] [ 2 ]
IF EMPTY( cVol )
ELSE
oPS:DrawCaptionStr( { nFix * 2, aTxtBox[ 2 ] }, ;
{ aTxtBox[ 3 ] + IMAGE_BOX, aTxtBox[ 4 ] }, cVol )
ENDIF
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 82 guests