Search found 4171 matches

by DavidHart
Tue Mar 14, 2006 10:37 am
Forum: C++ Development
Topic: Sizer in a handmade control ... with a fixed column
Replies: 10
Views: 2450

Hi, You carefully measure the available size with parent->GetClientSize(&parent_size_x, &parent_size_y); but as far as I can see you ignore the result. Shouldn't you use this in your wxControl::Create() line, and perhaps when you make the textctrls too? i want to fix the first column to a ce...
by DavidHart
Mon Mar 13, 2006 8:51 pm
Forum: C++ Development
Topic: GetValue(), the program crash !
Replies: 9
Views: 2097

Hi, wxTextCtrl::GetValue() returns a wxString. You are telling the compiler that it is a char*. The crash is the compiler's gentle way of pointing out that you're wrong. ;) Why not try const wxString fn = nodef->GetValue(); If you really, really need a char*, you can then do const char *charptr = fn...
by DavidHart
Sun Mar 12, 2006 11:24 am
Forum: C++ Development
Topic: Weird crash when calling wxString::c_str()
Replies: 2
Views: 789

Hi, I have googled entire 2 hours without any results . . . Why did you give up so soon? :wink: I can't tell you in detail why it crashes, but one thing sticks out: do you have a really compelling reason for using char* instead of wxString? You can easily replicate your code with wxStrings and wxStr...
by DavidHart
Sun Mar 12, 2006 10:55 am
Forum: C++ Development
Topic: GetRect() for wxPanel
Replies: 2
Views: 856

Hi Todd, Anybody encountered anything like this before? Not exactly the same but a similar problem, also involving a wxSplitterWindow. I wonder if GetRect() is being called too soon, before the resize has completed. As an experiment, try calling panel->GetRect() later (either from a convenient butto...
by DavidHart
Sat Mar 11, 2006 12:24 pm
Forum: C++ Development
Topic: how to get wxBoxSizer instance from xrc resource file?
Replies: 6
Views: 1808

Hmm. I don't know whether "hidden" should work from XRC with sizers (which aren't wxWindow derived). You can yourself call sizer->Show(), but that doesn't apply to the sizer, only the designated sizeritem. It might be a DialogBlocks buglet: XRCed doesn't let you give a sizer the "hidd...
by DavidHart
Sat Mar 11, 2006 10:54 am
Forum: C++ Development
Topic: About deallocate the heap memory
Replies: 2
Views: 753

Hi,

No you don't. When a wxWindow (or a class derived from it, such as controls) is deleted, it recursively deletes all of its children too. So the only wxWindow you might need to deal with yourself are parentless ones such as some wxDialogs.

Regards,

David
by DavidHart
Fri Mar 10, 2006 6:43 pm
Forum: C++ Development
Topic: how to get wxBoxSizer instance from xrc resource file?
Replies: 6
Views: 1808

Hi, When benedicte wrote "wxControlClass", I think he meant "The class you are looking for". So if you are looking for a wxTextCtrl, you should write XRCCTRL( *this, "CAKEYSELECT_TEXTCTRL", wxTextCtrl) If you look at the definition of XRCCTRL #define XRCCTRL(window, id,...
by DavidHart
Thu Mar 09, 2006 11:06 pm
Forum: General Development
Topic: update wxTextCtrl object
Replies: 5
Views: 1890

OK. So the problem is that the textctrl is given the output bit by bit, but only prints it at the end. Probably your function doesn't give it a chance. An easy answer, if it fits your situation, is to call wxYieldIfNeeded() from your function each time it tries to output. For a more complicated solu...
by DavidHart
Thu Mar 09, 2006 10:11 pm
Forum: C++ Development
Topic: GetParent undeclared ?!?!?!?
Replies: 5
Views: 1348

Can you tell us what the family relationships are, between the event class and the frame. For example, if the class that created the event were a button; the button's parent were a wxPanel; and the panel's parent were the frame, then I would have expected the code to work. Of course, there is probab...
by DavidHart
Thu Mar 09, 2006 10:01 pm
Forum: C++ Development
Topic: I need Dialogs with an active menu
Replies: 16
Views: 3267

I explained it before with a very simple sample. Yes, I understood the example, but if that is the sort of problem you have, you need to alter each window's code so that it halts these critical actions until the window receives focus again. Modal dialogs cannot access frame's menu. So duplication o...
by DavidHart
Thu Mar 09, 2006 9:46 pm
Forum: C++ Development
Topic: How can I match wxTextCtrl::GetSelection to GetValue?
Replies: 8
Views: 2042

Hmm. I'm probably missing some subtlety, but: You can find the string selection start/end with GetSelection(long* from, long* to). From this you can get a wxString of the text before the selection by GetRange(0, from) and after the selection by GetRange(to, GetLastPosition() ). So you can investigat...
by DavidHart
Thu Mar 09, 2006 8:08 pm
Forum: C++ Development
Topic: GetParent undeclared ?!?!?!?
Replies: 5
Views: 1348

Hi,

Depending on your code, this has a better chance of working.
((MyFrame *)((event.GetEventObject()->GetParent())->GetParent()))->DoConversion();

Regards,

David
by DavidHart
Thu Mar 09, 2006 8:02 pm
Forum: C++ Development
Topic: I need Dialogs with an active menu
Replies: 16
Views: 3267

Thanks, that makes things a bit clearer. However you should be able to solve your problem by using some variant of my last post, or the ideas below. It depends a bit on what you mean when you say you want the other windows disabled. If you mean that you don't want them to get menu events directed to...
by DavidHart
Thu Mar 09, 2006 5:36 pm
Forum: General Development
Topic: update wxTextCtrl object
Replies: 5
Views: 1890

Hi, You need to tell us a bit more about your function. Does it take control from wxApp because it is a separate program launched by wxExecute, for example? Or is it part of your application that takes a lot of time doing something, and then passes the results when it has finished? Or what? Regards,...
by DavidHart
Thu Mar 09, 2006 4:53 pm
Forum: C++ Development
Topic: I need Dialogs with an active menu
Replies: 16
Views: 3267

Yes, i am trying to tell my application not to operate while the child window is open. But you aren't. You want your application to operate, otherwise the menu won't work. The first window must stop the execution until the second is being closed. Right. I don't think there is a one-line way to do t...