Search found 95 matches

by samggyy
Wed Dec 17, 2008 6:30 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

The wxGlade outputs with default size and position but I need to change the size and position manually later. Then I can't see any difference between my codes and generation of wxGlade. May I ask if there is anything wrong in my coding please? Thanks a lot! Why do you need to change it manually lat...
by samggyy
Wed Dec 17, 2008 3:22 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

The wxGlade outputs with default size and position but I need to change the size and position manually later. Then I can't see any difference between my codes and generation of wxGlade. May I ask if there is anything wrong in my coding please? Thanks a lot! Codes of wxGlade: notebook_3 = new wxNoteb...
by samggyy
Wed Dec 17, 2008 2:49 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

ONEEYEMAN wrote:Hi,
Try to use some GUI designer tool and look at what code will be generated.
I prefer wxGlade because it's simple and free.

Thank you.
Thanks a lot! Any other suggestions?
by samggyy
Tue Dec 16, 2008 4:08 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

The layout which I expected to implement is shown in the picture.

A gauge, two notebooks and then one note book. Then three buttons at the buttom.

Thanks! :wink:
by samggyy
Tue Dec 16, 2008 4:02 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

Use sizers and let them decide how much space is needed for each panel. Picking set sizes is generally a bad idea, what happens when someone runs your application on a computer with only 640x480(I know, i know its 2008. Just an example), what happens when the frame is resized, maximized, run on 160...
by samggyy
Mon Dec 15, 2008 5:10 pm
Forum: C++ Development
Topic: How to decide the size of each panel and etc?
Replies: 9
Views: 1727

How to decide the size of each panel and etc?

Hi there, May I ask how to decide the size of each panel, each notebook on the panel please? For example, the size of my main frame is 800×600. Then I want to create a left panel, a right panel and some buttons, notebooks and etc on each panel; however, I met problem with how to decide the size of t...
by samggyy
Fri Dec 12, 2008 3:47 pm
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

Did the codes like following make a buffer as large as "imageSize*imageSize"? wxwidgets: unsigned char * bufferTest = static_cast<unsigned char *>(malloc (imageSize*imageSize)), *ptr = bufferTest; that was one mistake, it should have been "imageSize*imageSize*3" as wxImage always needs 3 bytes per ...
by samggyy
Fri Dec 12, 2008 3:42 pm
Forum: C++ Development
Topic: Program crash when delete the panels
Replies: 2
Views: 699

Program crash when delete the panels

My program has two panels on the main frame. I want to delete these panels when I close my "profile". My codes are shown as following but they gave a crash when I run the program. Any suggestions? Thanks! void wxDisplayFrame::OnEnd( wxCommandEvent& WXUNUSED( event ) ) { wxMessageBox( wxT( "You will ...
by samggyy
Fri Dec 12, 2008 3:21 pm
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

no offense, but you really should try understanding the code other people suggest. Rather than blindly pasting it and hoping it works. wxImage * phantomImageTest = new wxImage(imageSize, imageSize); unsigned char *ptr = phantomImageTest->GetData(); for (int y = 0; y < imageSize; ++y) for (int x = 0...
by samggyy
Fri Dec 12, 2008 10:23 am
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

Thanks if anyone can help!!! :P
by samggyy
Fri Dec 12, 2008 10:18 am
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

You'd need to specify R, G and B coords, so you'll need to make a buffer 3 times as big and do the *(++ptr)= command thrice Also, use method IsOkay() if possible to handle errors more gracefully than crashing I am sorry but I wrote codes like following which gave me a crash again... :evil: God save...
by samggyy
Fri Dec 12, 2008 12:06 am
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

Ow. You must covert void* pointer to any other pointer type before dereferencing it. It wouldn't harm if you change buffer type from 'void*' to 'char*' (but you'll have to convert explicitly the pointer returned from the malloc call). You must also cast values from the matrix to type appropriate fo...
by samggyy
Thu Dec 11, 2008 5:58 pm
Forum: C++ Development
Topic: How to display a image which is stored in a matrix?
Replies: 17
Views: 3520

Your matrix only contains zeroes and several other numbers, all less than 10. No wonder it appears black when you display it. You should multiply the numbers by some constant (25.0 should be fine) to see something. Errors: void * bufferTest = malloc (imageSize*imageSize), *ptr = bufferTest; for (in...
by samggyy
Thu Dec 11, 2008 5:28 pm
Forum: C++ Development
Topic: My program is very slow...WHY?
Replies: 10
Views: 2173

Thanks! I have changed the codes and tested but it still slow to display the notebooks and panels. :cry: I notice that when I new a profile. It will create a left panel and a right panel. The program create the left panel with notebooks on it at first. Then stop for 1 second and create the right pan...
by samggyy
Thu Dec 11, 2008 5:07 pm
Forum: C++ Development
Topic: My program is very slow...WHY?
Replies: 10
Views: 2173

Thanks! Could you show me where I download the background image every time in the OnPaint event please? I did not notice that. How to fix it? // Event for painting the background of the program UI void WxReconSimerFrame::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); wxBitmap bitmapBackground(w...