Search found 99 matches

by Disch
Mon Feb 09, 2009 7:44 pm
Forum: C++ Development
Topic: Event capture during for loop
Replies: 5
Views: 1064

The only thing I can think of would be to call ::wxSafeYield to allow the app to process pending events. Maybe something like: void MyClass::SomeFunc() { buttonPressed = false; for(int y=0;y<Screen.y;y++) { for(int x=0;x<Screen.x;x++) { PutToScreen(array[y*x + x]); SwapBuffer(); ::wxSafeYield(); if(...
by Disch
Mon Feb 09, 2009 6:30 pm
Forum: C++ Development
Topic: problem in using Dialog
Replies: 9
Views: 1241

Re: problem in using Dialog

how can i send it to another file ( i mean another function in another file ( class declaration file ( e.g. fun.cpp) )?!) The typical OOP way to do this would be to give your dialog a Get() function of some sort to retreive the user value from the dialog. If you need to send that value to yet anoth...
by Disch
Mon Feb 09, 2009 6:12 pm
Forum: C++ Development
Topic: wxSizer doesn't free space when hidden
Replies: 12
Views: 1916

No problem. Just a correction I feel I should make: I think Fit actually sets the window size to the best size... which isn't necessarily the minimum size -- I shouldnt've said that in my earlier post (see wxWindow::GetBestSize()). However the window can't be resized to be smaller than the minimum s...
by Disch
Mon Feb 09, 2009 5:57 pm
Forum: C++ Development
Topic: wxSizer doesn't free space when hidden
Replies: 12
Views: 1916

Fit() resizes the window to be the supplied minimum size -- often set by SetMinSize(), but can also be set by SetSizeHints(). In your SizerExampleFrame ctor (SizerExampleMain.cpp : line 87) you're calling SetSizeHints on your supplied sizer, which is setting the minimum size for the frame to match t...
by Disch
Sun Feb 08, 2009 11:54 pm
Forum: C++ Development
Topic: Size Event giving terrible problems... Hopefuly easy to fix
Replies: 3
Views: 541

Make sure RenderCanvasLink is a valid pointer. It's possible Size events are sent before the window becomes initially visible, if you're not creating your RenderCanvasLink object before then, you'll be trying to dereference a bad pointer. To confirm, you can try zeroing the pointer during RenderFrm'...
by Disch
Sun Feb 08, 2009 10:34 pm
Forum: C++ Development
Topic: wxSizer doesn't free space when hidden
Replies: 12
Views: 1916

I'm almost positive that Layout() does not resize the window, in which case he'd have the same problem he's having (the bottom cell grows to fill the gap rather than the whole window shrinking).
by Disch
Sun Feb 08, 2009 9:41 pm
Forum: Compiler / Linking / IDE Related
Topic: C++ Precompiled Headers in VS2002
Replies: 6
Views: 935

Yeah I don't see the point to having that example.cpp. Seems like an extra needless file -- the PCH is created and included fine without it... all you need is to have any file in the project include the header (at least from what I've been able to tell). Blech @ per-file settings, but I guess that'l...
by Disch
Sun Feb 08, 2009 9:31 pm
Forum: C++ Development
Topic: wxSizer doesn't free space when hidden
Replies: 12
Views: 1916

First of all, if you only have one column, consider using a vertical wxBoxSizer to simplify things.

Otherwise, modifying the sizer would not resize the window. If you want the window to shrink after removing/hiding an item, try calling Fit()
by Disch
Sun Feb 08, 2009 9:22 pm
Forum: C++ Development
Topic: Destroy for wxDialog based window
Replies: 4
Views: 1457

Is this a modal dialog? If it is, you must close it with EndModal() and not Destroy(). Otherwise for modeless dialogs the way I usually do it is to just call Close(), but Destroy() should also work.
by Disch
Sun Feb 08, 2009 4:53 pm
Forum: C++ Development
Topic: Toolbar icons
Replies: 4
Views: 930

1. I just confirmed this happens on my machine running Win2K as well. I wonder if this is a bug in wx? Strangely, if you don't specify a disabled bitmap, then the disabled version of the normal bitmap shows fine when the checkbox is disabled -- but not if you do specify a disable bitmap. Very strang...
by Disch
Fri Feb 06, 2009 9:20 pm
Forum: C++ Development
Topic: Toolbar icons
Replies: 4
Views: 930

To embed images (like a png), I've made a quick and sloppy utility in the past which just converts the .png file into a .h file with a big static const array. Kind of like how xpm is the image as a big string -- except the .png will be much smaller (usually -- for very small images it might not be)....
by Disch
Fri Feb 06, 2009 6:09 pm
Forum: C++ Development
Topic: Mouse event help
Replies: 3
Views: 558

I guess I could create a child class of it and create an event table in it, but that would be some extra work. This is the generally accepted approach. Derive a class from wxWindow and put that in your frame. You'd probably need/want to do this anyway so you can catch paint events and paint to this...
by Disch
Fri Feb 06, 2009 5:23 pm
Forum: C++ Development
Topic: Mouse event help
Replies: 3
Views: 558

Re: Mouse event help

There is another wxWindow inside of MyFrame, but that shouldn't matter, should it? It does matter. Events will be sent to the topmost visible window. IE: the one being clicked on. If you have another window on your frame, events will be sent to that window instead (or to one of its children if you ...
by Disch
Fri Feb 06, 2009 3:48 pm
Forum: Compiler / Linking / IDE Related
Topic: C++ Precompiled Headers in VS2002
Replies: 6
Views: 935

How did you create the precompiled header? Did you just use automatic? Have you already compiled your project? Well I guess this is my question. I didn't create the precompiled header. I'm totally new to this PCH stuff and I haven't been able to find any useful info on it in the wiki here or anythi...
by Disch
Fri Feb 06, 2009 3:22 pm
Forum: C++ Development
Topic: RTTI, dynamic casting, wxClientData questions
Replies: 6
Views: 873

Yeah I suppose I could just static_cast it, or use C++'s normal dynamic_cast. But assuming I want to stick with the wx casting stuff -- am I doing it right? That's really all I'm wondering. This is more about me trying to understand the 'proper' way to apply wx here, and not so much about getting it...