| 1 |
#ifndef TOPLEVELWINWRAPPER_H |
| 2 |
#define TOPLEVELWINWRAPPER_H |
| 3 |
|
| 4 |
#include "string_property.h" |
| 5 |
#include "wxc_project_metadata.h" |
| 6 |
#include "wxc_widget.h" // Base class: WrapperBase |
| 7 |
|
| 8 |
#include <wx/gdicmn.h> |
| 9 |
|
| 10 |
class TopLevelWinWrapper : public wxcWidget |
| 11 |
{ |
| 12 |
bool m_auiDropDownMenuHelperRegistered; |
| 13 |
|
| 14 |
protected: |
| 15 |
TopLevelWinWrapper(int type); |
| 16 |
virtual ~TopLevelWinWrapper(); |
| 17 |
wxString FormatCode(const wxString& chunk) const; |
| 18 |
virtual wxString BaseCtorImplPrefix() const = 0; |
| 19 |
virtual wxString BaseCtorDecl() const = 0; |
| 20 |
|
| 21 |
public: |
| 22 |
static void WrapXRC(wxString& text); |
| 23 |
virtual wxString DesignerXRC(bool forPreviewDialog) const = 0; |
| 24 |
|
| 25 |
virtual wxString CppCtorCode() const; |
| 26 |
/** |
| 27 |
* @brief to avoid code duplications, check if another aui toolbar |
| 28 |
* already registered the helpers for this TLW |
| 29 |
*/ |
| 30 |
bool IsAuiToolBarDropDownHelpersRegistered() const { return m_auiDropDownMenuHelperRegistered; } |
| 31 |
|
| 32 |
/** |
| 33 |
* @brief set whether a aui toolbar has registered the helpers for this TLW |
| 34 |
*/ |
| 35 |
void SetAuiToolBarDropDownHelpersRegistered(bool reg) { m_auiDropDownMenuHelperRegistered = reg; } |
| 36 |
/** |
| 37 |
* @brief return the derived class constructor signature (including the braces) |
| 38 |
* by default this functions returns "(wxWindow* parent)" |
| 39 |
* @return |
| 40 |
*/ |
| 41 |
virtual wxString GetDerivedClassCtorSignature() const { return "(wxWindow* parent)"; } |
| 42 |
|
| 43 |
/** |
| 44 |
* @brief return the arguments that should be passed to the parent constructor |
| 45 |
* @return |
| 46 |
*/ |
| 47 |
virtual wxString GetParentCtorInitArgumentList() const { return "(parent)"; } |
| 48 |
|
| 49 |
virtual void GenerateCode(const wxcProjectMetadata& project, bool promptUser, bool baseOnly, wxString& baseCpp, |
| 50 |
wxString& baseHeader, wxArrayString& headers, wxStringMap_t& additionalFiles); |
| 51 |
|
| 52 |
virtual bool IsTopWindow() const { return true; } |
| 53 |
/** |
| 54 |
* @brief return true if the top-level window is a real wxWindow derived class |
| 55 |
*/ |
| 56 |
virtual bool IsWindow() const { return true; } |
| 57 |
|
| 58 |
/** |
| 59 |
* @brief return true if this top-level window |
| 60 |
* should have a subclass as well |
| 61 |
*/ |
| 62 |
virtual bool WantsSubclass() const { return true; } |
| 63 |
|
| 64 |
/** |
| 65 |
* @brief return true if the TopLevel has an icon (this will be true for wxFrame, wxDialog and wxWizard) |
| 66 |
* @return by default return false, derived child can override this |
| 67 |
*/ |
| 68 |
virtual bool HasIcon() const { return false; } |
| 69 |
|
| 70 |
/** |
| 71 |
* @brief return true if the current top level window represents a wxWidgets's top level window |
| 72 |
* (wxWizard, wxDialog or wxFrame) |
| 73 |
*/ |
| 74 |
virtual bool IsWxTopLevelWindow() const; |
| 75 |
}; |
| 76 |
|
| 77 |
#endif // TOPLEVELWINWRAPPER_H |