METHOD Initiate( hDlg ) CLASS TComboBox
::Super:Initiate( hDlg )
::Default()
if nAnd( GetWindowLong( ::hWnd, GWL_STYLE ), CBS_DROPDOWNLIST ) == CBS_DROPDOWN
::oGet := TGet():ReDefine( nil, ; // ID not used
::bSetGet, ; // bSETGET(uVar)
Self, ; // oDlg
::nHelpID, ; // Help Context ID
::cPict, ; // Picture
nil, ; // Valid is handled by the CBx
::nClrText,;
::nClrPane,;
::oFont, ; // <oFont>
nil, ; // <oCursor>
::cMsg, ; // cMsg
nil, ; // <.update.>
nil, ; // <{uWhen}>
::bEChange, ; // {|nKey,nFlags,Self| <uEChange>}
.F. ) // <.readonly.> )
::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:bKeyChar = { | nKey | ::GetKeyChar( nKey ) }
endif
::Refresh()
return nil
Additional i had moved the creation from the ::oGet and ::oGet:bLostFocus and ::oGet:bKeyChar in ::initiate()
Sent to the dialog box procedure immediately before a dialog box is displayed
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: karinha, nageswaragunupudi and 115 guests