Posted: Mon Dec 30, 2002 11:40 am
Restored from previous forum. Originally posted by Max..
-
Update:
Changed topic so it's more descriptive.
At the moment I'm messing with MultiLine StringGadgets, trying to catch the Return. Wish me luck.
-
I'm trying to "fake" an editeable ListIconGadget at the moment. You click on the Item in the Gadget, a StringGadget appears and the entered text should be used to update the column.
I'm facing the problem now that I cannot get an event, when the Enter-Key is pressed in the StringGadget.
I tried this:
both in the main loop as in the callback (as can be seen in the example below).
Help...
-
Update:
Changed topic so it's more descriptive.
At the moment I'm messing with MultiLine StringGadgets, trying to catch the Return. Wish me luck.
-
I'm trying to "fake" an editeable ListIconGadget at the moment. You click on the Item in the Gadget, a StringGadget appears and the entered text should be used to update the column.
I'm facing the problem now that I cannot get an event, when the Enter-Key is pressed in the StringGadget.
I tried this:
Code: Select all
Select EventGadgetID()
Case #NoteInput
Select EventwParam()
Case 13
CallDebugger
EndSelect
EndSelect
Help...
Code: Select all
#Window1 = 0
#Window2 = 1
#W2LstIcon1 = 0
#NoteInput=1
#Window1Flags = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget
#Window2Flags = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget
#W2LstIcon1Flags = #PB_ListIcon_CheckBoxes | #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_HeaderDragDrop
Procedure ShowWindow2()
If OpenWindow( #Window2, 0,0,390,313, #Window2Flags,"Window 2")
If CreateGadgetList(WindowID(#Window2))
ListIconGadget (#W2LstIcon1,10,7 ,WindowWidth()-20,WindowHeight()-29,"",20,#W2LstIcon1Flags)
AddGadgetColumn(#W2LstIcon1, 1, "X", 30)
AddGadgetColumn(#W2LstIcon1, 2, "Y", 30)
AddGadgetColumn(#W2LstIcon1, 3, "Notiz", 300)
EndIf
EndIf
EndProcedure
Procedure myCallback(WindowID, Message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
Select Message
Case #WM_LBUTTONDOWN
AddGadgetItem(#W2LstIcon1,-1,""+Chr(10)+Str(WindowMouseX())+Chr(10)+Str(WindowMouseY()))
Case #WM_CHAR
Select EventGadgetID()
Case #NoteInput
Select EventwParam()
Case 13
CallDebugger
EndSelect
EndSelect
Default
EndSelect
ProcedureReturn Result
EndProcedure
If OpenWindow(#Window1, 100, 100, 400,400,#Window1Flags ,"Window1")
ShowWindow2()
UseWindow(#Window1)
SetWindowCallback(@myCallback())
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_EventGadget
Select EventGadgetID()
Case #W2LstIcon1
Select EventType()
Case #PB_EventType_LeftClick
DisableGadget(#W2LstIcon1,1)
UseGadgetList(WindowID(#Window2))
StringGadget(#NoteInput,250,200,100,20,"")
EndSelect
Case #NoteInput
EndSelect
EndIf
Until EventID = #PB_EventCloseWindow
EndIf