SourceForge logo
SourceForge logo
Menu

wxlua-users

From: É. Ő. <ejj...@gm...> - 2009年01月11日 10:58:22
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..
The second SetGridCursor problem has been solved, I used that from an
another event, wx.wxEVT_KEY_UP.
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 :)
---
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.
I hope somebody can help me in this.
Best regards: Attila
From: John L. <jla...@gm...> - 2009年01月12日 20:39:45
On Sun, Jan 11, 2009 at 5:58 AM, Éjjeli Őrjárat <ejj...@gm...> 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
From: Éjjeli Ő. <ejj...@gm...> - 2009年01月22日 16:54:15
My problem has been partially solved - wxHtmlEasyPrint works perfect. I have
to print checks and bills, html format is the best solution, easy to
generate it form grid cells. But after the preview, when I exit from the
application, it shown MS's error reporter window, so my app detected a
problem, please inform MS about it... It happened after I added these few
lines:
local hep = wx.wxHtmlEasyPrinting("Nyomtatás",MyApp)
local prnSetup = hep:GetPageSetupData()
local prnData = prnSetup:GetPrintData()
prnData:SetNoCopies(iOldalak) -- I want to set here how many pages to print.
local tMinoseg =
{wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
prnData:SetQuality(tMinoseg[tSettings["minoseg"]])
prnSetup:SetPrintData(prnData)
hep:PreviewText(sHTML)
After I close the preview window, seems everything is ok, but the error
comes after I shotdown the whole application...
By the way, is there any way to translate the preview dialog? The buttons
aren't translated. Same with DatePickerCtrl, even if I used
os.setlocale("","time")
Thanks in advance:
Attila
From: Éjjeli Ő. <ejj...@gm...> - 2009年01月26日 17:16:07
Sorry for writing again, I don't want to hurry anybody, but my application
is almost ready, and I was unable to fix this error. Any ideas?
From: John L. <jla...@gm...> - 2009年01月27日 04:25:16
On Thu, Jan 22, 2009 at 11:54 AM, Éjjeli Őrjárat
<ejj...@gm...> wrote:
> My problem has been partially solved - wxHtmlEasyPrint works perfect. I have
> to print checks and bills, html format is the best solution, easy to
> generate it form grid cells. But after the preview, when I exit from the
> application, it shown MS's error reporter window, so my app detected a
> problem, please inform MS about it... It happened after I added these few
> lines:
>
> local hep = wx.wxHtmlEasyPrinting("Nyomtatás",MyApp)
>
> local prnSetup = hep:GetPageSetupData()
> local prnData = prnSetup:GetPrintData()
> prnData:SetNoCopies(iOldalak) -- I want to set here how many pages to print.
> local tMinoseg =
> {wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
> prnData:SetQuality(tMinoseg[tSettings["minoseg"]])
> prnSetup:SetPrintData(prnData)
>
> hep:PreviewText(sHTML)
>
> After I close the preview window, seems everything is ok, but the error
> comes after I shotdown the whole application...
Can you post the simplest, runnable, code possible that demonstrates
this to help me debug it? The one thing to be careful about is making
sure that you don't use the local keyword for something that you need
to exist beyond the function it was created in.
> By the way, is there any way to translate the preview dialog? The buttons
> aren't translated. Same with DatePickerCtrl, even if I used
> os.setlocale("","time")
I do not know much about internationalization, but this may help.
http://docs.wxwidgets.org/stable/wx_internationalization.html#internationalization
Regards,
 John
From: Éjjeli Ő. <ejj...@gm...> - 2009年01月30日 15:16:16
Thanks for the reply, here is a code which demonstrate the error:
require "wx"
myApp = wx.wxFrame(wx.NULL,-1,"Testing
HtmlEasyPrinting",wx.wxDefaultPosition,wx.wxSize(200,100))
btn = wx.wxButton(myApp,-1,"Press me")
btn:Connect(wx.wxEVT_COMMAND_BUTTON_CLICKED,function(event)
 sHTML = [[<html><body>Please close this preview. After you closed, and you
want to exit from the application, it will throw an error.</body></html>]]
 hep = wx.wxHtmlEasyPrinting("My print's preview",myApp)
 hep:SetHeader("@PAGENUM@/@PAGESCNT@. page")
 prnSetup = hep:GetPageSetupData()
 prnData = prnSetup:GetPrintData()
 prnData:SetNoCopies(3)
 tMinoseg =
{wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
 prnData:SetQuality(2)
 prnSetup:SetMarginTopLeft(wx.wxPoint(12,12))
 prnSetup:SetPrintData(prnData)
 hep:PreviewText(sHTML)
end)
myApp:Connect(wx.wxEVT_CLOSE_WINDOW,
function(event)
 myApp:Destroy()
 wx.wxExit(0)
 event:Skip()
end)
myApp:Centre()
myApp:Show(true)
wx.wxGetApp():MainLoop()
Hope this helps (I made everything global, so this can't be the problem)
From: Éjjeli Ő. <ejj...@gm...> - 2009年02月01日 10:21:53
I found the problem now, and fixed it:
hep = wx.wxHtmlEasyPrinting("My print's preview",myApp)
 hep:SetHeader("@PAGENUM@/@PAGESCNT@. page")
 prnSetup = hep:GetPageSetupData()
 prnData = hep:GetPrintData()
 prnData:SetNoCopies(3)
 tMinoseg =
{wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
 prnData:SetQuality(2)
 prnSetup:SetMarginTopLeft(wx.wxPoint(12,12))
This works as it excepted, everything is OK now, no crash :-)
From: John L. <jla...@gm...> - 2009年02月03日 03:43:43
I found another "fix" too.
Do NOT ever use "wx.wxExit(0)" to close wxWidgets apps. There are a
lot of things going on behind the scenes for GUI apps and you should
call wxFrame::Destroy() if you want to close the app nicely, see also
wxApp::ExitMainLoop(). In fact, your event handler for
wx.wxEVT_CLOSE_WINDOW does nothing useful and you should remove it.
Regards,
 John
On Sun, Feb 1, 2009 at 5:21 AM, Éjjeli Őrjárat <ejj...@gm...> wrote:
> I found the problem now, and fixed it:
>
> hep = wx.wxHtmlEasyPrinting("My print's preview",myApp)
> hep:SetHeader("@PAGENUM@/@PAGESCNT@. page")
> prnSetup = hep:GetPageSetupData()
> prnData = hep:GetPrintData()
> prnData:SetNoCopies(3)
>
> tMinoseg =
> {wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
> prnData:SetQuality(2)
> prnSetup:SetMarginTopLeft(wx.wxPoint(12,12))
>
> This works as it excepted, everything is OK now, no crash :-)
>
>
> ------------------------------------------------------------------------------
> 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
> wxl...@li...
> https://lists.sourceforge.net/lists/listinfo/wxlua-users
>
>
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /