Search found 41 matches

by pete_b
Wed Mar 13, 2019 1:01 pm
Forum: Platform Related Issues
Topic: Using custom WNDCLASS for wxFrame subclass (MSW)
Replies: 1
Views: 129

Re: Using custom WNDCLASS for wxFrame subclass (MSW)

Just did copy and paste but the shadow looks so feeble I decided to do it a different way with a layered window.
by pete_b
Wed Mar 13, 2019 10:03 am
Forum: Platform Related Issues
Topic: Using custom WNDCLASS for wxFrame subclass (MSW)
Replies: 1
Views: 129

Using custom WNDCLASS for wxFrame subclass (MSW)

Just trying to implement a derived class of wxFrame that has CS_DROPSHADOW specified in its WNDCLASS. MSW specific for now. Is there a DRY way to do this? Looking through wx sources (3.0.4), it looks to me like I'm going to have top copy/paste an awful lot of code from wxFrame to do that. And then I...
by pete_b
Thu Jan 10, 2019 9:50 am
Forum: C++ Development
Topic: How to set wxTextCtrl text centered vertically?
Replies: 10
Views: 2466

Re: How to set wxTextCtrl text centered vertically?

This is possible on Windows by modifying the non-client area of the control. To do that, subclasswxTextCtrl and override MSWWindowProc. WXLRESULT TextEdit::MSWWindowProc(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) { LRESULT r = super::MSWWindowProc(msg, wParam, lParam); if (valign_ != 0) { // TODO...
by pete_b
Thu Jun 21, 2018 12:39 pm
Forum: C++ Development
Topic: Attaching a console or writing output to console
Replies: 4
Views: 5119

Re: Attaching a console or writing output to console

I know this is an old thread but I was looking for a way to output to the console when registering COM automation interface under Windows. Use attachConsole before writing to stdout/stderr. Its not ideal - the prompt disappears because the console does not wait for the process to finish (but pressin...
by pete_b
Tue May 15, 2012 1:15 pm
Forum: C++ Development
Topic: Custom Window derived from wxWindow problem
Replies: 1
Views: 738

Re: Custom Window derived from wxWindow problem

Digging up an old topic here, but just set m_oldWndProc = NULL after MSWCreate. Whats happening here is that the window is subclassed by wx because the classname does not match one of the ones wx defines, and the old window proc then ends up being the same function pointer, so you get an infinite lo...
by pete_b
Wed Sep 30, 2009 12:00 pm
Forum: C++ Development
Topic: wxFileInputStream
Replies: 3
Views: 728

wxFileInputStream in(sArchive); wxTarInputStream *TarInStream = NULL; if (bZipped) { wxBZipInputStream bzip2In(in); wxTarInputStream = new wxTarInputStream(bzip2In); } else { wxTarInputStream = new wxTarInputStream(in); } That will probably crash because bzip2In will be destroyed when it goes out o...
by pete_b
Wed Sep 30, 2009 11:51 am
Forum: C++ Development
Topic: Toolbar look and feel in Vista
Replies: 4
Views: 514

You've also got a spelling mistake of your 'Description' group box.
by pete_b
Wed Sep 30, 2009 11:45 am
Forum: C++ Development
Topic: Getting an executable's version number?
Replies: 2
Views: 556

Maybe take a look at wxDynamicLibraryDetails. I think this ought to get the version number as a string. If you need finer control/detail on Windows, take a look at GetFileVersionInfo: http://msdn.microsoft.com/en-us/library/ms647003(VS.85).aspx edit: On windows the module must have version info. To ...
by pete_b
Fri Feb 13, 2009 12:25 pm
Forum: The Code Dump
Topic: Transparent control background on MSW.
Replies: 0
Views: 1523

Transparent control background on MSW.

Found a way to do transparent backgrounds on MSW for wxCheckBox. Presumably would work for other stuff. Also you may need to override wxEVT_ERASE_BACKGROUND for your child controls. The handling is done by the parent panel, which gets the WM_CTLCOLOURxxx messages. class WinDC : public wxClientDC { p...
by pete_b
Wed Jan 28, 2009 10:23 am
Forum: C++ Development
Topic: Embedding Ogre into wxWidgets
Replies: 4
Views: 1046

Maybe try handling the size event and not calling Skip() to avoid the resize code getting called (just a hunch, don't know if it will work). Not sure why you want to do it this way - sizers are usually easier, but perhaps you have a good reason. By the way, I'd avoid using Ogre::WindowEventUtilities...
by pete_b
Tue Jan 27, 2009 2:14 pm
Forum: Platform Related Issues
Topic: [win32] ShowModal() doesn't exit when wxTimer in use
Replies: 3
Views: 989

This is a real nightmare. I've got a slightly different way of handling it that means you can still use a continuous timer. Using a one shot works and was also the way I was getting around it. However, the one shot timer method is less efficient than using a continuous timer, since it adds a new ele...
by pete_b
Mon Sep 08, 2008 8:04 am
Forum: C++ Development
Topic: Question about event loops and OnNextIteration()
Replies: 4
Views: 800

Would be great if you could just install a delegate into the loop processing. maybe something along the lines of: class wxEventLoopDelegate { public: virtual ~wxEventLoopDelegate() = 0; virtual void OnEventLoop(wxEventLoop*) = 0; }; With a vector of pointers to such objects that are invoked at the e...
by pete_b
Thu Aug 07, 2008 3:24 pm
Forum: C++ Development
Topic: wxTimer / Message / wxIdleEvent?
Replies: 2
Views: 897

Well that didn't really work very well either - UI pretty much grinds to a halt and wxYield gets re-entered causing an assert. I've gone down the timer route with an extra pause when an event loop is exiting for the moment but performance is not as good as when I was using the idle event. There has ...
by pete_b
Thu Aug 07, 2008 12:34 pm
Forum: C++ Development
Topic: wxTimer / Message / wxIdleEvent?
Replies: 2
Views: 897

I've just realized that wxEventLoop* mloop = wxEventLoop::GetActive(); EventLoopHack* hack = static_cast<EventLoopHack*>(mloop); int ms; if (mloop && hack->shouldExit()) { ms = 200; } else { ms = 1000 / rate_fps_; } Start(ms, wxTIMER_ONE_SHOT); can be replaced with: int ms = 1000 / rate_fps_; wxEven...
by pete_b
Thu Aug 07, 2008 12:31 pm
Forum: C++ Development
Topic: wxTimer / Message / wxIdleEvent?
Replies: 2
Views: 897

wxTimer / Message / wxIdleEvent?

I'm writing an app with a threaded comms layer (using boost::thread). Data is queued for the thread and the thread queues data for the main thread. I'v got a bit of a problem getting the data off the queue in the main thread. Initially I was using a method that ultimately used wxPostEvent with a cus...