Flype wrote:hello, found a strange bug, not easy to isolate :
Strange indeed.
Some facts :
- If you replace 'InputRequester("","",GetGadgetItemText(0,Position,3))' by 'MessageRequester("", GetGadgetItemText(0,Position,3))', there is no bug.
Code: Select all
; bug
InputRequester("","",GetGadgetItemText(0,Position,3))
Code: Select all
; no bug !
MessageRequester("", GetGadgetItemText(0,Position,3))
Code: Select all
; no bug !!
InputRequester("","",GetGadgetItemText(0,Position,3))
MessageRequester("", GetGadgetItemText(0,Position,3))
- If I remove the window subclassing, no bug.
=> It is because of the window subclassing, but why ? And why only the InputRequester ??
It seems to be a Purebasic bug !
I can reproduce it
without my lib but with subclassing :
Code: Select all
Procedure.s GetGadgetClass(hGadget.l)
Protected Class.s
Class = Space(255)
GetClassName_(hGadget, @Class, 254)
ProcedureReturn Class
EndProcedure
Procedure.l myCallback(WindowID, message, wParam, lParam)
Shared OldCallback
Result = CallWindowProc_(OldCallback, WindowID, message, wParam, lParam)
b$ = GetGadgetClass(WindowID)
ProcedureReturn Result
EndProcedure
If OpenWindow(0,0,0,640,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Bug()")
If CreateGadgetList(WindowID())
ListIconGadget(0,5,5,630,470,"A",120,#PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines)
AddGadgetColumn(0,1,"B",120)
AddGadgetColumn(0,2,"C",120)
AddGadgetColumn(0,3,"D",120)
For i=0 To 40
AddGadgetItem(0,i,"A"+Str(i)+#LF$+"B"+Str(i)+#LF$+"C"+Str(i)+#LF$+"D"+Str(i))
Next
EndIf
OldCallback = SetWindowLong_(WindowID(0), #GWL_WNDPROC, @myCallback())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadgetID()
Case 0
Select EventType()
Case #PB_EventType_LeftDoubleClick
Position = GetGadgetState(0)
If Position <> -1
InputRequester("","",GetGadgetItemText(0,Position,3)) ; <=== the bug : displays the window class !!!!
EndIf
EndSelect
EndSelect
EndSelect
ForEver
EndIf
Is it a bug or is there some error in the above code ?
Flype wrote:And by the way, do you think it is possible to implement a new parameter to change the font format of a specific cell ? It could be usefull...
It could be usefull, yes... Will see ...