Antonio, all FW-users profit from the team!
And at least: Please show that SetGetColorFocus() not functioning on this ::oGet.
Antonio, all FW-users profit from the team!
And at least: Please show that SetGetColorFocus() not functioning on this ::oGet.

Marco, has the Combobox clausula "UPDATE" ?
Yes of course
Can see no problems...!!??
Marco,
have you applied the combobox fixes that I have published on this thread ? thanks
Yes, I'll try to prepare a self-contained sample to show you the problem asap. Thanks
METHOD Set( cNewItem ) CLASS TComboBox
local nAt
if ValType( cNewItem ) == "N"
nAt = cNewItem
if nAt == 0
nAt = 1
endif
else
nAt = AScan( ::aItems,;
{ | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cNewItem ) ) } )
endif
if ValType( cNewItem ) == "N" .or. nAt != 0
::Select( nAt )
Eval( ::bSetGet, cNewItem )
SetWindowText( ::hWnd , cNewItem ) // added this line
else
cNewItem := cValToChar( cNewItem )
Eval( ::bSetGet, cNewItem )
SetWindowText( ::hWnd , cNewItem )
endif
return nilHi Colin,
solved with your code. Thank you very much.
Antonio, could you pls.add the Colin's fix to the next FWH release ? Thank you.
METHOD Set( cNewItem ) CLASS TComboBox
local nAt
if ValType( cNewItem ) == "N"
nAt = cNewItem
if nAt == 0
nAt = 1
endif
else
nAt = AScan( ::aItems,;
{ | cItem | Upper( AllTrim( cItem ) ) == ;
Upper( AllTrim( cNewItem ) ) } )
endif
if ValType( cNewItem ) == "N" .or. nAt != 0 .and. ::oGet == nil
::Select( nAt )
else
cNewItem := cValToChar( cNewItem )
endif
Eval( ::bSetGet, cNewItem )
SetWindowText( ::hWnd , cNewItem )
return nilif lAnd( ::nStyle, CBS_DROPDOWN )if !lAnd( ::nStyle, CBS_DROPDOWNLIST ) if ::oGet != nil
::oGet:hWnd = GetWindow( ::hWnd, GW_CHILD )
::oGet:Link()
::oGet:bLostFocus = ;
{| hCtlFocus, nAt, cItem| cItem := GetWindowText( ::hWnd ), ;
nAt := ::SendMsg( CB_FINDSTRING, 0, Trim( cItem )) + 1,;
Eval( ::bSetGet, cItem ),;
::Select( nAt ),;
SetWindowText( ::hWnd, cItem ),;
If( ::bValid != nil .and. ;
GetParent( hCtlFocus ) == GetParent( ::hWnd ),;
If( ! Eval( ::bValid, ::oGet, Self ),;
::PostMsg( WM_SETFOCUS ),),) }
::oGet:SetFont( ::oFont )
::oGet:bKeyChar = { | nKey | If( ( nKey == VK_TAB .and. ! GetKeyState( VK_SHIFT ) ) .or. ;
nKey == VK_RETURN,;
( ::oWnd:GoNextCtrl( ::hWnd ), 0 ),;
If( nKey == VK_TAB .and. GetKeyState( VK_SHIFT ),;
( ::oWnd:GoPrevCtrl( ::hWnd ), 0 ),) ) }
endif ::oGet:bKeyChar = { | nKey | If( ( nKey == VK_TAB .and. ! GetKeyState( VK_SHIFT ) ) .or. ;
nKey == VK_RETURN,;
( ::oWnd:GoNextCtrl( ::hWnd ), 0 ),;
If( nKey == VK_TAB .and. GetKeyState( VK_SHIFT ),;
( ::oWnd:GoPrevCtrl( ::hWnd ), 0 ),) ) }Antonio, please check my last post.
What function can i (we) use to gain the information from the RC-file that a Combobox has a decidedly style ???
Günther,
See these defines:
So you could use:
nAnd( GetWindowLong( ::hWnd, GWL_STYLE ), CBS_DROPDOWNLIST ) == CBS_DROPDOWNLIST
Don't use CBS_DROPDOWN in the above line, because CBS_DROPDOWN is contained in CBS_DROPDOWNLIST:
CBS_DROPDOWN ==> 0000 0010
CBS_DROPDOWNLIST ==> 000 0011
From what moment on i can use GetWindowLong( ::hWnd, GWL_STYLE )->(::hWnd is existent)? Can we transfer the definition from the ::oGet in method init()?
Günther,
From this moment on:
::Create( "COMBOBOX" ) // Method New()
the control has been created and ::hWnd should be valid.