Search found 235 matches

by purplex88
Thu Feb 27, 2014 9:39 am
Forum: C++ Development
Topic: Right clicking on Listbox and Sample examples
Replies: 6
Views: 2773

Re: Right clicking on Listbox and Sample examples

This method apparently works fine: MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame(NULL, wxID_ANY, title, pos, size) { wxPanel* panel = new wxPanel(this, wxID_ANY); wxArrayString strings; strings.Add(wxT("First string")); strings.Add(wxT("Second string")); s...
by purplex88
Thu Feb 27, 2014 8:20 am
Forum: C++ Development
Topic: Right clicking on Listbox and Sample examples
Replies: 6
Views: 2773

Right clicking on Listbox and Sample examples

I was reading this post here http://forums.wxwidgets.org/viewtopic.php?f=1&t=27698 where it answers about handling right click events on Listbox. I have a few question regarding this: 1. The answer tells me to catch wxEVT_RIGHT_DOWN event using wxEvtHandler::Connect instead of using event macros in ...
by purplex88
Wed Feb 26, 2014 6:30 pm
Forum: C++ Development
Topic: GetCount function with ComboBox
Replies: 3
Views: 1110

Re: GetCount function with ComboBox

Yes, I'm new to WxWigets and using 3.0. I'm currently reading the book "Cross-Platform GUI Programming with wxWidgets". I hope that it will be sufficient for now although It doesn't have much examples about everything and also I couldn't find any other book out there.

Thanks for the help.
by purplex88
Wed Feb 26, 2014 5:46 pm
Forum: C++ Development
Topic: GetCount function with ComboBox
Replies: 3
Views: 1110

GetCount function with ComboBox

I have the following code which draws a ComboBox: #define ID_COMBOBOX wxID_HIGHEST +1 wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_COMBOBOX(ID_COMBOBOX, MyFrame::OnComboBox) wxEND_EVENT_TABLE() MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame(NULL, wxID_ANY, tit...
by purplex88
Tue Feb 25, 2014 9:11 pm
Forum: C++ Development
Topic: Button size covering the whole frame window
Replies: 3
Views: 2200

Re: Button size covering the whole frame window

If a wxFrame contains exactly one child, this child will be resized to always fill the entire client area. First create a wxPanel as child of the wxFrame, then create the button as child of the panel. I have tried the following as you suggested and it appears to work. Please correct me if I'm wrong...
by purplex88
Tue Feb 25, 2014 8:28 pm
Forum: C++ Development
Topic: Button size covering the whole frame window
Replies: 3
Views: 2200

Button size covering the whole frame window

I'm trying to draw a simple button on the frame as the following: // Declare our main frame class class MyFrame: public wxFrame { public: // Constructor MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); private: // This class handles events wxDECLARE_EVENT_TABLE(); }; MyFrame::...
by purplex88
Tue Feb 25, 2014 3:49 am
Forum: C++ Development
Topic: Redrawing WxWidgets Window Resize
Replies: 9
Views: 4256

Re: Redrawing WxWidgets Window Resize

Thanks, I'll post an update when I'll get further to learn about creating child controls.
by purplex88
Mon Feb 24, 2014 7:21 pm
Forum: C++ Development
Topic: Redrawing WxWidgets Window Resize
Replies: 9
Views: 4256

Re: Redrawing WxWidgets Window Resize

I may be wrong, but isn't it one of the styles that can't be changed after the window is created ? I don't quite get what you meant by this. So here's my function where the window gets created: bool MyApp::OnInit() { // Create the main application window MyFrame *frame = new MyFrame( "Hello World",...
by purplex88
Mon Feb 24, 2014 5:18 pm
Forum: C++ Development
Topic: Redrawing WxWidgets Window Resize
Replies: 9
Views: 4256

Re: Redrawing WxWidgets Window Resize

I'm using the line:

Code: Select all

frame->SetWindowStyle(frame->GetWindowStyle() | wxFULL_REPAINT_ON_RESIZE);
But it seems to have no effect.
by purplex88
Mon Feb 24, 2014 3:18 pm
Forum: C++ Development
Topic: Redrawing WxWidgets Window Resize
Replies: 9
Views: 4256

Redrawing WxWidgets Window Resize

I have some code in OnPaint event handler function which draws a circle.

However, whenever I maximize or resize the window it doesn't redraw itself properly. What is the reason for this and how can I solve it?