The combobox detection and change (The #CBN_SELCHANGE section) works fine as it should. Master srod designed it:):)
I've added the stringgadget and it sort of works. The #EN_CHANGE is being detected and the stringbox activated but it closes immediately after one character.
I suspect this is because I don't understand what (wParam >> 16) & $ffff does and I have the #EN_CHANGE in the wrong place but I frankly (even Georgely!!) don't understand this bit of code so cannot fix it.
Anyone have any ideas please?
Code: Select all
Procedure.l ListIconECallBack(hWnd, uMsg, wParam, lParam)  ; The following callback allows a listicon control to be subclassed.
  Protected Result
  Select uMsg
    Case #WM_COMMAND                ; This is how the CBN_SELCHANGE message is sent.
      Select (wParam >> 16) & $ffff ; This contains the notification code.
        ;-----------------------------------------------------------------
        Case #CBN_SELCHANGE
          MapItem.l = GetGadgetState(#Gadget_exportaddress_mapbox)
          NewText.s = GetGadgetItemText(#Gadget_exportaddress_mapbox, MapItem.l, 0)
          SetGadgetItemText(#Gadget_exportaddress_tables, GetGadgetState(#Gadget_exportaddress_tables), NewText, 1)
          If Newtext.s <> "-Empty-"
            SetGadgetItemText(#Gadget_exportaddress_tables, GetGadgetState(#Gadget_exportaddress_tables), Str(MapItem.l + 1), 2)
          EndIf
          HideGadget(#Gadget_exportaddress_mapbox, 1)
          ;---------------------------------------------------------------
        Case #EN_CHANGE
          NewText.s = GetGadgetText(#Gadget_exportaddress_stringbox)       ; Get the text from the string box
          SetGadgetItemText(#Gadget_exportaddress_tables, GetGadgetState(#Gadget_exportaddress_tables), NewText, 0)
          HideGadget(#Gadget_exportaddress_stringbox, 1)                   ; Hide the gadget again
          ;---------------------------------------------------------------
      EndSelect
  EndSelect
  Result = CallWindowProc_(OldListEProc, hWnd, uMsg, wParam, lParam)
  ProcedureReturn Result
EndProcedure



 
 

 
  This one can also be done without a callback due to the fact that, unlike the CalendarGadget, the DateGadget sends a #PB_EventGadget when a change occurs. Just adjust the mask$ to remove the time if it's not needed.
 This one can also be done without a callback due to the fact that, unlike the CalendarGadget, the DateGadget sends a #PB_EventGadget when a change occurs. Just adjust the mask$ to remove the time if it's not needed.