[4.51 x86] SplitterGadget and ComboBoxGadget
Posted: Sat Apr 23, 2011 8:32 am
1. Drag the separator. Once the height of two ComboBox gadgets is 20 and then it is resized, it occurs repeatedly.
2. In addition, on moving the separator, the second ComboBox text is highlighted, but it's not activated.
2. In addition, on moving the separator, the second ComboBox text is highlighted, but it's not activated.
Code: Select all
Global old
#height = 40
; Structure my_COMBOBOXINFO
; cbSize.l
; rcItem.RECT
; rcButton.RECT
; stateButton.l
; hwndCombo.i
; hwndEdit.i
; hwndList.i
; EndStructure
; Procedure GetComboBoxEditHandle(hwndCombo)
; Protected cbi.my_COMBOBOXINFO\cbSize = SizeOf(my_COMBOBOXINFO)
; GetComboBoxInfo_(hwndCombo, cbi)
; ProcedureReturn cbi\hwndEdit
; EndProcedure
Procedure wndproc(hwnd, msg, wParam, lParam)
If msg = #WM_SIZE
;height = (lParam >> 16) & $FFFF
If GadgetHeight(2) <> #height
Debug "height: " + Str(GadgetHeight(2)) + " <-- 20"
Else
Debug "height: " + Str(GadgetHeight(2))
EndIf
EndIf
ProcedureReturn CallWindowProc_(old, hwnd, msg, wParam, lParam)
EndProcedure
If OpenWindow(0, 0, 0, 523, 125, "", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
ComboBoxGadget(1, 20, 15, 200, #height, #PB_ComboBox_Editable|#PB_ComboBox_LowerCase)
ComboBoxGadget(2, 225, 15, 260, #height, #PB_ComboBox_Editable|#PB_ComboBox_LowerCase)
SplitterGadget(3, 10, 10, 490, #height, 1, 2, #PB_Splitter_Vertical|#PB_Splitter_Separator)
; for showing the resizing problem clearly.
old = SetWindowLongPtr_(GadgetID(2), #GWL_WNDPROC, @wndproc())
; same result
;hwnd = GetComboBoxEditHandle(GadgetID(2))
;old = SetWindowLongPtr_(hwnd, #GWL_WNDPROC, @wndproc())
For i = 0 To 10
AddGadgetItem(2, -1, "aaaaaaaaaaaaaaaabbbbbbbccc")
Next
SetGadgetState(2, 0)
SetGadgetText(1, "abcdefg")
SetActiveGadget(1)
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf