BUG: COMBOBOX with style CBS_DROPDOWN
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Antonio, all FW-users profit from the team!
And at least: Please show that SetGetColorFocus() not functioning on this ::oGet.
And at least: Please show that SetGetColorFocus() not functioning on this ::oGet.
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Hi Antonio,
there are still problem with dropdown combobox.
When the dropdown combo hasn't the focus the values displayed is incorrect. See image 1
Only if I press the mouse button on the combo the right value appears. See image 2
Any ideas ?
Image 1
Image 2
there are still problem with dropdown combobox.
When the dropdown combo hasn't the focus the values displayed is incorrect. See image 1
Only if I press the mouse button on the combo the right value appears. See image 2
Any ideas ?
Image 1
Image 2
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Marco, has the Combobox clausula "UPDATE" ?
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Can see no problems...!!??
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Marco,
have you applied the combobox fixes that I have published on this thread ? thanks
have you applied the combobox fixes that I have published on this thread ? thanks
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Yes, I'll try to prepare a self-contained sample to show you the problem asap. Thanks
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
-
- Posts: 310
- Joined: Mon Oct 10, 2005 5:10 am
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Hi Marco
I had the same problem with comboboxes - not showing the correct value
Hope this helps
Cheers
Colin
I had the same problem with comboboxes - not showing the correct value
Code: Select all
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 nil
Cheers
Colin
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Hi 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.
solved with your code. Thank you very much.
Antonio, could you pls.add the Colin's fix to the next FWH release ? Thank you.
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Colin, Marco,
I modified Colin's code this way:
Included for the next FWH build, thanks!
I modified Colin's code this way:
Code: Select all
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 nil
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Antonio, with the last changes "COMBOBOX from code" is now ok but on "REDEFINE COMBOBOX" the ::oGet is created in all cases (tested with a characterlist) also on pure CBS_DROPDOWNLIST.
I found the is not correct!?
lAnd(2,3) == .T.
lAnd(3,2) == .T.
What function can i use to gain the information from the RC-file that a Combobox is style CBS_DROPDOWN or CBS_DROPDOWNLIST ???
I have tested
and it seems functioning. But sideeffects must check Antonio.
This block of code in ::new is to transfer in ::init (parts are already in ::init)
This code from ::redefine is in this case not required
I found the
Code: Select all
if lAnd( ::nStyle, CBS_DROPDOWN )
lAnd(2,3) == .T.
lAnd(3,2) == .T.
What function can i use to gain the information from the RC-file that a Combobox is style CBS_DROPDOWN or CBS_DROPDOWNLIST ???
I have tested
Code: Select all
if !lAnd( ::nStyle, CBS_DROPDOWNLIST )
This block of code in ::new is to transfer in ::init (parts are already in ::init)
Code: Select all
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
Code: Select all
::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 ),) ) }
Re: BUG: COMBOBOX with style CBS_DROPDOWN
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 ???
What function can i (we) use to gain the information from the RC-file that a Combobox has a decidedly style ???
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Günther,
See these defines:
#define CBS_DROPDOWN 0x0002
#define CBS_DROPDOWNLIST 0x0003
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
See these defines:
#define CBS_DROPDOWN 0x0002
#define CBS_DROPDOWNLIST 0x0003
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
Re: BUG: COMBOBOX with style CBS_DROPDOWN
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()?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: BUG: COMBOBOX with style CBS_DROPDOWN
Günther,
From this moment on:
::Create( "COMBOBOX" ) // Method New()
the control has been created and ::hWnd should be valid.
From this moment on:
::Create( "COMBOBOX" ) // Method New()
the control has been created and ::hWnd should be valid.