You are here

[icp-slam.cpp] How to change the auto-generated window style

2 posts / 0 new
Last post
NYC
NYC's picture
[icp-slam.cpp] How to change the auto-generated window style

Hi, I am trying to modify icp-slam.cpp.

In icp-slam.cpp, "MapBuilding_ICP" function creates a window automatically to build map.

==========================================
        win3D = CDisplayWindow3D::Create("ICP-SLAM @ MRPT C++ Library", 600, 500); <-----------

==========================================

Now I need to change the window style. (to disable or get rid of the title bar)

However, when I used windows API to get and set the window style, the win3D window couldn't display anymore.

The only two lines I added as follows:

==========================================
        win3D = CDisplayWindow3D::Create("ICP-SLAM @ MRPT C++ Library", 600, 500);
        LONG wstyle= GetWindowLong(hwnd_ICP_3D_MAP, GWL_STYLE);<-----------
        SetWindowLong(hwnd_ICP_3D_MAP, GWL_STYLE, wstyle);<-----------

==========================================

How can I change the window style properly?

Thanks a lot.

jlblanco
jlblanco's picture
Well, that's a dirty hack but

Well, that's a dirty hack but I think this way may allow you doing it:

1) Call the MRPT's Window object  ::getWxObject() method ( mrpt::gui::CBaseGUIWindow::getWxObject ), which returns you a "void*"

2) You'll need to #include wxWidgets headers. Warning: it's better if you build MRPT from sources to make sure you use exactly the same wxWidgets headers & .libs & .dlls. 

3) Cast the "void*" into "wxDialog*", for example:   wxDialog * dlg = static_cast<wxDialog*>( win->getWxObject() );

4) Do whatever you want on the wxDialog

 

First, check wxWidgets' docs to see if you can change a windows style after it's created. Otherwise, you can always just change MRPT sources and directly change the window style. Look at sources at MRPT/libs/gui/src/*.cpp

 

Cheers,

JL

Log in or register to post comments
Subscribe to Comments for "[icp-slam.cpp] How to change the auto-generated window style"