::wxSubType

Bool wxSubType(WXTYPE type1, WXTYPE type2)

TRUE if type1 is a subtype of, or the same type as, type2. This can be useful when determining whether an object is an instance of a class derived from some other class, and its usage can make for generic code.

See also wxTypeTree and wxObject::__type.

Example:

  wxNode *node = GetChildren()->First();
  while (node)
  {
    // Find a child that's a subwindow, but not a dialog box.
    wxWindow *child = (wxWindow *)node->Data();
    if ((wxSubType(child->__type, wxTYPE_PANEL) &&
         !wxSubType(child->__type, wxTYPE_DIALOG_BOX)) ||
        wxSubType(child->__type, wxTYPE_TEXT_WINDOW) ||
        wxSubType(child->__type, wxTYPE_CANVAS))
    {
      child->SetFocus();
      return;
    }
    node = node->Next();
  }