|
From: Andre <ar...@ki...> - 2007-01-01 13:16:06
|
Scintilla expect string for some of its messages this list may not be complete but since the code is emitted it is not important. SCI_SETTEXT SCI_COPYTEXT SCI_REPLACESEL SCI_REPLACETARGET SCI_REPLACETARGETRE SCI_SEARCHINTARGET SCI_ADDTEXT SCI_ADDSTYLEDTEXT SCI_INSERTTEXT SCI_APPENDTEXT SCI_SETWORDCHARS SCI_SETSTYLINGEX SCI_TEXTWIDTH SCI_MARKERDEFINEPIXMAP SCI_STYLESETFONT a change has to be made in wxLua_wxStyledTextCtrl_SendMsg in stc.cpp which is emitted by genwxbind.lua. also: in NotifyMacroRecord in editor.cxx SCI_REPLACESEL sends a pointer instead of the string. In all cases a single character is being transferred but it is stored in a string. I am not familiar enough with the code to propose a change so I will change the code locally an let others do the actual modification. Thank you Andre |
|
From: Andre <ar...@ki...> - 2007-01-02 13:20:15
|
Andre <arpin@...> writes: > in NotifyMacroRecord in editor.cxx > SCI_REPLACESEL sends a pointer instead of the string. > In all cases a single character is being transferred but it is stored in a > string. > I am not familiar enough with the code to propose a change so I will change > the code locally an let others do the actual modification. > > Thank you > > Andre > I have made the change in editor.cxx and got record macro to work but obviously the change will have to be made somewhere in wxlua. The value return is always a single character never a string. I took advantage of this for testing. I do not think that any of the other notifications return characters or strings. Andre |
|
From: John L. <jla...@gm...> - 2007-01-04 19:40:37
|
On 1/1/07, Andre <ar...@ki...> wrote: > > Scintilla expect string for some of its messages this list may not be > complete but since the code is emitted it is not important. > SCI_SETTEXT > SCI_COPYTEXT > SCI_REPLACESEL > SCI_REPLACETARGET > SCI_REPLACETARGETRE > SCI_SEARCHINTARGET > SCI_ADDTEXT > SCI_ADDSTYLEDTEXT > SCI_INSERTTEXT > SCI_APPENDTEXT > SCI_SETWORDCHARS > SCI_SETSTYLINGEX > SCI_TEXTWIDTH > SCI_MARKERDEFINEPIXMAP > SCI_STYLESETFONT > > a change has to be made in wxLua_wxStyledTextCtrl_SendMsg in stc.cpp which is > emitted by genwxbind.lua. I think all of these have an equivalent function which would be more appropriate to use. Is there one of these that does not have a function to go with it? SendMsg is very low level and I have never needed it. eg. SCI_APPENDTEXT == AppendText(string) > also: > in NotifyMacroRecord in editor.cxx > SCI_REPLACESEL sends a pointer instead of the string. > In all cases a single character is being transferred but it is stored in a > string. > I am not familiar enough with the code to propose a change so I will change > the code locally an let others do the actual modification. Again, just use the function wxStyledTextCtrl::ReplaceSelection(string). the documentation for the wxStyledTextCtrl can be viewed here. http://www.yellowbrain.com/stc/index.html Regards, John Labenski |
|
From: Andre <ar...@ki...> - 2007-01-05 11:06:15
|
John Labenski <jlabenski@...> writes: > > in NotifyMacroRecord in editor.cxx > > SCI_REPLACESEL sends a pointer instead of the string. > > In all cases a single character is being transferred but it is stored in a > > string. > > I am not familiar enough with the code to propose a change so I will change > > the code locally an let others do the actual modification. > > Again, just use the function wxStyledTextCtrl::ReplaceSelection(string). > > the documentation for the wxStyledTextCtrl can be viewed here. > http://www.yellowbrain.com/stc/index.html > > Regards, > John Labenski > In the case of the SCI_REPLACESEL notification I have no choice I am on the receiving end. The other one would be nice to fix but I have no problem coding around them. Andre |
|
From: Andre <ar...@ki...> - 2007-01-05 13:28:19
|
Maybe I should be clearer.
this is the code:
editor:StartRecord()
frame:Connect(wx.wxID_ANY, wx.wxEVT_STC_MACRORECORD,
function (event)
table.insert(recorded, {event.Message, event.WParam, event.LParam})
end)
the problem is that for the SCI_REPLACESEL notification scintilla send a
character back, but the event contains the pointer to the character instead of
the pointer.
I could see in the code where this could be changed but the character must be
transformed into a LUA string I could not figure out how to do this.
So I change Scintilla to send back a the value instead of the pointer and got
the code working. But this not a reasonnable solution.
Hope this help
Andre
|