Search code examples
c++stylesframewxwidgetslook-and-feel

How to make a custom border without breaking resize and move in wxWidgets?


I am writing an application in C++ using wxWidgets as the GUI library and I want to create custom windows. I want them to look like Visual Studio or 3ds Max. Is it possible to remove the border but leave resize and move functionality? I can use wxBORDER_NONE and catch all events to remove and resize (I hope) but in my opinion there should be easier way to customize the look of a wxFrame. Maybe something like a file which contains all needed bitmaps and settings or something like that?

Example image with these functions which I need:

Example image showing custom border with blue line, custom look for exit, maximize and minimize buttons, resize and move functionality, and highlighted border


Solution

  • You won't be able to do this in a portable way and so wxWidgets doesn't provide any API for it. But you can do it for Windows only in the usual way, i.e. removing the normal borders (wxBORDER_NONE style) and handling WM_NCHITTEST in your overridden MSWWindowProc() to pretend that specific parts of your window behave as standard borders.