John Labenski <jlaben...@...> writes:

> 
> On Thu, Feb 19, 2009 at 10:15 AM, Andre Arpin <ar...@...> wrote:
> > John Labenski <jlaben...@...> writes:
> >
> 
> The C++ function has this signature:
> wxStyledTextCtrl::SetMarginMask(int margin, int mask)
> 
> Even if wxLua handed it with an unsigned int it would be turned right
> back into -33554432 inside the wxStyledTextCtrl function. I see that
> editor.wx.lua makes a call to SetMarginMask(2,
> wxstc.wxSTC_MASK_FOLDERS) and it works fine since if you type "do \n
> end" into wxlua.exe, Scintilla draws the code folding icons.
> 
> So just to be sure, what is the problem? Do you not see the code folding 
icons?
> 

Not it does not, it sets it to 0x80000000 which is the folder icon ONLY.
It should be set 0xfe000000 so the other icons will also be set.

The icon folder will display because it is controlled by the top bit the other 
icon will not be displayed.

try

    editor:MarkerDefine(wxstc.wxSTC_MARKNUM_FOLDEROPENMID, 
wxstc.wxSTC_MARK_CIRCLEMINUSCONNECTED, wx.wxBLUE, wx.wxRED)

This should give you a Blue Circle with a Red + for sub folder but it will not 
display.

Use editor:SetMarginMask(2, -1)

You will see that it should work.

---------------------------------
The following code will also work and is somewhat simpler


static int LUACALL wxLua_wxStyledTextCtrl_SetMarginMask(lua_State *L)
{
    double doubleMask = wxlua_getnumbertype(L, 3);
        int mask = (doubleMask > INT_MAX) ? (int)(doubleMask + INT_MIN)| 
INT_MIN : (int)doubleMask;

---------------

I expected that (int)((unsigned int)doubleMask) would work but it does not
((unsigned int)doubleMask) is 0x8000000 I whould have expected 0xfe000000 
since 
unsigned int xxx = 0xfe000000; sets xxx to 0xfe000000
all rather mysterious.

Andre


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to