1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: xrc/xmlres.h 3 // Purpose: interface of wxXmlResource 4 // Author: wxWidgets team 5 // Licence: wxWindows licence 6 ///////////////////////////////////////////////////////////////////////////// 7 8 /** 9 Flags which can be used with wxXmlResource::wxXmlResource. 10 */ 11 enum wxXmlResourceFlags 12 { 13 /** Translatable strings will be translated via _(). */ 14 wxXRC_USE_LOCALE = 1, 15 16 /** Subclass property of object nodes will be ignored (useful for previews in XRC editors). */ 17 wxXRC_NO_SUBCLASSING = 2, 18 19 /** Prevent the XRC files from being reloaded from disk in case they have been modified there 20 since being last loaded (may slightly speed up loading them). */ 21 wxXRC_NO_RELOADING = 4, 22 23 /** 24 Expand environment variables for paths in XRC (such as bitmaps or icons). 25 26 @since 3.1.3 27 */ 28 wxXRC_USE_ENVVARS = 8 29 }; 30 31 32 /** 33 @class wxXmlResource 34 35 This is the main class for interacting with the XML-based resource system. 36 37 The class holds XML resources from one or more .xml files, binary files or zip 38 archive files. 39 40 Note that this is a singleton class and you'll never allocate/deallocate it. 41 Just use the static wxXmlResource::Get() getter. 42 43 @see @ref overview_xrc, @ref overview_xrcformat 44 45 @library{wxxrc} 46 @category{xrc} 47 */ 48 class wxXmlResource : public wxObject 49 { 50 public: 51 /** 52 Constructor. 53 54 @param filemask 55 The XRC file, archive file, or wildcard specification that will be 56 used to load all resource files inside a zip archive. 57 @param flags 58 One or more value of the ::wxXmlResourceFlags enumeration. 59 @param domain 60 The name of the gettext catalog to search for translatable strings. 61 By default all loaded catalogs will be searched. 62 This provides a way to allow the strings to only come from a specific catalog. 63 */ 64 wxXmlResource(const wxString& filemask, 65 int flags = wxXRC_USE_LOCALE, 66 const wxString& domain = wxEmptyString); 67 68 /** 69 Constructor. 70 71 @param flags 72 One or more value of the ::wxXmlResourceFlags enumeration. 73 @param domain 74 The name of the gettext catalog to search for translatable strings. 75 By default all loaded catalogs will be searched. 76 This provides a way to allow the strings to only come from a specific catalog. 77 */ 78 wxXmlResource(int flags = wxXRC_USE_LOCALE, 79 const wxString& domain = wxEmptyString); 80 81 /** 82 Destructor. 83 */ 84 virtual ~wxXmlResource(); 85 86 /** 87 Initializes only a specific handler (or custom handler). 88 Convention says that the handler name is equal to the control's name plus 89 'XmlHandler', for example wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. 90 91 The XML resource compiler (wxxrc) can create include file that contains 92 initialization code for all controls used within the resource. 93 Note that this handler must be allocated on the heap, since it will be 94 deleted by ClearHandlers() later. 95 */ 96 void AddHandler(wxXmlResourceHandler* handler); 97 98 /** 99 Add a new handler at the beginning of the handler list. 100 */ 101 void InsertHandler(wxXmlResourceHandler *handler); 102 103 104 /** 105 Attaches an unknown control to the given panel/window/dialog. 106 Unknown controls are used in conjunction with \<object class="unknown"\>. 107 */ 108 bool AttachUnknownControl(const wxString& name, 109 wxWindow* control, 110 wxWindow* parent = NULL); 111 112 /** 113 Removes all handlers and deletes them (this means that any handlers 114 added using AddHandler() must be allocated on the heap). 115 */ 116 void ClearHandlers(); 117 118 /** 119 Registers subclasses factory for use in XRC. This is useful only for 120 language bindings developers who need a way to implement subclassing in 121 wxWidgets ports that don't support wxRTTI (e.g. wxPython). 122 */ 123 static void AddSubclassFactory(wxXmlSubclassFactory *factory); 124 125 126 /** 127 Compares the XRC version to the argument. 128 129 Returns -1 if the XRC version is less than the argument, 130 +1 if greater, and 0 if they are equal. 131 */ 132 int CompareVersion(int major, int minor, int release, int revision) const; 133 134 /** 135 Returns a string ID corresponding to the given numeric ID. 136 137 The string returned is such that calling GetXRCID() with it as 138 parameter yields @a numId. If there is no string identifier 139 corresponding to the given numeric one, an empty string is returned. 140 141 Notice that, unlike GetXRCID(), this function is slow as it checks all 142 of the identifiers used in XRC. 143 144 @since 2.9.0 145 */ 146 static wxString FindXRCIDById(int numId); 147 148 /** 149 Gets the global resources object or creates one if none exists. 150 */ 151 static wxXmlResource* Get(); 152 153 /** 154 Returns the domain (message catalog) that will be used to load 155 translatable strings in the XRC. 156 */ 157 const wxString& GetDomain() const; 158 159 /** 160 Returns flags, which may be a bitlist of ::wxXmlResourceFlags 161 enumeration values. 162 */ 163 int GetFlags() const; 164 165 /** 166 Returns the wxXmlNode containing the definition of the object with the 167 given name or @NULL. 168 169 This function recursively searches all the loaded XRC files for an 170 object with the specified @a name. If the object is found, the 171 wxXmlNode corresponding to it is returned, so this function can be used 172 to access additional information defined in the XRC file and not used 173 by wxXmlResource itself, e.g. contents of application-specific XML 174 tags. 175 176 @param name 177 The name of the resource which must be unique for this function to 178 work correctly, if there is more than one resource with the given 179 name the choice of the one returned by this function is undefined. 180 @return 181 The node corresponding to the resource with the given name or @NULL. 182 */ 183 const wxXmlNode *GetResourceNode(const wxString& name) const; 184 185 /** 186 Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a). 187 */ 188 long GetVersion() const; 189 190 /** 191 Returns a numeric ID that is equivalent to the string ID used in an XML resource. 192 193 If an unknown @a str_id is requested (i.e. other than wxID_XXX or integer), 194 a new record is created which associates the given string with a number. 195 196 If @a value_if_not_found is @c wxID_NONE, the number is obtained via 197 wxNewId(). Otherwise @a value_if_not_found is used. 198 199 Macro @c XRCID(name) is provided for convenient use in event tables. 200 201 @note IDs returned by XRCID() cannot be used with the <tt>EVT_*_RANGE</tt> 202 macros, because the order in which they are assigned to symbolic @a name 203 values is not guaranteed. 204 */ 205 static int GetXRCID(const wxString& str_id, int value_if_not_found = wxID_NONE); 206 207 /** 208 Initializes handlers for all supported controls/windows. 209 210 This will make the executable quite big because it forces linking against 211 most of the wxWidgets library. 212 */ 213 void InitAllHandlers(); 214 215 /** 216 Loads resources from XML files that match given filemask. 217 218 Example: 219 @code 220 if (!wxXmlResource::Get()->Load("rc/*.xrc")) 221 wxLogError("Couldn't load resources!"); 222 @endcode 223 224 @note 225 If wxUSE_FILESYS is enabled, this method understands wxFileSystem URLs 226 (see wxFileSystem::FindFirst()). 227 228 @note 229 If you are sure that the argument is name of single XRC file (rather 230 than an URL or a wildcard), use LoadFile() instead. 231 232 @see LoadFile(), LoadAllFiles() 233 */ 234 bool Load(const wxString& filemask); 235 236 /** 237 Simpler form of Load() for loading a single XRC file. 238 239 @since 2.9.0 240 241 @see Load(), LoadAllFiles() 242 */ 243 bool LoadFile(const wxFileName& file); 244 245 /** 246 Loads all .xrc files from directory @a dirname. 247 248 Tries to load as many files as possible; if there's an error while 249 loading one file, it still attempts to load other files. 250 251 @since 2.9.0 252 253 @see LoadFile(), Load() 254 */ 255 bool LoadAllFiles(const wxString& dirname); 256 257 /** 258 Loads a bitmap resource from a file. 259 */ 260 wxBitmap LoadBitmap(const wxString& name); 261 262 /** 263 Loads a dialog. @a parent points to parent window (if any). 264 */ 265 wxDialog* LoadDialog(wxWindow* parent, const wxString& name); 266 267 /** 268 Loads a dialog. @a parent points to parent window (if any). 269 270 This form is used to finish creation of an already existing instance (the main 271 reason for this is that you may want to use derived class with a new event table). 272 Example: 273 274 @code 275 MyDialog dlg; 276 wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog"); 277 dlg.ShowModal(); 278 @endcode 279 */ 280 bool LoadDialog(wxDialog* dlg, wxWindow* parent, const wxString& name); 281 282 /** 283 Loads a frame from the resource. @a parent points to parent window (if any). 284 */ 285 wxFrame *LoadFrame(wxWindow* parent, const wxString& name); 286 287 /** 288 Loads the contents of a frame onto an existing wxFrame. 289 290 This form is used to finish creation of an already existing instance 291 (the main reason for this is that you may want to use derived class 292 with a new event table). 293 */ 294 bool LoadFrame(wxFrame* frame, wxWindow* parent, 295 const wxString& name); 296 297 /** 298 Loads an icon resource from a file. 299 */ 300 wxIcon LoadIcon(const wxString& name); 301 302 /** 303 Loads menu from resource. Returns @NULL on failure. 304 */ 305 wxMenu* LoadMenu(const wxString& name); 306 307 //@{ 308 /** 309 Loads a menubar from resource. Returns @NULL on failure. 310 */ 311 wxMenuBar* LoadMenuBar(wxWindow* parent, const wxString& name); 312 wxMenuBar* LoadMenuBar(const wxString& name); 313 //@} 314 315 //@{ 316 /** 317 Load an object from the resource specifying both the resource name and the 318 class name. 319 320 The first overload lets you load nonstandard container windows and returns 321 @NULL on failure. The second one lets you finish the creation of an existing 322 instance and returns @false on failure. 323 324 In either case, only the resources defined at the top level of XRC 325 files can be loaded by this function, use LoadObjectRecursively() if 326 you need to load an object defined deeper in the hierarchy. 327 */ 328 wxObject* LoadObject(wxWindow* parent, const wxString& name, 329 const wxString& classname); 330 bool LoadObject(wxObject* instance, wxWindow* parent, 331 const wxString& name, 332 const wxString& classname); 333 //@} 334 335 //@{ 336 /** 337 Load an object from anywhere in the resource tree. 338 339 These methods are similar to LoadObject() but may be used to load an 340 object from anywhere in the resource tree and not only the top level. 341 Note that you will very rarely need to do this as in normal use the 342 entire container window (defined at the top level) is loaded and not 343 its individual children but this method can be useful in some 344 particular situations. 345 346 @since 2.9.1 347 */ 348 wxObject* LoadObjectRecursively(wxWindow* parent, 349 const wxString& name, 350 const wxString& classname); 351 bool LoadObjectRecursively(wxObject* instance, wxWindow* parent, 352 const wxString& name, 353 const wxString& classname); 354 //@} 355 356 /** 357 Loads a panel. @a parent points to the parent window. 358 */ 359 wxPanel* LoadPanel(wxWindow* parent, const wxString& name); 360 361 /** 362 Loads a panel. @a parent points to the parent window. 363 This form is used to finish creation of an already existing instance. 364 */ 365 bool LoadPanel(wxPanel* panel, wxWindow* parent, const wxString& name); 366 367 /** 368 Loads a toolbar. 369 */ 370 wxToolBar* LoadToolBar(wxWindow* parent, const wxString& name); 371 372 /** 373 Sets the global resources object and returns a pointer to the previous one 374 (may be @NULL). 375 */ 376 static wxXmlResource* Set(wxXmlResource* res); 377 378 /** 379 Sets the domain (message catalog) that will be used to load 380 translatable strings in the XRC. 381 */ 382 void SetDomain(const wxString& domain); 383 384 /** 385 Sets flags (bitlist of ::wxXmlResourceFlags enumeration values). 386 */ 387 void SetFlags(int flags); 388 389 /** 390 This function unloads a resource previously loaded by Load(). 391 392 Returns @true if the resource was successfully unloaded and @false if it 393 hasn't been found in the list of loaded resources. 394 */ 395 bool Unload(const wxString& filename); 396 397 protected: 398 /** 399 Reports error in XRC resources to the user. 400 401 Any errors in XRC input files should be reported using this method 402 (or its wxXmlResourceHandler::ReportError() equivalent). Unlike 403 wxLogError(), this method presents the error to the user in a more 404 usable form. In particular, the output is compiler-like and contains 405 information about the exact location of the error. 406 407 @param context XML node the error occurred in or relates to. This can 408 be @NULL, but should be the most specific node possible, 409 as its line number is what is reported to the user. 410 @param message Text of the error message. This string should always 411 be in English (i.e. not wrapped in _()). It shouldn't 412 be a sentence -- it should start with lower-case letter 413 and shouldn't have a trailing period or exclamation 414 point. 415 416 @since 2.9.0 417 418 @see wxXmlResourceHandler::ReportError(), DoReportError() 419 */ 420 void ReportError(const wxXmlNode *context, const wxString& message); 421 422 /** 423 Implementation of XRC resources errors reporting. 424 425 This method is called by ReportError() and shouldn't be called 426 directly; use ReportError() or wxXmlResourceHandler::ReportError() 427 to log errors. 428 429 Default implementation uses wxLogError(). 430 431 @param xrcFile File the error occurred in or empty string if it 432 couldn't be determined. 433 @param position XML node where the error occurred or @NULL if it 434 couldn't be determined. 435 @param message Text of the error message. See ReportError() 436 documentation for details of the string's format. 437 438 @note 439 You may override this method in a derived class to customize errors 440 reporting. If you do so, you'll need to either use the derived class 441 in all your code or call wxXmlResource::Set() to change the global 442 wxXmlResource instance to your class. 443 444 @since 2.9.0 445 446 @see ReportError() 447 */ 448 virtual void DoReportError(const wxString& xrcFile, const wxXmlNode *position, 449 const wxString& message); 450 }; 451 452 453 454 /** 455 @class wxXmlResourceHandler 456 457 wxXmlResourceHandler is an abstract base class for resource handlers 458 capable of creating a control from an XML node. 459 460 See @ref overview_xrc for details. 461 462 @library{wxxrc} 463 @category{xrc} 464 */ 465 class wxXmlResourceHandler : public wxObject 466 { 467 public: 468 /** 469 Default constructor. 470 */ 471 wxXmlResourceHandler(); 472 473 /** 474 Destructor. 475 */ 476 virtual ~wxXmlResourceHandler(); 477 478 /** 479 Creates an object (menu, dialog, control, ...) from an XML node. 480 Should check for validity. @a parent is a higher-level object 481 (usually window, dialog or panel) that is often necessary to 482 create the resource. 483 484 If @b instance is non-@NULL it should not create a new instance via 485 'new' but should rather use this one, and call its Create method. 486 */ 487 wxObject* CreateResource(wxXmlNode* node, wxObject* parent, 488 wxObject* instance); 489 490 /** 491 Called from CreateResource after variables were filled. 492 */ 493 virtual wxObject* DoCreateResource() = 0; 494 495 /** 496 Returns @true if it understands this node and can create 497 a resource from it, @false otherwise. 498 499 @note 500 You must not call any wxXmlResourceHandler methods except IsOfClass() 501 from this method! The instance is not yet initialized with node data 502 at the time CanHandle() is called and it is only safe to operate on 503 node directly or to call IsOfClass(). 504 */ 505 virtual bool CanHandle(wxXmlNode* node) = 0; 506 507 /** 508 Sets the parent resource. 509 */ 510 void SetParentResource(wxXmlResource* res); 511 512 513 protected: 514 515 /** 516 Add a style flag (e.g. @c wxMB_DOCKABLE) to the list of flags 517 understood by this handler. 518 */ 519 void AddStyle(const wxString& name, int value); 520 521 /** 522 Add styles common to all wxWindow-derived classes. 523 */ 524 void AddWindowStyles(); 525 526 /** 527 Creates children. 528 */ 529 void CreateChildren(wxObject* parent, bool this_hnd_only = false); 530 531 /** 532 Helper function. 533 */ 534 void CreateChildrenPrivately(wxObject* parent, 535 wxXmlNode* rootnode = NULL); 536 537 /** 538 Creates a resource from a node. 539 */ 540 wxObject* CreateResFromNode(wxXmlNode* node, wxObject* parent, 541 wxObject* instance = NULL); 542 543 /** 544 Creates an animation (see wxAnimation) from the filename specified in @a param. 545 546 It is recommended to provide @a ctrl argument to this function (which 547 is only available in wxWidgets 3.1.4 or later) to make sure that the 548 created animation is compatible with the specified control, otherwise a 549 wxAnimation object compatible with the default wxAnimationCtrl 550 implementation is created. 551 */ 552 wxAnimation* GetAnimation(const wxString& param = "animation", 553 wxAnimationCtrlBase* ctrl = NULL); 554 555 /** 556 Gets a bitmap. 557 */ 558 wxBitmap GetBitmap(const wxString& param = "bitmap", 559 const wxArtClient& defaultArtClient = wxART_OTHER, 560 wxSize size = wxDefaultSize); 561 /** 562 Gets a bitmap from an XmlNode. 563 564 @since 2.9.1 565 */ 566 wxBitmap GetBitmap(const wxXmlNode* node, 567 const wxArtClient& defaultArtClient = wxART_OTHER, 568 wxSize size = wxDefaultSize); 569 570 /** 571 Gets a bool flag (1, t, yes, on, true are @true, everything else is @false). 572 */ 573 bool GetBool(const wxString& param, bool defaultv = false); 574 575 /** 576 Gets colour in HTML syntax (\#RRGGBB). 577 */ 578 wxColour GetColour(const wxString& param, 579 const wxColour& defaultColour = wxNullColour); 580 581 /** 582 Returns the current file system. 583 */ 584 wxFileSystem& GetCurFileSystem(); 585 586 /** 587 Gets a dimension (may be in dialog units). 588 */ 589 wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0, 590 wxWindow* windowToUse = 0); 591 592 /** 593 Gets a direction. 594 595 If the given @a param is not present or has empty value, @a dirDefault is 596 returned by default. Otherwise the value of the parameter is parsed and 597 a warning is generated if it's not one of @c wxLEFT, @c wxTOP, @c 598 wxRIGHT or @c wxBOTTOM. 599 600 @since 2.9.3 601 */ 602 wxDirection GetDirection(const wxString& param, wxDirection dirDefault = wxLEFT); 603 604 /** 605 Gets a font. 606 */ 607 wxFont GetFont(const wxString& param = "font"); 608 609 /** 610 Returns the XRCID. 611 */ 612 int GetID(); 613 614 /** 615 Returns an icon. 616 */ 617 wxIcon GetIcon(const wxString& param = "icon", 618 const wxArtClient& defaultArtClient = wxART_OTHER, 619 wxSize size = wxDefaultSize); 620 621 /** 622 Gets an icon from an XmlNode. 623 624 @since 2.9.1 625 */ 626 wxIcon GetIcon(const wxXmlNode* node, 627 const wxArtClient& defaultArtClient = wxART_OTHER, 628 wxSize size = wxDefaultSize); 629 630 /** 631 Returns an icon bundle. 632 633 @note 634 Bundles can be loaded either with stock IDs or from files that contain 635 more than one image (e.g. Windows icon files). If a file contains only 636 single image, a bundle with only one icon will be created. 637 638 @since 2.9.0 639 */ 640 wxIconBundle GetIconBundle(const wxString& param, 641 const wxArtClient& defaultArtClient = wxART_OTHER); 642 643 /** 644 Creates an image list from the @a param markup data. 645 646 @return 647 The new instance of wxImageList or @NULL if no data is found. 648 649 @since 2.9.1 650 */ 651 wxImageList *GetImageList(const wxString& param = "imagelist"); 652 653 /** 654 Gets the integer value from the parameter. 655 */ 656 long GetLong(const wxString& param, long defaultv = 0); 657 658 /** 659 Gets a float value from the parameter. 660 */ 661 float GetFloat(const wxString& param, float defaultv = 0); 662 663 /** 664 Returns the resource name. 665 */ 666 wxString GetName(); 667 668 /** 669 Checks if the given node is an object node. 670 671 Object nodes are those named "object" or "object_ref". 672 673 @since 3.1.0 674 */ 675 bool IsObjectNode(const wxXmlNode *node) const; 676 /** 677 Gets node content from wxXML_ENTITY_NODE. 678 */ 679 wxString GetNodeContent(wxXmlNode* node); 680 681 /** 682 Gets the parent of the node given. 683 684 This method is safe to call with @NULL argument, it just returns @NULL 685 in this case. 686 687 @since 3.1.0 688 */ 689 wxXmlNode *GetNodeParent(const wxXmlNode *node) const; 690 691 /** 692 Gets the next sibling node related to the given node, possibly @NULL. 693 694 This method is safe to call with @NULL argument, it just returns @NULL 695 in this case. 696 697 @since 3.1.0 698 */ 699 wxXmlNode *GetNodeNext(const wxXmlNode *node) const; 700 701 /** 702 Gets the first child of the given node or @NULL. 703 704 This method is safe to call with @NULL argument, it just returns @NULL 705 in this case. 706 707 @since 3.1.0 708 */ 709 wxXmlNode *GetNodeChildren(const wxXmlNode *node) const; 710 711 712 /** 713 Finds the node or returns @NULL. 714 */ 715 wxXmlNode* GetParamNode(const wxString& param); 716 717 /** 718 Finds the parameter value or returns the empty string. 719 */ 720 wxString GetParamValue(const wxString& param); 721 722 /** 723 Returns the node parameter value. 724 725 @since 2.9.1 726 */ 727 wxString GetParamValue(const wxXmlNode* node); 728 729 /** 730 Gets the position (may be in dialog units). 731 */ 732 wxPoint GetPosition(const wxString& param = "pos"); 733 734 /** 735 Gets the size (may be in dialog units). 736 */ 737 wxSize GetSize(const wxString& param = "size", wxWindow* windowToUse = 0); 738 739 /** 740 Gets style flags from text in form "flag | flag2| flag3 |..." 741 Only understands flags added with AddStyle(). 742 */ 743 int GetStyle(const wxString& param = "style", int defaults = 0); 744 745 /** 746 Gets text from param and does some conversions: 747 - replaces \\n, \\r, \\t by respective characters (according to C syntax) 748 - replaces @c $ by @c and @c $$ by @c $ (needed for @c _File to @c File 749 translation because of XML syntax) 750 - calls wxGetTranslations (unless disabled in wxXmlResource) 751 */ 752 wxString GetText(const wxString& param, bool translate = true); 753 754 /** 755 Gets a file path from the given node. 756 757 This function expands environment variables in the path if 758 wxXRC_USE_ENVVARS is used. 759 760 @since 3.1.3 761 */ 762 wxString GetFilePath(const wxXmlNode* node); 763 764 /** 765 Check to see if a parameter exists. 766 */ 767 bool HasParam(const wxString& param); 768 769 /** 770 Convenience function. 771 Returns @true if the node has a property class equal to classname, 772 e.g. object class="wxDialog". 773 */ 774 bool IsOfClass(wxXmlNode* node, const wxString& classname); 775 776 /** 777 Sets common window options. 778 */ 779 void SetupWindow(wxWindow* wnd); 780 781 /** 782 Reports error in XRC resources to the user. 783 784 See wxXmlResource::ReportError() for more information. 785 786 @since 2.9.0 787 */ 788 void ReportError(wxXmlNode *context, const wxString& message); 789 790 /** 791 Like ReportError(wxXmlNode*, const wxString&), but uses the node 792 of currently processed object (m_node) as the context. 793 794 @since 2.9.0 795 */ 796 void ReportError(const wxString& message); 797 798 /** 799 Like ReportError(wxXmlNode*, const wxString&), but uses the node 800 of parameter @a param of the currently processed object as the context. 801 This is convenience function for reporting errors in particular 802 parameters. 803 804 @since 2.9.0 805 */ 806 void ReportParamError(const wxString& param, const wxString& message); 807 808 809 /** 810 After CreateResource has been called this will return the current 811 wxXmlResource object. 812 813 @since 2.9.5 814 */ 815 wxXmlResource* GetResource() const; 816 817 /** 818 After CreateResource has been called this will return the XML node 819 being processed. 820 821 @since 2.9.5 822 */ 823 wxXmlNode* GetNode() const; 824 825 /** 826 After CreateResource has been called this will return the class name of 827 the XML resource node being processed. 828 829 @since 2.9.5 830 */ 831 wxString GetClass() const; 832 833 /** 834 After CreateResource has been called this will return the current 835 item's parent, if any. 836 837 @since 2.9.5 838 */ 839 wxObject* GetParent() const; 840 841 /** 842 After CreateResource has been called this will return the instance that 843 the XML resource content should be created upon, if it has already been 844 created. If @NULL then the handler should create the object itself. 845 846 @since 2.9.5 847 */ 848 wxObject* GetInstance() const; 849 850 /** 851 After CreateResource has been called this will return the item's parent 852 as a wxWindow. 853 854 @since 2.9.5 855 */ 856 wxWindow* GetParentAsWindow() const; 857 }; 858 859