Hello Guest it is April 25, 2024, 05:38:13 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DBK

Pages: 1
1
Mach4 General Discussion / wxLua and wxWidgets questions
« on: November 29, 2017, 06:11:03 PM »
Hello everyone,

I'm developing a Mach4 Wizzard and am having a problem with grid blocks, specifically wxGridCellCoordsArray's returned by wxWidgets.  I believe it is a result of a bug in a wxLua wrapper for wxWidgets.

A couple questions:
  • The mailing list activity on wxLua's site has slowed to a crawl.  Is wxLua still in development?
  • This one is a longshot... Has anybody tried processing multiple block-selections on a grid?  See the attachment for an example. Sample code is attached as well - to show syntax highlighting.
  • Finally, does anybody know how to recompile wxLua with wxWidgets 3.01? Or at least how easy or hard it might be?  Mach4 obviously has it done.  I am developing on another machine without Mach4 installed and am using the Windows install of wxLua to develop with. The latest version from their web-page is compiled with 2.8.12.
Text version here:
Code: [Select]
    local wxGridCellCoordsArray BTL = (grid:GetSelectionBlockTopLeft())   
    local wxGridCellCoordsArray BBR = (grid:GetSelectionBlockBottomRight())   
   
    print("BTL=",BTL)
    print("BTL Count="..BTL:GetCount(), "BBR Count="..BBR:GetCount()) --These print to an output window in wxLuaEdtor
 grid.SetCellValue(grid,2,0,"Ct="..BTL:GetCount()) --print doesn't show in mcLua, so I put it on the grid.
            --correctly displays the number of blocks selected in the grid

    local wxGridCellCoords topleft = (BTL:Item(1)) --this line blows up mcLua and wxLuaEditor
    row = topleft:GetRow()
    col = topleft:GetCol()
    print("topleft=", topleft)
    print("Row="..row,"Col="..col)

The two calls to GetSelectionBlock... work fine as a subsequent call to GetCount on each returns the correct value.
The call to Item(1) should return the first block’s row/col pair, but no matter how I try I can’t get it to return good values. I had some erroneous values at one time, but it wasn’t crashing the editor.
I have no expectation that anybody must troubleshoot this, but if some curious soul would like a try at it, I have included the code.  Just put it in a menu or button event, of course.

Thanks,    David

Pages: 1