Search found 29 matches

by DerKleineNik
Tue Oct 25, 2011 5:50 am
Forum: C++ Development
Topic: wxMemoryDC and text drawing - color problem
Replies: 2
Views: 1055

Re: wxMemoryDC and text drawing - color problem

Is it a monochrome picture? if yes see http://docs.wxwidgets.org/stable/wx_wxmemorydc.html
If not try to set Background colour of the text and the pen using dc. SetTextBackgroud(wxBLACK) and dc.SetPen(wxBLACK_PEN)
by DerKleineNik
Tue Oct 25, 2011 5:42 am
Forum: C++ Development
Topic: Resizing
Replies: 2
Views: 645

Re: Resizing

You can create the coordinates related to the actual size of the panel/frame. You can easily get the size of the panel/frame by using GetClientSize in the panel/frame for example: void PanelXY :: OnSize(wxSizeEvent& event) { int *width, *height; this.GetClientSize(width, height); wxClientDC mydc(thi...
by DerKleineNik
Fri Oct 21, 2011 11:41 am
Forum: C++ Development
Topic: OnPaint
Replies: 12
Views: 2380

Re: OnPaint

Am I right that you want the Grid to be drawn an handled in Window 1 and then being transferred to Window 2 to be drawn there exactly like in Window 1 specified? If thats right you should create a storing class to store alle the information needed to draw the grid in the first window, store the info...
by DerKleineNik
Fri Oct 21, 2011 11:24 am
Forum: C++ Development
Topic: OnPaint Panel
Replies: 3
Views: 571

Re: OnPaint Panel

Exactly the same way as on a Frame

You create a OnPaint(wxPaintEvent &event) in your Class, that is derived from wxPanel and connect this OnPaint method with the OnPaint event like this:

Code: Select all

this->Connect( wxEVT_PAINT, wxPaintEventHandler( PanelXY::OnPaint ), NULL, this );
by DerKleineNik
Fri Oct 21, 2011 6:10 am
Forum: C++ Development
Topic: OnPaint
Replies: 12
Views: 2380

Re: OnPaint

Hello, you can do the same stuff in a wxPanel too. In a wxPanel you also can define a OnPaint event handler and do drawing stuff there. If you want to do the drawing stuff in an exterior class you can work there with an instance of wxClientDC to draw. Therefore you need an instance of the wxFrame or...
by DerKleineNik
Thu Oct 20, 2011 6:19 am
Forum: C++ Development
Topic: OnPaint
Replies: 12
Views: 2380

Re: OnPaint

Hello, you can do this by using "DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)", a member of Class wxDC. In your OnPaint you must create an object of type wxPaintDC, as you may know, and then you just set the Brush of this wxPaintDC: void Panel_XY::OnPaint(wxPaintEvent& event) {...
by DerKleineNik
Wed Oct 12, 2011 6:17 am
Forum: wxCode
Topic: Bugfix wxPdfDC
Replies: 6
Views: 2550

Re: Bugfix wxPdfDC

Okay,
I just wanted to tell you what I found and how it possibly can be fixed.
This was just my quick and dirty fixes to make it work as i needed it.
I guess for other applikations this would not work maybe.
Thanks for your efforts!
by DerKleineNik
Tue Oct 11, 2011 7:56 am
Forum: wxCode
Topic: Bugfix wxPdfDC
Replies: 6
Views: 2550

Re: Bugfix wxPdfDC

Posting some Code would cause this Forum to explode as there are hundreds of lines drawn in different subclasses. This problem occurs when i have a finishing angle of 270° (-90°). In the method there is calculated drawed angle = finish angle - starting angle. If its calculated with -90° and you have...
by DerKleineNik
Mon Oct 10, 2011 9:30 am
Forum: wxCode
Topic: Bugfix wxPdfDC
Replies: 6
Views: 2550

Re: Bugfix wxPdfDC

Hello,

with this bugfix the problem with the Sector is solved (now draws just the arc) but the other problem with the angles still exists.
by DerKleineNik
Wed Sep 21, 2011 8:04 am
Forum: wxCode
Topic: Bugfix wxPdfDC
Replies: 6
Views: 2550

Bugfix wxPdfDC

Hey, by painting with wxPdfDC I found two little bugs: if I want to draw an arc, it draws a sector instead (solved by changing line 631 in pdfDC28 to m_pdfDocument->Ellipse(xxc,yyc,r,0,0,start,end,style,8,false) ) The other bug is that if I want to draw an arc with an ending angle of 270° (-90) it d...
by DerKleineNik
Thu Sep 15, 2011 12:04 pm
Forum: wxCode
Topic: OpenGL in wxPdfDocument
Replies: 3
Views: 1902

Re: OpenGL in wxPdfDocument

Thanks for the hints! It worked like this: here goes the GL drawing SwapBuffers(); if(DoPrint) { glReadBuffer(GL_BACK); glFinish(); glPixelStorei(GL_PACK_ALIGNMENT, 3); glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_ROWS, 0); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); unsigned char * g...
by DerKleineNik
Tue Sep 13, 2011 7:27 am
Forum: wxCode
Topic: OpenGL in wxPdfDocument
Replies: 3
Views: 1902

OpenGL in wxPdfDocument

I managed using the wxPdfDocument using the wxPdfDC and normal GDI commands.
But in my actual Project there are some OpenGL Graphics too.
Is it possible to print some GLCanvas to the PDF using wxPdfDocument?

Regards, DerKleineNik
by DerKleineNik
Sat Sep 10, 2011 10:05 am
Forum: wxCode
Topic: wxPDFDocument compiling
Replies: 3
Views: 1976

Re: wxPDFDocument compiling

Thanks for your reply!
I also had the idea with the typecast but the advisor in my project didn't want to start with such "hacking" in external sourcecode.
Well if should need the newer version i know now how to fix it.
Tank you very much!
by DerKleineNik
Fri Sep 09, 2011 12:24 pm
Forum: wxCode
Topic: wxPDFDocument compiling
Replies: 3
Views: 1976

wxPDFDocument compiling

First the environment: MinGW, wxWidgets-2.8.11, wxPDFDocument 0.9.2, Codelite v 3.0.5041 I'm trying to install(compile) the wxPDFDocument by using the makefile.gcc but i get the following error: C:\Programme\wxPDFDocument\build>mingw32-make -f makefile.gcc if not exist ..\lib\gcc_dll mkdir ..\lib\gc...