![]() ![]() For this reason, it's preferable to override DoGetBestClientSize() and let DoGetBestSize() compute the full best size. When the fitting size for the given contents is computed, it will usually be the client size and the size of the borders needs to be added to obtain the full best size. "Best Client Size": this is simply the client size corresponding to the best window size.There is a special virtual method in the C++ window classes called wxWindow::DoGetBestSize() that a class can override if it wants to calculate its own best size based on its content, however notice that usually it is more convenient to override DoGetBestClientSize(), see below. For example a wxListBox's best size will be calculated based on how many items it has, up to a certain limit, or a wxButton's best size will be calculated based on its label size, but normally won't be smaller than the platform default button size (unless a style flag overrides that). "Best Size": the best size of a widget depends on what kind of widget it is, and usually also on the contents of the widget.If a window doesn't have any border (and is not a wxFrame with some bars) then its client size is the same as its size. For wxFrame, the client size also excludes the frame menu, tool and status bars, if any. "Client Size": the client size represents the widget's area inside of any borders belonging to the widget and is the area that can be drawn upon in a EVT_PAINT event.This size value is the size that the widget is currently using on screen and is the way to change the size of something that is not being managed by a sizer. ![]() "Size": this is the current size of the window and it can be explicitly set or fetched with the wxWindow::SetSize() or wxWindow::GetSize() methods.This document will attempt to clear the fog a little, and give some simple explanations of things. It can sometimes be confusing to keep track of the various size-related attributes of a wxWindow, how they relate to each other, and how they interact with sizers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |