Search found 423 matches

by clyde729
Thu Oct 04, 2007 8:51 am
Forum: C++ Development
Topic: I can't catch EVT_CHAR from a wxPanel
Replies: 4
Views: 1119

Hi, please have a look at this thread . Keyevents will only be generated for controls that are able to get focus. Since it doesn't derive from wxCommandEvent it won't be propagated to the parentwindow (the panel in your case). Take the recursive connect solution if you need something like that. And ...
by clyde729
Tue Oct 02, 2007 5:45 am
Forum: C++ Development
Topic: Save
Replies: 5
Views: 617

If both programs are written in wxWidgets, you could probably use wxSerialize
by clyde729
Mon Oct 01, 2007 5:02 pm
Forum: C++ Development
Topic: Get children to detect parent event?
Replies: 2
Views: 527

The most cleanest solution is to use a wxSizer or rather a derivate of it. Define some flags on how the child should be resized and the framework will do the rest. There are samples on how to do it.
by clyde729
Mon Oct 01, 2007 7:26 am
Forum: C++ Development
Topic: numeric range validator
Replies: 5
Views: 2095

Look for the several RangeValidators in this thread . This should give you some hints on how to implement your validator. But be aware: The user can always use "copy and paste" in your textctrls. So you need to handle that. I wrote a "generic" spinctrl some time ago, which is a combination of a wxTe...
by clyde729
Tue Sep 25, 2007 10:42 am
Forum: C++ Development
Topic: Inherit from wxString
Replies: 3
Views: 667

I suggest the same. Write a "StringHelper" class and add some static methods to it, just as you need it.
by clyde729
Wed Sep 19, 2007 10:15 am
Forum: C++ Development
Topic: wxGrid::SetDefaultEditor question
Replies: 3
Views: 712

Just forgot to say: Be sure to implement the Clone() method of your editor. After initialisation of the first editor you can pass deep copies to the other grids. BTW: Also have a look at the 3rd party implementation wxSheet. They don't work with all these confusing pointers given to the grid, I think.
by clyde729
Wed Sep 19, 2007 10:11 am
Forum: C++ Development
Topic: wxGrid::SetDefaultEditor question
Replies: 3
Views: 712

Each grid instance needs its own editor instance. Passing a "shared" pointer to this method will lead your app to crash.

I prefer deriving from wxGrid and do stuff like that in grid's constructor.
by clyde729
Mon Sep 17, 2007 9:05 am
Forum: C++ Development
Topic: dropdown list separator?
Replies: 2
Views: 585

You can customize your combobox by using the wxComboCtrl. There are samples on how to use it.
by clyde729
Sun Sep 16, 2007 8:34 pm
Forum: C++ Development
Topic: Comparison between event handler's creation
Replies: 2
Views: 527

I agree,

handlers which are connected via "Connect" are checked first (before the static tables) by searching an appropriate handler for a certain event.
by clyde729
Thu Sep 13, 2007 6:39 pm
Forum: C++ Development
Topic: Why does the arrow keys work as the tab key ???
Replies: 8
Views: 1300

O.K., ready for some dirty hack? Check out this peace of code: void MyFrame::CreateGUIControls() { ////GUI Items Creation Start // create your controls... ////GUI Items Creation End WxPanel3->Connect(wxID_ANY, wxEVT_NAVIGATION_KEY, wxKeyEventHandler(MyFrame::onNavigation), (wxObject*) NULL, this); n...
by clyde729
Thu Sep 13, 2007 5:21 pm
Forum: C++ Development
Topic: Why does the arrow keys work as the tab key ???
Replies: 8
Views: 1300

I can't believe that. Which OS, which wxVersion? Please post some sample code so we can have a look on that. If it really don't work, maybe handling the undocumented wxNavigationKeyEvent could help. Or some Hotkey-registration. Or a global char hook. But I don't know too much about these solutions. ...
by clyde729
Thu Sep 13, 2007 5:11 pm
Forum: C++ Development
Topic: key events and focus
Replies: 3
Views: 765

Hi, please have a look on this thread . I posted some function there which you can use to pipe alle keyevents to the wxWindow you want. In the thread it is a toplevelwindow, so in your case you should put the method to your simulationpanel. I think with the handling of the keydown event you will sol...
by clyde729
Thu Sep 13, 2007 4:56 pm
Forum: C++ Development
Topic: Why does the arrow keys work as the tab key ???
Replies: 8
Views: 1300

It's not a bug, it's a feature :wink: A native feature of Windows (I guess). You will have to catch the wxEVT_KEY_DOWN event and handle it as you wish.
by clyde729
Thu Sep 13, 2007 2:45 pm
Forum: Component Writing
Topic: writing new non visual component.
Replies: 10
Views: 3280

The "-1" is AFAIK due to some backward compatibility. You can ignore the it. Simply pass "-1" into this argument. The "typedef" is used to enable passing a functionpointer to the eventtables that will be searched if an event occured. It works in general as a simple "callback" mechanism. Ask Google o...
by clyde729
Thu Sep 13, 2007 11:59 am
Forum: C++ Development
Topic: How to implement a log window
Replies: 5
Views: 1423

To send a message, do something like this in your code: wxString s = MyTextCtrl->GetValue(); wxLogMessage(s); int i = MySpinCtrl->GetValue(); wxLogMessage(wxT("There is %i as value in my spinctrl"), i); Every call to wxLogMessage will result in a line in your logwindow. Also have a look at the appro...