I found some code for editable spingadgets that worked fine. Then I put it in a DLL and including the spingadget source causes a 'userlib not found' error. Makes no sense.
Is there any easier way to make a spingadget where the value can be edited in text? This seems really ridiculous for such a simple task to be so complicated. Why doesn't PB just do this autmatically?!
Editable SpinGadgets
Okay, it can be boiled down to this. Fortunately, I can do without it, but the catch is that you CANNOT use this with a window callback function!!!
Code: Select all
Select WaitWindowEvent()
Case #PB_Event_Gadget
PROPERTIESCHANGED=1
;MessageRequester("","HI",0)
If EventGadgetID()=GADGET0
a$=GetGadgetText(GADGET0)
a=Val(a$)
b=GetGadgetState(GADGET0)
If b<>a Or a$<>Str(a)
If EventType()=#PB_EventType_Change Or EventType()=#PB_EventType_Focus Or EventType()=#PB_EventType_ReturnKey
SetGadgetState(GADGET0,a)
If Str(a)<>a$
SetGadgetText(GADGET0,Str(a))
SendMessage_(GadgetID(GADGET0),#em_setsel,0,-1)
EndIf
Else
SetGadgetText(GADGET0,Str(b))
SetGadgetState(GADGET0,b)
EndIf
EndIf
EndIf
; Default
; MessageRequester("",Str(EventID),0)
EndSelect
