Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax Highlightning in tuiTextBox
#9
Oh, just realized that you cannot easily parse the data yet.
It will work like this, but TUIA_DISPATCHEVENTCB is still missing:
[ab3]myDispatchEvent:
Function.l myDispatchEvent{*obj.tuiObject,*ev.tuiEvent}

*listView.tuiListView = (.tuiListView)*obj ; make sure this cast is legal
ntui_GetEventAttr{*ev,#TUIEVA_ID,&id.l} ; get the id of the event

Select id
Case #TUILVEV_APPEND ; its an APPEND event sent from the FileListener
ntui_GetEventAttr{*ev,#TUIEVA_STRING,&*strP.b} ; get the string
If *strP Then string.s = Peek.s(*strP) ; copy it to a Blitz Stromg
; ... manipulate string.s
ntui_AddListItem{*listView,-1,string,0,Null,#TUI_NOFLAGS} ; and append it to the ListView
Function Return True ; tell NTUI we are done with this event, no further processing

End Select

Function Return _ntui_DispatchListViewEvent{*listView,*ev} ; all other events go to the regular dispatcher for ListView
End Function
!_MakeGlobalFuncPointer{myDispatchEvent,{Null,Null}}

...
ntui_SetAttr{*listView,#TUIA_DISPATCHEVENTCB,*myDispatchEvent} ; attach the callback function to the listview
...[/ab3]


I know that you are calling a private function at this point. This is why I want to make some more changes to the OOP model of NTUI, that should allow subclassing in a better and more flexible way. So this might change slightly in the future.
Zitieren


Nachrichten in diesem Thema

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste