On Sun, Jan 11, 2009 at 5:58 AM, Éjjeli Őrjárat <ejjeliorja...@gmail.com> wrote:
> Hi!
> My previous e-mail went to a wrong topic, sorry. again:
> I have a little problem.. My application loads the GUI from the xrc file
> generated by DialogBlocks. I am using wxGrid-s, which are work very well -
> except I can't re-size them. Once I called grid:CreateGrid(rows,cols), I
> can't use this call again (I can, but no result). I tried
> grid:ClearGrid(), grid:Refresh(), but no result..

You need to send a wxGridTableMessage to the wxGrid to notify it that
changes have been made.

Search for wxGridStringTable::InsertRows(...) and see the code where
it creates a new wxGridTableMessage to send to the wxGrid. You need to
duplicate this.
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/src/generic/grid.cpp?view=markup

See also "class WXDLLIMPEXP_ADV wxGridTableMessage" here. There isn't
much documentation for this, but you can figure it out from the
wxGridStringTable::Insert/Append/Delete/Rows/Cols() functions above.
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/include/wx/generic/grid.h?view=markup

In the past I have written a function called UpdateGrid() (don't know
where it is anymore) that gets the current number of rows/cols from
the wxGrid and the number of rows/cols from my wxGridTable and sends
the wxGridTableMessages as appropriate. Once you have this function
you can adjust your wxGridTable as you like and then call the
UpdateGrid() function to sync the wxGrid to the table. I recommend
this method as opposed to duplicating the separate
Insert/AppendDelete/Rows/Cols functions.

> I have a report now too: seems wxGrid doesn't check the row and the column
> in SetCellValue(), because when I used that with negative rows, it throw me
> an unhandled exception window (well, now I have more unhandled exception
> related to wxGrid, but I haven't found out, what caused that till now...).
> The first problem has been 'patched' now: I know how many columns I want to
> add, so I check it:
> if grid:GetNumberRows() < iRows then
> grid:AppendRows(grid:GetNumberRows()-1,iRows-grid:GetNumberRows()) end
> But I think there must be a more elegant solution :)

Unfortunately not, there are checks in the wxWidgets C++ code that
will assert rather than cause an exception in the debug compiled
version of wxWidgets. Perhaps I should release a binary build of wxLua
compiled with the debug settings? I would rather not have to add
checks for proper values to the inputs of the wxWidgets functions
since there will be need to be thousands of them and that would really
bloat wxLua.

> ---
>
> Another problem that I have to print with my application. But the firm I
> write this app, use an old matrix printer, which prints to 'pull-out' (or
> fanfold? web-tranlslation, I hope it's correct. Here is a page about it:
> http://shop.unas.hu/shop_ordered/5207/shop_pic/termek_820145.jpg) paper. The
> samples I found can print pictures, and everything else, but I need just
> charaters, because the old program used just simple characters to draw a
> table. (But that used a .prn file too... :-/). So, I want to print just
> characters, and make some text's font bold and maybe bigger on it, that's
> all.

Printing in wxWidgets is done by using a wxPrinterDC that is created
by the printing framework itself. I assume you've looked at the
printing.wx.lua sample. You need to replace the function
DisplayFigure() with your own drawing code. You will need to use
wxC::DrawText(), wxDC::GetTextExtent() and friends along with all the
PPI and page size info used in the function printOut:OnPrintPage() in
printing.wx.lua.

You may also want to look into wxHTMLEasyPrinting, which will be able
do the layout for you, but I have never used it very seriously.

Regards,
    John
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to