Is it possible to hide/delete maximize button in wxWidgets C++?

心不动则不痛 提交于 2020-01-05 03:07:08

问题


I'm writing app in wxWidgets C++ version (using linux but I want to cross-compile to win) for my friend who plays RPG games.Quite simple app - 8 buttons imitating dices with diffrent sizes, and one static text showing the result of the randomizing. I've made the Window "static" - it is impossible to maximize it or ... generally change the size of the main window. So, I want to make the icon "maximize" hidden or deleted. I've been searching. However, I haven't found the solution. I've only disabled the button using

MainFrame::MainFrame(const wxString &title): wxFrame (
NULL, wxID_ANY, title, wxDefaultPosition, wxSize(290,180),
wxDEFAULT_FRAME_STYLE & ~(wxRESIZE_BORDER | wxMAXIMIZE_BOX))

So, it it possible to make the icon "hidden" or "deleted" ?


回答1:


It seems that you can either have none of the buttons (including the close button) like this:-

style = wxCAPTION;
MainFrame::MainFrame(const wxString &title): wxFrame (NULL, wxID_ANY, title, wxDefaultPosition, wxSize(290,180), style)

or you get all 3 buttons but with some disabled:-

style = wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX;
MainFrame::MainFrame(const wxString &title): wxFrame (NULL, wxID_ANY, title, wxDefaultPosition, wxSize(290,180), style)


来源:https://stackoverflow.com/questions/25179460/is-it-possible-to-hide-delete-maximize-button-in-wxwidgets-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!