Search found 21 matches

by freshairfly
Sun May 06, 2012 9:23 am
Forum: C++ Development
Topic: Why the image is not the exactly same?
Replies: 7
Views: 1447

Re: Why the image is not the exactly same?

I would also like to see the DoPaint() code. Are you redrawing the image from scratch but on a bitmap? Are you "bit blitting" the image from a screen DC? Have you freed the bitmap from the memory DC before saving? I am not an expert on graphics but as long as the bitmap is owned by the DC, the cont...
by freshairfly
Sun May 06, 2012 9:21 am
Forum: C++ Development
Topic: Why the image is not the exactly same?
Replies: 7
Views: 1447

Re: Why the image is not the exactly same?

Very strange. dc.SetBackground(wxBrush(*wxWHITE, wxSOLID)); dc.Clear(); Try explicitly drawing a white rectangle here. It doesn't work too. :( wxRect rect = GetClientRect(); wxBitmap bitmap(rect.width, rect.height); As a workaround you could try creating a bitmap with 24 bit depth here, then you sh...
by freshairfly
Sat May 05, 2012 12:55 am
Forum: C++ Development
Topic: Why the image is not the exactly same?
Replies: 7
Views: 1447

Re: Why the image is not the exactly same?

By the way, 1) if I save the image to bmp or jpeg (wxBITMAP_TYPE_BMP and wxBITMAP_TYPE_PNG) format, it works well. 2) if I don't use wxGCDC, no problem when saving to png file #if 0//wxUSE_GRAPHICS_CONTEXT wxGCDC gdc(mdc); wxDC& dc = gdc; #else wxDC& dc = mdc; #endif 3) I run the drawing sample proj...
by freshairfly
Sat May 05, 2012 12:47 am
Forum: C++ Development
Topic: Why the image is not the exactly same?
Replies: 7
Views: 1447

Re: Why the image is not the exactly same?

The code in DoPaint() would be more interesting. I guess you're not always setting Pen/Brush and just rely on some default values. Hi doublemax, Thanks for your reply. I checked the code in the DoPaint(), and it looks like: dc.SetPen(DrawingUtil::GetGradualColour(datasets[i]->GetColour(), 0.90)); d...
by freshairfly
Fri May 04, 2012 4:01 pm
Forum: C++ Development
Topic: Why the image is not the exactly same?
Replies: 7
Views: 1447

Why the image is not the exactly same?

Hi guys, I wrote a plot coponent, which draws a bar chart. It works well (see the screenshot). https://dl.dropbox.com/u/60152607/screenshot.png And the code looks like this: void Plot::OnPaint(wxPaintEvent& /*event*/) { wxAutoBufferedPaintDC adc(this); #if wxUSE_GRAPHICS_CONTEXT wxGCDC gdc(adc); wxD...
by freshairfly
Fri Jan 06, 2012 12:59 am
Forum: C++ Development
Topic: How to change wxFilePickerCtrl's label ?
Replies: 4
Views: 1315

Re: How to change wxFilePickerCtrl's label ?

I agree with doublemax. I don't segguest you change the label too. But on windows OS, maybe you could try the following code to change the label. :D :D savePathPicker = new wxDirPickerCtrl(this, ID_AutoSavePath, wxEmptyString, _("Select a Folder")); wxWindow* btnBrowse = FindWindowByLabel(wxT("Brows...
by freshairfly
Wed Feb 03, 2010 4:14 am
Forum: C++ Development
Topic: How to send a email via wxSMTP?
Replies: 1
Views: 554

Because the most of current SMTP server need authentication (ESMTP) and the wxSMTP only support SMTP, it will send email failed.
You could enhance the wxSMTP code, make it support authentication.
by freshairfly
Sat Nov 07, 2009 1:25 pm
Forum: C++ Development
Topic: Get the background colour of disbled text control
Replies: 3
Views: 651

I encountered the same problem, and finally wxSYS_COLOUR_BTNFACE should be the right colour. :)
by freshairfly
Sun Nov 09, 2008 9:37 am
Forum: wxWidgets Development (Chinese)
Topic: 如何让ListCtrl的标题不能改变大小
Replies: 1
Views: 1703

handle EVT_LIST_COL_BEGIN_DRAG, call Veto() in event handler function:

Code: Select all

void XXX::OnColBeginDrag(wxListEvent& event)
{
    event.Veto();
}
by freshairfly
Tue Oct 21, 2008 12:26 am
Forum: C++ Development
Topic: How to reduce flicker in wxListCtrl when move scroll bar?
Replies: 5
Views: 1001

Very Cool!! It works!!!
doublemax, Thanks very much.
by freshairfly
Mon Oct 20, 2008 2:35 pm
Forum: C++ Development
Topic: How to reduce flicker in wxListCtrl when move scroll bar?
Replies: 5
Views: 1001

How to reduce flicker in wxListCtrl when move scroll bar?

Hi all, I'm using wxListCtrl in virtual mode(there are too many items in the ListCtrl), and I found screen flicker of that control when move scroll bar or roll mouse middle button(not very heavy), but compare to other well-rounded softwares (i.e windows explorer), the problem is very obvious. I also...
by freshairfly
Sun Sep 21, 2008 10:34 am
Forum: C++ Development
Topic: When wxToolBar in a wxPanel, AddSeparator doesn't work well
Replies: 3
Views: 787

Re: When wxToolBar in a wxPanel, AddSeparator doesn't work w

Hi All,

I resolved it by reading wxFormBuilder code.:D
After creating the toolbar, this line code should be called.

Code: Select all

toolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
Andrew
by freshairfly
Fri Sep 19, 2008 3:55 pm
Forum: C++ Development
Topic: When wxToolBar in a wxPanel, AddSeparator doesn't work well
Replies: 3
Views: 787

framepointer wrote:Hi.

Try to add

Code: Select all

toolBar->Realize();
right after you finished adding all the items to a toolbar.

It might work.

Regards,
Robert
Robert,

Thanks for your reply.
Yes, I had added that code (see above codes). It doesn't work.

Andrew
by freshairfly
Fri Sep 19, 2008 9:45 am
Forum: C++ Development
Topic: When wxToolBar in a wxPanel, AddSeparator doesn't work well
Replies: 3
Views: 787

When wxToolBar in a wxPanel, AddSeparator doesn't work well

Hi All, I added a wxToolBar into a wxPanel using wxSizer, and it works fine. Then I add some separator between buttons, but there is only a gap between buttons, no a vertical line that I expected. My code is as follows: void MyPanel::CreateGuiControls() { CreateToolbar(); wxBoxSizer* sizer = new wxB...
by freshairfly
Mon Aug 11, 2008 12:57 pm
Forum: C++ Development
Topic: Why my wxListCtrl style is different from the sample?
Replies: 3
Views: 1009

Your are probably missing the Windows XP style... From the wiki: If project uses a resource (.rc), add the line: #define wxUSE_NO_MANIFEST 1 - i.e. the 'text' sample .rc file will look like this: mondrian ICON "mondrian.ico" #define wxUSE_NO_MANIFEST 1 #include "wx/msw/wx.rc" Open your .rc file and...